Community
Participate
Working Groups
I'm using AJDT dev build 20051012172335 and am getting the following error : java.lang.ClassCastException at org.aspectj.weaver.World.resolveGenericWildcardFor(World.java:369) at org.aspectj.weaver.World.resolveToReferenceType(World.java:284) at org.aspectj.weaver.World.resolve(World.java:209) at org.aspectj.weaver.World.resolve(World.java:131) at org.aspectj.weaver.World.resolve(World.java:162) at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:47) at org.aspectj.weaver.World.resolveToReferenceType(World.java:273) at org.aspectj.weaver.World.resolve(World.java:209) at org.aspectj.weaver.World.resolve(World.java:131) at org.aspectj.weaver.UnresolvedType.resolve(UnresolvedType.java:636) at org.aspectj.weaver.ResolvedMemberImpl.resolve(ResolvedMemberImpl.java:429) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeResolvedMember(EclipseFactory.java:475) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeResolvedMember(EclipseFactory.java:424) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.genBytecodeInfo(AsmHierarchyBuilder.java:525) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.visit(AsmHierarchyBuilder.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:185) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1183) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:339) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.internalBuild(AsmHierarchyBuilder.java:142) at org.aspectj.ajdt.internal.core.builder.AsmHierarchyBuilder.buildStructureForCompilationUnit(AsmHierarchyBuilder.java:82) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.finishedCompilationUnit(EclipseFactory.java:720) at org.aspectj.ajdt.internal.compiler.AjCompilerAdapter.afterProcessing(AjCompilerAdapter.java:195) at org.aspectj.ajdt.internal.compiler.CompilerAdapter.ajc$afterReturning$org_aspectj_ajdt_internal_compiler_CompilerAdapter$4$6b855184(CompilerAdapter.aj:89) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:528) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:759) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:249) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:158) at org.aspectj.ajde.internal.CompilerAdapter.compile(CompilerAdapter.java:117) at org.aspectj.ajde.internal.AspectJBuildManager$CompilerThread.run(AspectJBuildManager.java:191) ClassCastException thrown: org.aspectj.weaver.MissingResolvedTypeWithKnownSignature the following is my test classes : public interface GenericInterface<O> { public O doSomething(Class<? extends O> type); } the implementation of the above interface : import java.util.Collection; public class Implementation implements GenericInterface<Collection<?>>{ public Collection<?> doSomething(Class<? extends Collection<?>> type) { return null; } } granted, the Class<? extends O> in the interface is probably unnecessary for this example, but still this *is* valid Java and the same problem probably surfaces in similar valid circumstances.
The problem here is that in the expression 'Class<? extends Collection<?>>' the upperbound of the wildcard ? is being incorrectly set to a simple type with signature 'Collection<?>' which of course does not exist - it should be getting set to a parameterized type with basetype 'Collection' and typeparameter '?'. I've fixed this in CVS - waiting on build before closing.
Fix available in AspectJ - will appear in next AJDT.