try { | try { | ||||
// +1 to give first char of pointcut string | // +1 to give first char of pointcut string | ||||
ISourceContext context = new EclipseSourceContext(unit.compilationResult, pcLocation[0] + 1); | 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); | PatternParser pp = new PatternParser(pointcutExpression, context); | ||||
Pointcut pc = pp.parsePointcut(); | Pointcut pc = pp.parsePointcut(); | ||||
pp.checkEof(); | pp.checkEof(); |
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 {} |
*/ | */ | ||||
public class Ajc171Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | public class Ajc171Tests extends org.aspectj.testing.XMLBasedAjcTestCase { | ||||
public void testNpe_pr384401() { | |||||
runTest("npe"); | |||||
} | |||||
public void testUnresolvableEnum_pr387568() { | public void testUnresolvableEnum_pr387568() { | ||||
runTest("unresolvable enum"); | runTest("unresolvable enum"); | ||||
} | } |
<suite> | <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"> | <ajc-test dir="bugs171/pr387444" title="soft 17"> | ||||
<compile files="Code.java" options="-1.7"/> | <compile files="Code.java" options="-1.7"/> | ||||
</ajc-test> | </ajc-test> |