Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345639 - NPE when using @Annotation without braces
Summary: NPE when using @Annotation without braces
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 14:08 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:15 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.