Bug 91858 - NullPointerException when declare @type is spelt with capital letter
Summary: NullPointerException when declare @type is spelt with capital letter
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-19 05:38 EDT by Sian January CLA
Modified: 2005-08-26 11:19 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sian January CLA 2005-04-19 05:38:48 EDT
I have the following code in an AspectJ project:

declare @Type: MainClass : @MyAnnotation;

I believe the correct syntax should be:

declare @type: MainClass : @MyAnnotation;

However when I saved my aspect with the first version I got the following 
NullPointerException:

java.lang.NullPointerException
	at 
org.aspectj.ajdt.internal.compiler.ast.DeclareAnnotationDeclaration.postParse
(DeclareAnnotationDeclaration.java:83)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope.postParse
(ClassScope.java:175)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildFieldsAndM
ethods(ClassScope.java:154)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.build
FieldsAndMethods(CompilationUnitScope.java:63)
	at 
org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindi
ngs(AjLookupEnvironment.java:104)
	at 
org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile
(Compiler.java:331)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile
(Compiler.java:348)
	at 
org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation
(AjBuildManager.java:683)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild
(AjBuildManager.java:191)
	at 
org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild
(AjBuildManager.java:109)
	at org.aspectj.ajde.internal.CompilerAdapter.compile
(CompilerAdapter.java:117)
	at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run
(AspectJBuildManager.java:165)
Comment 1 Andrew J Huff CLA 2005-04-19 08:59:33 EDT
actually it's not just if you spell it Type, the following code produces the bug
for any XXX other than a recognised one (type):

@interface myInterface {}
aspect A{
  declare @XXX: A : @myInterface;
}
Comment 2 Adrian Colyer CLA 2005-04-20 09:01:16 EDT
patch submitted by Andrew Huff (IBM). Bug will be closed when available in a
published build.
Comment 3 Adrian Colyer CLA 2005-08-26 11:19:37 EDT
forgot to close this out, fix was available a good while ago...