Bug 308773 - IllegalStateException at ResolvedMemberImpl.java:676
Summary: IllegalStateException at ResolvedMemberImpl.java:676
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Library (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 major (vote)
Target Milestone: 1.6.9M1   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-11 23:18 EDT by Cyprien NOEL CLA
Modified: 2010-04-16 13:10 EDT (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 Cyprien NOEL CLA 2010-04-11 23:18:17 EDT
Build Identifier: Version: 2.0.3.e35x-20100410-1900, AspectJ version: 1.6.9.20100408142000

java.lang.IllegalStateException
at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:676)
at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:664)
at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:772)
at org.aspectj.weaver.ResolvedType.lookupMethod(ResolvedType.java:534)
at org.aspectj.weaver.World.resolve(World.java:617)
at org.aspectj.weaver.MemberI ... : ICONST_0
                    IRETURN
  end public final boolean retainAll(java.util.Collection)

end public class com.argilsoft.xstm.core.TSet


Reproducible: Sometimes

Steps to Reproduce:
1. Change an aspect in Eclipse
2. Rebuild project
3. Modify a few java files
4. Popup appears with this error
Comment 1 Andrew Clement CLA 2010-04-12 13:37:07 EDT
no doubt a regression related to the refactoring of generics handling.  Unfortunately all my tests work just fine and a sample project to try and recreate this works too.  Are you at all able to share the project with me (doesn't have to be in a public area like bugzilla) so that I can try to fix it?  Or distill down a small failing sample?
Comment 2 Andrew Clement CLA 2010-04-12 16:58:59 EDT
With help from Cyprien I now have a minimal failing testcase.  With these types:

Middle.java
public abstract class Middle<E> extends Top<E> {
    class IteratorImpl extends TopInner { }
}

Top.java
public class Top<K> {
        class TopInner {
        public void hhh() { }
        }
}

Zzz.java
public abstract class Zzz<E> extends Middle<E> {
    void removeAll() {
        IteratorImpl it = new IteratorImpl();
        it.hhh();
    }
}

Aspy.aj
public aspect Aspy {
        before(): call(* *(..)) {       }
}

and this command line:

ajc -1.5 Aspy.aj Zzz.java Top.java Middle.java

java.lang.IllegalStateException: Can't ask to parameterize a member of non-generic type: Top$TopInner  kind(simple)
        at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:676)
        at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:664)
        at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:772)
        at org.aspectj.weaver.ResolvedType.lookupMethod(ResolvedType.java:534)


I believe it is caused by the fact that the inner type is non directly generic but as it is the inner type of a generic type, it shouldn't be triggering the IllegalStateException (since it inherits the type variables).
Comment 3 Andrew Clement CLA 2010-04-13 16:20:03 EDT
fixed - allows for this scenario now, it won't trigger the illegalstate.