aboutsummaryrefslogtreecommitdiffstats
path: root/bcel-builder/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:14:13 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:14:13 +0200
commitf33600d4d5507f3aa02d7cacfc34fe910d6b858f (patch)
tree797427a7536d5e9fc927faceec4963754ab0133b /bcel-builder/src
parentc1c373f4278426308689db61f7758185e8f0401b (diff)
downloadaspectj-f33600d4d5507f3aa02d7cacfc34fe910d6b858f.tar.gz
aspectj-f33600d4d5507f3aa02d7cacfc34fe910d6b858f.zip
Unnecessary boxing
Reports explicit boxing, i.e. wrapping of primitive values in objects. Explicit manual boxing 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/src')
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/ConstantPool.java4
-rw-r--r--bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java2
2 files changed, 3 insertions, 3 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 0430e28ba..410891212 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
@@ -465,7 +465,7 @@ public class ConstantPool implements Node {
String typeSignature = ((ConstantUtf8) pool[cnat.getSignatureIndex()]).getValue();
if (!typeSignature.equals(searchSignature))
continue;
- fieldCache.put(k, new Integer(i));
+ fieldCache.put(k, i);
return i;
}
}
@@ -793,7 +793,7 @@ public class ConstantPool implements Node {
String typeSignature = ((ConstantUtf8) pool[cnat.getSignatureIndex()]).getValue();
if (!typeSignature.equals(searchSignature))
continue;
- methodCache.put(key, new Integer(i));
+ methodCache.put(key, i);
return i;
}
}
diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java
index 113be06ee..3fa40ac0f 100644
--- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java
+++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/Instruction.java
@@ -342,7 +342,7 @@ public class Instruction implements Cloneable, Serializable, Constants {
case ICONST_3:
case ICONST_4:
case ICONST_5:
- return new Integer(opcode - ICONST_0);
+ return opcode - ICONST_0;
default:
throw new IllegalStateException("Not implemented yet for " + getName());
}