Bug 180132 - ArrayIndexOutOfBounds while Saving java class whose join points catched by advice
Summary: ArrayIndexOutOfBounds while Saving java class whose join points catched by ad...
Status: RESOLVED DUPLICATE of bug 175039
Alias: None
Product: AspectJ
Classification: Tools
Component: Runtime (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 1.5.4   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 02:48 EDT by erkar CLA
Modified: 2007-11-06 10:55 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 erkar CLA 2007-03-30 02:48:24 EDT
Hello,
I am getting the following error messages while saving a *.java file. In the class to save there are some join points catched by an advice.

Using
- Eclipse Version: 3.2.0
  Build id: M20070212-1330
- JRE 1.5
- AJDT 1.4.2.2007-01-19
(- some other plugins, should not be involved)

Thanks.

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:1157)
at org.aspectj.weaver.ResolvedType.collectInterTypeMungers(ResolvedTyp ... ob.run(AutoBuildJob.java:217)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

Compile error: ArrayIndexOutOfBoundsException thrown: 0
Comment 1 erkar CLA 2007-03-30 02:52:57 EDT
Cleaning project using "Project | Clean..." compiles the project as expected. Yet, problem still reoccur on re-saving java file.
Comment 2 Christopher Pierce CLA 2007-03-30 10:12:00 EDT
I'm getting the same stack trace when saving a java file (compiling).
Doing a Project->clean gets the project to compile, but problem returns the next time I try to save.  Also found that restarting Eclipse makes the problem go away breifly, but it eventually comes back after doing a few saves.  Can't see any pattern to when it starts failing (after restart, it failed on saving a different class than it was failing on before the restart).

In my case, It's failing to comple a class that simply uses advised objects, and is not advised itself.

My code uses an aspect to apply an interface to POJOs that have a specific Annotation:

@Target({ElementType.TYPE})
@Retention(value=RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
}

@MyAnnotation
public class MyClass {
...
}

public interface MyInterface {
...
}

public aspect MyInterfaceAspect {
   declare parents: (@MyAspect *) implements MyInterface
...
}

public class MyService {

    public void doSomething(MyClass obj) {
        MyInterface mi = (MyInterface) obj;
        ...
    }
}

Saving (compiling) the "MyService" eventually fails.


Using
- Eclipse Version: 3.2.2
- JRE 6 (Compiler compliance set to 5)
- AJDT 1.4.2.200703020612 (Dev)
- AspectJ 1.5.4.200701151324
Comment 3 Christopher Pierce CLA 2007-04-05 12:30:58 EDT
The following bugs look suspiciously like this one.  Are these all the same?

bug #165787
bug #169605
bug #175039
bug #178379
Comment 4 Andrew Clement CLA 2007-10-09 09:20:59 EDT
this is a long shot but I have some development time now.  Do you by any chance have time to try some debug builds for me to investigate this problem?
Comment 5 Andrew Clement CLA 2007-11-06 10:55:12 EST
As Christopher says in comment 3, those bugs are all related.  Having had time to look through them, 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

this one raised against an AJDT of 1Jan2007
Comment 2 AspectJ level 15Jan2007

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