diff options
author | Grant Gayed <ggayed> | 2006-08-21 19:50:26 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2006-08-21 19:50:26 +0000 |
commit | 9c093047f33285b868bf92dfd7c756793835062d (patch) | |
tree | 3ce4de15c7247b478a3016bf242c435960fc0367 /tests | |
parent | 56f3c7daceb722a0c999feeb5d2239e564234dd9 (diff) | |
download | eclipse.platform.swt-9c093047f33285b868bf92dfd7c756793835062d.tar.gz eclipse.platform.swt-9c093047f33285b868bf92dfd7c756793835062d.tar.xz eclipse.platform.swt-9c093047f33285b868bf92dfd7c756793835062d.zip |
cleanup warningsv3306
Diffstat (limited to 'tests')
41 files changed, 288 insertions, 316 deletions
diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java index 4c9573d3d4..ed3919f09b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_LocationAdapter.java @@ -38,7 +38,7 @@ protected void tearDown() { } public void test_Constructor() { - LocationAdapter adapter = new LocationAdapter() {}; + new LocationAdapter() {}; } public void test_changedLorg_eclipse_swt_browser_LocationEvent() { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java index ad8fde037e..49ace93499 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_ProgressAdapter.java @@ -38,7 +38,7 @@ protected void tearDown() { } public void test_Constructor() { - ProgressAdapter adapter = new ProgressAdapter() {}; + new ProgressAdapter() {}; } public void test_changedLorg_eclipse_swt_browser_ProgressEvent() { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java index 82dc0c004f..a3d7f72924 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BidiSegmentListener.java @@ -114,7 +114,7 @@ private void testStyleRangeSegmenting(final int[] segments, int[] boldRanges) { for (int i=0; i<boldRanges.length; i+=2) { StyleRange styleRange = new StyleRange(boldRanges[i], boldRanges[i+1], null, null, SWT.BOLD); text.setStyleRange(styleRange); - }; + } text.getLocationAtOffset(0); } catch (IllegalArgumentException e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java index 8f41e950b5..dd60459827 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_StyleRange.java @@ -56,7 +56,7 @@ protected void setUp() { protected void tearDown() { Enumeration elements = colors.keys(); while (elements.hasMoreElements()) { - Color color = (Color)colors.get((RGB)elements.nextElement()); + Color color = (Color)colors.get(elements.nextElement()); color.dispose(); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java index 2e63364917..f99263f79f 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_FontData.java @@ -39,7 +39,7 @@ protected void tearDown() { public void test_Constructor() { // Test new FontData() - FontData fd = new FontData(); + new FontData(); } public void test_ConstructorLjava_lang_String() { @@ -52,39 +52,39 @@ public void test_ConstructorLjava_lang_String() { public void test_ConstructorLjava_lang_StringII() { // Test new FontData(String name, int height, int style) // valid font data with no name (strange, but apparently valid) - FontData fd = new FontData("", 10, SWT.NORMAL); + new FontData("", 10, SWT.NORMAL); // valid font data with unknown name (strange, but apparently valid) - fd = new FontData("bad-font", 10, SWT.NORMAL); + new FontData("bad-font", 10, SWT.NORMAL); // valid font data with 0 height (strange, but apparently valid) - fd = new FontData(SwtJunit.testFontName, 0, SWT.NORMAL); + new FontData(SwtJunit.testFontName, 0, SWT.NORMAL); // valid font data with 1000 height (pretty big, but apparently valid) - fd = new FontData(SwtJunit.testFontName, 1000, SWT.NORMAL); + // valid normal 10-point font data - fd = new FontData(SwtJunit.testFontName, 10, SWT.NORMAL); + new FontData(SwtJunit.testFontName, 10, SWT.NORMAL); // valid bold 10-point font data - fd = new FontData(SwtJunit.testFontName, 10, SWT.BOLD); + new FontData(SwtJunit.testFontName, 10, SWT.BOLD); // valid italic 10-point font data - fd = new FontData(SwtJunit.testFontName, 10, SWT.ITALIC); + new FontData(SwtJunit.testFontName, 10, SWT.ITALIC); // valid bold italic 10-point font data - fd = new FontData(SwtJunit.testFontName, 10, SWT.BOLD | SWT.ITALIC); + new FontData(SwtJunit.testFontName, 10, SWT.BOLD | SWT.ITALIC); // illegal argument, name == null try { - fd = new FontData(null, 10, SWT.NORMAL); + new FontData(null, 10, SWT.NORMAL); fail("No exception thrown for name == null"); } catch (IllegalArgumentException e) { } // illegal argument, height < 0 try { - fd = new FontData(SwtJunit.testFontName, -10, SWT.NORMAL); + new FontData(SwtJunit.testFontName, -10, SWT.NORMAL); fail("No exception thrown for height < 0"); } catch (IllegalArgumentException e) { } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java index 74319fb3a0..a60834e97e 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Image.java @@ -292,7 +292,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_io_InputStream String fileName = SwtTestCase.invalidImageFilenames[0]; Display[] displays = {display, null}; for (int j = 0; j < displays.length; j++) { - Display tempDisplay = displays[j]; +// Display tempDisplay = displays[j]; for (int i=0; i<numFormats; i++) { String format = SwtTestCase.imageFormats[i]; stream = SwtTestCase.class.getResourceAsStream(fileName + "." + format); @@ -381,7 +381,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_lang_String() fileName = SwtTestCase.invalidImageFilenames[0]; Display[] displays = {display, null}; for (int j = 0; j < displays.length; j++) { - Display tempDisplay = displays[j]; +// Display tempDisplay = displays[j]; for (int i=0; i<numFormats; i++) { String format = SwtTestCase.imageFormats[i]; @@ -409,7 +409,7 @@ public void test_ConstructorLorg_eclipse_swt_graphics_DeviceLjava_lang_String() // create valid images for (int j = 0; j < displays.length; j++) { - Display tempDisplay = displays[j]; +// Display tempDisplay = displays[j]; int numFileNames = SwtTestCase.imageFilenames.length; for (int k=0; k<numFileNames; k++) { fileName = SwtTestCase.imageFilenames[k]; @@ -430,7 +430,7 @@ public void test_dispose() { public void test_equalsLjava_lang_Object() { Image image = null; - Image image1 = null;; + Image image1 = null; try { image = new Image(display, 10, 10); @@ -501,7 +501,7 @@ public void test_getImageData() { public void test_hashCode() { Image image = null; - Image image1 = null;; + Image image1 = null; try { image = new Image(display, 10, 10); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java index 71b64ea565..9dbf84e94b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageData.java @@ -70,7 +70,7 @@ public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteData() { int[] validDepths = {1, 2, 4, 8, 16, 24, 32}; for (int i = 0; i < validDepths.length; i++) { new ImageData(1, 1, validDepths[i], new PaletteData(new RGB[] {new RGB(0, 0, 0)})); - }; + } } public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteDataI$B() { @@ -107,7 +107,7 @@ public void test_ConstructorIIILorg_eclipse_swt_graphics_PaletteDataI$B() { int[] validDepths = {1, 2, 4, 8, 16, 24, 32}; for (int i = 0; i < validDepths.length; i++) { new ImageData(1, 1, validDepths[i], new PaletteData(new RGB[] {new RGB(0, 0, 0)}), 1, new byte[] {}); - }; + } // illegal argument, data is null try { @@ -354,7 +354,6 @@ public void test_getPixelII() { } public void test_getPixelsIII$BI() { - byte value; final int SIZE = 20; final int GET_WIDTH = 10; final int OFFSET = 10; @@ -492,7 +491,6 @@ public void test_getPixelsIII$BI() { } public void test_getPixelsIII$II() { - int value; final int SIZE = 20; final int GET_WIDTH = 10; final int OFFSET = 10; @@ -898,7 +896,6 @@ public void test_setPixelIII() { } public void test_setPixelsIII$BI() { - byte value; final int SIZE = 20; final int OFFSET = 1; byte[] pixelData = new byte[SIZE]; @@ -1007,7 +1004,6 @@ public void test_setPixelsIII$BI() { } public void test_setPixelsIII$II() { - int value; final int SIZE = 20; final int OFFSET = 1; int[] pixelData = new int[SIZE]; diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java index 0e617f5148..85748cc1a7 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_ImageLoader.java @@ -41,7 +41,7 @@ protected void tearDown() { } public void test_Constructor() { - ImageLoader loader = new ImageLoader(); + new ImageLoader(); } public void test_addImageLoaderListenerLorg_eclipse_swt_graphics_ImageLoaderListener() { @@ -49,7 +49,7 @@ public void test_addImageLoaderListenerLorg_eclipse_swt_graphics_ImageLoaderList ImageLoaderListener loaderListener = new ImageLoaderListener() { public void imageDataLoaded(ImageLoaderEvent e) { loaderListenerCalled = true; - }; + } }; try { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java index ef6d910e40..2ea99872b1 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_RGB.java @@ -37,49 +37,49 @@ protected void tearDown() { public void test_ConstructorIII() { // Test RGB(int red, int green, int blue) - RGB rgb = new RGB(20,100,200); + new RGB(20,100,200); - rgb = new RGB(0,0,0); + new RGB(0,0,0); - rgb = new RGB(255,255,255); + try { - rgb = new RGB(-1, 20, 50); + new RGB(-1, 20, 50); fail("No exception thrown for red < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(256, 20, 50); + new RGB(256, 20, 50); fail("No exception thrown for red > 255"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(20, -1, 50); + new RGB(20, -1, 50); fail("No exception thrown for green < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(20, 256, 50); + new RGB(20, 256, 50); fail("No exception thrown for green > 255"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(20, 50, -1); + new RGB(20, 50, -1); fail("No exception thrown for blue < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(20, 50, 256); + new RGB(20, 50, 256); fail("No exception thrown for blue > 255"); } catch (IllegalArgumentException e) { @@ -89,139 +89,139 @@ public void test_ConstructorIII() { public void test_ConstructorFFF() { - RGB rgb = new RGB(0f,0f,0f); - rgb = new RGB(0f,1f,1f); - rgb = new RGB(0f,1f,0f); - rgb = new RGB(0f,0f,1f); - rgb = new RGB(0f,0.6f,0.4f); - rgb = new RGB(1f,0f,1f); - rgb = new RGB(1f,1f,1f); - rgb = new RGB(1f,0f,1f); - rgb = new RGB(1f,1f,0f); - rgb = new RGB(1f,0.6f,0.4f); - rgb = new RGB(59f,0f,1f); - rgb = new RGB(59f,1f,1f); - rgb = new RGB(59f,0f,1f); - rgb = new RGB(59f,1f,0f); - rgb = new RGB(59f,0.6f,0.4f); - rgb = new RGB(60f,0f,1f); - rgb = new RGB(60f,1f,1f); - rgb = new RGB(60f,0f,1f); - rgb = new RGB(60f,1f,0f); - rgb = new RGB(60f,0.6f,0.4f); - rgb = new RGB(61f,0f,1f); - rgb = new RGB(61f,1f,1f); - rgb = new RGB(61f,0f,1f); - rgb = new RGB(61f,1f,0f); - rgb = new RGB(61f,0.6f,0.4f); - rgb = new RGB(119f,0f,1f); - rgb = new RGB(119f,1f,1f); - rgb = new RGB(119f,0f,1f); - rgb = new RGB(119f,1f,0f); - rgb = new RGB(119f,0.6f,0.4f); - rgb = new RGB(120f,0f,1f); - rgb = new RGB(120f,1f,1f); - rgb = new RGB(120f,0f,1f); - rgb = new RGB(120f,1f,0f); - rgb = new RGB(120f,0.6f,0.4f); - rgb = new RGB(121f,0f,1f); - rgb = new RGB(121f,1f,1f); - rgb = new RGB(121f,0f,1f); - rgb = new RGB(121f,1f,0f); - rgb = new RGB(121f,0.6f,0.4f); - rgb = new RGB(179f,0f,1f); - rgb = new RGB(179f,1f,1f); - rgb = new RGB(179f,0f,1f); - rgb = new RGB(179f,1f,0f); - rgb = new RGB(179f,0.6f,0.4f); - rgb = new RGB(180f,0f,1f); - rgb = new RGB(180f,1f,1f); - rgb = new RGB(180f,0f,1f); - rgb = new RGB(180f,1f,0f); - rgb = new RGB(180f,0.6f,0.4f); - rgb = new RGB(181f,0f,1f); - rgb = new RGB(181f,1f,1f); - rgb = new RGB(181f,0f,1f); - rgb = new RGB(181f,1f,0f); - rgb = new RGB(181f,0.6f,0.4f); - rgb = new RGB(239f,0f,1f); - rgb = new RGB(239f,1f,1f); - rgb = new RGB(239f,0f,1f); - rgb = new RGB(239f,1f,0f); - rgb = new RGB(239f,0.6f,0.4f); - rgb = new RGB(240f,0f,1f); - rgb = new RGB(240f,1f,1f); - rgb = new RGB(240f,0f,1f); - rgb = new RGB(240f,1f,0f); - rgb = new RGB(240f,0.6f,0.4f); - rgb = new RGB(241f,0f,1f); - rgb = new RGB(241f,1f,1f); - rgb = new RGB(241f,0f,1f); - rgb = new RGB(241f,1f,0f); - rgb = new RGB(241f,0.6f,0.4f); - rgb = new RGB(299f,0f,1f); - rgb = new RGB(299f,1f,1f); - rgb = new RGB(299f,0f,1f); - rgb = new RGB(299f,1f,0f); - rgb = new RGB(299f,0.6f,0.4f); - rgb = new RGB(300f,0f,1f); - rgb = new RGB(300f,1f,1f); - rgb = new RGB(300f,0f,1f); - rgb = new RGB(300f,1f,0f); - rgb = new RGB(300f,0.6f,0.4f); - rgb = new RGB(301f,0f,1f); - rgb = new RGB(301f,1f,1f); - rgb = new RGB(301f,0f,1f); - rgb = new RGB(301f,1f,0f); - rgb = new RGB(301f,0.6f,0.4f); - rgb = new RGB(359f,0f,1f); - rgb = new RGB(359f,1f,1f); - rgb = new RGB(359f,0f,1f); - rgb = new RGB(359f,1f,0f); - rgb = new RGB(359f,0.6f,0.4f); - rgb = new RGB(360f,0f,1f); - rgb = new RGB(360f,1f,1f); - rgb = new RGB(360f,0f,1f); - rgb = new RGB(360f,1f,0f); - rgb = new RGB(360f,0.6f,0.4f); + new RGB(0f,0f,0f); + + new RGB(0f,1f,0f); + new RGB(0f,0f,1f); + new RGB(0f,0.6f,0.4f); + new RGB(1f,0f,1f); + new RGB(1f,1f,1f); + new RGB(1f,0f,1f); + new RGB(1f,1f,0f); + new RGB(1f,0.6f,0.4f); + new RGB(59f,0f,1f); + new RGB(59f,1f,1f); + new RGB(59f,0f,1f); + new RGB(59f,1f,0f); + new RGB(59f,0.6f,0.4f); + new RGB(60f,0f,1f); + new RGB(60f,1f,1f); + new RGB(60f,0f,1f); + new RGB(60f,1f,0f); + new RGB(60f,0.6f,0.4f); + new RGB(61f,0f,1f); + new RGB(61f,1f,1f); + new RGB(61f,0f,1f); + new RGB(61f,1f,0f); + new RGB(61f,0.6f,0.4f); + new RGB(119f,0f,1f); + new RGB(119f,1f,1f); + new RGB(119f,0f,1f); + new RGB(119f,1f,0f); + new RGB(119f,0.6f,0.4f); + new RGB(120f,0f,1f); + new RGB(120f,1f,1f); + new RGB(120f,0f,1f); + new RGB(120f,1f,0f); + new RGB(120f,0.6f,0.4f); + new RGB(121f,0f,1f); + new RGB(121f,1f,1f); + new RGB(121f,0f,1f); + new RGB(121f,1f,0f); + new RGB(121f,0.6f,0.4f); + new RGB(179f,0f,1f); + new RGB(179f,1f,1f); + new RGB(179f,0f,1f); + new RGB(179f,1f,0f); + new RGB(179f,0.6f,0.4f); + new RGB(180f,0f,1f); + new RGB(180f,1f,1f); + new RGB(180f,0f,1f); + new RGB(180f,1f,0f); + new RGB(180f,0.6f,0.4f); + new RGB(181f,0f,1f); + new RGB(181f,1f,1f); + new RGB(181f,0f,1f); + new RGB(181f,1f,0f); + new RGB(181f,0.6f,0.4f); + new RGB(239f,0f,1f); + new RGB(239f,1f,1f); + new RGB(239f,0f,1f); + new RGB(239f,1f,0f); + new RGB(239f,0.6f,0.4f); + new RGB(240f,0f,1f); + new RGB(240f,1f,1f); + new RGB(240f,0f,1f); + new RGB(240f,1f,0f); + new RGB(240f,0.6f,0.4f); + new RGB(241f,0f,1f); + new RGB(241f,1f,1f); + new RGB(241f,0f,1f); + new RGB(241f,1f,0f); + new RGB(241f,0.6f,0.4f); + new RGB(299f,0f,1f); + new RGB(299f,1f,1f); + new RGB(299f,0f,1f); + new RGB(299f,1f,0f); + new RGB(299f,0.6f,0.4f); + new RGB(300f,0f,1f); + new RGB(300f,1f,1f); + new RGB(300f,0f,1f); + new RGB(300f,1f,0f); + new RGB(300f,0.6f,0.4f); + new RGB(301f,0f,1f); + new RGB(301f,1f,1f); + new RGB(301f,0f,1f); + new RGB(301f,1f,0f); + new RGB(301f,0.6f,0.4f); + new RGB(359f,0f,1f); + new RGB(359f,1f,1f); + new RGB(359f,0f,1f); + new RGB(359f,1f,0f); + new RGB(359f,0.6f,0.4f); + new RGB(360f,0f,1f); + new RGB(360f,1f,1f); + new RGB(360f,0f,1f); + new RGB(360f,1f,0f); + new RGB(360f,0.6f,0.4f); try { - rgb = new RGB(400f, 0.5f, 0.5f); + new RGB(400f, 0.5f, 0.5f); fail("No exception thrown for hue > 360"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(-5f, 0.5f, 0.5f); + new RGB(-5f, 0.5f, 0.5f); fail("No exception thrown for hue < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(200f, -0.5f, 0.5f); + new RGB(200f, -0.5f, 0.5f); fail("No exception thrown for saturation < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(200f, 300f, 0.5f); + new RGB(200f, 300f, 0.5f); fail("No exception thrown for saturation > 1"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(200f, 0.5f, -0.5f); + new RGB(200f, 0.5f, -0.5f); fail("No exception thrown for brightness < 0"); } catch (IllegalArgumentException e) { } try { - rgb = new RGB(200f, 0.5f, 400f); + new RGB(200f, 0.5f, 400f); fail("No exception thrown for brightness > 1"); } catch (IllegalArgumentException e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java index 28420fd732..a9cfe6b97c 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_graphics_Region.java @@ -173,7 +173,7 @@ public void test_containsII() { Region reg = new Region(display); reg.dispose(); try { - boolean res = reg.contains(pointInRect1.x, pointInRect1.y); + reg.contains(pointInRect1.x, pointInRect1.y); fail("no exception thrown on disposed region"); } catch (Exception e) { @@ -212,7 +212,7 @@ public void test_containsLorg_eclipse_swt_graphics_Point() { Region reg = new Region(display); reg.dispose(); try { - boolean res = reg.contains(pointInRect1); + reg.contains(pointInRect1); fail("no exception thrown on disposed region"); } catch (Exception e) { @@ -308,7 +308,7 @@ public void test_getBounds() { reg.dispose(); try { - Rectangle rect = reg.getBounds(); + reg.getBounds(); fail("Region disposed should throw Exception"); } catch (Exception e) { @@ -535,7 +535,7 @@ public void test_intersectsIIII() { Region reg = new Region(display); reg.dispose(); try { - boolean res = reg.intersects(rectInter1.x, rectInter1.y, rectInter1.width, rectInter1.height); + reg.intersects(rectInter1.x, rectInter1.y, rectInter1.width, rectInter1.height); fail("no exception thrown on disposed region"); } catch (Exception e) { @@ -589,7 +589,7 @@ public void test_intersectsLorg_eclipse_swt_graphics_Rectangle() { Region reg = new Region(display); reg.dispose(); try { - boolean res = reg.intersects(rectInter1); + reg.intersects(rectInter1); fail("no exception thrown on disposed region"); } catch (Exception e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java index 0fe61a928f..0b7ccd8d06 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_printing_PrinterData.java @@ -38,11 +38,11 @@ protected void tearDown() { } public void test_Constructor() { - PrinterData data = new PrinterData(); + new PrinterData(); } public void test_ConstructorLjava_lang_StringLjava_lang_String() { - PrinterData data = new PrinterData("hello", "there"); + new PrinterData("hello", "there"); } public void test_toString() { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java index 978e5cf7b5..5c49654400 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_program_Program.java @@ -15,7 +15,6 @@ import java.util.*; import junit.framework.*; import junit.textui.*; import org.eclipse.swt.*; -import org.eclipse.swt.graphics.*; import org.eclipse.swt.program.*; import org.eclipse.swt.widgets.*; @@ -25,8 +24,6 @@ import org.eclipse.swt.widgets.*; * @see org.eclipse.swt.program.Program */ public class Test_org_eclipse_swt_program_Program extends SwtTestCase { - - private Display display; public Test_org_eclipse_swt_program_Program(String name) { super(name); @@ -37,7 +34,7 @@ public static void main(String[] args) { } protected void setUp() { - display = Display.getDefault(); + Display.getDefault(); } protected void tearDown() { @@ -84,13 +81,13 @@ public void test_findProgramLjava_lang_String() { // No assertion here because the doc does not guarantee a non-null result. if (extensions != null) { for (int i=0; i<extensions.length; i++) { - Program program = Program.findProgram(extensions[i]); + Program.findProgram(extensions[i]); // No assertion here because a null result is allowed. } } try { - Program program = Program.findProgram(null); + Program.findProgram(null); fail("Failed to throw ERROR_NULL_ARGUMENT"); } catch (IllegalArgumentException e) { assertEquals("Failed to throw ERROR_NULL_ARGUMENT", SWT.ERROR_NULL_ARGUMENT, e); @@ -118,7 +115,7 @@ public void test_getImageData() { for (int i=0; i<extensions.length; i++) { Program program = Program.findProgram(extensions[i]); if (program != null) { - ImageData data = program.getImageData(); + program.getImageData(); // Nothing to do. } } @@ -157,7 +154,7 @@ public void test_getPrograms() { int hashCode = programs[i].hashCode(); Integer key = new Integer(hashCode); if (lookup.contains(key)) { - fail("Duplicate hash code for "+programs[i]+" (same as "+(Program)lookup.get(key)+")"); + fail("Duplicate hash code for "+programs[i]+" (same as "+lookup.get(key)+")"); } else { lookup.put(key,programs[i]); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java index f709dd2eff..cdd79c882b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Button.java @@ -47,20 +47,20 @@ protected void tearDown() { public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { // Test Button(Composite parent, int style) - Button button = new Button(shell, SWT.NULL); + new Button(shell, SWT.NULL); - button = new Button(shell, SWT.PUSH); + new Button(shell, SWT.PUSH); - button = new Button(shell, SWT.CHECK); + new Button(shell, SWT.CHECK); - button = new Button(shell, SWT.TOGGLE); + new Button(shell, SWT.TOGGLE); - button = new Button(shell, SWT.ARROW); + new Button(shell, SWT.ARROW); - button = new Button(shell, SWT.PUSH | SWT.CHECK); + new Button(shell, SWT.PUSH | SWT.CHECK); try { - button = new Button(null, 0); + new Button(null, 0); fail("No exception thrown for parent == null"); } catch (IllegalArgumentException e) { @@ -72,9 +72,9 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() SelectionListener listener = new SelectionListener() { public void widgetSelected(SelectionEvent e) { listenerCalled = true; - }; + } public void widgetDefaultSelected(SelectionEvent e) { - }; + } }; try { @@ -245,7 +245,7 @@ public void test_setTextLjava_lang_String() { for (int i=0; i<goodCases; i++){ button.setText(cases[i]); assertTrue("good case: " + String.valueOf(i), button.getText().equals(cases[i])); - }; + } try { button.setText(null); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java index 11e6511ef9..5c89a621fd 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Canvas.java @@ -53,9 +53,8 @@ protected void setWidget(Widget w) { } public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { - Canvas newCanvas; try { - newCanvas = new Canvas(null, SWT.NONE); + new Canvas(null, SWT.NONE); fail("No exception thrown for parent == null"); } catch (IllegalArgumentException e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java index a6b9b09122..223b2a4ed7 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Caret.java @@ -47,9 +47,8 @@ protected void tearDown() { } public void test_ConstructorLorg_eclipse_swt_widgets_CanvasI() { - Caret newCaret; try { - newCaret = new Caret(null, 0); + new Caret(null, 0); fail("No exception thrown for parent == null"); } catch (IllegalArgumentException e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java index 15deaa23a1..cba4dba39b 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Control.java @@ -52,10 +52,10 @@ public void test_addControlListenerLorg_eclipse_swt_events_ControlListener() { ControlListener listener = new ControlListener() { public void controlMoved(ControlEvent e) { eventOccurred = true; - }; + } public void controlResized(ControlEvent e) { eventOccurred = true; - }; + } }; control.addControlListener(listener); eventOccurred = false; @@ -71,10 +71,10 @@ public void test_addFocusListenerLorg_eclipse_swt_events_FocusListener() { FocusListener listener = new FocusListener() { public void focusGained(FocusEvent e) { eventOccurred = true; - }; + } public void focusLost(FocusEvent e) { eventOccurred = true; - }; + } }; control.addFocusListener(listener); eventOccurred = false; @@ -90,7 +90,7 @@ public void test_addHelpListenerLorg_eclipse_swt_events_HelpListener() { HelpListener listener = new HelpListener() { public void helpRequested(HelpEvent e) { eventOccurred = true; - }; + } }; control.addHelpListener(listener); eventOccurred = false; @@ -103,10 +103,10 @@ public void test_addKeyListenerLorg_eclipse_swt_events_KeyListener() { KeyListener listener = new KeyListener() { public void keyPressed(KeyEvent e) { eventOccurred = true; - }; + } public void keyReleased(KeyEvent e) { eventOccurred = true; - }; + } }; control.addKeyListener(listener); eventOccurred = false; @@ -122,13 +122,13 @@ public void test_addMouseListenerLorg_eclipse_swt_events_MouseListener() { MouseListener listener = new MouseListener() { public void mouseDown(MouseEvent e) { eventOccurred = true; - }; + } public void mouseUp(MouseEvent e) { eventOccurred = true; - }; + } public void mouseDoubleClick(MouseEvent e) { eventOccurred = true; - }; + } }; control.addMouseListener(listener); eventOccurred = false; @@ -147,7 +147,7 @@ public void test_addMouseMoveListenerLorg_eclipse_swt_events_MouseMoveListener() MouseMoveListener listener = new MouseMoveListener() { public void mouseMove(MouseEvent e) { eventOccurred = true; - }; + } }; control.addMouseMoveListener(listener); eventOccurred = false; @@ -160,13 +160,13 @@ public void test_addMouseTrackListenerLorg_eclipse_swt_events_MouseTrackListener MouseTrackListener listener = new MouseTrackListener() { public void mouseEnter(MouseEvent e) { eventOccurred = true; - }; + } public void mouseExit(MouseEvent e) { eventOccurred = true; - }; + } public void mouseHover(MouseEvent e) { eventOccurred = true; - }; + } }; control.addMouseTrackListener(listener); eventOccurred = false; @@ -185,7 +185,7 @@ public void test_addPaintListenerLorg_eclipse_swt_events_PaintListener() { PaintListener listener = new PaintListener() { public void paintControl(PaintEvent e) { eventOccurred = true; - }; + } }; control.addPaintListener(listener); eventOccurred = false; @@ -201,7 +201,7 @@ public void test_addTraverseListenerLorg_eclipse_swt_events_TraverseListener() { TraverseListener listener = new TraverseListener() { public void keyTraversed(TraverseEvent e) { eventOccurred = true; - }; + } }; control.addTraverseListener(listener); eventOccurred = false; diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java index 80ec9facc9..e2aba476eb 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_CoolItem.java @@ -45,10 +45,10 @@ protected void tearDown() { public void test_ConstructorLorg_eclipse_swt_widgets_CoolBarI() { CoolBar coolBar = new CoolBar(shell, 0); - CoolItem coolItem = new CoolItem(coolBar, 0); + new CoolItem(coolBar, 0); try { - coolItem = new CoolItem(null, 0); + new CoolItem(null, 0); fail("No exception thrown for parent == null"); } catch (IllegalArgumentException e) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java index 9e62e98209..f18248c110 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_DirectoryDialog.java @@ -41,7 +41,7 @@ protected void tearDown() { } public void test_ConstructorLorg_eclipse_swt_widgets_Shell() { - DirectoryDialog dd = new DirectoryDialog(shell); + new DirectoryDialog(shell); try { new DirectoryDialog(null); fail("No exception thrown for null parent"); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java index 9de4a82173..49dbdc77a8 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Display.java @@ -69,7 +69,7 @@ public void test_addFilterILorg_eclipse_swt_widgets_Listener() { callbackReceived[CLOSE_CALLBACK] = true; else if (e.type == SWT.Dispose) callbackReceived[DISPOSE_CALLBACK] = true; - }; + } }; Display display = new Display(); @@ -100,7 +100,7 @@ public void test_addListenerILorg_eclipse_swt_widgets_Listener() { callbackReceived[CLOSE_CALLBACK] = true; else if (e.type == SWT.Dispose) callbackReceived[DISPOSE_CALLBACK] = true; - }; + } }; Display display = new Display(); @@ -794,7 +794,7 @@ public void test_removeFilterILorg_eclipse_swt_widgets_Listener() { callbackReceived[CLOSE_CALLBACK] = true; else if (e.type == SWT.Dispose) callbackReceived[DISPOSE_CALLBACK] = true; - }; + } }; Display display = new Display(); @@ -826,7 +826,7 @@ public void test_removeListenerILorg_eclipse_swt_widgets_Listener() { callbackReceived[CLOSE_CALLBACK] = true; else if (e.type == SWT.Dispose) callbackReceived[DISPOSE_CALLBACK] = true; - }; + } }; Display display = new Display(); @@ -1234,7 +1234,7 @@ public void test_getFontListLjava_lang_StringZ() { public void test_getWarnings() { Display display = new Display(); try { - boolean result = display.getWarnings(); + display.getWarnings(); // Since the behavior is platform specific, there's // no good test for the result value. } finally { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java index 749e780978..a9aa7447a0 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ExpandBar.java @@ -52,7 +52,7 @@ public void test_addExpandListenerLorg_eclipse_swt_events_ExpandListener() { } public void itemExpanded(ExpandEvent e) { listenerCalled[0] = true; - }; + } }; try { @@ -92,10 +92,9 @@ public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { public void test_getItemCount() { int number = 10; - ExpandItem item; for (int i = 0; i < number; i++) { assertTrue(":a:" + i, expandBar.getItemCount() == i); - item = new ExpandItem(expandBar, 0); + new ExpandItem(expandBar, 0); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java index 006cacaa81..2523933626 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FileDialog.java @@ -42,7 +42,7 @@ protected void tearDown() { public void test_ConstructorLorg_eclipse_swt_widgets_Shell() { // Test FileDialog(Shell) - FileDialog fd = new FileDialog(shell); + new FileDialog(shell); try { new FileDialog(null); fail("No exception thrown for parent == null"); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java index 1079d9588f..7095f684f8 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_FontDialog.java @@ -41,7 +41,7 @@ protected void tearDown() { } public void test_ConstructorLorg_eclipse_swt_widgets_Shell() { - FontDialog fd = new FontDialog(shell); + new FontDialog(shell); try { new FontDialog(null); fail("No exception thrown for parent == null"); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java index be28397d55..6237d6eb18 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Group.java @@ -70,7 +70,7 @@ public void test_setTextLjava_lang_String() { for (int i = 0; i < cases.length; i++) { group.setText(cases[i]); assertTrue("case: " + String.valueOf(i), group.getText().equals(cases[i])); - }; + } } public static Test suite() { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java index 0c17e63124..5fd3503386 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Link.java @@ -65,9 +65,9 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() SelectionListener listener = new SelectionListener() { public void widgetSelected(SelectionEvent e) { listenerCalled = true; - }; + } public void widgetDefaultSelected(SelectionEvent e) { - }; + } }; try { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java index 4917aa93f7..096d8e1b95 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_List.java @@ -220,8 +220,6 @@ public void test_computeSizeIIZ() { public void test_deselect$I() { String[] items = { "item0", "item1", "item2", "item3" }; - String[] empty = { - }; list.setItems(items); list.setSelection(items); assertSame(":a:", list.getSelection(), items); @@ -298,8 +296,6 @@ public void test_deselectI() { list.setItems(items); String[] items2 = { "item0", "item1", "item2", "item3" }; - String[] empty = { - }; list.setItems(items2); list.setSelection(items2); assertSame(items2, list.getSelection()); @@ -354,8 +350,6 @@ public void test_deselectII() { // done String[] items2 = { "item0", "item1", "item2", "item3" }; - String[] empty = { - }; list.setItems(items2); list.setSelection(items2); assertSame(":a:", items2, list.getSelection()); @@ -471,18 +465,15 @@ public void test_getItemHeight() { public void test_getItemI() { String[] items = { "item0", "item1", "item2", "item3" }; - String[] empty = { - }; list.setItems(items); - String item = null; try { - item = list.getItem(5); + list.getItem(5); fail("No exception thrown"); } catch (IllegalArgumentException e) { } try { - item = list.getItem(-1); + list.getItem(-1); fail("No exception thrown for index < 0"); } catch (IllegalArgumentException e) { } @@ -493,13 +484,13 @@ public void test_getItemI() { setSingleList(); list.setItems(items); try { - item = list.getItem(5); + list.getItem(5); fail("No exception thrown"); } catch (IllegalArgumentException e) { } try { - item = list.getItem(-1); + list.getItem(-1); fail("No exception thrown for index < 0"); } catch (IllegalArgumentException e) { } @@ -734,9 +725,8 @@ public void test_indexOfLjava_lang_String() { assertEquals(list.indexOf("text3"), 2); assertEquals(list.indexOf("text4"), -1); - int ind; try { - ind = list.indexOf(null); + list.indexOf(null); fail("No exception thrown for item == null"); } catch (IllegalArgumentException e) { } @@ -760,7 +750,7 @@ public void test_indexOfLjava_lang_String() { try { - ind = list.indexOf(null); + list.indexOf(null); fail("No exception thrown"); } catch (IllegalArgumentException e) { } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java index 18fc1a14f0..1fcb3d1b74 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Menu.java @@ -44,7 +44,7 @@ protected void tearDown() { public void test_ConstructorLorg_eclipse_swt_widgets_Control() { Composite comp = new Composite(shell, SWT.NULL); - Menu testMenu = new Menu(comp); + new Menu(comp); comp.dispose(); } @@ -62,8 +62,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_DecorationsI() { } public void test_ConstructorLorg_eclipse_swt_widgets_Menu() { - Menu newMenu; - newMenu = new Menu(menu); + new Menu(menu); } public void test_ConstructorLorg_eclipse_swt_widgets_MenuItem() { @@ -85,7 +84,7 @@ public void test_addHelpListenerLorg_eclipse_swt_events_HelpListener() { HelpListener listener = new HelpListener() { public void helpRequested(HelpEvent e) { listenerCalled = true; - }; + } }; try { @@ -115,10 +114,10 @@ public void test_addMenuListenerLorg_eclipse_swt_events_MenuListener() { MenuListener menuListener = new MenuListener() { public void menuShown(MenuEvent e) { listenerCalled = true; - }; + } public void menuHidden(MenuEvent e) { listenerCalled = true; - }; + } }; try { @@ -157,10 +156,9 @@ public void test_getEnabled() { public void test_getItemCount() { int number = 10; - MenuItem ti; for (int i = 0; i<number ; i++){ assertEquals(menu.getItemCount(), i); - ti = new MenuItem(menu, 0); + new MenuItem(menu, 0); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java index 380b56ef72..a029b6f79d 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MenuItem.java @@ -83,7 +83,7 @@ public void test_addArmListenerLorg_eclipse_swt_events_ArmListener() { ArmListener listener = new ArmListener() { public void widgetArmed(ArmEvent e) { listenerCalled = true; - }; + } }; try { @@ -112,7 +112,7 @@ public void test_addHelpListenerLorg_eclipse_swt_events_HelpListener() { HelpListener listener = new HelpListener() { public void helpRequested(HelpEvent e) { listenerCalled = true; - }; + } }; try { @@ -141,9 +141,9 @@ public void test_addSelectionListenerLorg_eclipse_swt_events_SelectionListener() SelectionListener listener = new SelectionListener() { public void widgetSelected(SelectionEvent e) { listenerCalled = true; - }; + } public void widgetDefaultSelected(SelectionEvent e) { - }; + } }; try { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java index 2a7306777f..1cb1e22317 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_MessageBox.java @@ -52,7 +52,7 @@ protected void tearDown() { * </ul> */ public void test_ConstructorLorg_eclipse_swt_widgets_Shell(){ - MessageBox mb = new MessageBox(shell); + new MessageBox(shell); try { new MessageBox(null); fail("No exception thrown for parent == null"); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java index 8ff51a4ac0..b20d86590f 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Sash.java @@ -108,9 +108,9 @@ Sash sash; private void createSash() { tearDown(); super.setUp(); - Button b1 = new Button(shell, SWT.PUSH); + new Button(shell, SWT.PUSH); Sash sash = new Sash(shell, SWT.VERTICAL); - Button b2 = new Button(shell, SWT.PUSH); + new Button(shell, SWT.PUSH); setWidget(sash); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java index 93eb2e7625..6ee47cc0c3 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Scrollable.java @@ -50,11 +50,11 @@ public void test_getClientArea() { } public void test_getHorizontalBar() { - ScrollBar hbar = scrollable.getHorizontalBar(); + scrollable.getHorizontalBar(); } public void test_getVerticalBar() { - ScrollBar vbar = scrollable.getVerticalBar(); + scrollable.getVerticalBar(); } public static Test suite() { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java index e0418ec61c..ea2124cd35 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TabFolder.java @@ -42,9 +42,8 @@ protected void tearDown() { } public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { - TabFolder newTabFolder; try { - newTabFolder = new TabFolder(null, 0); + new TabFolder(null, 0); fail("No exception thrown for parent == null"); } catch (IllegalArgumentException e) { @@ -69,10 +68,9 @@ public void test_getClientArea() { public void test_getItemCount() { int number = 10; - TabItem ti; for (int i = 0; i<number ; i++){ assertTrue(":a:" + i, tabFolder.getItemCount()==i); - ti = new TabItem(tabFolder, 0); + new TabItem(tabFolder, 0); } } @@ -224,9 +222,8 @@ public void test_setSelection$Lorg_eclipse_swt_widgets_TabItem() { public void test_setSelectionI() { int number = 10; - TabItem ti; for (int i = 0; i<number ; i++){ - ti = new TabItem(tabFolder, 0); + new TabItem(tabFolder, 0); } for (int i = 0; i<number ; i++){ tabFolder.setSelection(i); @@ -237,7 +234,7 @@ public void test_setSelectionI() { makeCleanEnvironment(); for (int i = 0; i<number ; i++){ - ti = new TabItem(tabFolder, 0); + new TabItem(tabFolder, 0); assertEquals("i=" + i, 0, tabFolder.getSelectionIndex()); } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java index 1567e25f04..f982ae85f5 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Table.java @@ -325,7 +325,7 @@ public void test_getItemCount() { int[] cases = {0, 10, 100}; for (int j = 0; j < cases.length; j++) { for (int i = 0; i < cases[j]; i++) { - TableItem ti = new TableItem(table, 0); + new TableItem(table, 0); } assertEquals("j="+ j, cases[j], table.getItemCount()); table.removeAll(); @@ -335,7 +335,7 @@ public void test_getItemCount() { makeCleanEnvironment(true); for (int j = 0; j < cases.length; j++) { for (int i = 0; i < cases[j]; i++) { - TableItem ti = new TableItem(table, 0); + new TableItem(table, 0); } assertEquals("j="+ j, cases[j], table.getItemCount()); table.removeAll(); @@ -401,7 +401,7 @@ public void test_getItems() { int[] cases = {0, 10, 100}; for (int j = 0; j < cases.length; j++) { for (int i = 0; i < cases[j]; i++) { - TableItem ti = new TableItem(table, 0); + new TableItem(table, 0); } assertEquals("j=" + j, cases[j], table.getItems().length); table.removeAll(); @@ -424,7 +424,7 @@ public void test_getItems() { for (int j = 0; j < cases.length; j++) { for (int i = 0; i < cases[j]; i++) { - TableItem ti = new TableItem(table, 0); + new TableItem(table, 0); } assertEquals("j=" + j, cases[j], table.getItems().length); table.removeAll(); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java index 35b2ecf7b6..d5fe86b34c 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TableItem.java @@ -233,7 +233,7 @@ public void test_getBoundsI() { makeCleanEnvironment(); tableItem.setText("hello"); - TableColumn column = new TableColumn(table, SWT.RIGHT); + new TableColumn(table, SWT.RIGHT); bounds = tableItem.getBounds(0); assertTrue(":3s:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0); @@ -318,7 +318,7 @@ public void test_getBoundsI() { tableItem2 = new TableItem(table2, SWT.NONE); tableItem2.setText("hello"); - column = new TableColumn(table2, SWT.RIGHT); + new TableColumn(table2, SWT.RIGHT); bounds = tableItem2.getBounds(0); assertTrue(":4s:", bounds.x > 0 && bounds.height > 0 && bounds.width == 0); } @@ -671,7 +671,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() { int columnCount = table.getColumnCount(); if (columnCount < texts.length) { for (int i = columnCount; i < texts.length; i++){ - TableColumn column = new TableColumn(table, SWT.NONE); + new TableColumn(table, SWT.NONE); } } TableColumn[] columns = table.getColumns(); @@ -703,8 +703,8 @@ public void test_setImageILorg_eclipse_swt_graphics_Image() { assertEquals(null, tableItem.getImage(10)); // with columns - TableColumn column1 = new TableColumn(table, SWT.LEFT); - TableColumn column2 = new TableColumn(table, SWT.LEFT); + new TableColumn(table, SWT.LEFT); + new TableColumn(table, SWT.LEFT); // index beyond range - no error tableItem.setImage(10, images[0]); @@ -778,7 +778,7 @@ public void test_setText$Ljava_lang_String() { int columnCount = table.getColumnCount(); if (columnCount < images.length) { for (int i = columnCount; i < images.length; i++){ - TableColumn column = new TableColumn(table, SWT.NONE); + new TableColumn(table, SWT.NONE); } } TableColumn[] columns = table.getColumns(); @@ -819,7 +819,7 @@ public void test_setTextILjava_lang_String(){ int columnCount = table.getColumnCount(); if (columnCount < images.length) { for (int i = columnCount; i < images.length; i++){ - TableColumn column = new TableColumn(table, SWT.NONE); + new TableColumn(table, SWT.NONE); } } TableColumn[] columns = table.getColumns(); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java index 2d26268ef2..2271876960 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_ToolBar.java @@ -61,10 +61,9 @@ public void test_computeTrimIIII() { public void test_getItemCount() { int number = 10; - ToolItem ti; for (int i = 0; i<number ; i++){ assertTrue(":a:" + i, toolBar.getItemCount()==i); - ti = new ToolItem(toolBar, 0); + new ToolItem(toolBar, 0); } } diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java index b555ca2828..07a6f81835 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Tree.java @@ -57,7 +57,7 @@ public void test_ConstructorLorg_eclipse_swt_widgets_CompositeI() { cases = new int[]{0, 10, 100}; for (int j = 0; j < cases.length; j++) { for (int i = 0; i < cases[j]; i++) { - TreeItem ti = new TreeItem(tree, 0); + new TreeItem(tree, 0); } assertEquals(cases[j], tree.getItemCount()); tree.removeAll(); @@ -390,14 +390,14 @@ public void test_setItemCountI() { tree.removeAll(); assertEquals(0, tree.getItemCount()); for (int i=0; i<8; i++) { - TreeItem item = new TreeItem(tree, SWT.NULL); + new TreeItem(tree, SWT.NULL); assertEquals(i+1, tree.getItemCount()); } assertEquals(8, tree.getItemCount()); assertEquals(4, tree.indexOf(tree.getItems()[4])); tree.getItem(1).dispose(); assertEquals(7, tree.getItemCount()); - TreeItem item = new TreeItem (tree, SWT.NULL, 0); + new TreeItem (tree, SWT.NULL, 0); assertEquals(1, tree.indexOf(tree.getItems()[1])); assertEquals(8, tree.getItemCount()); tree.removeAll(); @@ -604,17 +604,17 @@ public void test_setSelection$Lorg_eclipse_swt_widgets_TreeItem() { public void test_setTopItemLorg_eclipse_swt_widgets_TreeItem() { tree.removeAll(); for (int i = 0; i < 10; i++) { - TreeItem item = new TreeItem(tree, 0); + new TreeItem(tree, 0); } TreeItem top = new TreeItem(tree, 0); for (int i = 0; i < 10; i++) { - TreeItem item = new TreeItem(tree, 0); + new TreeItem(tree, 0); } tree.setSize(50,50); shell.open(); tree.setTopItem(top); for (int i = 0; i < 10; i++) { - TreeItem item = new TreeItem(tree, 0); + new TreeItem(tree, 0); } TreeItem top2 = tree.getTopItem(); shell.setVisible(false); @@ -663,7 +663,7 @@ public void test_showItemLorg_eclipse_swt_widgets_TreeItem() { TreeItem[] items2 = new TreeItem[number]; for (int i = 0; i < number; i++) { items2[i] = new TreeItem(tree2, 0); - }; + } for(int i=0; i<number; i++) tree.showItem(items2[i]); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java index 539b60f542..bce32a7963 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_TreeItem.java @@ -399,7 +399,7 @@ void test_getBoundsIC() { makeCleanEnvironment(); treeItem.setText(string1); - TreeColumn column = new TreeColumn(tree, SWT.RIGHT); + new TreeColumn(tree, SWT.RIGHT); bounds = treeItem.getBounds(0); assertTrue(":3x:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width == 0); } @@ -516,7 +516,7 @@ void test_getBoundsID() { treeItem2 = new TreeItem(tree2, SWT.NONE); treeItem2.setText(string1); - TreeColumn column = new TreeColumn(tree2, SWT.RIGHT); + new TreeColumn(tree2, SWT.RIGHT); bounds = treeItem2.getBounds(0); assertTrue(":4x:", bounds.x > 0 && bounds.height > stringExtent1.y && bounds.width == 0); } @@ -724,8 +724,8 @@ public void test_setBackgroundILorg_eclipse_swt_graphics_Color() { assertEquals(treeItem.getBackground(), treeItem.getBackground(10)); // with columns - TreeColumn column1 = new TreeColumn(tree, SWT.LEFT); - TreeColumn column2 = new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); // index beyond range - no error treeItem.setBackground(10, red); @@ -842,8 +842,8 @@ public void test_setFontILorg_eclipse_swt_graphics_Font() { assertTrue(treeItem.getFont().equals(treeItem.getFont(10))); // with columns - TreeColumn column1 = new TreeColumn(tree, SWT.LEFT); - TreeColumn column2 = new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); // index beyond range - no error treeItem.setFont(10, font); @@ -893,8 +893,8 @@ public void test_setForegroundILorg_eclipse_swt_graphics_Color() { assertEquals(treeItem.getForeground(), treeItem.getForeground(10)); // with columns - TreeColumn column1 = new TreeColumn(tree, SWT.LEFT); - TreeColumn column2 = new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); // index beyond range - no error treeItem.setForeground(10, red); @@ -965,7 +965,7 @@ public void test_setImage$Lorg_eclipse_swt_graphics_Image() { int columnCount = tree.getColumnCount(); if (columnCount < texts.length) { for (int i = columnCount; i < texts.length; i++){ - TreeColumn column = new TreeColumn(tree, SWT.NONE); + new TreeColumn(tree, SWT.NONE); } } TreeColumn[] columns = tree.getColumns(); @@ -997,8 +997,8 @@ public void test_setImageILorg_eclipse_swt_graphics_Image() { assertEquals(null, treeItem.getImage(10)); // with columns - TreeColumn column1 = new TreeColumn(tree, SWT.LEFT); - TreeColumn column2 = new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); + new TreeColumn(tree, SWT.LEFT); // index beyond range - no error treeItem.setImage(10, images[0]); @@ -1059,7 +1059,7 @@ public void test_setText$Ljava_lang_String() { int columnCount = tree.getColumnCount(); if (columnCount < images.length) { for (int i = columnCount; i < images.length; i++){ - TreeColumn column = new TreeColumn(tree, SWT.NONE); + new TreeColumn(tree, SWT.NONE); } } TreeColumn[] columns = tree.getColumns(); @@ -1100,7 +1100,7 @@ public void test_setTextILjava_lang_String(){ int columnCount = tree.getColumnCount(); if (columnCount < images.length) { for (int i = columnCount; i < images.length; i++){ - TreeColumn column = new TreeColumn(tree, SWT.NONE); + new TreeColumn(tree, SWT.NONE); } } TreeColumn[] columns = tree.getColumns(); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser1.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser1.java index ddf0c42d00..14466b780e 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser1.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser1.java @@ -95,7 +95,6 @@ public class Browser1 { if (verbose) System.out.println("URL Loading Filtering - args: "+url+" Expected Event Sequence: Location.changing cancel true > no Location.changed, no Progress.completed"); locationChanging = locationChanged = progressCompleted = false; passed = false; - final String[] locationCancelled = new String[1]; final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); @@ -113,7 +112,7 @@ public class Browser1 { new Thread() { public void run() { if (verbose) System.out.println("timer start"); - try { sleep(2000); } catch (Exception e) {}; + try { sleep(2000); } catch (Exception e) {} if (!display.isDisposed()) display.asyncExec(new Runnable(){ public void run() { @@ -122,7 +121,7 @@ public class Browser1 { } }); if (verbose) System.out.println("timer over"); - }; + } }.start(); } public void changed(LocationEvent event) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser2.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser2.java index b834c56f6c..15f65aaacc 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser2.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser2.java @@ -61,7 +61,7 @@ public class Browser2 { new Thread() { public void run() { if (verbose) System.out.println("timer start"); - try { sleep(2000); } catch (Exception e) {}; + try { sleep(2000); } catch (Exception e) {} if (!display.isDisposed()) display.asyncExec(new Runnable(){ public void run() { @@ -70,7 +70,7 @@ public class Browser2 { } }); if (verbose) System.out.println("timer over"); - }; + } }.start(); } } @@ -89,7 +89,6 @@ public class Browser2 { if (verbose) System.out.println("setText URL Loading Filtering - args: "+html+" Expected Event Sequence: Location.changing cancel true > no Location.changed, no Progress.completed"); locationChanging = locationChanged = progressCompleted = false; passed = false; - final String[] locationCancelled = new String[1]; final Display display = new Display(); final Shell shell = new Shell(display); shell.setLayout(new FillLayout()); @@ -115,7 +114,7 @@ public class Browser2 { new Thread() { public void run() { if (verbose) System.out.println("timer start"); - try { sleep(2000); } catch (Exception e) {}; + try { sleep(2000); } catch (Exception e) {} if (!display.isDisposed()) display.asyncExec(new Runnable(){ public void run() { @@ -124,7 +123,7 @@ public class Browser2 { } }); if (verbose) System.out.println("timer over"); - }; + } }.start(); } public void changed(LocationEvent event) { diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser3.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser3.java index 6e399b4f51..18a3ee0fc8 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser3.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser3.java @@ -95,7 +95,7 @@ public class Browser3 { new Thread() { public void run() { if (verbose) System.out.println("timer start"); - try { sleep(2000); } catch (Exception e) {}; + try { sleep(2000); } catch (Exception e) {} passed = true; if (!display.isDisposed()) display.asyncExec(new Runnable(){ @@ -105,7 +105,7 @@ public class Browser3 { } }); if (verbose) System.out.println("timer over"); - }; + } }.start(); } }); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser4.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser4.java index b5480cab59..7b2433fb04 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser4.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/browser/Browser4.java @@ -118,7 +118,7 @@ public class Browser4 { new Thread() { public void run() { if (verbose) System.out.println("timer start"); - try { sleep(2000); } catch (Exception e) {}; + try { sleep(2000); } catch (Exception e) {} passed = true; if (!display.isDisposed()) display.asyncExec(new Runnable(){ @@ -128,7 +128,7 @@ public class Browser4 { } }); if (verbose) System.out.println("timer over"); - }; + } }.start(); } }); diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java index d7e2568df7..8dcf8fc062 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/performance/Test_situational.java @@ -60,7 +60,7 @@ public void test_createComposites() { PerformanceMeter meter = createMeter("Create composites"); int samples; - Performance performance = Performance.getDefault(); + Performance.getDefault(); // Warm up. for(samples = 0; samples < 2; samples++) { @@ -68,11 +68,11 @@ public void test_createComposites() { for (int i = 0; i < 100; i++) { Composite c = new Composite(shell, SWT.NONE); for (int j = 0; j < 10; j++) { - Composite c2 = new Composite(c, SWT.NONE); + new Composite(c, SWT.NONE); } } shell.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } for(samples = 0; samples < 100; samples++) { @@ -81,12 +81,12 @@ public void test_createComposites() { for (int i = 0; i < 100; i++) { Composite c = new Composite(shell, SWT.NONE); for (int j = 0; j < 50; j++) { - Composite c2 = new Composite(c, SWT.NONE); + new Composite(c, SWT.NONE); } } meter.stop(); shell.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -105,24 +105,24 @@ public void test_createWidgets() { for (int i = 0; i < 50; i++) { Composite c = new Composite(shell, SWT.NONE); for (int j = 0; j < 10; j++) { - Button b = new Button(c, SWT.PUSH); - Label label = new Label(c, SWT.NONE); - Scale scale = new Scale(c, SWT.NONE); - ProgressBar bar = new ProgressBar(c, SWT.NONE); - List list = new List(c, SWT.NONE); - Text text = new Text(c, SWT.SINGLE); - Text multitext = new Text(c, SWT.MULTI); - Slider slider = new Slider(c, SWT.NONE); - Tree tree = new Tree(c, SWT.NONE); - Table table = new Table(c, SWT.NONE); - TabFolder tabFolder = new TabFolder(c, SWT.NONE); - Group g = new Group(c, SWT.BORDER); - Composite c2 = new Composite(c, SWT.NONE); + new Button(c, SWT.PUSH); + new Label(c, SWT.NONE); + new Scale(c, SWT.NONE); + new ProgressBar(c, SWT.NONE); + new List(c, SWT.NONE); + new Text(c, SWT.SINGLE); + new Text(c, SWT.MULTI); + new Slider(c, SWT.NONE); + new Tree(c, SWT.NONE); + new Table(c, SWT.NONE); + new TabFolder(c, SWT.NONE); + new Group(c, SWT.BORDER); + new Composite(c, SWT.NONE); } } meter.stop(); shell.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -194,9 +194,9 @@ public void test_layout() { changedLabel.setLayoutData(data); shell.open(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} try { Thread.sleep(2000); } catch (Exception e) {} - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} meter.start(); for(int numlayouts = 0; numlayouts < 20; numlayouts++) { shell.layout(true); @@ -206,7 +206,7 @@ public void test_layout() { } meter.stop(); shell.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -240,7 +240,7 @@ public void test_imageDrawing() { image.dispose(); color1.dispose(); color2.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -261,9 +261,9 @@ public void test_windowDrawing() { c.setLayoutData(data); shell.pack(); shell.open(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} try { Thread.sleep(2000); } catch (Exception e) {} - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} Color color1 = new Color(display, 0xff, 0, 0xff); Color color2 = new Color(display, 0, 0xff, 0xff); int x1 = 0, y1 = height/2, x2 = width/2, y2 = 0; @@ -285,7 +285,7 @@ public void test_windowDrawing() { shell.dispose(); color1.dispose(); color2.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -306,9 +306,9 @@ public void test_stringDrawing() { c.setLayoutData(data); shell.pack(); shell.open(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} try { Thread.sleep(2000); } catch (Exception e) {} - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} Color color1 = new Color(display, 0xff, 0, 0xff); Color color2 = new Color(display, 0, 0xff, 0xff); Font font1 = new Font(display, "Helvetica", 20, SWT.NONE); @@ -333,7 +333,7 @@ public void test_stringDrawing() { color2.dispose(); font1.dispose(); font2.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } @@ -354,9 +354,9 @@ public void test_fastStringDrawing() { c.setLayoutData(data); shell.pack(); shell.open(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} try { Thread.sleep(2000); } catch (Exception e) {} - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} Color color1 = new Color(display, 0xff, 0, 0xff); Color color2 = new Color(display, 0, 0xff, 0xff); Font font1 = new Font(display, "Helvetica", 20, SWT.NONE); @@ -380,7 +380,7 @@ public void test_fastStringDrawing() { color2.dispose(); font1.dispose(); font2.dispose(); - while(display.readAndDispatch()); + while(display.readAndDispatch()){/*empty*/} } disposeMeter(meter); } |