aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2021-11-20 20:37:02 +0300
committerAndrey Turbanov <turbanoff@gmail.com>2021-11-20 20:37:02 +0300
commitbfd6fee99d2685751a6d49eb29a0173c3f825c09 (patch)
tree33383e16d3008206284965d88254f648d4f5668c /testing
parent0f85ca109b9e6ab849e201e76f62d5023cbfcb98 (diff)
downloadaspectj-bfd6fee99d2685751a6d49eb29a0173c3f825c09.tar.gz
aspectj-bfd6fee99d2685751a6d49eb29a0173c3f825c09.zip
Cleanup redundant boxing.
Methods Integer.parseInt/Boolean.parseBoolean should be preferred over Integer.valueOf/Boolean.valueOf/ if final result is primitive. They are generally faster and generate less garbage.
Diffstat (limited to 'testing')
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/FlatSuiteReader.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/harness/bridge/ParseTestCase.java4
-rw-r--r--testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java2
-rw-r--r--testing/src/test/java/org/aspectj/testing/xml/SoftSourceLocation.java2
4 files changed, 5 insertions, 5 deletions
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 0b9d6910e..5c2ec2ae3 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));
+ result.setBugId(Integer.parseInt(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 85cdd38f1..e6f1ab918 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
@@ -105,7 +105,7 @@ public class ParseTestCase extends TestCase {
AjcTest.Spec test = new AjcTest.Spec();
test.setDescription(title);
test.setTestDirOffset(dir);
- test.setBugId(Integer.valueOf(pr));
+ test.setBugId(Integer.parseInt(pr));
test.setSourceLocation(sourceLocation);
//AjcTest test = new AjcTest(title, dir, pr, sourceLocation);
@@ -174,7 +174,7 @@ public class ParseTestCase extends TestCase {
file = new File("XXX"); //XXX
}
- int line = Integer.valueOf(getAttributeString(child, "line"));
+ int line = Integer.parseInt(getAttributeString(child, "line"));
ISourceLocation sourceLocation = new SourceLocation(file, line, line, 0);
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 a223a3453..be3541e4d 100644
--- a/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java
+++ b/testing/src/test/java/org/aspectj/testing/xml/SoftMessage.java
@@ -300,7 +300,7 @@ public class SoftMessage implements IMessage {
if (null != sourceLocation) {
throw new IllegalStateException("cannot set line after creating source location");
}
- this.line = Integer.valueOf(line);
+ this.line = Integer.parseInt(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 305047d31..f0329d653 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);
+ return Integer.parseInt(in);
}
public String getLocationContext() {