Do not leak Kryo from atomix.storage
[controller.git] / third-party / atomix / storage / src / main / java / io / atomix / storage / journal / JournalSegmentFile.java
index 9fe7f12ed581c5f17edbc103eb7c6ae87f34de2b..5fe226d3bb0e7a5cd909c2f38268916f52b43681 100644 (file)
@@ -17,7 +17,7 @@ package io.atomix.storage.journal;
 
 import java.io.File;
 
-import static com.google.common.base.Preconditions.checkNotNull;
+import static java.util.Objects.requireNonNull;
 
 /**
  * Segment file utility.
@@ -47,8 +47,8 @@ public final class JournalSegmentFile {
    * @throws NullPointerException if {@code file} is null
    */
   public static boolean isSegmentFile(String journalName, String fileName) {
-    checkNotNull(journalName, "journalName cannot be null");
-    checkNotNull(fileName, "fileName cannot be null");
+    requireNonNull(journalName, "journalName cannot be null");
+    requireNonNull(fileName, "fileName cannot be null");
 
     int partSeparator = fileName.lastIndexOf(PART_SEPARATOR);
     int extensionSeparator = fileName.lastIndexOf(EXTENSION_SEPARATOR);
@@ -73,7 +73,7 @@ public final class JournalSegmentFile {
    * Creates a segment file for the given directory, log name, segment ID, and segment version.
    */
   static File createSegmentFile(String name, File directory, long id) {
-    return new File(directory, String.format("%s-%d.log", checkNotNull(name, "name cannot be null"), id));
+    return new File(directory, String.format("%s-%d.log", requireNonNull(name, "name cannot be null"), id));
   }
 
   /**