diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-03-21 17:34:09 +0700 |
commit | ecb5320c7b61d72edbf4a440e4996171a9c8f7dd (patch) | |
tree | 2b5496ad42ca47d0f3c7e636f2130dbb4d8b6e2c /bcel-builder/src | |
parent | e4a2a5a5d274bc16bae3d1178789752dba043730 (diff) | |
download | aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.tar.gz aspectj-ecb5320c7b61d72edbf4a440e4996171a9c8f7dd.zip |
Fix some deprecated Java and JUnit warnings by using newer API calls
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'bcel-builder/src')
2 files changed, 8 insertions, 8 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java index 2c795b136..fabfa8ca4 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/SimpleElementValue.java @@ -239,7 +239,7 @@ public class SimpleElementValue extends ElementValue { return Integer.toString(b.getValue()); case PRIMITIVE_CHAR: ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx); - return new Character((char) ch.getIntValue()).toString(); + return Character.toString((char) ch.getIntValue()); case PRIMITIVE_BOOLEAN: ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx); if (bo.getValue() == 0) { @@ -262,11 +262,11 @@ public class SimpleElementValue extends ElementValue { switch (type) { case PRIMITIVE_INT: ConstantInteger c = (ConstantInteger) cpool.getConstant(idx); - s.append("(int)").append(Integer.toString(c.getValue())); + s.append("(int)").append(c.getValue()); break; case PRIMITIVE_LONG: ConstantLong j = (ConstantLong) cpool.getConstant(idx); - s.append("(long)").append(Long.toString(j.getValue())); + s.append("(long)").append(j.getValue()); break; case PRIMITIVE_DOUBLE: ConstantDouble d = (ConstantDouble) cpool.getConstant(idx); @@ -274,19 +274,19 @@ public class SimpleElementValue extends ElementValue { break; case PRIMITIVE_FLOAT: ConstantFloat f = (ConstantFloat) cpool.getConstant(idx); - s.append("(float)").append(Float.toString(f.getValue())); + s.append("(float)").append(f.getValue()); break; case PRIMITIVE_SHORT: ConstantInteger ci = (ConstantInteger) cpool.getConstant(idx); - s.append("(short)").append(Integer.toString(ci.getValue())); + s.append("(short)").append(ci.getValue()); break; case PRIMITIVE_BYTE: ConstantInteger b = (ConstantInteger) cpool.getConstant(idx); - s.append("(byte)").append(Integer.toString(b.getValue())); + s.append("(byte)").append(b.getValue()); break; case PRIMITIVE_CHAR: ConstantInteger ch = (ConstantInteger) cpool.getConstant(idx); - s.append("(char)").append(new Character((char) ch.getIntValue()).toString()); + s.append("(char)").append((char) ch.getIntValue()); break; case PRIMITIVE_BOOLEAN: ConstantInteger bo = (ConstantInteger) cpool.getConstant(idx); diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java index 5fe956790..62c1b3bd7 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java @@ -201,7 +201,7 @@ public class RuntimeVisibleAnnotationAttributeTest extends BcelTestCase { checkValue(ann,"dval","33.4"); checkValue(ann,"sval","99"); checkValue(ann,"bval","2"); - checkValue(ann,"cval",new Character('5').toString()); + checkValue(ann,"cval", Character.toString('5')); checkValue(ann,"zval","false"); } |