@@ -385,6 +385,11 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor { | |||
try { | |||
// +1 to give first char of pointcut string | |||
ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0] + 1); | |||
if (pointcutExpression == null) { | |||
methodDeclaration.scope.problemReporter().signalError(methodDeclaration.sourceStart, | |||
methodDeclaration.sourceEnd, "the advice annotation must specify a pointcut value"); | |||
return; | |||
} | |||
PatternParser pp = new PatternParser(pointcutExpression, context); | |||
Pointcut pc = pp.parsePointcut(); | |||
pp.checkEof(); |
@@ -0,0 +1,15 @@ | |||
import org.aspectj.lang.JoinPoint; | |||
import org.aspectj.lang.annotation.AfterThrowing; | |||
import org.aspectj.lang.annotation.Aspect; | |||
@Aspect | |||
public class X { | |||
// @AfterThrowing(pointcut="execution(* *(..))",throwing = "e") | |||
@AfterThrowing(throwing = "e") | |||
public void bizLoggerWithException(JoinPoint thisJoinPoint,Throwable e) { | |||
// .....// do some stuff | |||
} | |||
} | |||
class BizLoggable {} |
@@ -21,6 +21,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase; | |||
*/ | |||
public class Ajc171Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | |||
public void testNpe_pr384401() { | |||
runTest("npe"); | |||
} | |||
public void testUnresolvableEnum_pr387568() { | |||
runTest("unresolvable enum"); | |||
} |
@@ -2,6 +2,12 @@ | |||
<suite> | |||
<ajc-test dir="bugs171/pr384401" title="npe"> | |||
<compile files="X.java" options="-1.5"> | |||
<message kind="error" line="9" text="the advice annotation must specify a pointcut value"/> | |||
</compile> | |||
</ajc-test> | |||
<ajc-test dir="bugs171/pr387444" title="soft 17"> | |||
<compile files="Code.java" options="-1.7"/> | |||
</ajc-test> |