diff options
author | aclement <aclement> | 2006-01-30 10:25:59 +0000 |
---|---|---|
committer | aclement <aclement> | 2006-01-30 10:25:59 +0000 |
commit | deaa590e83b2e7707fecd5281f342d13246b36d0 (patch) | |
tree | f37647772394e362fae486077c37a31a27e960d4 /org.aspectj.ajdt.core/src | |
parent | 49341327b19da8e97c12194be2c162eae9916b40 (diff) | |
download | aspectj-deaa590e83b2e7707fecd5281f342d13246b36d0.tar.gz aspectj-deaa590e83b2e7707fecd5281f342d13246b36d0.zip |
fixes for 125475/125480 - matches nothing @AJ support. Definetly *NOT* as clean as it could be, but works.
Diffstat (limited to 'org.aspectj.ajdt.core/src')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java | 13 |
1 files changed, 8 insertions, 5 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 ab320a187..e16e73d51 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 @@ -493,6 +493,7 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { methodDeclaration.scope.problemReporter().disallowedTargetForAnnotation(ajAnnotations.adviceNameAnnotation); } + boolean noValueSupplied=true; boolean containsIfPcd = false; int[] pcLocation = new int[2]; String pointcutExpression = getStringLiteralFor("value",ajAnnotations.pointcutAnnotation,pcLocation); @@ -500,8 +501,9 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { ISourceContext context = new EclipseSourceContext(unit.compilationResult,pcLocation[0]); Pointcut pc = null;//abstract if (pointcutExpression == null || pointcutExpression.length() == 0) { - ;//will have to ensure abstract ()V method + noValueSupplied=true; // matches nothing pointcut } else { + noValueSupplied=false; pc = new PatternParser(pointcutExpression,context).parsePointcut(); } pcDecl.pointcutDesignator = (pc==null)?null:new PointcutDesignator(pc); @@ -561,16 +563,17 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { } if (pcDecl.pointcutDesignator == null) { - if (Modifier.isAbstract(methodDeclaration.modifiers) + if (Modifier.isAbstract(methodDeclaration.modifiers) + || noValueSupplied // this is a matches nothing pointcut //those 2 checks makes sense for aop.xml concretization but NOT for regular abstraction of pointcut //&& returnsVoid //&& (methodDeclaration.arguments == null || methodDeclaration.arguments.length == 0)) { ) { ;//fine } else { - methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart, - methodDeclaration.returnType.sourceEnd, - "Method annotated with @Pointcut() for abstract pointcut must be abstract"); + methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart, + methodDeclaration.returnType.sourceEnd, + "Method annotated with @Pointcut() for abstract pointcut must be abstract"); } } else if (Modifier.isAbstract(methodDeclaration.modifiers)) { methodDeclaration.scope.problemReporter().signalError(methodDeclaration.returnType.sourceStart, |