Bug 195659

Summary: java.lang.ClassCastException at org.aspectj.weaver.World.resolveGenericWildcardFor(World.java:461)
Product: [Tools] AspectJ Reporter: chu rennan <churennan>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement, jcaplan, peter.empen
Version: DEVELOPMENT   
Target Milestone: 1.6.0 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description chu rennan CLA 2007-07-06 10:20:06 EDT
sample:
public class ObjectArrayDataProvider<E>  {
	private Class<? extends E[]> newType;
	public ObjectArrayDataProvider(Class<? extends E[]> newType) {
		this.newType = newType;
	}	
}

error info:
java.lang.ClassCastException
at org.aspectj.weaver.World.resolveGenericWildcardFor(World.java:461)
at org.aspectj.weaver.World.resolveToReferenceType(World.java:372)
at org.aspectj.weaver.World.resolve(World.java:271)
at org.aspectj.weaver.World.resolve(World.java:191)
at org.aspectj.weaver.World.resolve(World.java:223)
at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:47)
at org.aspectj.weaver.World.resolveTo ... :183)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

Compile error: ClassCastException thrown: org.aspectj.weaver.ResolvedType$Array
Comment 1 Matt Chapman CLA 2007-07-06 11:21:01 EDT
passing over to compiler
Comment 2 Peter CLA 2008-03-05 04:04:41 EST
I have the same bug with AspectJ Tools 1.5.3.
If you write "passing over to compiler", where can I look for resolution?
Comment 3 Andrew Clement CLA 2008-03-05 18:33:38 EST
It means the bug was reassigned to AspectJ from AJDT - any resolution information will still be in this bug report.
Comment 4 Andrew Clement CLA 2008-03-05 18:40:43 EST
I initially thought this was because of the same reason as bug 167197 (that array is not a referencetype) but on attempting to compile the code supplied in the first comment here with AspectJ6 - it just works.
Comment 5 Andrew Clement CLA 2008-03-17 13:03:53 EDT
playing around with this, I managed to get it to fail with a little aspect attached:

aspect X { before(): execution(new(Class<*>)) {}}

with the changes I have just put in under 167197 - this is fixed.  fixes should be available shortly.