Project: AspectJ
Bug 131933 grotty ClassCastException on referring to pointcut in generic type
Reported: 2006-03-15 09:46:31 | Status: resolved fixed

import java.util.List; public aspect Slide71 { before(): GenericType<String>.foo() {} before(): GenericType<MyList>.foo() {} //before(): GenericType.foo() {} } class GenericType<T> { public pointcut foo(): execution(* T.*(..)); } that programs gives: (because MyList is not a known type) java.lang.ClassCastException at org.aspectj.weaver.patterns.TypePattern.resolveExactType(TypePattern.java:193) at org.aspectj.weaver.patterns.ReferencePointcut.resolveBindings(ReferencePointcut.java:130) at org.aspectj.weaver.patterns.Pointcut.resolve(Pointcut.java:194) at org.aspectj.ajdt.internal.compiler.ast.PointcutDesignator.finishResolveTypes(PointcutDesignator.java:84) at org.aspectj.ajdt.internal.compiler.ast.AdviceDeclaration.resolveStatements(AdviceDeclaration.java:118) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:400) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1088) at org.aspectj.ajdt.internal.compiler.ast.AspectDeclaration.resolve(AspectDeclaration.java:116) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1137) at org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:305) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:514) at org.aspectj.org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:329) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performCompilation(AjBuildManager.java:843) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.doBuild(AjBuildManager.java:268) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.incrementalBuild(AjBuildManager.java:170) 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.patterns.WildTypePattern

Files changed in fix:
tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java weaver/src/org/aspectj/weaver/patterns/TypePattern.java