]> source.dussan.org Git - aspectj.git/commitdiff
implementation of parameterize with
authoracolyer <acolyer>
Tue, 16 Aug 2005 09:28:24 +0000 (09:28 +0000)
committeracolyer <acolyer>
Tue, 16 Aug 2005 09:28:24 +0000 (09:28 +0000)
weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java

index 6e5da128e60e169eb7d9ccb761861ea269616180..c9a668e0dac111247a7901b53505c408c3a501d1 100644 (file)
@@ -38,8 +38,12 @@ public class DeclareSoft extends Declare {
        }
        
        public Declare parameterizeWith(Map typeVariableBindingMap) {
-               // TODO Auto-generated method stub
-               return this;
+               DeclareSoft ret = 
+                       new DeclareSoft(
+                                       exception.parameterizeWith(typeVariableBindingMap),
+                                       pointcut.parameterizeWith(typeVariableBindingMap));
+               ret.copyLocationFrom(this);
+               return ret;
        }
        
        public String toString() {
@@ -96,6 +100,10 @@ public class DeclareSoft extends Declare {
        exception = exception.resolveBindings(scope, null, false, true);
        ResolvedType excType = exception.getExactType().resolve(scope.getWorld());
        if (excType != ResolvedType.MISSING) {
+               if (excType.isTypeVariableReference()) {
+                       // a declare soft in a generic abstract aspect, we need to check the upper bound
+                       excType = excType.getUpperBound().resolve(scope.getWorld());
+               }
                if (!scope.getWorld().getCoreType(UnresolvedType.THROWABLE).isAssignableFrom(excType)) {
                        scope.getWorld().showMessage(IMessage.ERROR,
                                        WeaverMessages.format(WeaverMessages.NOT_THROWABLE,excType.getName()),