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

Compilation warning when using @AutoClone on an object with collection properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2
    • 2.3.0-beta-1, 2.2.3
    • groovy-jdk
    • None

    Description

      I'm getting a compilation error/warning when I try to compile a class using the @AutoClone annotation (with a "copy constructor" style) which contains list/collection values. I am using Groovy 2.2.2, and building my code using IntelliJ Ultimate 12.1.3.

      Attached is a simple test class I put together which produces the error when compiled. The error message I get in my IDE is as follows:

      Groovyc: A transform used a generics containing ClassNode com.Test for the constructor protected void <init>(com.Test other)

      { ... }

      directly. You are not supposed to do this. Please create a new ClassNode referring to the old ClassNode and use the new ClassNode instead of the old one. Otherwise the compiler will create wrong descriptors and a potential NullPointerException in TypeResolver in the OpenJDK. If this is not your own doing, please report this bug to the writer of the transform.

      Attachments

        1. Test.groovy
          0.2 kB
          Nicole Treague

        Activity

          People

            paulk Paul King
            nicoletreague Nicole Treague
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: