Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-07-31 22:08:17 +0000
committerAlex Blewitt2015-09-03 10:21:11 +0000
commit9d920dc184c0ea2271a9f088d1af6f52df1b4eed (patch)
tree6022f848e592ea43b840222a49ea0304f00c722e /org.eclipse.debug.examples.core
parent678c63a96bd3bce570a62beb5546ca0b29d608a0 (diff)
downloadeclipse.platform.debug-9d920dc184c0ea2271a9f088d1af6f52df1b4eed.tar.gz
eclipse.platform.debug-9d920dc184c0ea2271a9f088d1af6f52df1b4eed.tar.xz
eclipse.platform.debug-9d920dc184c0ea2271a9f088d1af6f52df1b4eed.zip
Bug 474074 - Replace new Boolean with Boolean.valueOfI20150908-0800
Using `new Boolean()` results in the creation of a new object on the heap, when the flyweight `Boolean.TRUE` and `Boolean.FALSE` are available. Java 1.4 added a `Boolean.valueOf()` which can be used in place of `new Boolean()` but which will use the existing flyweight values instead. Globally change `new Boolean(...)` to `Boolean.valueOf(...)` and replace `new Boolean(...).booleanValue()` to `Boolean.parseBoolean(...)`. Change-Id: I95bed6f2af0293c20d1ac7076ca151b85d1f962d Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'org.eclipse.debug.examples.core')
-rw-r--r--org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
index 4f473c9d1..9589a844b 100644
--- a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
+++ b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java
@@ -902,7 +902,7 @@ public class PDAVirtualMachine {
void debugEventStop(Args args) {
String event = args.getNextStringArg();
int stop = args.getNextIntArg();
- fEventStops.put(event, new Boolean(stop > 0));
+ fEventStops.put(event, Boolean.valueOf(stop > 0));
sendCommandResponse("ok\n"); //$NON-NLS-1$
}
@@ -1051,7 +1051,7 @@ public class PDAVirtualMachine {
int line = args.getNextIntArg();
int stopVM = args.getNextIntArg();
- fBreakpoints.put(new Integer(line), new Boolean(stopVM != 0));
+ fBreakpoints.put(new Integer(line), Boolean.valueOf(stopVM != 0));
sendCommandResponse("ok\n"); //$NON-NLS-1$
}

Back to the top