From 0afe6b3137e636e126d58d6db1a21d2990c06d95 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 23 Jan 2009 17:49:39 +0000 Subject: [PATCH] 262154: test and fix --- .../compiler/lookup/EclipseSourceType.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) 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 cf7b45a1e..4f5260705 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 @@ -396,9 +396,9 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { ResolvedMember[] pointcuts = getDeclaredPointcuts(); boolean sawError = false; for (int i = 0, len = pointcuts.length; i < len; i++) { - if (pointcuts[i]==null) { + if (pointcuts[i] == null) { // Something else is broken in this file and will be reported separately - continue; + continue; } if (pointcuts[i].isAbstract()) { if (!this.isAspect()) { @@ -413,9 +413,9 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { } for (int j = i + 1; j < len; j++) { - if (pointcuts[j]==null) { + if (pointcuts[j] == null) { // Something else is broken in this file and will be reported separately - continue; + continue; } if (pointcuts[i].getName().equals(pointcuts[j].getName())) { eclipseWorld().showMessage(IMessage.ERROR, "duplicate pointcut name: " + pointcuts[j].getName(), @@ -463,13 +463,12 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { public boolean isEnum() { return (binding.getAccessFlags() & ACC_ENUM) != 0; - } + } public boolean isAnnotation() { return (binding.getAccessFlags() & ACC_ANNOTATION) != 0; } - public boolean isAnnotationWithRuntimeRetention() { if (!isAnnotation()) { return false; @@ -693,11 +692,10 @@ public class EclipseSourceType extends AbstractReferenceTypeDelegate { } else { if (memberValuePairReturnType.isArrayType() && !defaultValueBinding.isArrayType()) { if (constant != null && constant != Constant.NotAConstant) { - throw new MissingImplementationException( - "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value [" - + defaultValue + "]"); - // generateElementValue(attributeOffset, defaultValue, - // constant, memberValuePairReturnType.leafComponentType()); + // Testcase for this clause is MultiProjectIncrementalTests.testAnnotations_pr262154() + AnnotationValue av = EclipseAnnotationConvertor.generateElementValueForConstantExpression(defaultValue, + defaultValueBinding); + return new ArrayAnnotationValue(new AnnotationValue[] { av }); } else { AnnotationValue av = generateElementValueForNonConstantExpression(defaultValue, defaultValueBinding); return new ArrayAnnotationValue(new AnnotationValue[] { av }); -- 2.39.5