From 9ffc63b51aa49fa3bb67a4a1c40dd7d1fe4c97ae Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 16 May 2006 07:38:53 +0000 Subject: tests and fix for 135068: verifyerror for @AJ --- .../internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'org.aspectj.ajdt.core/src') diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java index a79ef0931..09d6b441e 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java @@ -282,6 +282,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { * 3) Advice must not have any other @AspectJ annotations * 4) After throwing advice must declare the thrown formal * 5) After returning advice must declare the returning formal + * 6) Advice must not be static */ private void validateAdvice(MethodDeclaration methodDeclaration) { @@ -295,6 +296,11 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { methodDeclaration.scope.problemReporter() .signalError(methodDeclaration.sourceStart,methodDeclaration.sourceEnd,"advice must be public"); } + + if (Modifier.isStatic(methodDeclaration.modifiers)) { + methodDeclaration.scope.problemReporter() + .signalError(methodDeclaration.sourceStart,methodDeclaration.sourceEnd,"advice can not be declared static"); + } if (ajAnnotations.hasMultipleAdviceAnnotations) { methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.duplicateAdviceAnnotation); -- cgit v1.2.3