]> source.dussan.org Git - aspectj.git/commitdiff
Bugette: annotation value of primitive type 'char' wasnt working !
authoraclement <aclement>
Tue, 14 Feb 2006 14:06:36 +0000 (14:06 +0000)
committeraclement <aclement>
Tue, 14 Feb 2006 14:06:36 +0000 (14:06 +0000)
bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java
bcel-builder/testdata/ComplexAnnotatedClass.java
bcel-builder/testdata/testcode.jar
bcel-builder/testsrc/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java

index 71eed6a1b389719f62e572b2a2c051c7a1a1e69f..7f1affe334cf4e8d07696c932b59c73348753e21 100644 (file)
@@ -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";
index 155e531d09e99d42a8005883445d8c79c53a411e..1e6214a4a8f719234eafeb5a54f6ed1c57e4e831 100644 (file)
@@ -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 {
 }
index 6bac0c9fb2eeb0259d2ee8c2560b7daedcbcecfa..985cd3884ada096737831517ab3cdd1e7bd1ca5c 100644 (file)
Binary files a/bcel-builder/testdata/testcode.jar and b/bcel-builder/testdata/testcode.jar differ
index 644c3e8da3cb20429d2e3ae47f4fab9d2b153fb8..7a1925dde1fdc30dbf35c9e68aeada7c43863c17 100644 (file)
@@ -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");
                
        }