Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345639

Summary: NPE when using @Annotation without braces
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Justin Spadea CLA 2011-05-12 14:08:48 EDT
The following annotation declaration throws an error during compilation.

record testAnnotation {@Annotation}
end

If I change it to have a settings block, the error goes away. I do not need to use the braces for other annotations (like using @SQLRecord):

record testAnnotation {@Annotation{}}
end





java.lang.NullPointerException
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator$2.visit(AnnotationValidator.java:438)
at org.eclipse.edt.compiler.core.ast.AnnotationExpression.accept(AnnotationExpression.java:42)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.processAnnotations(AnnotationValidator.java:373)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.access$5(AnnotationValidator.java:372)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator$4.visit(AnnotationValidator.java:693)
at org.eclipse.edt.compiler.core.ast.AnnotationExpression.accept(AnnotationExpression.java:42)
at org.eclipse.edt.compiler.core.ast.Node.acceptChildren(Node.java:83)
at org.eclipse.edt.compiler.core.ast.SettingsBlock.accept(SettingsBlock.java:45)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.processComplexAnnotationFields(AnnotationValidator.java:683)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.access$8(AnnotationValidator.java:681)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator$6.visit(AnnotationValidator.java:856)
at org.eclipse.edt.compiler.core.ast.SettingsBlock.accept(SettingsBlock.java:43)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.processPartSubTypeFields(AnnotationValidator.java:852)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator.access$1(AnnotationValidator.java:847)
at org.eclipse.edt.compiler.internal.core.validation.annotation.AnnotationValidator$1.visit(AnnotationValidator.java:149)
at org.eclipse.edt.compiler.core.ast.Record.accept(Record.java:85)
Comment 1 Paul Harmon CLA 2011-05-19 17:11:15 EDT
I have fixed this with a change to: PartSubTypeAndAnnotationCollector
Comment 2 Justin Spadea CLA 2011-05-20 11:20:10 EDT
Verified with the latest CVS code.