aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.matcher/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 /org.aspectj.matcher/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 'org.aspectj.matcher/src')
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/ResolvedTypeMunger.java6
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java2
-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.java5
-rw-r--r--org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java4
-rw-r--r--org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java16
6 files changed, 18 insertions, 17 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 2ba3cbc36..289547bbc 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
@@ -259,11 +259,11 @@ public abstract class ResolvedTypeMunger {
} else {
s.writeByte(0);
ObjectOutputStream oos = new ObjectOutputStream(s);
- oos.writeObject(new Boolean(location != null));
+ oos.writeObject(location != null);
if (location != null) {
oos.writeObject(location.getSourceFile());
- oos.writeObject(new Integer(location.getLine()));
- oos.writeObject(new Integer(location.getOffset()));
+ oos.writeObject(location.getLine());
+ oos.writeObject(location.getOffset());
}
oos.flush();
oos.close();
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java
index fc2b1d4d1..1892e8940 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/Shadow.java
@@ -596,7 +596,7 @@ public abstract class Shadow {
// Ask the world if it knows about precedence between these
Integer order = getIWorld().getPrecedenceIfAny(adviceA.concreteAspect, adviceB.concreteAspect);
- if (order != null && order.equals(new Integer(0))) {
+ if (order != null && order.equals(0)) {
String key = adviceA.getDeclaringAspect() + ":" + adviceB.getDeclaringAspect();
String possibleExistingKey = adviceB.getDeclaringAspect() + ":" + adviceA.getDeclaringAspect();
if (!clashingAspects.contains(possibleExistingKey)) {
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 3b69a5d73..32648268e 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
@@ -1453,7 +1453,7 @@ public abstract class World implements Dump.INode {
}
}
}
- cachedResults.put(key, new Integer(order));
+ cachedResults.put(key, order);
return order;
}
}
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 6c1d0557e..83ad90528 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
@@ -33,10 +33,11 @@ public class ModifiersPattern extends PatternNode {
int flag = 1;
while (flag <= Modifier.STRICT) {
String flagName = Modifier.toString(flag);
- modifierFlags.put(flagName, new Integer(flag));
+ modifierFlags.put(flagName, flag);
flag = flag << 1;
}
- modifierFlags.put("synthetic", new Integer(0x1000 /* Modifier.SYNTHETIC */));
+ /* Modifier.SYNTHETIC */
+ modifierFlags.put("synthetic", 0x1000);
}
public ModifiersPattern(int requiredModifiers, int forbiddenModifiers) {
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
index 39d4a387b..c766d30ba 100644
--- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
+++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/WildTypePattern.java
@@ -1023,7 +1023,7 @@ public class WildTypePattern extends TypePattern {
if ((tvs.length < minRequiredTypeParameters) || (!foundEllipsis && minRequiredTypeParameters != tvs.length)) {
// issue message "does not match because wrong no of type params"
String msg = WeaverMessages.format(WeaverMessages.INCORRECT_NUMBER_OF_TYPE_ARGUMENTS, genericType.getName(),
- new Integer(tvs.length));
+ tvs.length);
if (requireExactType) {
scope.message(MessageUtil.error(msg, getSourceLocation()));
} else {
@@ -1092,7 +1092,7 @@ public class WildTypePattern extends TypePattern {
parameterName = ((TypeVariableReference) ut).getTypeVariable().getDisplayName();
}
String msg = WeaverMessages.format(WeaverMessages.VIOLATES_TYPE_VARIABLE_BOUNDS, parameterName,
- new Integer(i + 1), tvs[i].getDisplayName(), genericType.getName());
+ i + 1, tvs[i].getDisplayName(), genericType.getName());
if (requireExactType) {
scope.message(MessageUtil.error(msg, sLoc));
} else {
diff --git a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java
index 705674cb3..b60cad835 100644
--- a/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java
+++ b/org.aspectj.matcher/src/test/java/org/aspectj/weaver/patterns/ArgsTestCase.java
@@ -116,15 +116,15 @@ public class ArgsTestCase extends TestCase {
Method oneIntegerM = A.class.getMethod("anInteger", new Class[] { Integer.class });
if (LangUtil.is15VMOrGreater()) {
- checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
- checkMatches(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
- checkMatches(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
- checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
+ checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+ checkMatches(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
+ checkMatches(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+ checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
} else {
- checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
- checkNoMatch(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
- checkNoMatch(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] { new Integer(5) });
- checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] { new Integer(5) });
+ checkMatches(oneInt.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+ checkNoMatch(oneInt.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
+ checkNoMatch(oneInteger.matchesMethodExecution(oneIntM), new A(), new A(), new Object[] {5});
+ checkMatches(oneInteger.matchesMethodExecution(oneIntegerM), new A(), new A(), new Object[] {5});
}
} catch (Exception ex) {