diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java index 005806a3f9e..82e9cef9b88 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestOfflineSorter.java @@ -27,8 +27,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.OfflineSorter.BufferSize; import org.apache.lucene.util.OfflineSorter.ByteSequencesWriter; import org.apache.lucene.util.OfflineSorter.SortInfo; diff --git a/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java b/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java index 0d14a1e9c88..2194e3d368e 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java +++ b/lucene/sandbox/src/java/org/apache/lucene/bkdtree/BKDTreeWriter.java @@ -443,19 +443,6 @@ class BKDTreeWriter { return indexFP; } - // Called only from assert - private boolean directoryIsEmpty(Path in) { - try (DirectoryStream dir = Files.newDirectoryStream(in)) { - for (Path path : dir) { - assert false: "dir=" + in + " still has file=" + path; - return false; - } - } catch (IOException ioe) { - // Just ignore: we are only called from assert - } - return true; - } - /** Sliced reference to points in an OfflineSorter.ByteSequencesWriter file. */ private static final class PathSlice { final LatLonWriter writer; diff --git a/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java b/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java index ef9b16696e0..8b81e527926 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java +++ b/lucene/sandbox/src/java/org/apache/lucene/rangetree/RangeTreeWriter.java @@ -386,19 +386,6 @@ class RangeTreeWriter { return indexFP; } - // Called only from assert - private boolean directoryIsEmpty(Path in) { - try (DirectoryStream dir = Files.newDirectoryStream(in)) { - for (Path path : dir) { - assert false: "dir=" + in + " still has file=" + path; - return false; - } - } catch (IOException ioe) { - // Just ignore: we are only called from assert - } - return true; - } - /** Sliced reference to points in an OfflineSorter.ByteSequencesWriter file. */ private static final class PathSlice { final SliceWriter writer; diff --git a/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java b/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java index 02fbe5e5eac..743da8f940f 100644 --- a/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java +++ b/lucene/spatial3d/src/java/org/apache/lucene/bkdtree3d/BKD3DTreeWriter.java @@ -452,19 +452,6 @@ class BKD3DTreeWriter { return indexFP; } - // Called only from assert - private boolean directoryIsEmpty(Path in) { - try (DirectoryStream dir = Files.newDirectoryStream(in)) { - for (Path path : dir) { - assert false: "dir=" + in + " still has file=" + path; - return false; - } - } catch (IOException ioe) { - // Just ignore: we are only called from assert - } - return true; - } - /** Sliced reference to points in an OfflineSorter.ByteSequencesWriter file. */ private static final class PathSlice { final Writer writer;