From 9c9949b2bcdf9d9fe9e72a0ae2f00dfc48b646ab Mon Sep 17 00:00:00 2001 From: sabi0 <2sabio@gmail.com> Date: Thu, 28 Dec 2023 19:28:24 +0100 Subject: [PATCH] Remove unused imports (#12970) --- .../java/org/apache/lucene/gradle/WrapperDownloader.java | 8 +------- .../org/apache/lucene/missingdoclet/MissingDoclet.java | 7 ++----- .../apache/lucene/monitor/ForceNoBulkScoringQuery.java | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java index 5123291bb83..133216b46f0 100644 --- a/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java +++ b/buildSrc/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java @@ -21,22 +21,16 @@ import java.io.InputStream; import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; -import java.net.URLConnection; -import java.nio.channels.Channels; -import java.nio.channels.FileChannel; -import java.nio.channels.ReadableByteChannel; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.EnumSet; import java.util.Locale; import java.util.concurrent.TimeUnit; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; -import static java.nio.file.StandardOpenOption.APPEND; /** * Standalone class that can be used to download a gradle-wrapper.jar @@ -60,7 +54,7 @@ public class WrapperDownloader { } public static void checkVersion() { - int major = Runtime.getRuntime().version().feature(); + int major = Runtime.version().feature(); if (major < 17 || major > 21) { throw new IllegalStateException("java version must be between 17 and 21, your version: " + major); } diff --git a/dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java b/dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java index 6cea1098c67..6e13068128c 100644 --- a/dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java +++ b/dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java @@ -21,12 +21,10 @@ import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Locale; -import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; @@ -75,8 +73,7 @@ public class MissingDoclet extends StandardDoclet { @Override public Set getSupportedOptions() { - Set options = new HashSet<>(); - options.addAll(super.getSupportedOptions()); + Set options = new HashSet<>(super.getSupportedOptions()); options.add(new Doclet.Option() { @Override public int getArgumentCount() { @@ -410,7 +407,7 @@ public class MissingDoclet extends StandardDoclet { case MODULE: case PACKAGE: // for modules/packages, we don't have filename + line number, fully qualify - fullMessage.append(element.toString()); + fullMessage.append(element); break; case METHOD: case CONSTRUCTOR: diff --git a/lucene/monitor/src/java/org/apache/lucene/monitor/ForceNoBulkScoringQuery.java b/lucene/monitor/src/java/org/apache/lucene/monitor/ForceNoBulkScoringQuery.java index a97d1054c4c..a2a069fafc5 100644 --- a/lucene/monitor/src/java/org/apache/lucene/monitor/ForceNoBulkScoringQuery.java +++ b/lucene/monitor/src/java/org/apache/lucene/monitor/ForceNoBulkScoringQuery.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.util.Objects; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.search.*; -import org.apache.lucene.search.Matches; /** Query wrapper that forces its wrapped Query to use the default doc-by-doc BulkScorer. */ class ForceNoBulkScoringQuery extends Query {