Andy Clement 11 роки тому
джерело
коміт
55ebaa1530

+ 5
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/ValidateAtAspectJAnnotationsVisitor.java Переглянути файл

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

+ 15
- 0
tests/bugs171/pr384401/X.java Переглянути файл

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 Переглянути файл

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

+ 6
- 0
tests/src/org/aspectj/systemtest/ajc171/ajc171.xml Переглянути файл



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

Завантаження…
Відмінити
Зберегти