Description
I just spotted a change in 2.4.7 that inadvertently broke source code/contract compatibility. After 1 year it seems just as dangerous to revert as to leave. So I am creating this Jira to note the change and suggest a workaround. We'll change this issue if a better solution is found.
https://github.com/apache/groovy/commit/78b6cc54af85988829ecd6120b69f65e0d9a8ade
src/main/groovy/lang/GroovyCodeSource.java - public GroovyCodeSource(URL url) throws IOException { + public GroovyCodeSource(URL url) {
Suggested workarounds.
- If you are upgrading and are going to now only use Groovy 2.4.7 and above, just delete any catch statements catching IOException.
- If you have code that needs to work with old and new versions of Groovy and are checking for the IOException, change it to just Exception (and potentially move after other catch blocks) and check for IOException using instanceof if needed.