From: aclement Date: Tue, 14 Feb 2006 14:06:36 +0000 (+0000) Subject: Bugette: annotation value of primitive type 'char' wasnt working ! X-Git-Tag: POST_MEMORY_CHANGES~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32fccd359a00bcfcfef4c9ab4a08eb722aee13b7;p=aspectj.git Bugette: annotation value of primitive type 'char' wasnt working ! --- diff --git a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java index 71eed6a1b..7f1affe33 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java @@ -133,7 +133,7 @@ public class SimpleElementValue extends ElementValue { return Integer.toString(b.getBytes()); case PRIMITIVE_CHAR: ConstantInteger ch = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); - return Integer.toString(ch.getBytes()); + return new Character((char)ch.getBytes()).toString(); case PRIMITIVE_BOOLEAN: ConstantInteger bo = (ConstantInteger)cpool.getConstant(idx,Constants.CONSTANT_Integer); if (bo.getBytes() == 0) return "false"; diff --git a/bcel-builder/testdata/ComplexAnnotatedClass.java b/bcel-builder/testdata/ComplexAnnotatedClass.java index 155e531d0..1e6214a4a 100644 --- a/bcel-builder/testdata/ComplexAnnotatedClass.java +++ b/bcel-builder/testdata/ComplexAnnotatedClass.java @@ -1,3 +1,3 @@ -@ComplexAnnotation(ival=4,bval=2,cval=5,fval=3.0f,dval=33.4,zval=false,jval=56,sval=99) +@ComplexAnnotation(ival=4,bval=2,cval='5',fval=3.0f,dval=33.4,zval=false,jval=56,sval=99) public class ComplexAnnotatedClass { } diff --git a/bcel-builder/testdata/testcode.jar b/bcel-builder/testdata/testcode.jar index 6bac0c9fb..985cd3884 100644 Binary files a/bcel-builder/testdata/testcode.jar and b/bcel-builder/testdata/testcode.jar differ diff --git a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java index 644c3e8da..7a1925dde 100644 --- a/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java +++ b/bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java @@ -202,7 +202,7 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase { checkValue(ann,"dval","33.4"); checkValue(ann,"sval","99"); checkValue(ann,"bval","2"); - checkValue(ann,"cval","5"); + checkValue(ann,"cval",new Character('5').toString()); checkValue(ann,"zval","false"); }