Community
Participate
Working Groups
I believe this is similar to 112880. The message and stack trace I am getting are -- (IllegalStateException) Can't ask to parameterize a member of non-generic type: com...object kind(raw) Can't ask to parameterize a member of non-generic type: com...object kind(raw) java.lang.IllegalStateException: Can't ask to parameterize a member of non-generic type: com....object kind(raw) at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:612) at org.aspectj.weaver.ResolvedMemberImpl.parameterizedWith(ResolvedMemberImpl.java:597) at org.aspectj.weaver.ReferenceType.getDeclaredMethods(ReferenceType.java:508) at org.aspectj.weaver.ResolvedType$4.get(ResolvedType.java:225) at org.aspectj.weaver.Iterators$3$1.hasNext(Iterators.java:118) at org.aspectj.weaver.Iterators$5.hasNext(Iterators.java:171) at org.aspectj.weaver.Iterators$3.hasNext(Iterators.java:128) at org.aspectj.weaver.ResolvedType.lookupMember(ResolvedType.java:345) at org.aspectj.weaver.ResolvedType.lookupMethod(ResolvedType.java:326) . . . The same code was able to be weaved under 1.5.0. The reason why this is a major issue is 1.5.0 suffers from a StackOverflowException.
The stackoverflow bug was 125101.
Does comment #1 about 125101 apply to this bug? since the exception included in the initial text is an IllegalStateException? I've seen this IllegalState occur for a few reasons. Can I ask if you are doing a regular command line compile or are you in AJDT or are you doing loadtime weaving? Did the code compile/weave ok under AspectJ 1.5.1a or did it also fail there? I'm very confused by the text of the message as it says the declaring type is 'com...object' ??! Do you have a package called that? Is there any way you can summarize your type hierarchy (the part that includes generic signatures) so that I can investigate further?
have you managed to try this on 1.5.1a yet?
Created attachment 45597 [details] Simple class with non-utilized generic
Created attachment 45598 [details] Class that extends B
Created attachment 45599 [details] Class that obtains an aspect.
Created attachment 45601 [details] "Controlling method" used in the aspect
Created attachment 45602 [details] aspect that causes the parameterization error
Hi Andy, I was able to create a small test reproducible test case. You will have to forgive the obfuscation, but it was the best I could do. I have attached the following files: A.java, B.java, C.java, D.java, and TestAspect.aj. The command I used to compile the files is % ajc -source 5 -target 5 -inpath C:\Software\hibernate.org\hibernate-3.1\hibernate3.jar A.java B.java C.java D.java TestAspect.aj Obviously, you will need the hibernate3.jar for the compilation. The bug 148738 is related to this bug as you will see from the output. The same problem happens with 1.5.1a. If you have any questions, please let me know.
I've made a shorter test program that demonstrates the failure (didn't need hibernate): =========8<============ public abstract class A<E> { public A() { } public void setUniqueID(Object o) {} } class B extends A { public B() {} } class D { public void method() { B b = new B(); b.setUniqueID(null); } } aspect TestAspect { before(): call(public void *.*()) { } } =========8<============ ajc -source 5 -target 5 A.java It turns out the actual problem is that you are supplying "-source 5" rather than "-source 1.5". Although the compiler sees these as equivalent, the weaver only understands "1.5". Typically we invoke the compiler with this shorthand: ajc -1.5 A.java So - I've made the weaver understand "5". Just to confirm this is what you are seeing, can you try supplying the option as "1.5". My fix should be in a dev build shortly (this is probably the fix for the other bug too...)
fix to also support "5" is in the latest AJ dev build.
fix is available - please reopen if you continue to have problems.