]> source.dussan.org Git - aspectj.git/commitdiff
298504: test and fix: incremental build when invalid declare @type
authoraclement <aclement>
Mon, 15 Mar 2010 21:04:35 +0000 (21:04 +0000)
committeraclement <aclement>
Mon, 15 Mar 2010 21:04:35 +0000 (21:04 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java

index 2ea7d2e3a242a2966c41b724cdb7214799205aa3..a0da4cd64d9de217b93234b5e5a740d93f0c8881 100644 (file)
@@ -938,6 +938,11 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
                        // on the weaver type temporarily
                        ResolvedType theTargetType = factory.fromEclipse(sourceType);
                        TypeBinding theAnnotationType = toAdd[0].resolvedType;
+                       // The annotation type may be null if it could not be resolved (eg. the relevant import has not been added yet)
+                       // In this case an error will be put out about the annotation but not if we crash here
+                       if (theAnnotationType == null) {
+                               return false;
+                       }
                        String sig = new String(theAnnotationType.signature());
                        UnresolvedType bcelAnnotationType = UnresolvedType.forSignature(sig);
                        String name = bcelAnnotationType.getName();