Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Blewitt2015-06-17 04:31:18 -0400
committerAlex Blewitt2015-07-31 04:29:48 -0400
commitdaa59ae7f9eec005b257ef65c0361228e8fc34ec (patch)
tree299133a209f1e37630c0f3e3b1fc96f5d3ed4186 /tests
parentd4eadcca6620f0c222b2b101ca33f13d2fe92176 (diff)
downloadeclipse.platform.team-daa59ae7f9eec005b257ef65c0361228e8fc34ec.tar.gz
eclipse.platform.team-daa59ae7f9eec005b257ef65c0361228e8fc34ec.tar.xz
eclipse.platform.team-daa59ae7f9eec005b257ef65c0361228e8fc34ec.zip
Bug 470344 - Replace new Boolean with Boolean.valueOf
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 constant valued expressions with their flyweight counterparts. In-line `Boolean.valueOf(true)` with `Boolean.TRUE`, c.f. false. Bug: 470344 Change-Id: I673669144881f738006b8567e99e5760e851ad07 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
index 670ec876c..ebd5b2b04 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/PatchWizardRadioButtonGroupTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Alex Blewitt <alex.blewitt@gmail.com> - replace new Boolean with Boolean.valueOf - https://bugs.eclipse.org/470344
*******************************************************************************/
package org.eclipse.team.tests.ccvs.ui;
@@ -341,7 +342,7 @@ public class PatchWizardRadioButtonGroupTests extends TestCase {
Method method = clazz.getMethod("setEnablement", partypes);
method.setAccessible(true);
Object arglist[] = new Object[3];
- arglist[0] = new Boolean(enabled);
+ arglist[0] = Boolean.valueOf(enabled);
arglist[1] = buttonsToChange;
arglist[2] = new Integer(defaultSelection);
method.invoke(groupObject, arglist);
@@ -366,7 +367,7 @@ public class PatchWizardRadioButtonGroupTests extends TestCase {
Method method = clazz.getMethod("setEnablement", partypes);
method.setAccessible(true);
Object arglist[] = new Object[2];
- arglist[0] = new Boolean(enabled);
+ arglist[0] = Boolean.valueOf(enabled);
arglist[1] = buttonsToChange;
method.invoke(groupObject, arglist);
} catch (SecurityException e) {

Back to the top