Community
Participate
Working Groups
This program: @interface A {} aspect Test { declare @method : @A void process* () : @A; declare @method : void process* () : @A; interface Subject {} public void Subject.processa () {} public void Subject.processb () {} } class X implements Test.Subject { } results in AspectJ compiler crashing (the command: ajc -1.5 Test.java) with java.util.NoSuchElementException exception. The reason for this is that one of the loops in the weaveAtMethodOnITDSRepeatedly method in the org.aspectj.weaver.bcel.BcelClassWeaver class iterates through one list, but calls "hasNext" on an iterator of another collection: the line for (Iterator iter2 = worthRetrying.iterator(); iter.hasNext();) { should be replaced with the line for (Iterator iter2 = worthRetrying.iterator(); iter2.hasNext();) { This fix causes AspectJ to correctly process the program above. The bug was reproduced by me on the 1.5.3 version, but it's present in all newer versions as well, including the development version. I didn't look at earlier versions, however.
fixed in latest dev builds of AspectJ