diff options
author | aclement <aclement> | 2006-05-16 07:38:53 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-05-16 07:38:53 +0000 |
commit | 9ffc63b51aa49fa3bb67a4a1c40dd7d1fe4c97ae (patch) | |
tree | 849734d4b11d088f3f5159c69034c727093397ce /org.aspectj.ajdt.core | |
parent | 5c2da6f738945e027241703ef91c49099d9851d8 (diff) | |
download | aspectj-9ffc63b51aa49fa3bb67a4a1c40dd7d1fe4c97ae.tar.gz aspectj-9ffc63b51aa49fa3bb67a4a1c40dd7d1fe4c97ae.zip |
tests and fix for 135068: verifyerror for @AJ
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java | 6 |
1 files changed, 6 insertions, 0 deletions
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); |