]> source.dussan.org Git - vaadin-framework.git/commitdiff
Better error reporting for anonymous classes
authorArtur Signell <artur@vaadin.com>
Tue, 13 Mar 2012 08:22:36 +0000 (10:22 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 14 Mar 2012 14:00:29 +0000 (16:00 +0200)
tests/server-side/com/vaadin/tests/server/TestClassesSerializable.java

index c047565fccf0ca13e9cf3be378bd467bc069de85..486b1ba0c15ad583dd064dbfaf6b454bc9fdb183 100644 (file)
@@ -98,9 +98,19 @@ public class TestClassesSerializable extends TestCase {
         if (!nonSerializableClasses.isEmpty()) {
             String nonSerializableString = "";
             Iterator<Class<?>> it = nonSerializableClasses.iterator();
-            nonSerializableString = it.next().getName();
             while (it.hasNext()) {
-                nonSerializableString += ", " + it.next().getName();
+                Class c = it.next();
+                nonSerializableString += ", " + c.getName();
+                if (c.isAnonymousClass()) {
+                    nonSerializableString += "(super: ";
+                    nonSerializableString += c.getSuperclass().getName();
+                    nonSerializableString += ", interfaces: ";
+                    for (Class i : c.getInterfaces()) {
+                        nonSerializableString += i.getName();
+                        nonSerializableString += ",";
+                    }
+                    nonSerializableString += ")";
+                }
             }
             fail("Serializable not implemented by the following classes and interfaces: "
                     + nonSerializableString);