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