From 62b242d2c4bc905b22c1bf5eb96b871cf6764bde Mon Sep 17 00:00:00 2001 From: dungba88 Date: Wed, 28 Feb 2024 09:35:17 +0900 Subject: [PATCH] Use IOUtils to delete files --- .../lucene90/blocktree/Lucene90BlockTreeTermsWriter.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java index 08e22d375f6f..5fd694704db6 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/blocktree/Lucene90BlockTreeTermsWriter.java @@ -1347,13 +1347,7 @@ public void close() throws IOException { IOUtils.closeWhileHandlingException(metaOut, termsOut, indexOut, postingsWriter); IOUtils.closeWhileHandlingException(tempIndexInputs); } - for (String inputName : tempInputNames) { - try { - state.directory.deleteFile(inputName); - } catch (IOException ex) { - - } - } + IOUtils.deleteFilesIgnoringExceptions(state.directory, tempInputNames); } }