From: Robert Varga Date: Thu, 2 Mar 2023 16:00:59 +0000 (+0100) Subject: Remove Namespace.Builder.nextId() X-Git-Tag: v7.0.5~54 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=650b08e2767c28e99f03ffacd26c23a76ddd5338 Remove Namespace.Builder.nextId() The facility to assign ids is not used by us, remove it, as it seems to be a leak from Kryo. JIRA: CONTROLLER-2072 Change-Id: I5069e3c0dfa395a56c98498d566b615651bda820 Signed-off-by: Robert Varga --- diff --git a/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java b/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java index b9eeaf269c..6942ba2713 100644 --- a/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java +++ b/third-party/atomix/storage/src/main/java/io/atomix/utils/serializer/Namespace.java @@ -64,12 +64,12 @@ public final class Namespace implements KryoFactory, KryoPool { /** * ID to use if this KryoNamespace does not define registration id. */ - public static final int FLOATING_ID = -1; + private static final int FLOATING_ID = -1; /** * Smallest ID free to use for user defined registrations. */ - public static final int INITIAL_ID = 16; + private static final int INITIAL_ID = 16; static final String NO_NAME = "(no name)"; @@ -128,30 +128,6 @@ public final class Namespace implements KryoFactory, KryoPool { return new Namespace(blocks, classLoader, registrationRequired, compatible, friendlyName).populate(1); } - /** - * Sets the next Kryo registration Id for following register entries. - * - * @param id Kryo registration Id - * @return this - * @see Kryo#register(Class, Serializer, int) - */ - public Builder nextId(final int id) { - if (!types.isEmpty()) { - if (id != FLOATING_ID && id < blockHeadId + types.size()) { - - if (LOGGER.isWarnEnabled()) { - LOGGER.warn("requested nextId {} could potentially overlap " - + "with existing registrations {}+{} ", - id, blockHeadId, types.size(), new RuntimeException()); - } - } - blocks.add(new RegistrationBlock(this.blockHeadId, types)); - types = new ArrayList<>(); - } - this.blockHeadId = id; - return this; - } - /** * Registers serializer for the given set of classes. *