aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-01-07 23:20:37 +0000
committerjhugunin <jhugunin>2003-01-07 23:20:37 +0000
commitee5a8c8347a8d1638d7ca65783d96d17950bc016 (patch)
tree7fca55c20e4321eee0dd6375dc4bf5dc783f5854 /weaver
parent1e068fe485d7539ad938712b6bed5812fadf7df7 (diff)
downloadaspectj-ee5a8c8347a8d1638d7ca65783d96d17950bc016.tar.gz
aspectj-ee5a8c8347a8d1638d7ca65783d96d17950bc016.zip
the type declared soft must be a subtype of Throwable
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
index c249340e4..5306a16fe 100644
--- a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
+++ b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java
@@ -15,7 +15,10 @@ package org.aspectj.weaver.patterns;
import java.io.*;
+import org.aspectj.bridge.IMessage;
import org.aspectj.weaver.ISourceContext;
+import org.aspectj.weaver.ResolvedTypeX;
+import org.aspectj.weaver.TypeX;
public class DeclareSoft extends Declare {
private TypePattern exception;
@@ -78,6 +81,17 @@ public class DeclareSoft extends Declare {
public void resolve(IScope scope) {
exception = exception.resolveBindings(scope, null, false, true);
+ TypeX excType = exception.getExactType();
+ if (excType != ResolvedTypeX.MISSING) {
+ if (!scope.getWorld().resolve(TypeX.THROWABLE).isAssignableFrom(excType)) {
+ scope.getWorld().showMessage(IMessage.ERROR,
+ excType.getName() + " is not a subtype of Throwable",
+ exception.getSourceLocation(), null);
+ pointcut = Pointcut.makeMatchesNothing(Pointcut.RESOLVED);
+ return;
+ }
+ }
+
pointcut = pointcut.resolve(scope);
}