Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-06-16 08:49:32 +0000
committerAlex Blewitt2015-07-30 20:07:38 +0000
commita4fd9a1fcbb3ae2e7650bfdfa62b8f53f788c964 (patch)
treea8f31533885b3139f5e0bb034cd8f662e0b4ddc0 /org.eclipse.core.filebuffers.tests
parent21a52484ee07d271e4f9bb200e9890e0d03e70dc (diff)
downloadeclipse.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.core.filebuffers.tests')
-rw-r--r--org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
index ea814faabbb..5a0254672d4 100644
--- a/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.java
+++ b/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBufferFunctions.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
@@ -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.core.filebuffers.tests;
@@ -823,7 +824,7 @@ public abstract class FileBufferFunctions extends TestCase {
buf.append("listener.newLocation: " + listener.newLocation + "\n");
buf.append("newLocation: " + newLocation + "\n");
}
- buf.append("buffers identical: " + new Boolean(listener.buffer == fileBuffer));
+ buf.append("buffers identical: " + Boolean.valueOf(listener.buffer == fileBuffer));
fail(buf.toString());
}
}

Back to the top