akshattandon / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

Not using braces on some parameters causes error on delombok #680

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a class that you want to use in a @Delegate
2. Create a class where you want to use the class in step 1 as the delegate.
3. Specify the delegate with the format
@Delegate(types=MyDelegate.class, excludes=SomeExclusionInterface.class)

What is the expected output? 

Expected output is for a correctly formed and processed source file from 
delombok with the appropriate methods created and excluded from the 
types/excludes.

What do you see instead?

An exception:

 [delombok] java.lang.IllegalStateException: Called with something that isn't a block, method decl, or variable decl
 [delombok]     at lombok.javac.JavacResolution.attrib(JavacResolution.java:184)
 [delombok]     at lombok.javac.JavacResolution.resolveClassMember(JavacResolution.java:174)
 [delombok]     at lombok.javac.handlers.HandleDelegate.handle(HandleDelegate.java:146)
 [delombok]     at lombok.javac.HandlerLibrary$AnnotationHandlerContainer.handle(HandlerLibrary.java:105)
 [delombok]     at lombok.javac.HandlerLibrary.handleAnnotation(HandlerLibrary.java:243)
 [delombok]     at lombok.javac.JavacTransformer$AnnotationVisitor.visitAnnotationOnField(JavacTransformer.java:91)
 [delombok]     at lombok.javac.JavacNode.traverse(JavacNode.java:115)
 [delombok]     at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
 [delombok]     at lombok.javac.JavacNode.traverse(JavacNode.java:80)
 [delombok]     at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
 [delombok]     at lombok.javac.JavacNode.traverse(JavacNode.java:75)
 [delombok]     at lombok.javac.JavacAST.traverseChildren(JavacAST.java:113)
 [delombok]     at lombok.javac.JavacNode.traverse(JavacNode.java:70)
 [delombok]     at lombok.javac.JavacAST.traverse(JavacAST.java:109)
 [delombok]     at lombok.javac.JavacTransformer.transform(JavacTransformer.java:70)
 [delombok]     at lombok.javac.apt.Processor.process(Processor.java:250)
 [delombok]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
 [delombok]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
 [delombok]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
 [delombok]     at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
 [delombok]     at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
 [delombok]     at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
 [delombok]     at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1011)
 [delombok]     at lombok.delombok.Delombok.delombok(Delombok.java:502)
 [delombok]     at lombok.delombok.ant.DelombokTask.execute(DelombokTask.java:158)
 [delombok]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
 [delombok]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

What version of the product are you using? 

1.12.6

On what operating system?

Windows 7 and CentOS 6.5

Please provide any additional information below.

Running from the Ant task.  Using Delombok to build reusable source jars for 
GWT projects that are not otherwise dependent upon lombok.

The work around is to put curly braces around the parameter.  IE 
@Delegate(types={MyDelegate.class}, excludes={SomeExclusionInterface.class})

Delegate works fine in Eclipse declared in either manner.

Original issue reported on code.google.com by j...@percsolutions.com on 20 May 2014 at 10:10

GoogleCodeExporter commented 9 years ago

Original comment by reini...@gmail.com on 1 Jun 2014 at 8:19