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.ui.externaltools
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.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
index 483b652c6..a0bd3a0f9 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -874,8 +874,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
String val = command.getArguments().get(COMMAND_ENABLED);
if(val != null) {
//null means enabled, see #doPerformOk
- Boolean enabled = new Boolean(val);
- return enabled.booleanValue();
+ return Boolean.parseBoolean(val);
}
} else if (element instanceof ILaunchConfiguration) {
try {
@@ -996,8 +995,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
Map<String, String> args = command.getArguments();
String val = args.get(COMMAND_ENABLED);
if(val != null) {
- Boolean enabled = new Boolean(val);
- if (!enabled.booleanValue()) {
+ if (!Boolean.parseBoolean(val)) {
ILaunchConfiguration config= disableCommand(command);
if (config != null) {
data= BuilderUtils.commandFromLaunchConfig(project,config);

Back to the top