Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0-rc-3
-
None
-
None
Description
The SIMPLE style of autocloning doesn't like generics. The following code will fail compilation:
@AutoClone(style=AutoCloneStyle.SIMPLE) class Book { String isbn String title List<String> authors Date publicationDate }
The error is a typical AST transformation failure due to the reuse of generics (missing call to getPlainNodeReference):
A transform used a generics containing ClassNode Book for the method protected void cloneOrCopyMembers(Book other) throws java.lang.CloneNotSupportedException { ... } 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.