aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:16:40 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-08 03:16:40 +0200
commit93ce335dc0dad2f420d1b7b1d426ad7bfa3574ad (patch)
treee37a88693a2de065eb8c6c56f35b053bcf951c4a /org.aspectj.matcher
parentf33600d4d5507f3aa02d7cacfc34fe910d6b858f (diff)
downloadaspectj-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 'org.aspectj.matcher')
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java4
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java16
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java2
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java2
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java2
5 files changed, 13 insertions, 13 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java
index 289547bbc..86e06e767 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java
@@ -217,8 +217,8 @@ public abstract class ResolvedTypeMunger {
File f = (File) ois.readObject();
Integer ii = (Integer) ois.readObject();
Integer offset = (Integer) ois.readObject();
- ret = new SourceLocation(f, ii.intValue());
- ret.setOffset(offset.intValue());
+ ret = new SourceLocation(f, ii);
+ ret.setOffset(offset);
}
} else {
boolean validLocation = b == 2;
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java
index 27af4e8f5..32e55f6b4 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/SimpleAnnotationValue.java
@@ -21,31 +21,31 @@ public class SimpleAnnotationValue extends AnnotationValue {
super(kind);
switch (kind) {
case AnnotationValue.PRIMITIVE_BYTE:
- theByte = ((Byte) value).byteValue();
+ theByte = (Byte) value;
break;
case AnnotationValue.PRIMITIVE_CHAR:
- theChar = ((Character) value).charValue();
+ theChar = (Character) value;
break;
case AnnotationValue.PRIMITIVE_INT:
- theInt = ((Integer) value).intValue();
+ theInt = (Integer) value;
break;
case AnnotationValue.STRING:
theString = (String) value;
break;
case AnnotationValue.PRIMITIVE_DOUBLE:
- theDouble = ((Double) value).doubleValue();
+ theDouble = (Double) value;
break;
case AnnotationValue.PRIMITIVE_FLOAT:
- theFloat = ((Float) value).floatValue();
+ theFloat = (Float) value;
break;
case AnnotationValue.PRIMITIVE_LONG:
- theLong = ((Long) value).longValue();
+ theLong = (Long) value;
break;
case AnnotationValue.PRIMITIVE_SHORT:
- theShort = ((Short) value).shortValue();
+ theShort = (Short) value;
break;
case AnnotationValue.PRIMITIVE_BOOLEAN:
- theBoolean = ((Boolean) value).booleanValue();
+ theBoolean = (Boolean) value;
break;
default:
throw new BCException("Not implemented for this kind: " + whatKindIsThis(kind));
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
index 32648268e..b2af422ff 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/World.java
@@ -1428,7 +1428,7 @@ public abstract class World implements Dump.INode {
public int compareByPrecedence(ResolvedType firstAspect, ResolvedType secondAspect) {
PrecedenceCacheKey key = new PrecedenceCacheKey(firstAspect, secondAspect);
if (cachedResults.containsKey(key)) {
- return (cachedResults.get(key)).intValue();
+ return cachedResults.get(key);
} else {
int order = 0;
DeclarePrecedence orderer = null; // Records the declare
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java
index 83ad90528..d4b747af3 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/ModifiersPattern.java
@@ -97,7 +97,7 @@ public class ModifiersPattern extends PatternNode {
if (flag == null) {
return -1;
}
- return flag.intValue();
+ return flag;
}
public Object accept(PatternNodeVisitor visitor, Object data) {
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java
index 6d819de50..e9b42fb83 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/TraceFactory.java
@@ -32,7 +32,7 @@ public abstract class TraceFactory {
protected static boolean getBoolean(String name, boolean def) {
String defaultValue = String.valueOf(def);
String value = System.getProperty(name,defaultValue);
- return Boolean.valueOf(value).booleanValue();
+ return Boolean.valueOf(value);
}
static {