diff options
author | Andrey Turbanov <turbanoff@gmail.com> | 2021-11-20 20:37:02 +0300 |
---|---|---|
committer | Andrey Turbanov <turbanoff@gmail.com> | 2021-11-20 20:37:02 +0300 |
commit | bfd6fee99d2685751a6d49eb29a0173c3f825c09 (patch) | |
tree | 33383e16d3008206284965d88254f648d4f5668c /org.aspectj.ajdt.core/src | |
parent | 0f85ca109b9e6ab849e201e76f62d5023cbfcb98 (diff) | |
download | aspectj-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 'org.aspectj.ajdt.core/src')
-rw-r--r-- | org.aspectj.ajdt.core/src/test/java/org/aspectj/ajdt/internal/compiler/batch/IncrementalCase.java | 2 | ||||
-rw-r--r-- | org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java | 2 |
2 files changed, 2 insertions, 2 deletions
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 96c959970..cf753b8c6 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 @@ -311,7 +311,7 @@ public class IncrementalCase { // XXX NOT bound to junit - bridge tests? if (-1 != loc) s = s.substring(loc + 1); try { - exp[i] = Integer.valueOf(s); + exp[i] = Integer.parseInt(s); sb.append(exp[i] + ((i < (exp.length - 1)) ? ", " : "")); } catch (NumberFormatException e) { info(handler, "bad " + label + ":" + expected[i]); diff --git a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java index 35bd22c68..d5df01079 100644 --- a/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java +++ b/org.aspectj.ajdt.core/src/test/java/org/aspectj/tools/ajc/AjcTestCase.java @@ -1041,7 +1041,7 @@ public abstract class AjcTestCase extends TestCase { private static boolean getBoolean(String name, boolean def) { String defaultValue = String.valueOf(def); String value = System.getProperty(name, defaultValue); - return Boolean.valueOf(value); + return Boolean.parseBoolean(value); } /* |