diff --git a/src/test/java/org/elasticsearch/index/store/CorruptedFileTest.java b/src/test/java/org/elasticsearch/index/store/CorruptedFileTest.java index 4cdede72a1a..2e11cf471fc 100644 --- a/src/test/java/org/elasticsearch/index/store/CorruptedFileTest.java +++ b/src/test/java/org/elasticsearch/index/store/CorruptedFileTest.java @@ -486,7 +486,7 @@ public class CorruptedFileTest extends ElasticsearchIntegrationTest { Path file = Paths.get(path).resolve(relativeDataLocationPath); try (DirectoryStream stream = Files.newDirectoryStream(file)) { for (Path item : stream) { - if (Files.isRegularFile(item) && "write.lock".equals(item.getFileName()) == false) { + if (Files.isRegularFile(item) && "write.lock".equals(item.getFileName().toString()) == false) { if (includePerCommitFiles || isPerSegmentFile(item.getFileName().toString())) { files.add(item); }