]> source.dussan.org Git - aspectj.git/commitdiff
238992: test and fix: string anno values
authoraclement <aclement>
Thu, 31 Jul 2008 19:17:00 +0000 (19:17 +0000)
committeraclement <aclement>
Thu, 31 Jul 2008 19:17:00 +0000 (19:17 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseResolvedMember.java

index 2a28a8535426fa490d7522ce3ef6aa8219177731..1a46ece7bdc9ca80a68d329eab67e2c8fc9fa44c 100644 (file)
@@ -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;
index 0f885579cda8dd225be25e9a263c8ecb9c99cc60..107feb098f3ac78cc689c8a99b51b83e54f18a4b 100644 (file)
@@ -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 {