Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java8
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug144120_GLCanvasMouseEvents.java10
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java24
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java4
-rw-r--r--tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java4
5 files changed, 25 insertions, 25 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java
index 9edb48252b..c2e83ef353 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet307.java
@@ -81,12 +81,12 @@ static class CustomFunction extends BrowserFunction {
}
}
Object returnValue = new Object[] {
- new Short ((short)3),
- new Boolean (true),
+ Short.valueOf ((short)3),
+ true,
null,
- new Object[] {"a string", new Boolean (false)},
+ new Object[] {"a string", false},
"hi",
- new Float (2.0f / 3.0f),
+ Float.valueOf (2.0f / 3.0f),
};
//int z = 3 / 0; // uncomment to cause a java error instead
return returnValue;
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug144120_GLCanvasMouseEvents.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug144120_GLCanvasMouseEvents.java
index 0484119cc9..37a02089e6 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug144120_GLCanvasMouseEvents.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug144120_GLCanvasMouseEvents.java
@@ -45,7 +45,7 @@ public class Bug144120_GLCanvasMouseEvents {
@Override
public void mouseMove(MouseEvent event) {
long time=System.currentTimeMillis();
- System.out.println(new Long(time).toString() + " mouse move: " + event.x + " " + event.y);
+ System.out.println(Long.valueOf(time).toString() + " mouse move: " + event.x + " " + event.y);
try {
synchronized(this) {
wait(100);
@@ -63,7 +63,7 @@ public class Bug144120_GLCanvasMouseEvents {
@Override
public void mouseDoubleClick(MouseEvent event) {
long time=System.currentTimeMillis();
- System.out.println(new Long(time).toString() + " mouse doubleclick: " + event.x + " " + event.y);
+ System.out.println(Long.valueOf(time).toString() + " mouse doubleclick: " + event.x + " " + event.y);
}
@Override
@@ -78,13 +78,13 @@ public class Bug144120_GLCanvasMouseEvents {
// TODO Auto-generated catch block
e.printStackTrace();
}
- System.out.println(new Long(time).toString() + " mouse down: " + event.x + " " + event.y);
+ System.out.println(Long.valueOf(time).toString() + " mouse down: " + event.x + " " + event.y);
}
@Override
public void mouseUp(MouseEvent event) {
long time=System.currentTimeMillis();
- System.out.println(new Long(time).toString() + " mouse move: " + event.x + " " + event.y);
+ System.out.println(Long.valueOf(time).toString() + " mouse move: " + event.x + " " + event.y);
try {
synchronized(this) {
wait(100);
@@ -93,7 +93,7 @@ public class Bug144120_GLCanvasMouseEvents {
// TODO Auto-generated catch block
e.printStackTrace();
}
- System.out.println(new Long(time).toString() + " mouse up: " + event.x + " " + event.y);
+ System.out.println(Long.valueOf(time).toString() + " mouse up: " + event.x + " " + event.y);
}
}
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
index 6db7d7f89d..80dc0f4fe6 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellBoundsTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2018 Red Hat and others.
+ * Copyright (c) 2018, 2019 Red Hat and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -22,28 +22,28 @@ import org.eclipse.swt.widgets.Shell;
public class Bug336238_ShellBoundsTest {
static int cycles = 5;
-
+
// @Test
public void testSetBounds() {
-
+
int x;
int y;
int width = 100;
int height = 100;
-
+
for (int i=0; i < cycles; i++) {
-
- x = (new Double(Math.random()*1000)).intValue();
- y = (new Double(Math.random()*1000)).intValue();
-
+
+ x = (Double.valueOf(Math.random()*1000)).intValue();
+ y = (Double.valueOf(Math.random()*1000)).intValue();
+
Shell testShell = new Shell();
testShell.open();
-
+
testShell.setBounds(x, y, width, height);
-
+
// assertEquals(x, testShell.getLocation().x);
// assertEquals(y, testShell.getLocation().y);
testShell.close();
- }
- }
+ }
+ }
} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java
index 3947d85133..607f908c06 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug336238_ShellSetBoundFailTest.java
@@ -32,8 +32,8 @@ public class Bug336238_ShellSetBoundFailTest {
for (int i = 0; i < cycles; i++) {
- x = (new Double(Math.random() * 1000)).intValue();
- y = (new Double(Math.random() * 1000)).intValue() + 27;
+ x = (Double.valueOf(Math.random() * 1000)).intValue();
+ y = (Double.valueOf(Math.random() * 1000)).intValue() + 27;
Shell testShell = new Shell();
testShell.open();
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
index c6938c660f..2f8500afaf 100644
--- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
+++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java
@@ -927,7 +927,7 @@ public void test_setUrl_remote_with_post() {
assertTrue("Expecting setUrl() to return true", opSuccess);
};
- final AtomicReference<Boolean> completed = new AtomicReference<>(new Boolean(false));
+ final AtomicReference<Boolean> completed = new AtomicReference<>(false);
browser.addProgressListener(completedAdapter(event -> {
testLog.append("ProgressListener fired");
completed.set(true);
@@ -1667,7 +1667,7 @@ public void test_evaluate_boolean() {
public void test_evaluate_null() {
assumeFalse(webkit1SkipMsg(), isWebkit1); // Bug 509411
// Boolen only used as dummy placeholder so the object is not null.
- final AtomicReference<Object> returnValue = new AtomicReference<>(new Boolean(true));
+ final AtomicReference<Object> returnValue = new AtomicReference<>(true);
browser.addProgressListener(completedAdapter(event -> {
Object evalResult = browser.evaluate("return null");
returnValue.set(evalResult);

Back to the top