diff options
author | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-08 03:16:40 +0200 |
---|---|---|
committer | Lars Grefer <eclipse@larsgrefer.de> | 2020-08-08 03:16:40 +0200 |
commit | 93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad (patch) | |
tree | e37a88693a2de065eb8c6c56f35b053bcf951c4a /bcel-builder | |
parent | f33600d4d5507f3aa02d7cacfc34fe910d6b858f (diff) | |
download | aspectj-93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad.tar.gz aspectj-93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad.zip |
Unnecessary unboxing
Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed.
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'bcel-builder')
-rw-r--r-- | bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java | 4 | ||||
-rw-r--r-- | bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java index 410891212..de8f9c650 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java @@ -444,7 +444,7 @@ public class ConstantPool implements Node { String k = new StringBuffer().append(searchClassname).append(searchFieldname).append(searchSignature).toString(); Integer pos = fieldCache.get(k); if (pos != null) - return pos.intValue(); + return pos; for (int i = 1; i < poolSize; i++) { Constant c = pool[i]; if (c != null && c.tag == Constants.CONSTANT_Fieldref) { @@ -771,7 +771,7 @@ public class ConstantPool implements Node { String key = new StringBuffer().append(searchClassname).append(searchMethodName).append(searchSignature).toString(); Integer cached = methodCache.get(key); if (cached != null) - return cached.intValue(); + return cached; searchClassname = searchClassname.replace('.', '/'); for (int i = 1; i < poolSize; i++) { Constant c = pool[i]; diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java index 50b9ac496..086f276ee 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/FieldGen.java @@ -189,16 +189,16 @@ public class FieldGen extends FieldGenOrMethodGen { case Constants.T_BYTE: case Constants.T_BOOLEAN: case Constants.T_SHORT: - return cp.addInteger(((Integer) value).intValue()); + return cp.addInteger((Integer) value); case Constants.T_FLOAT: - return cp.addFloat(((Float) value).floatValue()); + return cp.addFloat((Float) value); case Constants.T_DOUBLE: - return cp.addDouble(((Double) value).doubleValue()); + return cp.addDouble((Double) value); case Constants.T_LONG: - return cp.addLong(((Long) value).longValue()); + return cp.addLong((Long) value); case Constants.T_REFERENCE: return cp.addString(((String) value)); |