Fixed gradle check errors

This commit is contained in:
expani 2024-10-07 14:32:18 +05:30
parent 0289c6bcee
commit e20be32b55
1 changed files with 5 additions and 4 deletions

View File

@ -16,14 +16,13 @@
*/ */
package org.apache.lucene.benchmark.jmh; package org.apache.lucene.benchmark.jmh;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
@ -444,14 +443,16 @@ public class DocIdEncodingBenchmark {
try { try {
if (inputFilePath != null && !inputFilePath.isEmpty()) { if (inputFilePath != null && !inputFilePath.isEmpty()) {
DOC_ID_SEQUENCES = docIdProvider.getDocIds(new FileInputStream(inputFilePath)); DOC_ID_SEQUENCES =
docIdProvider.getDocIds(
Files.newInputStream(Path.of(inputFilePath), StandardOpenOption.READ));
} else { } else {
DOC_ID_SEQUENCES = DOC_ID_SEQUENCES =
docIdProvider.getDocIds( docIdProvider.getDocIds(
DocIdEncodingBenchmark.class.getResourceAsStream( DocIdEncodingBenchmark.class.getResourceAsStream(
"/org.apache.lucene.benchmark.jmh/docIds_bpv21.txt")); "/org.apache.lucene.benchmark.jmh/docIds_bpv21.txt"));
} }
} catch (FileNotFoundException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }