Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-07-31 21:35:48 +0000
committerBrian de Alwis2015-08-04 14:04:23 +0000
commitabe0ea1fcdc0b40864ec95993f4e1d887265ed2c (patch)
tree35683717516e5bd6de8c366ed0ca4d66ae14c18b /org.eclipse.help.base
parentb89af46eb192144779d9c76540eed014b2fe0036 (diff)
downloadeclipse.platform.ua-abe0ea1fcdc0b40864ec95993f4e1d887265ed2c.tar.gz
eclipse.platform.ua-abe0ea1fcdc0b40864ec95993f4e1d887265ed2c.tar.xz
eclipse.platform.ua-abe0ea1fcdc0b40864ec95993f4e1d887265ed2c.zip
Bug 474070 - 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 `new Boolean(...).booleanValue()` with `Boolean.parseBoolean(...)` Bug: 474070 Change-Id: I673669144881f738006b8567e99e5760e851ad07 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'org.eclipse.help.base')
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteStatusData.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteStatusData.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteStatusData.java
index c502cbdf3..ec6366119 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteStatusData.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/remote/RemoteStatusData.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 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 - Bug 474070
*******************************************************************************/
package org.eclipse.help.internal.base.remote;
@@ -178,7 +179,7 @@ public class RemoteStatusData {
public void put(URL url,boolean connected)
{
- cache.put(url,new Boolean(connected));
+ cache.put(url,Boolean.valueOf(connected));
}
}

Back to the top