From 204dacffc724d4d762a418d76f7112b22e196519 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 3 Feb 2005 11:37:36 +0000 Subject: [PATCH] Fix for PR84290: Runtime retention not recognized; inhibts use of annotation binding --- .../compiler/lookup/EclipseSourceType.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 2ba0dfec7..9149398ef 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -45,6 +45,7 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName { private SourceTypeBinding binding; private TypeDeclaration declaration; + private boolean annotationsResolved = false; protected EclipseFactory eclipseWorld() { return factory; @@ -232,6 +233,12 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName { } public boolean hasAnnotation(TypeX ofType) { + + // Make sure they are resolved + if (!annotationsResolved) { + TypeDeclaration.resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, binding); + annotationsResolved = true; + } Annotation[] as = declaration.annotations; if (as == null) return false; for (int i = 0; i < as.length; i++) { @@ -250,7 +257,22 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName { } public ResolvedTypeX[] getAnnotationTypes() { - throw new RuntimeException("How to implement this? Needs to ask eclipse!"); + throw new RuntimeException("Missing implementation"); + // FIXME Finish this off +// // Make sure they are resolved +// if (!annotationsResolved) { +// TypeDeclaration.resolveAnnotations(declaration.staticInitializerScope, declaration.annotations, binding); +// annotationsResolved = true; +// } +// ResolvedTypeX[] rtxAs = new ResolvedTypeX[declaration.annotations.length]; +// Annotation[] as = declaration.annotations; +// if (as == null) return rtxAs; +// for (int i = 0; i < as.length; i++) { +// Annotation annotation = as[i]; +// // FIXME - need to implement this ! +// rtxAs[i] = factory.makeAnnotation(as[i]); +// } +// return rtxAs; } public PerClause getPerClause() { -- 2.39.5