Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-11-08 21:35:50 +0000
committerAlexander Kurtakov2017-11-09 05:16:55 +0000
commit304375597ad6705f2c2bd16898286d0463179271 (patch)
tree71140168048f600cffd691a2fcfec418ef0449f2 /bundles/org.eclipse.swt/Eclipse SWT Accessibility
parent547372e38f208e4d173057e7645e6f45d468685d (diff)
downloadeclipse.platform.swt-304375597ad6705f2c2bd16898286d0463179271.tar.gz
eclipse.platform.swt-304375597ad6705f2c2bd16898286d0463179271.tar.xz
eclipse.platform.swt-304375597ad6705f2c2bd16898286d0463179271.zip
Bug 527018 - [refactoring] Replace use of Number constructors by valueOf
Change-Id: Ic80547adfda217ced4174be7efb43392ac69b786 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Accessibility')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java2
3 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
index c97eaf8ace..1b9fd53cf8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/cocoa/org/eclipse/swt/accessibility/Accessible.java
@@ -1535,7 +1535,7 @@ public class Accessible {
if (accessibleValueListenersSize() > 0) {
AccessibleValueEvent event = new AccessibleValueEvent(this);
NSNumber number = new NSNumber(value);
- event.value = new Double(number.doubleValue());
+ event.value = Double.valueOf(number.doubleValue());
for (int i = 0; i < accessibleValueListenersSize(); i++) {
AccessibleValueListener listener = accessibleValueListeners.get(i);
listener.setCurrentValue(event);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
index 041e9a2434..1ac9fa3539 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java
@@ -3584,9 +3584,9 @@ class AccessibleObject {
static Number getGValue (long /*int*/ value) {
long /*int*/ type = OS.G_VALUE_TYPE(value);
if (type == 0) return null;
- if (type == OS.G_TYPE_DOUBLE()) return new Double(OS.g_value_get_double(value));
- if (type == OS.G_TYPE_FLOAT()) return new Float(OS.g_value_get_float(value));
- if (type == OS.G_TYPE_INT64()) return new Long(OS.g_value_get_int64(value));
+ if (type == OS.G_TYPE_DOUBLE()) return Double.valueOf(OS.g_value_get_double(value));
+ if (type == OS.G_TYPE_FLOAT()) return Float.valueOf(OS.g_value_get_float(value));
+ if (type == OS.G_TYPE_INT64()) return Long.valueOf(OS.g_value_get_int64(value));
return Integer.valueOf(OS.g_value_get_int(value));
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
index 9f3c4ca63a..6229af87df 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Accessibility/win32/org/eclipse/swt/accessibility/Accessible.java
@@ -5313,7 +5313,7 @@ public class Accessible {
Number getNumberVARIANT(long /*int*/ variant) {
VARIANT v = new VARIANT();
COM.MoveMemory(v, variant, VARIANT.sizeof);
- if (v.vt == COM.VT_I8) return new Long(v.lVal); // TODO: Fix this - v.lVal is an int - don't use struct
+ if (v.vt == COM.VT_I8) return Long.valueOf(v.lVal); // TODO: Fix this - v.lVal is an int - don't use struct
return Integer.valueOf(v.lVal);
}

Back to the top