Bug 123612 - ArrayIndexOutOfBoundsException with incremental and declare @type
Summary: ArrayIndexOutOfBoundsException with incremental and declare @type
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: DEVELOPMENT   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 1.5.1   Edit
Assignee: Andrew Clement CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-12 11:08 EST by Helen Beeken CLA
Modified: 2012-04-03 15:58 EDT (History)
0 users

See Also:


Attachments
testcase patch (1.77 KB, patch)
2006-01-12 11:13 EST, Helen Beeken CLA
aclement: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helen Beeken CLA 2006-01-12 11:08:45 EST
Given the following code:

-------------------------------------------------
public aspect A {
	declare @type : C : @MyAnnotation;
}
@interface MyAnnotation {	
}

class C {
}
-------------------------------------------------

if you comment out the declare @type statement and do an incremental build, then the following ArrayIndexOutOfBoundsException occurs:

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.doDeclareAnnotations(AjLookupEnvironment.java:754)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:571)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveIntertypes(AjLookupEnvironment.java:357)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.completeTypeBindings(AjLookupEnvironment.java:209)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:811)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:254)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:163)
	at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117)
	at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)



This is against the latest code in HEAD.
Comment 1 Helen Beeken CLA 2006-01-12 11:13:05 EST
Created attachment 32913 [details]
testcase patch

Patch containing MultiProjectIncrementalTest.

Apply to the tests project.
Comment 2 Andrew Clement CLA 2006-01-17 10:31:42 EST
fixed - needed to clear the cache of old dec@s so they didn't interfere on a later compile.
Comment 3 Andrew Clement CLA 2006-01-18 03:16:00 EST
fix available.