summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-13 11:28:20 (EST)
committerCarsten Drossel2009-01-13 11:28:20 (EST)
commita2efd010caee97ffb44576972b75dbd28ba83a66 (patch)
tree7a585c959b7b702e37bb9233ac0216f5143f8403
parent739eaad35a985c1207c41ccccfd6d63ec809d658 (diff)
downloadorg.eclipse.riena-a2efd010caee97ffb44576972b75dbd28ba83a66.zip
org.eclipse.riena-a2efd010caee97ffb44576972b75dbd28ba83a66.tar.gz
org.eclipse.riena-a2efd010caee97ffb44576972b75dbd28ba83a66.tar.bz2
fixed findbugs warnings
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java14
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/GenericObjectCacheTest.java18
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/LRUCacheTest.java14
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java1
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/LazyThing.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractItemPropertiesTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTWidgetRidgetTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemPropertiesTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuPropertiesTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java6
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ShellRidgetTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToolItemPropertiesTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java7
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/ShellBorderRendererTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleGroupViewTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubApplicationViewTest.java4
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleViewTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/tests/nanohttp/TestServer.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/EmbeddedTitleBarTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/FlasherSupportForRendererTest.java2
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/AbstractTitleBarRendererTest.java8
-rw-r--r--org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/DialogTitleBarRendererTest.java8
37 files changed, 100 insertions, 58 deletions
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
index f17452d..93e6ee8 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/communication/core/attachment/AttachmentClientITest.java
@@ -239,11 +239,15 @@ public final class AttachmentClientITest extends RienaTestCase {
*/
public void testSendAndDeleteFile() throws IOException {
File file = new File("/testattachments.txt");
- OutputStream out = new FileOutputStream(file);
- for (int i = 0; i < 200; i++) {
- out.write(i);
+ OutputStream out = null;
+ try {
+ out = new FileOutputStream(file);
+ for (int i = 0; i < 200; i++) {
+ out.write(i);
+ }
+ } finally {
+ out.close();
}
- out.close();
// attachService.sendFile(new Attachment(file));
boolean deleted = file.delete();
@@ -296,7 +300,7 @@ public final class AttachmentClientITest extends RienaTestCase {
}
inputStream.close();
assertTrue(file.exists());
- file.delete();
+ assertTrue(file.delete());
assertFalse(file.exists());
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/GenericObjectCacheTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/GenericObjectCacheTest.java
index e3b502c..320f6f7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/GenericObjectCacheTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/GenericObjectCacheTest.java
@@ -39,9 +39,9 @@ public class GenericObjectCacheTest extends RienaTestCase {
* test basic instantiation
*/
public void testInstantiate() {
- genericCache.put("test", new Integer(2));
+ genericCache.put("test", Integer.valueOf(2));
assertNotNull("did not find put object in cache", genericCache.get("test"));
- assertTrue("object in cache has incorrect value", genericCache.get("test").equals(new Integer(2)));
+ assertTrue("object in cache has incorrect value", genericCache.get("test").equals(Integer.valueOf(2)));
genericCache.clear();
}
@@ -49,7 +49,7 @@ public class GenericObjectCacheTest extends RienaTestCase {
* @throws Exception
*/
public void testTimeout() throws Exception {
- genericCache.put("test", new Integer(3));
+ genericCache.put("test", Integer.valueOf(3));
genericCache.setTimeout(300);
Thread.sleep(100);
assertNotNull("did not find put object in cache", genericCache.get("test"));
@@ -64,11 +64,11 @@ public class GenericObjectCacheTest extends RienaTestCase {
public void testPutMultiple() throws Exception {
IGenericObjectCache<Integer, String> genericCacheLocal = new GenericObjectCache<Integer, String>();
for (int i = 0; i < 30; i++) {
- genericCacheLocal.put(new Integer(i), "testvalue");
+ genericCacheLocal.put(Integer.valueOf(i), "testvalue");
}
for (int i = 0; i < 30; i++) {
- assertNotNull("object not found in cache", genericCacheLocal.get(new Integer(i)));
+ assertNotNull("object not found in cache", genericCacheLocal.get(Integer.valueOf(i)));
}
genericCacheLocal.clear();
}
@@ -135,7 +135,7 @@ public class GenericObjectCacheTest extends RienaTestCase {
int x = 1;
for (int i = 0; i < 5000; i++) {
- genericCache3.put(new Integer(i).toString(), new StringBuffer(20000));
+ genericCache3.put(Integer.valueOf(i).toString(), new StringBuffer(20000));
// System.out.print(".");
x++;
if (x > 100) {
@@ -198,10 +198,10 @@ public class GenericObjectCacheTest extends RienaTestCase {
try {
for (int i = 0; i < runs; i++) {
for (int k = lowRange; k <= highRange; k++) {
- genericCache2.put(new Integer(k), this);
+ genericCache2.put(Integer.valueOf(k), this);
}
for (int k = lowRange; k <= highRange; k++) {
- assertNotNull("object not found in cache", genericCache2.get(new Integer(k)));
+ assertNotNull("object not found in cache", genericCache2.get(Integer.valueOf(k)));
}
}
} catch (Exception e) {
@@ -211,7 +211,7 @@ public class GenericObjectCacheTest extends RienaTestCase {
}
}
- class Status {
+ static class Status {
private Exception lastException;
/**
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/LRUCacheTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/LRUCacheTest.java
index 84c5a0b..d7ffde0 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/LRUCacheTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/cache/LRUCacheTest.java
@@ -38,9 +38,9 @@ public class LRUCacheTest extends RienaTestCase {
* test basic instantiation
*/
public void testInstantiate() {
- genericCache.put("test", new Integer(2));
+ genericCache.put("test", Integer.valueOf(2));
assertNotNull("did not find put object in cache", genericCache.get("test"));
- assertTrue("object in cache has incorrect value", genericCache.get("test").equals(new Integer(2)));
+ assertTrue("object in cache has incorrect value", genericCache.get("test").equals(Integer.valueOf(2)));
genericCache.clear();
}
@@ -48,7 +48,7 @@ public class LRUCacheTest extends RienaTestCase {
* @throws Exception
*/
public void testTimeout() throws Exception {
- genericCache.put("test", new Integer(3));
+ genericCache.put("test", Integer.valueOf(3));
genericCache.setTimeout(500);
Thread.sleep(100);
assertNotNull("did not find put object in cache", genericCache.get("test"));
@@ -63,11 +63,11 @@ public class LRUCacheTest extends RienaTestCase {
public void testPutMultiple() throws Exception {
genericCache3 = new LRUCache<Integer, String>();
for (int i = 0; i < 30; i++) {
- genericCache3.put(new Integer(i), "testvalue");
+ genericCache3.put(Integer.valueOf(i), "testvalue");
}
for (int i = 0; i < 30; i++) {
- assertNotNull("object not found in cache", genericCache3.get(new Integer(i)));
+ assertNotNull("object not found in cache", genericCache3.get(Integer.valueOf(i)));
}
genericCache.clear();
}
@@ -164,10 +164,10 @@ public class LRUCacheTest extends RienaTestCase {
public void run() {
for (int i = 0; i < runs; i++) {
for (int k = lowRange; k <= highRange; k++) {
- genericCache2.put(new Integer(k), this);
+ genericCache2.put(Integer.valueOf(k), this);
}
for (int k = lowRange; k <= highRange; k++) {
- assertNotNull("object not found in cache", genericCache2.get(new Integer(k)));
+ assertNotNull("object not found in cache", genericCache2.get(Integer.valueOf(k)));
}
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
index 2e39929..9ba2796 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/exception/ExceptionHandlerManagerTest.java
@@ -32,6 +32,7 @@ public class ExceptionHandlerManagerTest extends RienaTestCase {
public void tearDown() throws Exception {
manager = null;
+ super.tearDown();
}
public void testAddHandler() {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/LazyThing.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/LazyThing.java
index 7825e10..768cca7 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/LazyThing.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/extension/LazyThing.java
@@ -15,7 +15,7 @@ package org.eclipse.riena.core.extension;
*/
public class LazyThing implements ILazyThing {
- public static boolean instantiated;
+ static boolean instantiated;
public LazyThing() {
instantiated = true;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
index 8a9ac85..0bc20cb 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/marker/AbstractMarkerTest.java
@@ -70,7 +70,7 @@ public class AbstractMarkerTest extends RienaTestCase {
marker.reset();
marker.setAttribute("lastname", 12);
- assertEquals(new Integer(12), marker.getAttribute("lastname"));
+ assertEquals(Integer.valueOf(12), marker.getAttribute("lastname"));
assertTrue(marker.isChangeFired());
marker.reset();
@@ -101,7 +101,7 @@ public class AbstractMarkerTest extends RienaTestCase {
}
- private class DummyMarker extends AbstractMarker implements IMarkerAttributeChangeListener {
+ private static class DummyMarker extends AbstractMarker implements IMarkerAttributeChangeListener {
private boolean changeFired;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
index b27436b..27399e4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/IterTest.java
@@ -14,6 +14,7 @@ import java.io.IOException;
import java.net.URL;
import java.util.Enumeration;
import java.util.Iterator;
+import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.Vector;
@@ -171,6 +172,9 @@ public class IterTest extends RienaTestCase {
}
public Object next() {
+ if (i == strings.length) {
+ throw new NoSuchElementException();
+ }
return strings[i++];
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
index 9b67082..520228d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/core/util/ReflectionUtilsTest.java
@@ -146,7 +146,7 @@ public class ReflectionUtilsTest extends RienaTestCase {
public void testSetGetHiddenInstance() {
String s = "Hallo";
- ReflectionUtils.setHidden(s, "count", new Integer(2));
+ ReflectionUtils.setHidden(s, "count", Integer.valueOf(2));
Integer count = (Integer) ReflectionUtils.getHidden(s, "count");
assertEquals(2, count.intValue());
assertEquals(s, "Ha");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
index 9bc9f8b..e7e0e55 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/navigation/ui/filter/AbstractUIFilterRuleNavigationMarkerTest.java
@@ -79,7 +79,7 @@ public class AbstractUIFilterRuleNavigationMarkerTest extends TestCase {
}
- private class MyUIFilterRuleNavigationMarker extends AbstractUIFilterRuleNavigationMarker {
+ private static class MyUIFilterRuleNavigationMarker extends AbstractUIFilterRuleNavigationMarker {
public MyUIFilterRuleNavigationMarker(String nodeId, IMarker marker) {
super(nodeId, marker);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractItemPropertiesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractItemPropertiesTest.java
index 8d04c7d..3a3553e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractItemPropertiesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractItemPropertiesTest.java
@@ -104,7 +104,7 @@ public class AbstractItemPropertiesTest extends TestCase {
}
- private class ItemProperties extends AbstractItemProperties {
+ private static class ItemProperties extends AbstractItemProperties {
public ItemProperties(AbstractItemRidget ridget) {
super(ridget);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
index ef1872b..18374f0 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTRidgetTest.java
@@ -55,6 +55,8 @@ public abstract class AbstractSWTRidgetTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
Display display = Display.getDefault();
Realm realm = SWTObservables.getRealm(display);
@@ -88,6 +90,8 @@ public abstract class AbstractSWTRidgetTest extends RienaTestCase {
otherControl = null;
shell.dispose();
shell = null;
+
+ super.tearDown();
}
// protected methods
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTWidgetRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTWidgetRidgetTest.java
index 36eb5d1..df85416 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTWidgetRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/AbstractSWTWidgetRidgetTest.java
@@ -35,7 +35,7 @@ public class AbstractSWTWidgetRidgetTest extends TestCase {
}
- private class MockRidget extends AbstractSWTWidgetRidget {
+ private static class MockRidget extends AbstractSWTWidgetRidget {
@Override
protected void bindUIControl() {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
index d9ba523..e621837 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ChoiceCompositeTest.java
@@ -31,6 +31,8 @@ public class ChoiceCompositeTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
Display display = Display.getDefault();
shell = new Shell(display);
@@ -45,6 +47,8 @@ public class ChoiceCompositeTest extends RienaTestCase {
protected void tearDown() throws Exception {
shell.dispose();
shell = null;
+
+ super.tearDown();
}
// testing methods
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
index 46db08f..2b75a45 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ComboRidgetTest.java
@@ -366,6 +366,10 @@ public class ComboRidgetTest extends AbstractSWTRidgetTest {
assertEquals("B", getRidget().getSelection());
}
+ /**
+ * Should be deleted when the deprecated method getSelectionObservable() is
+ * removed.
+ */
public void testGetSelectionObservable() {
ComboRidget ridget = getRidget();
StringManager aManager = new StringManager("A", "B", "C", "D", "E");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
index f6567d5..d916812 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ListRidgetTest.java
@@ -12,6 +12,7 @@ package org.eclipse.riena.internal.ui.ridgets.swt;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.io.Serializable;
import java.util.Arrays;
import java.util.Comparator;
@@ -707,7 +708,8 @@ public class ListRidgetTest extends AbstractTableRidgetTest {
/**
* Compares two strings.
*/
- private static final class StringComparator implements Comparator<Object> {
+ @SuppressWarnings("serial")
+ private static final class StringComparator implements Comparator<Object>, Serializable {
public int compare(Object o1, Object o2) {
String s1 = (String) o1;
String s2 = (String) o2;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
index 7c0b02c..7f526d9 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MarkableRidgetTest.java
@@ -164,7 +164,6 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
ridget.addMarker(marker2);
verifyPropertyChangeEvents();
- newValue = ridget.getMarkers();
markers = ridget.getMarkers();
assertEquals(2, markers.size());
assertEquals(true, markers.contains(marker1));
@@ -206,7 +205,6 @@ public class MarkableRidgetTest extends AbstractSWTRidgetTest {
ridget.removeMarker(marker1);
verifyPropertyChangeEvents();
- newValue = ridget.getMarkers();
Collection<?> markers = ridget.getMarkers();
assertEquals(1, markers.size());
assertEquals(true, markers.contains(marker2));
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemPropertiesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemPropertiesTest.java
index 1872632..38272c8 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemPropertiesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuItemPropertiesTest.java
@@ -105,7 +105,7 @@ public class MenuItemPropertiesTest extends TestCase {
* This class changes the visibility of some protected methods to public. So
* the methods can be tested better.
*/
- private class MyMenuItemProperties extends MenuItemProperties {
+ private static class MyMenuItemProperties extends MenuItemProperties {
public MyMenuItemProperties(MenuItemRidget ridget) {
super(ridget);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuPropertiesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuPropertiesTest.java
index 150a4a5..ca3805b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuPropertiesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuPropertiesTest.java
@@ -105,7 +105,7 @@ public class MenuPropertiesTest extends TestCase {
* This class changes the visibility of some protected methods to public. So
* the methods can be tested better.
*/
- private class MyMenuProperties extends MenuProperties {
+ private static class MyMenuProperties extends MenuProperties {
public MyMenuProperties(MenuRidget ridget) {
super(ridget);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
index e146715..88ae9e4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/MenuRidgetTest.java
@@ -31,12 +31,16 @@ public class MenuRidgetTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
shell = new Shell();
}
@Override
protected void tearDown() throws Exception {
SwtUtilities.disposeWidget(shell);
+
+ super.tearDown();
}
/**
@@ -116,7 +120,7 @@ public class MenuRidgetTest extends RienaTestCase {
* This class changes the visibility of some protected methods to public. So
* the methods can be tested better.
*/
- private class MyMenuRidget extends MenuRidget {
+ private static class MyMenuRidget extends MenuRidget {
@Override
public void checkUIControl(Object uiControl) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ShellRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ShellRidgetTest.java
index 0fa26e8..51dae7e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ShellRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ShellRidgetTest.java
@@ -38,7 +38,7 @@ public class ShellRidgetTest extends TestCase {
/**
* This class reduces the visibility of some protected method for testing.
*/
- private class MockShellRidget extends ShellRidget {
+ private static class MockShellRidget extends ShellRidget {
@Override
public boolean hasChanged(Object oldValue, Object newValue) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
index 13afff3..11213b3 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TableRidgetTest.java
@@ -11,6 +11,7 @@
package org.eclipse.riena.internal.ui.ridgets.swt;
import java.beans.PropertyChangeEvent;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -777,7 +778,8 @@ public class TableRidgetTest extends AbstractTableRidgetTest {
/**
* Compares two strings.
*/
- private static final class StringComparator implements Comparator<Object> {
+ @SuppressWarnings("serial")
+ private static final class StringComparator implements Comparator<Object>, Serializable {
public int compare(Object o1, Object o2) {
String s1 = (String) o1;
String s2 = (String) o2;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToolItemPropertiesTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToolItemPropertiesTest.java
index 66255b4..6757e8f 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToolItemPropertiesTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/ToolItemPropertiesTest.java
@@ -83,7 +83,7 @@ public class ToolItemPropertiesTest extends TestCase {
}
- private class MyToolItemProperties extends ToolItemProperties {
+ private static class MyToolItemProperties extends ToolItemProperties {
public MyToolItemProperties(ToolItemRidget ridget) {
super(ridget);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
index 526cdcf..e235044 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/internal/ui/ridgets/swt/TreeTableRidgetTest.java
@@ -11,6 +11,7 @@
package org.eclipse.riena.internal.ui.ridgets.swt;
import java.beans.PropertyChangeEvent;
+import java.io.Serializable;
import java.util.Comparator;
import org.eclipse.riena.tests.TreeUtils;
@@ -684,7 +685,8 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
/**
* Compares two strings.
*/
- private static final class StringComparator implements Comparator<Object> {
+ @SuppressWarnings("serial")
+ private static final class StringComparator implements Comparator<Object>, Serializable {
public int compare(Object o1, Object o2) {
String s1 = (String) o1;
String s2 = (String) o2;
@@ -695,7 +697,8 @@ public class TreeTableRidgetTest extends AbstractSWTRidgetTest {
/**
* Comparets two Integers.
*/
- private static final class IntegerComparator implements Comparator<Object> {
+ @SuppressWarnings("serial")
+ private static final class IntegerComparator implements Comparator<Object>, Serializable {
public int compare(Object o1, Object o2) {
Integer i1 = (Integer) o1;
Integer i2 = (Integer) o2;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java
index c1ad3a1..ce82a7b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/model/NavigationProcessorTest.java
@@ -567,7 +567,7 @@ public class NavigationProcessorTest extends RienaTestCase {
}
- private class TestSubModuleNode extends SubModuleNode {
+ private static class TestSubModuleNode extends SubModuleNode {
private boolean allowsActivate;
private boolean allowsDeactivate;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
index 9417702..9d6be65 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/controllers/NavigationNodeControllerTest.java
@@ -145,7 +145,7 @@ public class NavigationNodeControllerTest extends TestCase {
}
- private class MyNavigationNodeContoller extends SubModuleController {
+ private static class MyNavigationNodeContoller extends SubModuleController {
public MyNavigationNodeContoller(ISubModuleNode navigationNode) {
super(navigationNode);
@@ -158,7 +158,7 @@ public class NavigationNodeControllerTest extends TestCase {
}
- private class CompositeRidget extends AbstractCompositeRidget {
+ private static class CompositeRidget extends AbstractCompositeRidget {
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
index 89762b4..6d06d56 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/binding/DefaultSwtControlRidgetMapperTest.java
@@ -40,6 +40,8 @@ public class DefaultSwtControlRidgetMapperTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
mapper = new DefaultSwtControlRidgetMapper();
shell = new Shell();
}
@@ -49,6 +51,8 @@ public class DefaultSwtControlRidgetMapperTest extends RienaTestCase {
mapper = null;
shell.dispose();
shell = null;
+
+ super.tearDown();
}
/**
@@ -125,7 +129,7 @@ public class DefaultSwtControlRidgetMapperTest extends RienaTestCase {
condition2.setMatch(false);
try {
- ridgetClass = mapper.getRidgetClass(widget);
+ mapper.getRidgetClass(widget);
fail();
} catch (BindingException bex) {
ok();
@@ -148,7 +152,7 @@ public class DefaultSwtControlRidgetMapperTest extends RienaTestCase {
assertEquals(LabelRidget.class.getName(), ridget.getName());
try {
- ridget = mapper.getRidgetClass(MockComposite.class);
+ mapper.getRidgetClass(MockComposite.class);
fail("BindingException expected");
} catch (BindingException e) {
ok("BindingException expected");
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/ShellBorderRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/ShellBorderRendererTest.java
index 1cb850c..cd19830 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/ShellBorderRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/ShellBorderRendererTest.java
@@ -52,7 +52,7 @@ public class ShellBorderRendererTest extends TestCase {
/**
* Look and Feel where it is possible to change the setting for padding.
*/
- private class MyLnf extends RienaDefaultLnf {
+ private static class MyLnf extends RienaDefaultLnf {
public void removePadding() {
getSettingTable().remove(ILnfKeyConstants.TITLELESS_SHELL_PADDING);
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
index d813e06..0ba170e 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/lnf/renderer/SubModuleTreeItemMarkerRendererTest.java
@@ -267,7 +267,7 @@ public class SubModuleTreeItemMarkerRendererTest extends RienaTestCase {
}
- private class MockRenderer extends SubModuleTreeItemMarkerRenderer {
+ private static class MockRenderer extends SubModuleTreeItemMarkerRenderer {
private boolean paintMarkersCalled;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleGroupViewTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleGroupViewTest.java
index 2c048a9..3c3a698 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleGroupViewTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/ModuleGroupViewTest.java
@@ -81,7 +81,7 @@ public class ModuleGroupViewTest extends TestCase {
}
- private class MyLnF extends RienaDefaultLnf {
+ private static class MyLnF extends RienaDefaultLnf {
@Override
protected void initWidgetRendererDefaults() {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubApplicationViewTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubApplicationViewTest.java
index 2f4d734..ef0efbb 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubApplicationViewTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubApplicationViewTest.java
@@ -250,10 +250,10 @@ public class SubApplicationViewTest extends TestCase {
}
- private class MyContributionItem extends ContributionItem {
+ private static class MyContributionItem extends ContributionItem {
}
- private class Controller extends AbstractRidgetController {
+ private static class Controller extends AbstractRidgetController {
@Override
public void configureRidgets() {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleViewTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleViewTest.java
index c66631f..dae3f5b 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleViewTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleViewTest.java
@@ -61,7 +61,7 @@ public class SubModuleViewTest extends RienaTestCase {
public void testCreateController() throws Exception {
- assertTrue(subModuleNodeView.getController() instanceof SubModuleController);
+ assertNotNull(subModuleNodeView.getController());
assertEquals(node, subModuleNodeView.getController().getNavigationNode());
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/nanohttp/TestServer.java b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/nanohttp/TestServer.java
index c5998da..6b18f23 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/tests/nanohttp/TestServer.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/tests/nanohttp/TestServer.java
@@ -52,7 +52,7 @@ public class TestServer extends NanoHTTPD {
super.stop();
try {
new URL("http://localhost:" + port).openStream();
- } catch (Exception e) {
+ } catch (IOException e) {
// no action necessary
}
}
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
index 438a26e..3a89789 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/ridgets/validation/tests/ValidDecimalTest.java
@@ -490,7 +490,7 @@ public class ValidDecimalTest extends RienaTestCase {
}
- private class MyValidDecimal extends ValidDecimal {
+ private static class MyValidDecimal extends ValidDecimal {
@Override
public void setLocal(String[] localArgs) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/EmbeddedTitleBarTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/EmbeddedTitleBarTest.java
index 446e4a7..9eaa405 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/EmbeddedTitleBarTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/EmbeddedTitleBarTest.java
@@ -211,7 +211,7 @@ public class EmbeddedTitleBarTest extends TestCase {
* Mock of the class {@link EmbeddedTitleBar}. The mock notice if the method
* {@code redraw()} was called.
*/
- private class EmbeddedTitleBarMock extends EmbeddedTitleBar {
+ private static class EmbeddedTitleBarMock extends EmbeddedTitleBar {
private boolean redrawCalled;
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/FlasherSupportForRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/FlasherSupportForRendererTest.java
index a8b1db3..5bbfd4d 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/FlasherSupportForRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/FlasherSupportForRendererTest.java
@@ -56,7 +56,7 @@ public class FlasherSupportForRendererTest extends TestCase {
/**
* This renderer doesn't paint anything. It only collects the markers.
*/
- private class MockRenderer extends AbstractLnfRenderer {
+ private static class MockRenderer extends AbstractLnfRenderer {
@Override
public void paint(GC gc, Object value) {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/AbstractTitleBarRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/AbstractTitleBarRendererTest.java
index 78753cd..cd841f5 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/AbstractTitleBarRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/AbstractTitleBarRendererTest.java
@@ -39,6 +39,8 @@ public class AbstractTitleBarRendererTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
shell = new Shell();
gc = new GC(shell);
renderer = new TitleBarRenderer();
@@ -52,6 +54,8 @@ public class AbstractTitleBarRendererTest extends RienaTestCase {
gc = null;
renderer.dispose();
renderer = null;
+
+ super.tearDown();
}
/**
@@ -120,7 +124,7 @@ public class AbstractTitleBarRendererTest extends RienaTestCase {
* This class changes the visibility of some method for testing and
* implements the abstract methods.
*/
- private class TitleBarRenderer extends AbstractTitleBarRenderer {
+ private static class TitleBarRenderer extends AbstractTitleBarRenderer {
@Override
protected String[] getBtnHoverImageKeys() {
@@ -177,7 +181,7 @@ public class AbstractTitleBarRendererTest extends RienaTestCase {
* This Look and Feel adds additional images. This images are used for
* testing.
*/
- private class TitleBarLnf extends RienaDefaultLnf {
+ private static class TitleBarLnf extends RienaDefaultLnf {
@Override
protected void initImageDefaults() {
diff --git a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/DialogTitleBarRendererTest.java b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/DialogTitleBarRendererTest.java
index 4639075..3a6a6d4 100644
--- a/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/DialogTitleBarRendererTest.java
+++ b/org.eclipse.riena.tests/src/org/eclipse/riena/ui/swt/lnf/renderer/DialogTitleBarRendererTest.java
@@ -39,6 +39,8 @@ public class DialogTitleBarRendererTest extends RienaTestCase {
@Override
protected void setUp() throws Exception {
+ super.setUp();
+
renderer = new OpenDialogTitleBarRenderer();
shell = new Shell();
renderer.setShell(shell);
@@ -52,6 +54,8 @@ public class DialogTitleBarRendererTest extends RienaTestCase {
gc = null;
renderer.dispose();
renderer = null;
+
+ super.tearDown();
}
/**
@@ -109,7 +113,7 @@ public class DialogTitleBarRendererTest extends RienaTestCase {
* This look and feel sets the font of the dialog and some setting can be
* changed for testing.
*/
- private class DialogLnf extends RienaDefaultLnf {
+ private static class DialogLnf extends RienaDefaultLnf {
@Override
protected void initFontDefaults() {
@@ -127,7 +131,7 @@ public class DialogTitleBarRendererTest extends RienaTestCase {
* This class changes the visibility of some method for testing and
* implements the abstract methods.
*/
- private class OpenDialogTitleBarRenderer extends DialogTitleBarRenderer {
+ private static class OpenDialogTitleBarRenderer extends DialogTitleBarRenderer {
@Override
public Rectangle paintTitle(GC gc) {