From: hsestupin Date: Wed, 2 Jul 2014 11:36:30 +0000 (+0400) Subject: add last apt fix [apt] X-Git-Tag: V1_8_2~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a7f617d3d69822f6383d9ab18561b22b69436000;p=aspectj.git add last apt fix [apt] Signed-off-by: hsestupin --- 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 918d0177e..49b0f7371 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 @@ -31,13 +31,7 @@ import org.aspectj.bridge.WeaveMessage; import org.aspectj.bridge.context.CompilationAndWeavingContext; import org.aspectj.bridge.context.ContextToken; import org.aspectj.org.eclipse.jdt.core.compiler.CharOperation; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleTypeReference; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeReference; +import org.aspectj.org.eclipse.jdt.internal.compiler.ast.*; import org.aspectj.org.eclipse.jdt.internal.compiler.env.AccessRestriction; import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType; import org.aspectj.org.eclipse.jdt.internal.compiler.env.INameEnvironment; @@ -1432,6 +1426,29 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC public void anonymousTypeBindingCreated(LocalTypeBinding aBinding) { factory.addSourceTypeBinding(aBinding, null); } + + @Override + public void buildTypeBindings(CompilationUnitDeclaration unit, AccessRestriction accessRestriction) { + if (this.isProcessingAnnotations && hasAspectDeclarations(unit)) { + throw new SourceTypeCollisionException(); + } + super.buildTypeBindings(unit, accessRestriction); + } + + private static boolean hasAspectDeclarations(CompilationUnitDeclaration unit) { + for (int j = 0; j < unit.types.length; j++) { + if (unit.types[j] instanceof AspectDeclaration) { + return true; + } + } + return false; + } + + @Override + public void reset() { + this.factory.cleanup(); + super.reset(); + } } // commented out, supplied as info on how to manipulate annotations in an