aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2008-07-31 19:17:00 +0000
committeraclement <aclement>2008-07-31 19:17:00 +0000
commit32c77ef7eb98a4b9cbf68485ab89a99d0b07ba0a (patch)
treed165ca5915c4249bdb022b82d8580c6fe54cc757
parent8f00831a5444d8bcdd81584596033fd5a6dc9add (diff)
downloadaspectj-32c77ef7eb98a4b9cbf68485ab89a99d0b07ba0a.tar.gz
aspectj-32c77ef7eb98a4b9cbf68485ab89a99d0b07ba0a.zip
238992: test and fix: string anno values
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java4
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java3
2 files changed, 7 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
index 2a28a8535..1a46ece7b 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
@@ -23,6 +23,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.SingleNameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.BooleanConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.Constant;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.StringConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TagBits;
@@ -147,6 +148,9 @@ public class EclipseAnnotationConvertor {
} else if (c instanceof BooleanConstant) {
BooleanConstant iConstant = (BooleanConstant)c;
return new SimpleAnnotationValue(ElementValueGen.PRIMITIVE_BOOLEAN,new Boolean(iConstant.booleanValue()));
+ } else if (c instanceof StringConstant) {
+ StringConstant sConstant = (StringConstant)c;
+ return new SimpleAnnotationValue(ElementValueGen.STRING,sConstant.stringValue());
}
}
return null;
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
index 0f885579c..107feb098 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java
@@ -20,6 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FalseLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.StringLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant;
@@ -123,6 +124,8 @@ public class EclipseResolvedMember extends ResolvedMemberImpl {
return "true";
} else if (e instanceof FalseLiteral) {
return "false";
+ } else if (e instanceof StringLiteral) {
+ return new String(((StringLiteral)e).source());
} else if (e instanceof IntLiteral) {
return Integer.toString(((IntConstant)e.constant).intValue());
} else {