}
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)) {
--- /dev/null
+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);
+ }
+}
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
*/
</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">