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 0fdf43659ac46453f920fea6f3d9f77c75d9be0e..8dd49e1cad4982aad17d1084671c2a792aa7078f 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 cfa9166de48a59fccbfd15454eed22e4cbc6e3d8..32e24b704f358309887d931436bf75e8dfff2e96 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 289b3bb7859a274f7774de79a8ba5659068290d2..5e1f20b97d47fd27f917a69ec55416b4f326cdd4 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 f99dc773c05f7be711a174413d9b9b1dd9286e9e..6080232538e22cd755807f449cbb84bbbfad4210 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 5b76685cb731c5cf9e3b9145d0585d5e67184efb..4261baef2fd22f19c5374139f34f15ba063eb1b5 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;
     }
 }