aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
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.ajdt.core
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.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java2
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java2
-rw-r--r--org.aspectj.ajdt.core/src/test/java/AroundAMain.java4
-rw-r--r--org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java2
-rw-r--r--org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java6
5 files changed, 8 insertions, 8 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
index 3d2fb727f..93a5019f3 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/compiler/lookup/EclipseAnnotationConvertor.java
@@ -155,7 +155,7 @@ public class EclipseAnnotationConvertor {
Constant c = defaultValue.constant;
if (c instanceof IntConstant) {
IntConstant iConstant = (IntConstant) c;
- return new SimpleAnnotationValue(ElementValue.PRIMITIVE_INT, new Integer(iConstant.intValue()));
+ return new SimpleAnnotationValue(ElementValue.PRIMITIVE_INT, iConstant.intValue());
} else if (c instanceof BooleanConstant) {
BooleanConstant iConstant = (BooleanConstant) c;
return new SimpleAnnotationValue(ElementValue.PRIMITIVE_BOOLEAN, iConstant.booleanValue());
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java
index 7e08c02a7..4c38f125c 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjState.java
@@ -1536,7 +1536,7 @@ public class AjState implements CompilerConfigurationChangeFlags, TypeDelegateRe
// System.err.println("Detected a structural change in " + thisTime.getFilename());
printStructuralChanges(thisTime.getFilename(),reader, existingStructure);
}
- structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), new Long(currentBuildTime));
+ structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), currentBuildTime);
recordTypeChanged(new String(reader.getName()).replace('/', '.'));
}
}
diff --git a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java
index d9a2929d0..9dce77d1e 100644
--- a/org.aspectj.ajdt.core/src/test/java/AroundAMain.java
+++ b/org.aspectj.ajdt.core/src/test/java/AroundAMain.java
@@ -25,7 +25,7 @@ public class AroundAMain {//extends TestCase {
@Override
public Object run(Object[] args) throws Throwable {
// System.out.println("run with: " + Arrays.asList(args));
- return new Integer(10);
+ return 10;
}
};
@@ -33,7 +33,7 @@ public class AroundAMain {//extends TestCase {
"ajc$perSingletonInstance");
Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$1$73ebb943", // was $AroundA$46
- new Integer(10), true, closure);
+ 10, true, closure);
Reflection.invoke(Class.forName("AroundA"), instance, "ajc$around$AroundA$2$a758212d", // Was $AroundA$c5
"hello there", closure);
diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java
index 6b96c9469..82682bb29 100644
--- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java
+++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java
@@ -174,7 +174,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests?
IMessageHolder compilerMessages,
StringBuffer commandLine,
IMessageHandler handler) {
- log("verifyCompile - iteration ", new Integer(iteration), handler);
+ log("verifyCompile - iteration ", iteration, handler);
log("verifyCompile - def ", def, handler);
log("verifyCompile - command ", commandLine.toString(), handler);
log("verifyCompile - messages ", compilerMessages, handler);
diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java
index c41e07fe1..560d7d244 100644
--- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java
+++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjAST5Test.java
@@ -62,7 +62,7 @@ public class AjAST5Test extends AjASTTestCase {
} else if (o instanceof SimplePropertyDescriptor) {
SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
if (element.getId().equals("privileged")) {
- Boolean b = new Boolean(true);
+ Boolean b = Boolean.TRUE;
d.setStructuralProperty(element, b);
assertEquals("AspectDeclaration's isPrivileged property should" +
" now be a boolean", b, d.getStructuralProperty(element));
@@ -89,7 +89,7 @@ public class AjAST5Test extends AjASTTestCase {
if (o instanceof SimplePropertyDescriptor) {
SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
if (element.getId().equals("aspect")) {
- Boolean b = new Boolean(true);
+ Boolean b = Boolean.TRUE;
d.setStructuralProperty(element, b);
assertEquals("AjTypeDeclaration's aspect property should" +
" now be a SignaturePattern", b, d.getStructuralProperty(element));
@@ -140,7 +140,7 @@ public class AjAST5Test extends AjASTTestCase {
} else if (o instanceof SimplePropertyDescriptor) {
SimplePropertyDescriptor element = (SimplePropertyDescriptor) o;
if (element.getId().equals("isExtends")) {
- Boolean b = new Boolean(true);
+ Boolean b = Boolean.TRUE;
d.setStructuralProperty(element, b);
assertEquals("DeclareParentsDeclaration's isExtends property should" +
" now be a boolean", b, d.getStructuralProperty(element));