From fd871b7bc451d89fe1c27535d65c1d182e9da7a5 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 13 Mar 2012 10:22:36 +0200 Subject: [PATCH] Better error reporting for anonymous classes --- .../tests/server/TestClassesSerializable.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/server-side/com/vaadin/tests/server/TestClassesSerializable.java b/tests/server-side/com/vaadin/tests/server/TestClassesSerializable.java index c047565fcc..486b1ba0c1 100644 --- a/tests/server-side/com/vaadin/tests/server/TestClassesSerializable.java +++ b/tests/server-side/com/vaadin/tests/server/TestClassesSerializable.java @@ -98,9 +98,19 @@ public class TestClassesSerializable extends TestCase { if (!nonSerializableClasses.isEmpty()) { String nonSerializableString = ""; Iterator> 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); -- 2.39.5