Community
Participate
Working Groups
This is the exception i get in eclipse java.lang.ClassCastException at org.aspectj.weaver.TypeVariableReferenceType.<init>(TypeVariableReferenceType.java:38) at org.aspectj.weaver.UnresolvedTypeVariableReferenceType.resolve(UnresolvedTypeVariableReferenceType.java:50) at org.aspectj.weaver.World.resolve(World.java:186) at org.aspectj.weaver.World.resolve(World.java:134) at org.aspectj.weaver.World.resolve(World.java:165) at org.aspectj.weaver.TypeFactory.createParameterizedType(TypeFactory.java:47) at org.aspectj.weaver.World.resolveToReferenceType(World.java:276) at org.aspectj.weaver.World.resolve(World.java:212) at org.aspectj.weaver.World.resolve(World.java:134) at org.aspectj.weaver.UnresolvedType.resolve(UnresolvedType.java:636) at org.aspectj.weaver.TypeVariable.resolve(TypeVariable.java:158) at org.aspectj.weaver.ResolvedMemberImpl.resolve(ResolvedMemberImpl.java:414) at org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory.makeResolvedMember(EclipseFactory.java:476) 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:762) 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.UnresolvedType and this is a reduced version of the code i think its the method signature the causes the error.. as ive made the codee inside the method as minimal as possible and the bug still occurs public class Test { public <T extends Enum<T>> T getEnum(String name, Class<T> enumClass) { return (T)new Object(); } }
This only fails if building a structure model. To cause the failure on the command line I had to: ajc -1.5 -emacssym Test.java Now looking at the problem...
Actually this only fails at M4, it is already fixed in HEAD, probably due to all the recent changes to make the system even more generics aware. I'll add the supplied test program (thanks!) to our test suite.
need to specify a target!
Yeah sorry bout that... i forgot to methion it happened in eclipse so maybe the plugin uses those -1.5 -emacssym options :)