From: aclement Date: Mon, 15 Mar 2010 21:04:35 +0000 (+0000) Subject: 298504: test and fix: incremental build when invalid declare @type X-Git-Tag: V1_6_9M1~42 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=85d90a601b1da2b59bd4920cddf8b8e001c39780;p=aspectj.git 298504: test and fix: incremental build when invalid declare @type --- diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java index 2ea7d2e3a..a0da4cd64 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java @@ -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();