Mark Payloads with java.io.Serial 63/105163/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Apr 2023 13:37:19 +0000 (15:37 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Apr 2023 13:59:15 +0000 (15:59 +0200)
We have a number of fields/methods which should be marked with @Serial,
add another pass on them.

Change-Id: Ie08d6e718980e4e3acb148226760ad75ef82566e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/IdentifiablePayload.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/Payload.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java

index dad696deb12f006176dfbdced7deca8f50d2ebe9..a6034c55cc5b5ecc2e3f64490596c89e358cd9e8 100644 (file)
@@ -11,6 +11,6 @@ import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.Identifier;
 
 public abstract class IdentifiablePayload<T extends Identifier> extends Payload implements Identifiable<T> {
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
-
 }
index bda1d1e22ca1762f71f5c0516e6c23cfa07929be..c75385ab1ea4f83e298d0ac1b6289b7f691a877e 100644 (file)
@@ -17,6 +17,7 @@ import java.io.Serializable;
  * Similarly when state needs to be applied to the derived RaftActor it will be passed an instance of the Payload class.
  */
 public abstract class Payload implements Serializable {
+    @java.io.Serial
     private static final long serialVersionUID = 1L;
 
     /**
@@ -40,5 +41,6 @@ public abstract class Payload implements Serializable {
      *
      * @return Serialization proxy
      */
+    @java.io.Serial
     protected abstract Object writeReplace();
 }
index 9dedc67e68776215bf58acad376c07e35ab83137..22369d78870b64b2d1a3ebce71bdac2b795a5aaf 100644 (file)
@@ -98,6 +98,7 @@ public class RaftActorDelegatingPersistentDataProviderTest {
     }
 
     static class TestNonPersistentPayload extends Payload {
+        @java.io.Serial
         private static final long serialVersionUID = 1L;
 
         @Override
@@ -118,7 +119,7 @@ public class RaftActorDelegatingPersistentDataProviderTest {
     }
 
     static class TestPersistentPayload extends TestNonPersistentPayload implements PersistentPayload {
+        @java.io.Serial
         private static final long serialVersionUID = 1L;
-
     }
 }