From: aclement Date: Thu, 16 Mar 2006 11:01:54 +0000 (+0000) Subject: test and fix for 131933 X-Git-Tag: V1_5_1_final~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f2cd94f88a9976fc98786955a764522a8ccb37f1;p=aspectj.git test and fix for 131933 --- diff --git a/tests/bugs151/pr131933.aj b/tests/bugs151/pr131933.aj new file mode 100644 index 000000000..a374c13af --- /dev/null +++ b/tests/bugs151/pr131933.aj @@ -0,0 +1,11 @@ +import java.util.List; + +aspect Slide71 { + before(): GenericType.foo() {} + before(): GenericType.foo() {} + //before(): GenericType.foo() {} +} + +class GenericType { + public pointcut foo(): execution(* T.*(..)); +} diff --git a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java index 49ccd33c5..c431e763a 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java @@ -107,6 +107,11 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testSwallowedExceptionIgnored() { runTest("swallowed exceptions with xlint"); } + + public void testGenericAspectWithUnknownType_pr131933() { + runTest("no ClassCastException with generic aspect and unknown type"); + } + /* * @AspectJ bugs and enhancements */ diff --git a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml index f935c4da9..129c1b434 100644 --- a/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml +++ b/tests/src/org/aspectj/systemtest/ajc151/ajc151.xml @@ -246,6 +246,13 @@ + + + + + + + diff --git a/weaver/src/org/aspectj/weaver/patterns/TypePattern.java b/weaver/src/org/aspectj/weaver/patterns/TypePattern.java index 3098f05de..671adcf94 100644 --- a/weaver/src/org/aspectj/weaver/patterns/TypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/TypePattern.java @@ -188,8 +188,7 @@ public abstract class TypePattern extends PatternNode { public UnresolvedType resolveExactType(IScope scope, Bindings bindings) { TypePattern p = resolveBindings(scope, bindings, false, true); - if (p == NO) return ResolvedType.MISSING; - + if (!(p instanceof ExactTypePattern)) return ResolvedType.MISSING; return ((ExactTypePattern)p).getType(); }