Remove Namespace.Builder.nextId()
[controller.git] / third-party / atomix / storage / src / main / java / io / atomix / utils / serializer / Namespace.java
index b9eeaf269c9dad75bb06026c8af7a61474daf6c9..6942ba27138a8274443ce925c1a62b01799ff9c1 100644 (file)
@@ -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.
      * <p>