Fix incorrect readResolve signatures 31/42731/2
authorTom Pantelis <tpanteli@brocade.com>
Thu, 28 Jul 2016 16:46:28 +0000 (12:46 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 29 Jul 2016 02:06:10 +0000 (02:06 +0000)
In several Serializable classes the return type of the readResolve
method is the class. However this is incorrect - the return type must
be Object or it is not recognized by the serialization framework.
Eclipse actually flags the incorrect signature with the "unused" warning
but the warning was suppressed in the code. Using the correct Object
return type, Eclipse doesn't issue the warning.

Change-Id: Id53182925fa48879f1f754c3f25361fb846b23ca
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ElectionTimeout.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/LeaderTransitioning.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/SendHeartBeat.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/FindLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java

index 0fdf436..8dd49e1 100644 (file)
@@ -21,8 +21,7 @@ public final class ElectionTimeout implements Serializable {
         // Hidden on purpose
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private ElectionTimeout readResolve() {
+    private Object readResolve() {
         return INSTANCE;
     }
 }
index cfa9166..32e24b7 100644 (file)
@@ -22,8 +22,7 @@ public final class LeaderTransitioning implements Serializable {
         // Hidden on purpose
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private LeaderTransitioning readResolve() {
+    private Object readResolve() {
         return INSTANCE;
     }
 }
index 289b3bb..5e1f20b 100644 (file)
@@ -24,8 +24,7 @@ public final class SendHeartBeat implements Serializable {
         // Hidden on purpose
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private SendHeartBeat readResolve() {
+    private Object readResolve() {
         return INSTANCE;
     }
 }
index f99dc77..6080232 100644 (file)
@@ -27,8 +27,7 @@ public final class FindLeader implements Serializable {
         // Hidden to force reuse
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private FindLeader readResolve() {
+    private Object readResolve() {
         return INSTANCE;
     }
 }
index 5b76685..4261bae 100644 (file)
@@ -24,8 +24,7 @@ public final class Shutdown implements Serializable {
         // Hidden on purpose
     }
 
-    @SuppressWarnings({ "static-method", "unused" })
-    private Shutdown readResolve() {
+    private Object readResolve() {
         return INSTANCE;
     }
 }