Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2017-11-08 16:35:50 -0500
committerAlexander Kurtakov2017-11-09 00:16:55 -0500
commit304375597ad6705f2c2bd16898286d0463179271 (patch)
tree71140168048f600cffd691a2fcfec418ef0449f2 /examples
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 'examples')
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java8
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java2
4 files changed, 8 insertions, 8 deletions
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
index 95c8d1dca6..acc32abe08 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
@@ -952,7 +952,7 @@ public class FileViewer {
fileSize += file.length();
}
diskSpaceLabel.setText(getResourceString("details.FileSize.text",
- new Object[] { new Long(fileSize) }));
+ new Object[] { Long.valueOf(fileSize) }));
} else {
// No files selected
diskSpaceLabel.setText("");
@@ -1569,7 +1569,7 @@ public class FileViewer {
iconImage = iconCache.stockImages[iconCache.iconClosedFolder];
} else {
sizeString = getResourceString("filesize.KB",
- new Object[] { new Long((file.length() + 512) / 1024) });
+ new Object[] { Long.valueOf((file.length() + 512) / 1024) });
int dot = nameString.lastIndexOf('.');
if (dot != -1) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
index d169ae81a6..2a7ca23770 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/BallTab.java
@@ -89,8 +89,8 @@ public class BallTab extends AnimatedGraphicsTab {
for (int i = 0; i < bc.length; i++) {
if (bc[i] == null) return;
if (bc[i].prevx.size() == 0) {
- bc[i].prevx.addLast(new Float(bc[i].x));
- bc[i].prevy.addLast(new Float(bc[i].y));
+ bc[i].prevx.addLast(Float.valueOf(bc[i].x));
+ bc[i].prevy.addLast(Float.valueOf(bc[i].y));
} else if (bc[i].prevx.size() == bc[i].capacity) {
bc[i].prevx.removeFirst();
bc[i].prevy.removeFirst();
@@ -121,8 +121,8 @@ public class BallTab extends AnimatedGraphicsTab {
bc[i].y = 0;
bc[i].incY = random * height / 16 + 1;
}
- bc[i].prevx.addLast(new Float(bc[i].x));
- bc[i].prevy.addLast(new Float(bc[i].y));
+ bc[i].prevx.addLast(Float.valueOf(bc[i].x));
+ bc[i].prevy.addLast(Float.valueOf(bc[i].y));
}
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java
index 77504d9dd0..1843cdb24b 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet135.java
@@ -64,7 +64,7 @@ public class Snippet135 {
@Override
public Object getValueAt (int row, int col) {
if (col == 0) return files[row].getName();
- if (col == 1) return new Long(files[row].length());
+ if (col == 1) return Long.valueOf(files[row].length());
if (col == 2) return new Date(files[row].lastModified());
return "";
}
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java
index d9047f9ac1..953b30a258 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet361.java
@@ -197,7 +197,7 @@ public class Snippet361 {
/* Allow user-entered numbers. */
Double d = (double) 0;
try {
- d = new Double(string);
+ d = Double.valueOf(string);
} catch(NumberFormatException ex) {
}
return d;

Back to the top