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 /testing | |
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 'testing')
9 files changed, 10 insertions, 10 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java index 0c5b6ddeb..38f85b2c9 100644 --- a/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/XMLBasedAjcTestCase.java @@ -201,7 +201,7 @@ public abstract class XMLBasedAjcTestCase extends AjcTestCase { if (clearTestAfterRun.isEmpty()) { return false; } - boolean result = clearTestAfterRun.peek().booleanValue(); + boolean result = clearTestAfterRun.peek(); if (pop) { clearTestAfterRun.pop(); } diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java index 6c8b2ba5f..7a5bff3df 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -1842,7 +1842,7 @@ public class CompilerRun implements IAjcRun { compilerOption, result); } - return result.booleanValue(); + return result; } } } // CompilerRun.Spec.CRSOptions diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java index 95977aeee..e3e60e028 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/DirChanges.java @@ -59,7 +59,7 @@ public class DirChanges { static { long delay = 10l; try { - delay = Long.getLong(DELAY_NAME).longValue(); + delay = Long.getLong(DELAY_NAME); if ((delay > 40000) || (delay < 0)) { delay = 10l; } diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java index 16d1d6d19..28db821cb 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java @@ -267,7 +267,7 @@ public class FlatSuiteReader implements SFileReader.Maker { description.setLength(0); description.append((prefix + " " + suffix).trim()); try { - result.setBugId(Integer.valueOf(pr).intValue()); + result.setBugId(Integer.valueOf(pr)); } catch (NumberFormatException e) { throw new Error("unable to convert " + pr + " for " + result + " at " + lineReader); diff --git a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java index ee07fe4f6..7aaa1767c 100644 --- a/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java +++ b/testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java @@ -106,7 +106,7 @@ public class ParseTestCase extends TestCase { AjcTest.Spec test = new AjcTest.Spec(); test.setDescription(title); test.setTestDirOffset(dir); - test.setBugId(Integer.valueOf(pr).intValue()); + test.setBugId(Integer.valueOf(pr)); test.setSourceLocation(sourceLocation); //AjcTest test = new AjcTest(title, dir, pr, sourceLocation); @@ -175,7 +175,7 @@ public class ParseTestCase extends TestCase { file = new File("XXX"); //XXX } - int line = Integer.valueOf(getAttributeString(child, "line")).intValue(); + int line = Integer.valueOf(getAttributeString(child, "line")); ISourceLocation sourceLocation = new SourceLocation(file, line, line, 0); diff --git a/testing/src/test/java/org/aspectj/testing/util/IntRange.java b/testing/src/test/java/org/aspectj/testing/util/IntRange.java index 1f44f69bd..4181e7018 100644 --- a/testing/src/test/java/org/aspectj/testing/util/IntRange.java +++ b/testing/src/test/java/org/aspectj/testing/util/IntRange.java @@ -82,7 +82,7 @@ public class IntRange implements IntValidator, ObjectChecker, Serializable { /** @return true if integer instanceof Integer with acceptable intValue */ public final boolean isValid(Object integer) { return ((integer instanceof Integer) - && (acceptInt(((Integer) integer).intValue()))); + && (acceptInt((Integer) integer))); } /** @return true if min <= value < max */ diff --git a/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java b/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java index 25985ae5e..e1f771b9d 100644 --- a/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java +++ b/testing/src/test/java/org/aspectj/testing/util/ObjectChecker.java @@ -34,7 +34,7 @@ public interface ObjectChecker { public static final ObjectChecker ANY_ZERO = new ObjectChecker() { public boolean isValid(Object input) { if (input instanceof Integer) { - return (0 == ((Integer) input).intValue()); + return (0 == (Integer) input); } else { return true; } diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java index 2241904bd..969c8ecd8 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java +++ b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java @@ -294,7 +294,7 @@ public class SoftMessage implements IMessage { if (null != sourceLocation) { throw new IllegalStateException("cannot set line after creating source location"); } - this.line = Integer.valueOf(line).intValue(); + this.line = Integer.valueOf(line); SourceLocation.validLine(this.line); } diff --git a/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java b/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java index 17f5ae673..3895f302e 100644 --- a/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java +++ b/testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java @@ -109,7 +109,7 @@ public class SoftSourceLocation implements ISourceLocation { } private int convert(String in) { - return Integer.valueOf(in).intValue(); + return Integer.valueOf(in); } public String getLocationContext() { |