From: aclement Date: Thu, 31 Jul 2008 19:17:00 +0000 (+0000) Subject: 238992: test and fix: string anno values X-Git-Tag: V162DEV_M1~155 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32c77ef7eb98a4b9cbf68485ab89a99d0b07ba0a;p=aspectj.git 238992: test and fix: string anno values --- 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 {