summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2006-05-16 07:38:53 +0000
committeraclement <aclement>2006-05-16 07:38:53 +0000
commit9ffc63b51aa49fa3bb67a4a1c40dd7d1fe4c97ae (patch)
tree849734d4b11d088f3f5159c69034c727093397ce /org.aspectj.ajdt.core
parent5c2da6f738945e027241703ef91c49099d9851d8 (diff)
downloadaspectj-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.java6
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);