Browse Source

test and fix for 121616

tags/POST_MEMORY_CHANGES
aclement 18 years ago
parent
commit
d4219e12ea

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

@@ -147,6 +147,9 @@ public class ValidateAtAspectJAnnotationsVisitor extends ASTVisitor {
}
public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
if (methodDeclaration.hasErrors()) {
return false;
}
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.VALIDATING_AT_ASPECTJ_ANNOTATIONS, methodDeclaration.selector);
ajAnnotations = new AspectJAnnotations(methodDeclaration.annotations);
if (!methodDeclaration.getClass().equals(AjMethodDeclaration.class)) {

+ 16
- 0
tests/bugs151/pr121616.java View File

@@ -0,0 +1,16 @@
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

class Main {
public static void main(String[] args) {
System.out.println("Main");
}
}

@Aspect
class MainLogger {
@Before("execution(* main(..))")
public void log(JoinPoint thisJoinPoint) {
System.out.println("Before " + thisJoinPoint);
}
}

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc151/Ajc151Tests.java View File

@@ -160,6 +160,10 @@ public class Ajc151Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("@AJ no NPE with deow when structure model isn't generated");
}
public void testAtAspectWithoutJoinPointImport_pr121616() {
runTest("@AJ without JoinPoint import");
}
/*
* Load-time weaving bugs and enhancements
*/

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

@@ -176,6 +176,12 @@
</compile>
</ajc-test>

<ajc-test dir="bugs151" title="@AJ without JoinPoint import">
<compile files="pr121616.java" options="-1.5">
<message kind="error" line="13" text="JoinPoint cannot be resolved to a type"/>
</compile>
</ajc-test>

<!-- New features down here... when they arent big enough to have their own test file -->
<ajc-test dir="features151/ptw" title="exposing withintype">

Loading…
Cancel
Save