Add serialVersionUID to Serializable classes 49/12649/4
authorRobert Varga <rovarga@cisco.com>
Fri, 7 Nov 2014 19:50:32 +0000 (20:50 +0100)
committerRobert Varga <rovarga@cisco.com>
Sat, 8 Nov 2014 11:14:32 +0000 (12:14 +0100)
Each serializable class withouth serialVersionUID produces an eclipse
warning. It also means that the class has undefined versioning and
cannot be be upgraded -- this patch fixes all such classes.

Change-Id: I57696f47b312517acd44799e10850f4887dab2e5
Signed-off-by: Robert Varga <rovarga@cisco.com>
51 files changed:
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ClientActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValue.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/messages/KeyValueSaved.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/messages/PrintRole.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/messages/PrintState.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ReplicatedLogImplEntry.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/Snapshot.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyLogEntries.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplySnapshot.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/ApplyState.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/CommitEntry.java
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/PersistEntry.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/Replicate.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/SaveSnapshot.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/FindLeaderReply.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AbstractRaftRPC.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntries.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntriesReply.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshotReply.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVote.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/RequestVoteReply.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailbox.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/Monitor.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/CompositeModificationPayload.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/common/actor/MeteredBoundedMailboxTest.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DataChangeListenerRegistration.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/NotInitializedException.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/PrimaryNotFoundException.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/TimeoutException.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/exceptions/UnknownMessageException.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ActorInitialized.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ActorNotInitialized.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardManagerTest.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLColumn.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCCommand.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RpcManager.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/InvokeRpc.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/BucketImpl.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/gossip/Messages.java

index 2560f16..59bec91 100644 (file)
@@ -29,6 +29,7 @@ public class ClientActor extends UntypedActor {
 
     public static Props props(final ActorRef target){
         return Props.create(new Creator<ClientActor>(){
+            private static final long serialVersionUID = 1L;
 
             @Override public ClientActor create() throws Exception {
                 return new ClientActor(target);
index cb375c2..8e4a44c 100644 (file)
@@ -52,6 +52,7 @@ public class ExampleActor extends RaftActor {
     public static Props props(final String id, final Map<String, String> peerAddresses,
         final Optional<ConfigParams> configParams){
         return Props.create(new Creator<ExampleActor>(){
+            private static final long serialVersionUID = 1L;
 
             @Override public ExampleActor create() throws Exception {
                 return new ExampleActor(id, peerAddresses, configParams);
index 617bb7e..042b9fb 100644 (file)
@@ -739,9 +739,9 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
     }
 
     static class DeleteEntries implements Serializable {
+        private static final long serialVersionUID = 1L;
         private final int fromIndex;
 
-
         public DeleteEntries(int fromIndex) {
             this.fromIndex = fromIndex;
         }
@@ -792,6 +792,7 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
     }
 
     static class UpdateElectionTerm implements Serializable {
+        private static final long serialVersionUID = 1L;
         private final long currentTerm;
         private final String votedFor;
 
index fc2ec5c..ceb5633 100644 (file)
@@ -14,6 +14,7 @@ import java.io.Serializable;
 
 public class ReplicatedLogImplEntry implements ReplicatedLogEntry,
     Serializable {
+    private static final long serialVersionUID = 1L;
 
     private final long index;
     private final long term;
index 8e0fcca..77bf103 100644 (file)
@@ -12,6 +12,7 @@ import java.util.List;
 
 
 public class Snapshot implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final byte[] state;
     private final List<ReplicatedLogEntry> unAppliedEntries;
     private final long lastIndex;
index c356804..54ee02a 100644 (file)
@@ -16,6 +16,7 @@ import java.io.Serializable;
  * Internal message, issued by follower to its actor
  */
 public class ApplySnapshot implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final Snapshot snapshot;
 
     public ApplySnapshot(Snapshot snapshot) {
index b904335..0a7a632 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import java.io.Serializable;
 
 public class ApplyState implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final ActorRef clientActor;
     private final String identifier;
     private final ReplicatedLogEntry replicatedLogEntry;
index 9bc737a..611c6ea 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import java.io.Serializable;
 
 public class Replicate implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final ActorRef clientActor;
     private final String identifier;
     private final ReplicatedLogEntry replicatedLogEntry;
index 64c7350..8b2e45a 100644 (file)
@@ -11,6 +11,7 @@ package org.opendaylight.controller.cluster.raft.client.messages;
 import java.io.Serializable;
 
 public class FindLeaderReply implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final String leaderActor;
 
     public FindLeaderReply(String leaderActor) {
index 14eb8a4..e5aebaa 100644 (file)
@@ -24,10 +24,10 @@ import java.util.Map;
  * heartbeat (§5.2).
  */
 public class AppendEntries extends AbstractRaftRPC {
-
     public static final Class<AppendEntriesMessages.AppendEntries> SERIALIZABLE_CLASS = AppendEntriesMessages.AppendEntries.class;
 
     private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(AppendEntries.class);
+    private static final long serialVersionUID = 1L;
 
     // So that follower can redirect clients
     private final String leaderId;
index b923baa..a782eda 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.cluster.raft.messages;
  * Reply for the AppendEntriesRpc message
  */
 public class AppendEntriesReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 1L;
 
     // true if follower contained entry matching
     // prevLogIndex and prevLogTerm
index 5a0cc95..3c4e811 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.controller.protobuff.messages.cluster.raft.InstallSnapsh
 public class InstallSnapshot extends AbstractRaftRPC {
 
     public static final Class<InstallSnapshotMessages.InstallSnapshot> SERIALIZABLE_CLASS = InstallSnapshotMessages.InstallSnapshot.class;
+    private static final long serialVersionUID = 1L;
 
     private final String leaderId;
     private final long lastIncludedIndex;
index d293a47..71e7ecc 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.cluster.raft.messages;
 
 public class InstallSnapshotReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 1L;
 
     // The followerId - this will be used to figure out which follower is
     // responding
index 6ef2a06..8321d0c 100644 (file)
@@ -12,6 +12,7 @@ package org.opendaylight.controller.cluster.raft.messages;
  * Invoked by candidates to gather votes (§5.2).
  */
 public class RequestVote extends AbstractRaftRPC {
+    private static final long serialVersionUID = 1L;
 
     // candidate requesting vote
     private String candidateId;
index df80b4e..da3ba5c 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.cluster.raft.messages;
 
 public class RequestVoteReply extends AbstractRaftRPC {
+    private static final long serialVersionUID = 1L;
 
     // true means candidate received vot
     private final boolean voteGranted;
index a1088aa..562ca21 100644 (file)
@@ -198,6 +198,7 @@ public class MockRaftActorContext implements RaftActorContext {
     }
 
     public static class MockPayload extends Payload implements Serializable {
+        private static final long serialVersionUID = 1L;
         private String value = "";
 
         public MockPayload(){
@@ -231,6 +232,7 @@ public class MockRaftActorContext implements RaftActorContext {
     }
 
     public static class MockReplicatedLogEntry implements ReplicatedLogEntry, Serializable {
+        private static final long serialVersionUID = 1L;
 
         private final long term;
         private final long index;
index 8244604..90827fc 100644 (file)
@@ -85,6 +85,7 @@ public class RaftActorTest extends AbstractActorTest {
         private final RaftActor delegate;
 
         public static final class MockRaftActorCreator implements Creator<MockRaftActor> {
+            private static final long serialVersionUID = 1L;
             private final Map<String, String> peerAddresses;
             private final String id;
             private final Optional<ConfigParams> config;
index 458f379..2a6735a 100644 (file)
@@ -66,6 +66,7 @@ public class MeteredBoundedMailbox implements MailboxType, ProducesMessageQueue<
 
 
     public static class MeteredMessageQueue extends BoundedDequeBasedMailbox.MessageQueue {
+        private static final long serialVersionUID = 1L;
 
         public MeteredMessageQueue(int capacity, FiniteDuration pushTimeOut) {
             super(capacity, pushTimeOut);
index 88ce791..f81b34a 100644 (file)
@@ -13,6 +13,7 @@ import akka.actor.ActorRef;
 import java.io.Serializable;
 
 public class Monitor implements Serializable {
+    private static final long serialVersionUID = 1L;
     private final ActorRef actorRef;
 
     public Monitor(ActorRef actorRef){
index d33e79f..60efb9d 100644 (file)
@@ -81,6 +81,7 @@ public class MeteredBoundedMailboxTest {
 
         public static Props props(final ReentrantLock lock){
             return Props.create(new Creator<PingPongActor>(){
+                private static final long serialVersionUID = 1L;
                 @Override
                 public PingPongActor create() throws Exception {
                     return new PingPongActor(lock);
index 3426112..a8d7d22 100644 (file)
@@ -53,6 +53,7 @@ public class DataChangeListenerRegistration extends AbstractUntypedActor {
 
     private static class DataChangeListenerRegistrationCreator
                                             implements Creator<DataChangeListenerRegistration> {
+        private static final long serialVersionUID = 1L;
         final ListenerRegistration<AsyncDataChangeListener<YangInstanceIdentifier,
                                                            NormalizedNode<?, ?>>> registration;
 
index c7213e6..88f818f 100644 (file)
@@ -556,6 +556,7 @@ public class ShardManager extends AbstractUntypedPersistentActorWithMetering {
     }
 
     static class SchemaContextModules implements Serializable {
+        private static final long serialVersionUID = 1L;
         private final Set<String> modules;
 
         SchemaContextModules(Set<String> modules){
index f6eb6d7..e70d79c 100644 (file)
@@ -387,6 +387,7 @@ public class ShardManagerTest extends AbstractActorTest {
             throws Exception {
         final CountDownLatch persistLatch = new CountDownLatch(1);
         final Creator<ShardManager> creator = new Creator<ShardManager>() {
+            private static final long serialVersionUID = 1L;
             @Override
             public ShardManager create() throws Exception {
                 return new ShardManager(shardMrgIDSuffix, new MockClusterWrapper(), new MockConfiguration(), DatastoreContext.newBuilder().build()) {
@@ -466,6 +467,7 @@ public class ShardManagerTest extends AbstractActorTest {
     }
 
     private static class DelegatingShardManagerCreator implements Creator<ShardManager> {
+        private static final long serialVersionUID = 1L;
         private Creator<ShardManager> delegate;
 
         public DelegatingShardManagerCreator(Creator<ShardManager> delegate) {
index dd8b878..c1404d5 100644 (file)
@@ -3,6 +3,8 @@ package org.opendaylight.controller.md.sal.dom.xsql;
 import java.io.Serializable;
 
 public class XSQLColumn implements Serializable, Comparable<Object> {
+    private static final long serialVersionUID = 4854919735031714751L;
+
     private String name = null;
     private String tableName = null;
     private int charWidth = -1;
index 0197111..ba0626f 100644 (file)
@@ -6,6 +6,8 @@ import java.util.Map;
 import org.opendaylight.controller.md.sal.dom.xsql.XSQLBluePrint;
 
 public class JDBCCommand implements Serializable {
+    private static final long serialVersionUID = 1L;
+
     public int type = 0;
     public static final int TYPE_EXECUTE_QUERY = 1;
     public static final int TYPE_QUERY_REPLY = 2;
index 4ae9c2e..a840712 100644 (file)
@@ -65,6 +65,7 @@ public class RpcManager extends AbstractUntypedActor {
                             final Broker.ProviderSession brokerSession,
                             final RpcProvisionRegistry rpcProvisionRegistry) {
     return Props.create(new Creator<RpcManager>() {
+      private static final long serialVersionUID = 1L;
       @Override
       public RpcManager create() throws Exception {
         return new RpcManager(schemaContext, brokerSession, rpcProvisionRegistry);
index 522dd44..4bb5258 100644 (file)
@@ -14,6 +14,7 @@ import org.opendaylight.yangtools.yang.common.QName;
 import java.io.Serializable;
 
 public class ExecuteRpc implements Serializable {
+  private static final long serialVersionUID = 1L;
 
   private final String inputCompositeNode;
   private final QName rpc;
index 59d09fc..652569b 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import java.io.Serializable;
 
 public class InvokeRpc implements Serializable {
+  private static final long serialVersionUID = 1L;
 
   private final QName rpc;
   private final YangInstanceIdentifier identifier;
index 17766f1..387cb90 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.controller.remote.rpc.messages;
 
-
-
 import java.io.Serializable;
 
 public class RpcResponse implements Serializable {
+  private static final long serialVersionUID = 1L;
   private final String resultCompositeNode;
 
   public RpcResponse(final String resultCompositeNode) {
index d21d05d..fe8c463 100644 (file)
@@ -18,6 +18,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 public class RoutingTable implements Copier<RoutingTable>, Serializable {
+    private static final long serialVersionUID = 1L;
 
     private Map<RpcRouter.RouteIdentifier<?, ?, ?>, Long> table = new HashMap<>();
     private ActorRef router;
index 4dac456..01c77f1 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.remote.rpc.registry.gossip;
 import java.io.Serializable;
 
 public class BucketImpl<T extends Copier<T>> implements Bucket<T>, Serializable {
+    private static final long serialVersionUID = 1L;
 
     private Long version = System.currentTimeMillis();
 
index bf8b202..4e8f2c6 100644 (file)
@@ -29,9 +29,12 @@ public class Messages {
 
     public static class BucketStoreMessages{
 
-        public static class GetLocalBucket implements Serializable{}
+        public static class GetLocalBucket implements Serializable {
+            private static final long serialVersionUID = 1L;
+        }
 
         public static class ContainsBucket implements Serializable {
+            private static final long serialVersionUID = 1L;
             final private Bucket bucket;
 
             public ContainsBucket(Bucket bucket){
@@ -46,20 +49,25 @@ public class Messages {
         }
 
         public static class UpdateBucket extends ContainsBucket implements Serializable {
+            private static final long serialVersionUID = 1L;
             public UpdateBucket(Bucket bucket){
                 super(bucket);
             }
         }
 
         public static class GetLocalBucketReply extends ContainsBucket implements Serializable {
+            private static final long serialVersionUID = 1L;
             public GetLocalBucketReply(Bucket bucket){
                 super(bucket);
             }
         }
 
-        public static class GetAllBuckets implements Serializable{}
+        public static class GetAllBuckets implements Serializable {
+            private static final long serialVersionUID = 1L;
+        }
 
         public static class GetBucketsByMembers implements Serializable{
+            private static final long serialVersionUID = 1L;
             private Set<Address> members;
 
             public GetBucketsByMembers(Set<Address> members){
@@ -73,6 +81,7 @@ public class Messages {
         }
 
         public static class ContainsBuckets implements Serializable{
+            private static final long serialVersionUID = 1L;
             private Map<Address, Bucket> buckets;
 
             public ContainsBuckets(Map<Address, Bucket> buckets){
@@ -94,20 +103,25 @@ public class Messages {
         }
 
         public static class GetAllBucketsReply extends ContainsBuckets implements Serializable{
+            private static final long serialVersionUID = 1L;
             public GetAllBucketsReply(Map<Address, Bucket> buckets) {
                 super(buckets);
             }
         }
 
         public static class GetBucketsByMembersReply extends ContainsBuckets implements Serializable{
+            private static final long serialVersionUID = 1L;
             public GetBucketsByMembersReply(Map<Address, Bucket> buckets) {
                 super(buckets);
             }
         }
 
-        public static class GetBucketVersions implements Serializable{}
+        public static class GetBucketVersions implements Serializable {
+            private static final long serialVersionUID = 1L;
+        }
 
         public static class ContainsBucketVersions implements Serializable{
+            private static final long serialVersionUID = 1L;
             Map<Address, Long> versions;
 
             public ContainsBucketVersions(Map<Address, Long> versions) {
@@ -123,12 +137,14 @@ public class Messages {
         }
 
         public static class GetBucketVersionsReply extends ContainsBucketVersions implements Serializable{
+            private static final long serialVersionUID = 1L;
             public GetBucketVersionsReply(Map<Address, Long> versions) {
                 super(versions);
             }
         }
 
         public static class UpdateRemoteBuckets extends ContainsBuckets implements Serializable{
+            private static final long serialVersionUID = 1L;
             public UpdateRemoteBuckets(Map<Address, Bucket> buckets) {
                 super(buckets);
             }
@@ -136,11 +152,16 @@ public class Messages {
     }
 
     public static class GossiperMessages{
-        public static class Tick implements Serializable {}
+        public static class Tick implements Serializable {
+            private static final long serialVersionUID = 1L;
+        }
 
-        public static final class GossipTick extends Tick {}
+        public static final class GossipTick extends Tick {
+            private static final long serialVersionUID = 1L;
+        }
 
         public static final class GossipStatus extends ContainsBucketVersions implements Serializable{
+            private static final long serialVersionUID = 1L;
             private Address from;
 
             public GossipStatus(Address from, Map<Address, Long> versions) {
@@ -154,6 +175,7 @@ public class Messages {
         }
 
         public static final class GossipEnvelope extends ContainsBuckets implements Serializable {
+            private static final long serialVersionUID = 1L;
             private final Address from;
             private final Address to;