Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2015-06-19 09:18:40 +0000
committerAlexander Kurtakov2015-07-07 08:57:27 +0000
commit4976c78e1f8140ee2ccd13db6f6d574e844114ee (patch)
treed658c0ffa9375a6c72f433716193d8c72fd7f52f /bundles/org.eclipse.swt.tools
parent9c11c60b1c468edeb1c6ccb338da886f4e4c9b77 (diff)
downloadeclipse.platform.swt-4976c78e1f8140ee2ccd13db6f6d574e844114ee.tar.gz
eclipse.platform.swt-4976c78e1f8140ee2ccd13db6f6d574e844114ee.tar.xz
eclipse.platform.swt-4976c78e1f8140ee2ccd13db6f6d574e844114ee.zip
Bug 470568 - 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: 470568 Change-Id: I0a9abceef0032f92581f381c36d9971457c3fdee Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
Diffstat (limited to 'bundles/org.eclipse.swt.tools')
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java2
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
index c44606a1f4..512f069d85 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ASTMethod.java
@@ -128,7 +128,7 @@ public boolean isNativeUnique() {
break;
}
}
- unique = new Boolean(result);
+ unique = Boolean.valueOf(result);
return result;
}
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
index 67bcb0db77..d8ad18c9d5 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/ReflectMethod.java
@@ -138,7 +138,7 @@ public boolean isNativeUnique() {
break;
}
}
- unique = new Boolean(result);
+ unique = Boolean.valueOf(result);
return result;
}

Back to the top