Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8126

Inadvertent source code incompatibility in Groovy 2.4.7 release

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.7
    • Fix Version/s: 2.4.7
    • Component/s: None
    • Labels:

      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.

      1. If you are upgrading and are going to now only use Groovy 2.4.7 and above, just delete any catch statements catching IOException.
      2. 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.

        Attachments

          Activity

            People

            • Assignee:
              paulk Paul King
              Reporter:
              paulk Paul King
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: