Remove old unversioned proxies
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / FrontendType.java
index 1ccdd69a07481557b4f99b2c1ee83fc51ea57d8a..66191816136573bdce79299a33d388012b163cf3 100644 (file)
@@ -16,10 +16,7 @@ import com.google.common.base.Strings;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.DataInput;
 import java.io.DataOutput;
-import java.io.Externalizable;
 import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
 import java.nio.charset.StandardCharsets;
 import java.util.regex.Pattern;
 import org.eclipse.jdt.annotation.NonNull;
@@ -32,64 +29,6 @@ import org.opendaylight.yangtools.concepts.WritableIdentifier;
  * discerned.
  */
 public final class FrontendType implements Comparable<FrontendType>, WritableIdentifier {
-    interface SerialForm extends Externalizable {
-        @NonNull FrontendType type();
-
-        void setType(@NonNull FrontendType type);
-
-        @java.io.Serial
-        Object readResolve();
-
-        @Override
-        default void writeExternal(final ObjectOutput out) throws IOException {
-            final var serialized = type().getSerialized();
-            out.writeInt(serialized.length);
-            out.write(serialized);
-        }
-
-        @Override
-        default void readExternal(final ObjectInput in) throws IOException {
-            final var serialized = new byte[in.readInt()];
-            in.readFully(serialized);
-            // TODO: consider caching instances here
-            setType(new FrontendType(new String(serialized, StandardCharsets.UTF_8), serialized));
-        }
-    }
-
-    @Deprecated(since = "7.0.0", forRemoval = true)
-    private static final class Proxy implements SerialForm {
-        @java.io.Serial
-        private static final long serialVersionUID = 1L;
-
-        private FrontendType type;
-
-        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
-        // be able to create instances via reflection.
-        @SuppressWarnings("checkstyle:RedundantModifier")
-        public Proxy() {
-            // For Externalizable
-        }
-
-        Proxy(final FrontendType type) {
-            this.type = requireNonNull(type);
-        }
-
-        @Override
-        public FrontendType type() {
-            return verifyNotNull(type);
-        }
-
-        @Override
-        public void setType(final FrontendType type) {
-            this.type = requireNonNull(type);
-        }
-
-        @Override
-        public Object readResolve() {
-            return type();
-        }
-    }
-
     @java.io.Serial
     private static final long serialVersionUID = 1L;
     private static final String SIMPLE_STRING_REGEX = "^[a-zA-Z0-9-_.*+:=,!~';]+$";
@@ -181,6 +120,6 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
 
     @java.io.Serial
     private Object writeReplace() {
-        return new FT(this);
+        return new FT(getSerialized());
     }
 }