Remove EmptyExternalizableProxy 72/105172/8
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 3 Apr 2023 14:19:26 +0000 (16:19 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 15 May 2023 12:00:52 +0000 (12:00 +0000)
EmptyExternalizableProxy is a rather inefficient way of doing things,
remove it along with its (unused) users.

JIRA: CONTROLLER-2079
Change-Id: I87179e1e8b53547711b4d0c8ceb4607f341c997d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java [deleted file]
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/TimeoutNow.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/client/messages/Shutdown.java

diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/base/messages/EmptyExternalizableProxy.java
deleted file mode 100644 (file)
index 96c25d5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2017 Inocybe Technologies and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.raft.base.messages;
-
-import static java.util.Objects.requireNonNull;
-
-import java.io.Externalizable;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-
-/**
- * Abstract base that implements Externalizable with no-op methods that is intended for classes that use the
- * externalizable proxy pattern but have no data to serialize and read-resolve to a static instance.
- *
- * @author Thomas Pantelis
- */
-@Deprecated(since = "7.0.0", forRemoval = true)
-public abstract class EmptyExternalizableProxy implements Externalizable {
-    private static final long serialVersionUID = 1L;
-
-    private final Object readResolveTo;
-
-    protected EmptyExternalizableProxy(final Object readResolveTo) {
-        this.readResolveTo = requireNonNull(readResolveTo);
-    }
-
-    @Override
-    public void writeExternal(final ObjectOutput out) {
-    }
-
-    @Override
-    public void readExternal(final ObjectInput in) {
-    }
-
-    protected Object readResolve() {
-        return readResolveTo;
-    }
-}
index be3b0b5ffd135ba10747c36c1ce43427aeac4b65..2b7684481955110bab875403db0447554583cc7e 100644 (file)
@@ -26,20 +26,8 @@ public final class TimeoutNow implements Serializable, ControlMessage {
     }
 
     @java.io.Serial
+    @SuppressWarnings("static-method")
     private Object readResolve() {
         return INSTANCE;
     }
-
-    @Deprecated(since = "7.0.0", forRemoval = true)
-    private static class Proxy extends EmptyExternalizableProxy {
-        @java.io.Serial
-        private static final long serialVersionUID = 1L;
-
-        // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
-        // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
-        @SuppressWarnings("checkstyle:RedundantModifier")
-        public Proxy() {
-            super(INSTANCE);
-        }
-    }
 }
index 2f2ff47934ab0a4a85761c9f69fa90d98157fd7c..7fba245bf26fedd040e09c0b13dfc0cb425e2bcf 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.controller.cluster.raft.client.messages;
 
 import akka.dispatch.ControlMessage;
 import java.io.Serializable;
-import org.opendaylight.controller.cluster.raft.base.messages.EmptyExternalizableProxy;
 
 /**
  * Message sent to a raft actor to shutdown gracefully. If it's the leader it will transfer leadership to a
@@ -29,20 +28,8 @@ public final class Shutdown implements Serializable, ControlMessage {
     }
 
     @java.io.Serial
+    @SuppressWarnings("static-method")
     private Object readResolve() {
         return INSTANCE;
     }
-
-    @Deprecated(since = "7.0.0", forRemoval = true)
-    private static class Proxy extends EmptyExternalizableProxy {
-        @java.io.Serial
-        private static final long serialVersionUID = 1L;
-
-        // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
-        // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
-        @SuppressWarnings("checkstyle:RedundantModifier")
-        public Proxy() {
-            super(INSTANCE);
-        }
-    }
 }