Bug 169605 - ArrayIndexOutOfBoundsException in ResolvedType.getMemberParameterizationmap
Summary: ArrayIndexOutOfBoundsException in ResolvedType.getMemberParameterizationmap
Status: RESOLVED DUPLICATE of bug 175039
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 1.5.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-04 17:50 EST by Dustin Sallings CLA
Modified: 2007-11-06 10:50 EST (History)
3 users (show)

See Also:


Attachments
LTW on JRocket can cause the same exception (91.30 KB, text/plain)
2007-04-13 00:34 EDT, John D. Heintz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dustin Sallings CLA 2007-01-04 17:50:50 EST
In what is perhaps related to bug 169600, I am getting the following compilation error:

java.lang.ArrayIndexOutOfBoundsException
at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:695)
at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406)
at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1156)
at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.jav ... .java:102)
at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191)

ArrayIndexOutOfBoundsException thrown: 0
Comment 1 Michael Chervil CLA 2007-01-08 09:33:19 EST
I am getting the same error. But not the one from bug 169000 (yet).
Comment 2 Michael Chervil CLA 2007-01-10 06:23:21 EST
Meanwhile I am getting the exception from bug 169600 as well. But the ArrayIndexOutOfBoundsException comes first. I am using WinXP, AspectJ 1.5.3 and AJDT 1.4.1.

This seems to be a AJDT Bug, not AspectJ, don't you think so?
Comment 3 Andrew Clement CLA 2007-01-10 06:29:07 EST
the stack trace doesnt involve any AJDT code - so I think it is an aspectj problem.
Comment 4 Andrew Clement CLA 2007-01-10 06:57:17 EST
this bug is because of something about your use of generic types.  Are you able to describe the hierarchy to any degree?  How are the type variables inherited through your declarations? Do you parameterize partial generic signatures in your subtypes?
Comment 5 Keith Kowalczykowski CLA 2007-02-05 17:51:15 EST
Everyone,

This is a full stack trace when running from Eclipse with AJDT in case it is any help:

java.lang.ArrayIndexOutOfBoundsException: 0
	at org.aspectj.weaver.ResolvedType.getMemberParameterizationMap(ResolvedType.java:695)
	at org.aspectj.weaver.ReferenceType.getDeclaredInterfaces(ReferenceType.java:406)
	at org.aspectj.weaver.ResolvedType.getDirectSupertypes(ResolvedType.java:65)
	at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1157)
	at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedType.java:1159)
	at org.aspectj.weaver.ResolvedType.getInterTypeMungersIncludingSupers(ResolvedType.java:1136)
	at org.aspectj.weaver.ResolvedType.checkInterTypeMungers(ResolvedType.java:1203)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:643)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.weaveInterTypeDeclarations(AjLookupEnvironment.java:519)
	at org.aspectj.ajdt.internal.compiler.lookup.AjLookupEnvironment.createBinaryTypeFrom(AjLookupEnvironment.java:1060)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:480)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:190)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:111)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:43)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:53)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getMemberType(BinaryTypeBinding.java:618)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:444)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:466)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:331)
	at org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:400)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:512)
	at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:973)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:290)
	at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:184)
	at org.aspectj.ajde.core.internal.AjdeCoreBuildManager.doBuild(AjdeCoreBuildManager.java:88)
	at org.aspectj.ajde.core.AjCompiler.build(AjCompiler.java:96)
	at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:219)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:621)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:163)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:194)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:243)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)


For me, this problem mostly occurs when I have incremental build on in Eclipse and make a change that is either:
1) Non code modifying change. I.E. Changing whitespace, comments, etc.
2) Save a file (and thus auto build triggers) which has errors in it.

As far as what the type hierarchy is like, it is a fairly large project, so I'm not sure where to start. Anything specific you are looking for? The class that was auto-built and generated the above exception is not generic, but it does have/use member variables that are generic. Would this potentially affect it as well?
Comment 6 Keith Kowalczykowski CLA 2007-02-07 19:54:20 EST
Interesting find. So my previous bug report was running under JRockit JDK 5 Update 8 R27.1.0. I just tried changing back to JVM 1.6 and everything works fine. Auto compilation, everything. Kind of strange considering AspectWerks and AspectJ merged not to long ago. Not sure if it is an AspectJ or a JRockit thing, but it would nice to see this get fixed soon.
Comment 7 Andrew Clement CLA 2007-02-08 03:10:12 EST
> The class that was auto-built and generated the above exception 
> is not generic, but it does have/use member variables that are 
> generic. Would this potentially affect it as well?

Yes.  It is also interesting that it happens on incremental builds.  Behaving differently at different VM levels can entirely be down to how they have implemented internal classes using generics.
Comment 8 Keith Kowalczykowski CLA 2007-02-08 03:37:02 EST
> Yes.  It is also interesting that it happens on incremental builds.  

I wouldn't say that it is not limited to auto builds, only. However, that is the most common/reproducible occurence. But it does also happen during a standard compile, all-be-it less frequently.

> Behaving
> differently at different VM levels can entirely be down to how they have
> implemented internal classes using generics.

So assume this is something that JRockit would need to fix? Or is this potentially something wrong with the implementation of generics in AspectJ's compiler?

Comment 9 Andrew Clement CLA 2007-02-08 03:54:36 EST
> So assume this is something that JRockit would need to fix? Or is this
> potentially something wrong with the implementation of generics in AspectJ's
> compiler?

No fix in JRockit required - it is purely an AspectJ bug.  There is something in the way generics are being used in the classes upon which you depend which is perfectly valid but AspectJ hasn't seen it before and can't cope with it.
Comment 10 John D. Heintz CLA 2007-04-13 00:34:11 EDT
Created attachment 63693 [details]
LTW on JRocket can cause the same exception

Installing Glassbox into WebLogic 10 running on JRocket generated the same exceptions with only weblogic and org.aspectj.weaver code in the stacktrace.

Hope this ajcore file helps!
Comment 11 Craig Mahy CLA 2007-06-08 10:54:35 EDT
I am getting the same bug in Eclipse when changing a specific class file that has many references to generic types. It will happen either when I have Build Automatically set or when I compile explicitly. The only thing that fixes the problem is to clean my project and start a fresh compile. So far that has solved the problem every time. I am introducing AspectJ to our development team, and they are excited to use the technology but a little hesitant. Even though this bug is not fatal (we have a work-around), it's annoyance may cause our team to loose confidence in using AspectJ - so I am curious why the severity level on this is "normal"?
Comment 12 Eclipse Webmaster CLA 2007-07-29 09:21:24 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 13 Andrew Clement CLA 2007-11-06 10:50:27 EST
I am closing this as a dup of bug 175039.  That bug covers the same stack trace but also includes an explanation of the problem and a fix was put in under that bug on the 6Mar2007.  Of all these similar bugs I have yet to see one reported on an AspectJ level after the 6Mar2007
Comment 2 here mentions 1.5.3 (22Nov2006)
Comment 10 includes a core file for a build of 28Feb2007

*** This bug has been marked as a duplicate of bug 175039 ***