aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
diff options
context:
space:
mode:
Diffstat (limited to 'org.aspectj.matcher')
-rw-r--r--org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java
index 7d62ae8ab..e1cc54341 100644
--- a/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java
+++ b/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.aspectj.weaver.patterns;
+import org.aspectj.weaver.BCException;
import org.aspectj.weaver.ResolvedPointcutDefinition;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
@@ -36,7 +37,13 @@ public class PerThisOrTargetPointcutVisitor extends AbstractPatternNodeVisitor {
}
public TypePattern getPerTypePointcut(Pointcut perClausePointcut) {
- return (TypePattern) perClausePointcut.accept(this, perClausePointcut);
+ Object o = perClausePointcut.accept(this, perClausePointcut);
+ if (o instanceof TypePattern) {
+ return (TypePattern) o;
+ } else {
+ throw new BCException("perClausePointcut visitor did not return a typepattern, it returned " + o
+ + (o == null ? "" : " of type " + o.getClass()));
+ }
}
// -- visitor methods, all is like Identity visitor except when it comes to transform pointcuts