]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added Serializable where missing and ignore classes which do not need Serializable
authorArtur Signell <artur@vaadin.com>
Mon, 27 May 2013 18:38:25 +0000 (21:38 +0300)
committerArtur Signell <artur@vaadin.com>
Tue, 28 May 2013 07:13:56 +0000 (10:13 +0300)
Change-Id: I197b2d62282ee957458e05d9cac357df47f05e85

server/src/com/vaadin/data/util/LegacyPropertyHelper.java
server/src/com/vaadin/server/communication/AtmospherePushConnection.java
server/src/com/vaadin/server/communication/PushConnection.java
server/tests/src/com/vaadin/tests/server/TestClassesSerializable.java
shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java
shared/src/com/vaadin/shared/ui/calendar/DateConstants.java
shared/src/com/vaadin/shared/util/SharedUtil.java

index 0276e35dbf6b814af26ffc8c599797ae24aa83e3..3eb22524f8ddfe4ec3ea570c9c046f9847c18e84 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.vaadin.data.util;
 
+import java.io.Serializable;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -32,7 +33,7 @@ import com.vaadin.server.VaadinService;
  * @deprecated This is only used internally for backwards compatibility
  */
 @Deprecated
-public class LegacyPropertyHelper {
+public class LegacyPropertyHelper implements Serializable {
 
     /**
      * Returns the property value converted to a String.
index 96507b55f16f2fa31f538d9fd8ff5fd70ddf6f1f..e967dd925af95746fafb94256b5916a43ffef633 100644 (file)
@@ -42,12 +42,12 @@ import com.vaadin.ui.UI;
  * @author Vaadin Ltd
  * @since 7.1
  */
-public class AtmospherePushConnection implements Serializable, PushConnection {
+public class AtmospherePushConnection implements PushConnection {
 
     /**
      * Represents a message that can arrive as multiple fragments.
      */
-    protected static class FragmentedMessage {
+    protected static class FragmentedMessage implements Serializable {
         private final StringBuilder message = new StringBuilder();
         private final int messageLength;
 
index 4e043f565f10a5da2647b3ea7fe95cc16ed7cea3..bb889984029a383374b4dbe9d8de99ecd3c9dc37 100644 (file)
@@ -16,6 +16,8 @@
 
 package com.vaadin.server.communication;
 
+import java.io.Serializable;
+
 import com.vaadin.ui.UI;
 
 /**
@@ -25,7 +27,7 @@ import com.vaadin.ui.UI;
  * @author Vaadin Ltd
  * @since 7.1
  */
-public interface PushConnection {
+public interface PushConnection extends Serializable {
 
     /**
      * Pushes pending state changes and client RPC calls to the client. It is
index 90cb6b9994cfc35288792e7453d4df07aa8f27cb..af6d9ed732a12ae5bfd334421fc33fd8b45ce9fe 100644 (file)
@@ -7,6 +7,7 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
@@ -33,6 +34,7 @@ public class TestClassesSerializable extends TestCase {
             "com\\.vaadin\\.launcher\\..*", //
             "com\\.vaadin\\.client\\..*", //
             "com\\.vaadin\\.server\\.widgetsetutils\\..*", //
+            "com\\.vaadin\\.server\\.themeutils\\..*", //
             "com\\.vaadin\\.tests\\..*", // exclude automated tests
             "com\\.vaadin\\.tools\\..*", //
             "com\\.vaadin\\.ui\\.themes\\..*", //
@@ -41,7 +43,13 @@ public class TestClassesSerializable extends TestCase {
             "com\\.vaadin\\.event\\.LayoutEvents", //
             "com\\.vaadin\\.event\\.MouseEvents", //
             "com\\.vaadin\\.server\\.VaadinPortlet", //
+            "com\\.vaadin\\.server\\.MockServletConfig", //
+            "com\\.vaadin\\.server\\.MockServletContext", //
             "com\\.vaadin\\.server\\.Constants", //
+            "com\\.vaadin\\.server\\.communication\\.FileUploadHandler\\$SimpleMultiPartInputStream", //
+            "com\\.vaadin\\.server\\.communication\\.PushRequestHandler.*",
+            "com\\.vaadin\\.server\\.communication\\.PushHandler.*", // PushHandler
+            // and its inner classes do not need to be serializable
             "com\\.vaadin\\.util\\.SerializerHelper", // fully static
             // class level filtering, also affecting nested classes and
             // interfaces
@@ -50,6 +58,7 @@ public class TestClassesSerializable extends TestCase {
             "com\\.vaadin\\.util\\.ReflectTools.*", //
             "com\\.vaadin\\.data\\.util\\.ReflectTools.*", //
             "com\\.vaadin\\.sass.*", //
+            "com\\.vaadin\\.testbench.*", //
             "com\\.vaadin\\.util\\.CurrentInstance\\$1", //
     };
 
@@ -88,6 +97,19 @@ public class TestClassesSerializable extends TestCase {
 
             // report non-serializable classes and interfaces
             if (!Serializable.class.isAssignableFrom(cls)) {
+                if (cls.getSuperclass() == Object.class
+                        && cls.getInterfaces().length == 1) {
+                    // Single interface implementors
+                    Class<?> iface = cls.getInterfaces()[0];
+
+                    if (iface == Runnable.class) {
+                        // Ignore Runnables used with access()
+                        continue;
+                    } else if (iface == Comparator.class) {
+                        // Ignore inline comparators
+                        continue;
+                    }
+                }
                 nonSerializableClasses.add(cls);
                 // TODO easier to read when testing
                 // System.err.println(cls);
index 6f52aabf4320cd9256cbfac9e1ef5ff4ecda7bc2..27f1cdd341be3712de70931e87146d3ec5931bf6 100644 (file)
@@ -15,6 +15,8 @@
  */
 package com.vaadin.shared.ui.calendar;
 
+import java.io.Serializable;
+
 /**
  * CalendarEventId contains static String identifiers for all Calendar events.
  * These are used both in the client and server side code.
@@ -22,7 +24,7 @@ package com.vaadin.shared.ui.calendar;
  * @since 7.1
  * @author Vaadin Ltd.
  */
-public class CalendarEventId {
+public class CalendarEventId implements Serializable {
 
     public static final String EVENTMOVE = "eventMove";
     public static final String RANGESELECT = "rangeSelect";
index 8a840274c29a96b72bd02fc8167b231b56e9555a..9b1c995642161d2244b810e1d71d0c4fddb4ec1f 100644 (file)
  */
 package com.vaadin.shared.ui.calendar;
 
+import java.io.Serializable;
+
 /**
  * 
  * @since 7.1
  * 
  */
-public class DateConstants {
+public class DateConstants implements Serializable {
 
     public static final String ACTION_DATE_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";
     public static final String CLIENT_DATE_FORMAT = "yyyy-MM-dd";
index 2242fa436334b3a55520d139e47f84bca468f9f6..80efe68d83c9bbfb5cc2df40504b131e87252f62 100644 (file)
@@ -15,6 +15,8 @@
  */
 package com.vaadin.shared.util;
 
+import java.io.Serializable;
+
 /**
  * Misc internal utility methods used by both the server and the client package.
  * 
@@ -22,7 +24,7 @@ package com.vaadin.shared.util;
  * @since 7.1
  * 
  */
-public class SharedUtil {
+public class SharedUtil implements Serializable {
     /**
      * Checks if a and b are equals using {@link #equals(Object)}. Handles null
      * values as well. Does not ensure that objects are of the same type.