From: Robert Varga Date: Mon, 3 Apr 2023 13:37:19 +0000 (+0200) Subject: Mark Payloads with java.io.Serial X-Git-Tag: v6.0.8~19 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=008a1cc34f4445769ce7a9336c2ff020e9874f20 Mark Payloads with java.io.Serial 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 (cherry picked from commit c1bae57105d04c2d13fcf6c0ca654177743b51f8) --- diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/IdentifiablePayload.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/IdentifiablePayload.java index dad696deb1..a6034c55cc 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/IdentifiablePayload.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/IdentifiablePayload.java @@ -11,6 +11,6 @@ import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.concepts.Identifier; public abstract class IdentifiablePayload extends Payload implements Identifiable { + @java.io.Serial private static final long serialVersionUID = 1L; - } diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/Payload.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/Payload.java index bda1d1e22c..c75385ab1e 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/Payload.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/Payload.java @@ -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(); } diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java index 9dedc67e68..22369d7887 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorDelegatingPersistentDataProviderTest.java @@ -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; - } }