From e20be32b55b8105ec3e037a2159228f3e902241c Mon Sep 17 00:00:00 2001 From: expani Date: Mon, 7 Oct 2024 14:32:18 +0530 Subject: [PATCH] Fixed gradle check errors --- .../lucene/benchmark/jmh/DocIdEncodingBenchmark.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java index b7f1f9f0eae..e83e8929154 100644 --- a/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java +++ b/lucene/benchmark-jmh/src/java/org/apache/lucene/benchmark/jmh/DocIdEncodingBenchmark.java @@ -16,14 +16,13 @@ */ package org.apache.lucene.benchmark.jmh; -import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.InvocationTargetException; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.StandardOpenOption; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -444,14 +443,16 @@ public class DocIdEncodingBenchmark { try { 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 { DOC_ID_SEQUENCES = docIdProvider.getDocIds( DocIdEncodingBenchmark.class.getResourceAsStream( "/org.apache.lucene.benchmark.jmh/docIds_bpv21.txt")); } - } catch (FileNotFoundException e) { + } catch (IOException e) { throw new RuntimeException(e); } }