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

Empty static initializer generates code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      After updating Gradle from Groovy 2.5.4 to 2.5.7 the following test started to fail:

      https://github.com/gradle/gradle/blob/bc8d6ebd11d81be35ea7453cda6f955de236add3/subprojects/plugins/src/integTest/groovy/org/gradle/java/compile/AbstractJavaGroovyCompileAvoidanceIntegrationSpec.groovy#L330

       

      The reason was that:

      • implicit and explicit default constructors don't generate the same bytecode anymore (explicit implicit one is marked as @Generated now)
      • static initializers generate and empty if statement

      See the attachment and the corresponding PR: https://github.com/gradle/gradle/pull/9627

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              paplorinc Lőrinc Pap
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: