diff options
author | Alex Blewitt | 2015-06-16 08:49:32 +0000 |
---|---|---|
committer | Alex Blewitt | 2015-07-30 20:07:38 +0000 |
commit | a4fd9a1fcbb3ae2e7650bfdfa62b8f53f788c964 (patch) | |
tree | a8f31533885b3139f5e0bb034cd8f662e0b4ddc0 /org.eclipse.search | |
parent | 21a52484ee07d271e4f9bb200e9890e0d03e70dc (diff) | |
download | eclipse.platform.text-a4fd9a1fcbb3ae2e7650bfdfa62b8f53f788c964.tar.gz eclipse.platform.text-a4fd9a1fcbb3ae2e7650bfdfa62b8f53f788c964.tar.xz eclipse.platform.text-a4fd9a1fcbb3ae2e7650bfdfa62b8f53f788c964.zip |
Bug 470244 - 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.
Bug: 470244
Change-Id: I608c1acf8b35274e3e8325de8d396f2d077001ce
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'org.eclipse.search')
-rw-r--r-- | org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java index 6d87a0a64b9..fd9c50af09e 100644 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java +++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/util/ExtendedDialogWindow.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 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 @@ -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/470244 *******************************************************************************/ package org.eclipse.search.internal.ui.util; @@ -312,7 +313,7 @@ public abstract class ExtendedDialogWindow extends TrayDialog implements IRunnab private void saveEnableStateAndSet(Control w, HashMap h, boolean enabled) { if (!w.isDisposed()) { - h.put(w, new Boolean(w.isEnabled())); + h.put(w, Boolean.valueOf(w.isEnabled())); w.setEnabled(enabled); } } |