Browse Source

384401

tags/V1_7_1
Andy Clement 11 years ago
parent
commit
55ebaa1530

+ 5
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java View File

@@ -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();

+ 15
- 0
tests/bugs171/pr384401/X.java View File

@@ -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 {}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java View File

@@ -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");
}

+ 6
- 0
tests/src/org/aspectj/systemtest/ajc171/ajc171.xml View File

@@ -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>

Loading…
Cancel
Save