]> source.dussan.org Git - aspectj.git/commitdiff
checking that parameter to after throwing isa Throwable
authorjhugunin <jhugunin>
Mon, 30 Dec 2002 20:29:56 +0000 (20:29 +0000)
committerjhugunin <jhugunin>
Mon, 30 Dec 2002 20:29:56 +0000 (20:29 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java

index 157d54320b7647f6c03c3388974ee14c4ab2c747..65bf5c3527b95f3e3ffe2c4882e1ab05e282db78 100644 (file)
@@ -72,6 +72,16 @@ public class AdviceDeclaration extends MethodDeclaration {
                
                modifiers = binding.modifiers = checkAndSetModifiers(modifiers, upperScope);
                
+               if (kind == AdviceKind.AfterThrowing && extraArgument != null) {
+                       TypeBinding argTb = extraArgument.binding.type;
+                       TypeBinding expectedTb = upperScope.getJavaLangThrowable();
+                       if (!upperScope.areTypesCompatible(argTb, expectedTb)) {
+                               scope.problemReporter().typeMismatchError(argTb, expectedTb, extraArgument);
+                               ignoreFurtherInvestigation = true;
+                               return;
+                       }
+               }
+               
                
                pointcutDesignator.finishResolveTypes(this, this.binding, 
                        baseArgumentCount, upperScope.referenceContext.binding);
@@ -160,6 +170,8 @@ public class AdviceDeclaration extends MethodDeclaration {
 
 
        public void generateCode(ClassScope classScope, ClassFile classFile) {
+               if (ignoreFurtherInvestigation) return;
+               
                super.generateCode(classScope, classFile);
                if (proceedMethodBinding != null) {
                        generateProceedMethod(classScope, classFile);