Apache Solr open-source search software
SOLR-16410: Upgrade build tool versions (#1011)
Kevin Risdendadf0f0b4e91
diff --git a/build.gradle b/build.gradleindex ba05d41b24c..cc0d3f2d271 100644--- a/build.gradle+++ b/build.gradle@@ -20,14 +20,14 @@ import java.time.format.DateTimeFormatterplugins {id "base"- id "com.palantir.consistent-versions" version "2.8.0"- id "org.owasp.dependencycheck" version "6.5.3"- id 'ca.cutterslade.analyze' version "1.8.3"+ id "com.palantir.consistent-versions" version "2.11.0"+ id "org.owasp.dependencycheck" version "7.2.0"+ id 'ca.cutterslade.analyze' version "1.9.0"id 'de.thetaphi.forbiddenapis' version '3.3' apply false- id "de.undercouch.download" version "4.0.2" apply false+ id "de.undercouch.download" version "5.2.0" apply falseid "net.ltgt.errorprone" version "2.0.2" apply false- id 'com.diffplug.spotless' version "6.3.0" apply false- id 'com.github.node-gradle.node' version '3.1.1' apply false+ id 'com.diffplug.spotless' version "6.5.2" apply false+ id 'com.github.node-gradle.node' version '3.4.0' apply false}apply from: file('gradle/globals.gradle')@@ -108,7 +108,7 @@ configurations {dependencies {// Use a newer groovy that doesn't have illegal reflective accesses.- groovy "org.codehaus.groovy:groovy-all:3.0.9"+ groovy "org.codehaus.groovy:groovy-all:3.0.12"}apply from: file('buildSrc/scriptDepVersions.gradle')diff --git a/buildSrc/scriptDepVersions.gradle b/buildSrc/scriptDepVersions.gradleindex cdc130f11d6..802aa2a6275 100644--- a/buildSrc/scriptDepVersions.gradle+++ b/buildSrc/scriptDepVersions.gradle@@ -21,11 +21,11 @@ext {scriptDepVersions = [- "apache-rat": "0.13",+ "apache-rat": "0.14","commons-codec": "1.15",- "ecj": "3.28.0",- "javacc": "7.0.10",- "jgit": "5.13.0.202109080827-r",+ "ecj": "3.30.0",+ "javacc": "7.0.12",+ "jgit": "5.13.1.202206130422-r","flexmark": "0.64.0",]}diff --git a/gradle/validation/dependency-analyze.gradle b/gradle/validation/dependency-analyze.gradleindex 55339e9c0af..1f35012ecf2 100644--- a/gradle/validation/dependency-analyze.gradle+++ b/gradle/validation/dependency-analyze.gradle@@ -24,13 +24,13 @@ allprojects { prj ->analyzeClassesDependencies {warnUsedUndeclared = false // means fail build if UsedUndeclared found- warnUnusedDeclared = true // means only log warning if UnusedDeclared found+ warnUnusedDeclared = false // means fail build if UnusedDeclared foundlogDependencyInformationToFiles = true}analyzeTestClassesDependencies {warnUsedUndeclared = false // means fail build if UsedUndeclared found- warnUnusedDeclared = true // means only log warning if UnusedDeclared found+ warnUnusedDeclared = false // means fail build if UnusedDeclared foundlogDependencyInformationToFiles = true}})diff --git a/gradle/validation/error-prone.gradle b/gradle/validation/error-prone.gradleindex 12f655f219e..9915d892398 100644--- a/gradle/validation/error-prone.gradle+++ b/gradle/validation/error-prone.gradle@@ -84,6 +84,7 @@ allprojects { prj ->'-Xep:BadImport:OFF', // style preference that we don't want to enforce'-Xep:BadInstanceof:OFF','-Xep:BadShiftAmount:OFF',+ '-Xep:CanIgnoreReturnValueSuggester:OFF','-Xep:ClassCanBeStatic:OFF','-Xep:CollectionUndefinedEquality:OFF','-Xep:ComplexBooleanConstant:OFF',diff --git a/gradle/validation/spotless.gradle b/gradle/validation/spotless.gradleindex daee2561b2c..90bd625dce1 100644--- a/gradle/validation/spotless.gradle+++ b/gradle/validation/spotless.gradle@@ -37,7 +37,7 @@ configure(project(":solr").subprojects) { prj ->lineEndings 'UNIX'endWithNewline()- googleJavaFormat('1.14.0')+ googleJavaFormat('1.15.0')// Apply to all Java sourcestarget "src/**/*.java"@@ -82,6 +82,11 @@ configure(project(":solr").subprojects) { prj ->}}+ // Emit a custom message about how to fix formatting errors.+ tasks.matching { task -> task.name == "spotlessJavaCheck" }.configureEach {+ runToFixMessage.set("\nIMPORTANT: run the top-level './gradlew tidy' to format code automatically (see help/formatting.txt for more info).")+ }+// Add an alias to 'spotlessApply' simply called 'tidy' and wire up// spotlessCheck to convention's check.task tidy() {diff --git a/solr/core/build.gradle b/solr/core/build.gradleindex a97563a8827..2f9a0c14abb 100644--- a/solr/core/build.gradle+++ b/solr/core/build.gradle@@ -81,9 +81,12 @@ dependencies {implementation 'javax.servlet:javax.servlet-api'- implementation "org.glassfish.jersey.containers:jersey-container-jetty-http"+ implementation 'org.glassfish.jersey.containers:jersey-container-jetty-http'+ permitUnusedDeclared 'org.glassfish.jersey.containers:jersey-container-jetty-http'implementation 'org.glassfish.jersey.inject:jersey-hk2'+ permitUnusedDeclared 'org.glassfish.jersey.inject:jersey-hk2'implementation 'org.glassfish.jersey.media:jersey-media-json-jackson'+ permitUnusedDeclared 'org.glassfish.jersey.media:jersey-media-json-jackson'implementation 'org.glassfish.jersey.core:jersey-common'implementation 'org.glassfish.jersey.core:jersey-server'implementation 'org.glassfish.hk2:hk2-api'@@ -98,6 +101,7 @@ dependencies {runtimeOnly "org.apache.lucene:lucene-backward-codecs"implementation "org.apache.lucene:lucene-codecs"implementation "org.apache.lucene:lucene-backward-codecs"+ permitUnusedDeclared "org.apache.lucene:lucene-backward-codecs"implementation "org.apache.lucene:lucene-classification"implementation "org.apache.lucene:lucene-expressions"implementation "org.apache.lucene:lucene-grouping"@@ -194,6 +198,7 @@ dependencies {testImplementation 'org.glassfish.jersey.test-framework:jersey-test-framework-core'testImplementation 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2'+ permitTestUnusedDeclared 'org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-grizzly2'testImplementation('org.mockito:mockito-core', {diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.javaindex 6efeef06a25..8423b192b7f 100644--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java@@ -1008,8 +1008,7 @@ public class SolrCore implements SolrInfoBean, Closeable {}}- public <T extends Object> T createInitInstance(- PluginInfo info, Class<T> cast, String msg, String defClassName) {+ public <T> T createInitInstance(PluginInfo info, Class<T> cast, String msg, String defClassName) {if (info == null) return null;T o =createInstance(@@ -1021,7 +1020,7 @@ public class SolrCore implements SolrInfoBean, Closeable {return initPlugin(info, o);}- public static <T extends Object> T initPlugin(PluginInfo info, T o) {+ public static <T> T initPlugin(PluginInfo info, T o) {if (o instanceof PluginInfoInitialized) {((PluginInfoInitialized) o).init(info);} else if (o instanceof NamedListInitializedPlugin) {diff --git a/solr/core/src/java/org/apache/solr/parser/QueryParser.java b/solr/core/src/java/org/apache/solr/parser/QueryParser.javaindex 67fa3b7a162..f1fb211c94d 100644--- a/solr/core/src/java/org/apache/solr/parser/QueryParser.java+++ b/solr/core/src/java/org/apache/solr/parser/QueryParser.java@@ -2,14 +2,6 @@/* Generated By:JavaCC: Do not edit this line. QueryParser.java */package org.apache.solr.parser;-import org.apache.lucene.analysis.Analyzer;-import org.apache.lucene.queryparser.charstream.CharStream;-import org.apache.lucene.queryparser.charstream.FastCharStream;-import org.apache.lucene.search.BooleanClause;-import org.apache.lucene.search.Query;-import org.apache.solr.search.QParser;-import org.apache.solr.search.SyntaxError;-import java.io.StringReader;import java.util.ArrayList;import java.util.Arrays;@@ -17,6 +9,15 @@ import java.util.HashSet;import java.util.List;import java.util.Set;+import org.apache.lucene.analysis.Analyzer;+import org.apache.lucene.search.BooleanClause;+import org.apache.lucene.search.Query;+import org.apache.solr.search.SyntaxError;+import org.apache.solr.search.QParser;++import org.apache.lucene.queryparser.charstream.CharStream;+import org.apache.lucene.queryparser.charstream.FastCharStream;+public class QueryParser extends SolrQueryParserBase implements QueryParserConstants {/** The default operator for parsing queries.*/@@ -833,8 +834,8 @@ if (splitOnWhitespace == false) {return this;}}- @SuppressWarnings("StaticAssignmentOfThrowable")- static private final LookaheadSuccess jj_ls = new LookaheadSuccess();+ @SuppressWarnings("StaticAssignmentOfThrowable")+ static private final LookaheadSuccess jj_ls = new LookaheadSuccess();private boolean jj_scan_token(int kind) {if (jj_scanpos == jj_lastpos) {jj_la--;diff --git a/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java b/solr/core/src/java/org/apache/solr/parser/TokenMgrError.javaindex 609c572de27..085a4928211 100644--- a/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java+++ b/solr/core/src/java/org/apache/solr/parser/TokenMgrError.java@@ -95,7 +95,7 @@ public class TokenMgrError extends Error* token manager to indicate a lexical error.* Parameters :* EOFSeen : indicates if EOF caused the lexical error- * curLexState : lexical state in which this error occurred+ * lexState : lexical state in which this error occurred* errorLine : line number when the error occurred* errorColumn : column number when the error occurred* errorAfter : prefix that was seen before this error occurred@@ -103,12 +103,12 @@ public class TokenMgrError extends Error* Note: You can customize the lexical error message by modifying this method.*/protected static String LexicalErr(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, int curChar) {- char curChar1 = (char)curChar;- return("Lexical error at line " +- errorLine + ", column " +- errorColumn + ". Encountered: " +- (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar1)) + "\"") + " (" + curChar + "), ") +- "after : \"" + addEscapes(errorAfter) + "\"");+ return("Lexical error at line " + //+ errorLine + ", column " + //+ errorColumn + ". Encountered: " + //+ (EOFSeen ? "<EOF>" : ("'" + addEscapes(String.valueOf(curChar)) + "' (" + curChar + "),")) + //+ (errorAfter == null || errorAfter.length() == 0 ? "" : " after prefix \"" + addEscapes(errorAfter) + "\"")) + //+ (lexState == 0 ? "" : " (in lexical state " + lexState + ")");}/**diff --git a/solr/core/src/test/org/apache/solr/cloud/MockSolrSource.java b/solr/core/src/test/org/apache/solr/cloud/MockSolrSource.javaindex 804983c71b4..37a79777525 100644--- a/solr/core/src/test/org/apache/solr/cloud/MockSolrSource.java+++ b/solr/core/src/test/org/apache/solr/cloud/MockSolrSource.java@@ -24,6 +24,7 @@ import org.apache.solr.common.cloud.ZkStateReader;public class MockSolrSource {+ @SuppressWarnings("DirectInvocationOnMock")public static ZkController makeSimpleMock(Overseer overseer, ZkStateReader reader, SolrZkClient zkClient) {ZkController zkControllerMock = mock(ZkController.class);diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.javaindex c59f1195b66..cf10c16406f 100644--- a/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionConfigSetProcessorTest.java@@ -134,7 +134,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {private static SolrMetricsContext solrMetricsContextMock;private static ObjectCache objectCache;- private Map<String, byte[]> zkClientData = new HashMap<>();+ private final Map<String, byte[]> zkClientData = new HashMap<>();private final Map<String, ClusterState.CollectionRef> collectionsSet = new HashMap<>();private final List<ZkNodeProps> replicas = new ArrayList<>();private SolrResponse lastProcessMessageResult;@@ -142,7 +142,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {private OverseerCollectionConfigSetProcessorToBeTested underTest;private Thread thread;- private Queue<QueueEvent> queue = new ArrayBlockingQueue<>(10);+ private final Queue<QueueEvent> queue = new ArrayBlockingQueue<>(10);private static class OverseerCollectionConfigSetProcessorToBeTestedextends OverseerCollectionConfigSetProcessor {@@ -282,7 +282,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {super.tearDown();}- @SuppressWarnings("unchecked")+ @SuppressWarnings({"DirectInvocationOnMock", "unchecked"})protected Set<String> commonMocks(int liveNodesCount, boolean distributedClusterStateUpdates)throws Exception {when(shardHandlerFactoryMock.getShardHandler()).thenReturn(shardHandlerMock);@@ -297,7 +297,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {if (count > 1) return null;}- return Arrays.asList(result);+ return List.of(result);});when(workQueueMock.getTailId())@@ -506,7 +506,8 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {Mockito.doAnswer(new Answer<Void>() {public Void answer(InvocationOnMock invocation) {- System.out.println("set data: " + invocation.getArgument(0) + " " + new byte[0]);+ System.out.println(+ "set data: " + invocation.getArgument(0) + " " + Arrays.toString(new byte[0]));zkClientData.put(invocation.getArgument(0), new byte[0]);return null;}@@ -570,10 +571,12 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {public Void answer(InvocationOnMock invocation) {try {handleCreateCollMessage(invocation.getArgument(0));- stateUpdateQueueMock.offer(invocation.getArgument(0));+ verify(stateUpdateQueueMock, Mockito.atLeast(0))+ .offer(invocation.getArgument(0));} catch (KeeperException e) {throw new RuntimeException(e);} catch (InterruptedException e) {+ Thread.currentThread().interrupt();throw new RuntimeException(e);}return null;@@ -678,6 +681,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {replicas.add(props);}} catch (Exception e) {+ log.error("Ignored exception", e);}}@@ -788,7 +792,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {"Shard " + coreName + " created on wrong node " + shardRequest.shards[0],nodeUrlWithoutProtocolPartForLiveNodes.contains(shardRequest.shards[0]));coreName_TO_nodeUrlWithoutProtocolPartForLiveNodes_map.put(coreName, shardRequest.shards[0]);- assertEquals(shardRequest.shards, shardRequest.actualShards);+ assertArrayEquals(shardRequest.shards, shardRequest.actualShards);String sliceName = shardRequest.params.get(CoreAdminParams.SHARD);if (!sliceToNodeUrlsWithoutProtocolPartToNumberOfShardsRunningMapMap.containsKey(sliceName)) {@@ -831,9 +835,8 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {numberOfSlices.intValue(),sliceToNodeUrlsWithoutProtocolPartToNumberOfShardsRunningMapMap.size());for (int i = 1; i <= numberOfSlices; i++) {- sliceToNodeUrlsWithoutProtocolPartToNumberOfShardsRunningMapMap- .keySet()- .contains("shard" + i);+ assertTrue(+ sliceToNodeUrlsWithoutProtocolPartToNumberOfShardsRunningMapMap.containsKey("shard" + i));}int minShardsPerSlicePerNode = numberOfReplica / createNodes.size();int numberOfNodesSupposedToRunMaxShards = numberOfReplica % createNodes.size();@@ -905,6 +908,7 @@ public class OverseerCollectionConfigSetProcessorTest extends SolrTestCaseJ4 {SEND_NULL}+ @SuppressWarnings("DirectInvocationOnMock")protected void testTemplate(Integer numberOfNodes,Integer numberOfNodesToCreateOn,diff --git a/solr/licenses/error_prone_annotations-2.14.0.jar.sha1 b/solr/licenses/error_prone_annotations-2.14.0.jar.sha1deleted file mode 100644index 7f102a60197..00000000000--- a/solr/licenses/error_prone_annotations-2.14.0.jar.sha1+++ /dev/null@@ -1 +0,0 @@-9f01b3654d3c536859705f09f8d267ee977b4004diff --git a/solr/licenses/error_prone_annotations-2.15.0.jar.sha1 b/solr/licenses/error_prone_annotations-2.15.0.jar.sha1new file mode 100644index 00000000000..1d051d4a495--- /dev/null+++ b/solr/licenses/error_prone_annotations-2.15.0.jar.sha1@@ -0,0 +1 @@+38c8485a652f808c8c149150da4e5c2b0bd17f9adiff --git a/solr/licenses/randomizedtesting-runner-2.8.0.jar.sha1 b/solr/licenses/randomizedtesting-runner-2.8.0.jar.sha1deleted file mode 100644index a6b0aaa5121..00000000000--- a/solr/licenses/randomizedtesting-runner-2.8.0.jar.sha1+++ /dev/null@@ -1 +0,0 @@-631ae08801457db4398d0b376305d0cdab357a60diff --git a/solr/licenses/randomizedtesting-runner-2.8.1.jar.sha1 b/solr/licenses/randomizedtesting-runner-2.8.1.jar.sha1new file mode 100644index 00000000000..f284774194e--- /dev/null+++ b/solr/licenses/randomizedtesting-runner-2.8.1.jar.sha1@@ -0,0 +1 @@+55ffe691e90d31ab916746516654b5701e532d6fdiff --git a/solr/modules/clustering/build.gradle b/solr/modules/clustering/build.gradleindex 652a7d60528..fa0811dda7d 100644--- a/solr/modules/clustering/build.gradle+++ b/solr/modules/clustering/build.gradle@@ -29,7 +29,6 @@ dependencies {implementation 'org.slf4j:slf4j-api'testImplementation project(':solr:test-framework')- testImplementation 'org.apache.lucene:lucene-test-framework'testImplementation 'com.carrotsearch.randomizedtesting:randomizedtesting-runner'testImplementation 'junit:junit'testImplementation 'org.hamcrest:hamcrest'diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.javaindex c2ac1acae73..c69b6ad7571 100644--- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java+++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/HdfsRecoverLeaseTest.java@@ -32,7 +32,6 @@ import org.apache.solr.SolrIgnoredThreadsFilter;import org.apache.solr.SolrTestCaseJ4;import org.apache.solr.hdfs.util.BadHdfsThreadsFilter;import org.apache.solr.hdfs.util.HdfsRecoverLeaseFileSystemUtils;-import org.apache.solr.hdfs.util.HdfsRecoverLeaseFileSystemUtils.CallerInfo;import org.junit.After;import org.junit.AfterClass;import org.junit.Before;@@ -85,24 +84,14 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {Path path = new Path(uri);Configuration conf = HdfsTestUtil.getClientConfiguration(dfsCluster);FileSystem fs1 = FileSystem.get(path.toUri(), conf);- Path testFile = new Path(uri.toString() + "/testfile");+ Path testFile = new Path(uri + "/testfile");FSDataOutputStream out = fs1.create(testFile);out.write(5);out.hflush();out.close();- HdfsRecoverLeaseFileSystemUtils.recoverFileLease(- fs1,- testFile,- conf,- new CallerInfo() {-- @Override- public boolean isCallerClosed() {- return false;- }- });+ HdfsRecoverLeaseFileSystemUtils.recoverFileLease(fs1, testFile, conf, () -> false);assertEquals(0,HdfsRecoverLeaseFileSystemUtils.RECOVER_LEASE_SUCCESS_COUNT.get()@@ -111,7 +100,7 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {fs1.close();FileSystem fs2 = FileSystem.get(path.toUri(), conf);- Path testFile2 = new Path(uri.toString() + "/testfile2");+ Path testFile2 = new Path(uri + "/testfile2");FSDataOutputStream out2 = fs2.create(testFile2);if (random().nextBoolean()) {@@ -127,17 +116,7 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {FileSystem fs3 = FileSystem.get(path.toUri(), conf);- HdfsRecoverLeaseFileSystemUtils.recoverFileLease(- fs3,- testFile2,- conf,- new CallerInfo() {-- @Override- public boolean isCallerClosed() {- return false;- }- });+ HdfsRecoverLeaseFileSystemUtils.recoverFileLease(fs3, testFile2, conf, () -> false);assertEquals(1,HdfsRecoverLeaseFileSystemUtils.RECOVER_LEASE_SUCCESS_COUNT.get()@@ -148,6 +127,7 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {}@Test+ @SuppressWarnings("DoNotCall")public void testMultiThreaded() throws Exception {long startRecoverLeaseSuccessCount =HdfsRecoverLeaseFileSystemUtils.RECOVER_LEASE_SUCCESS_COUNT.get();@@ -158,8 +138,8 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {// n threads create filesclass WriterThread extends Thread {- private FileSystem fs;- private int id;+ private final FileSystem fs;+ private final int id;public WriterThread(int id) {this.id = id;@@ -172,7 +152,7 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {@Overridepublic void run() {- Path testFile = new Path(uri.toString() + "/file-" + id);+ Path testFile = new Path(uri + "/file-" + id);FSDataOutputStream out;try {out = fs.create(testFile);@@ -199,8 +179,8 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {}class RecoverThread extends Thread {- private FileSystem fs;- private int id;+ private final FileSystem fs;+ private final int id;public RecoverThread(int id) {this.id = id;@@ -213,19 +193,9 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {@Overridepublic void run() {- Path testFile = new Path(uri.toString() + "/file-" + id);+ Path testFile = new Path(uri + "/file-" + id);try {- HdfsRecoverLeaseFileSystemUtils.recoverFileLease(- fs,- testFile,- conf,- new CallerInfo() {-- @Override- public boolean isCallerClosed() {- return false;- }- });+ HdfsRecoverLeaseFileSystemUtils.recoverFileLease(fs, testFile, conf, () -> false);} catch (IOException e) {throw new RuntimeException(e);}@@ -236,13 +206,14 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {}}- Set<WriterThread> writerThreads = new HashSet<WriterThread>();- Set<RecoverThread> recoverThreads = new HashSet<RecoverThread>();+ Set<WriterThread> writerThreads = new HashSet<>();+ Set<RecoverThread> recoverThreads = new HashSet<>();int threadCount = 3;for (int i = 0; i < threadCount; i++) {WriterThread wt = new WriterThread(i);writerThreads.add(wt);+ // should be wt.start();wt.run();}@@ -255,6 +226,7 @@ public class HdfsRecoverLeaseTest extends SolrTestCaseJ4 {for (WriterThread wt : writerThreads) {RecoverThread rt = new RecoverThread(wt.getFileId());recoverThreads.add(rt);+ // should be rt.start();rt.run();}diff --git a/solr/modules/jwt-auth/build.gradle b/solr/modules/jwt-auth/build.gradleindex 9e137e1bced..92fae20b085 100644--- a/solr/modules/jwt-auth/build.gradle+++ b/solr/modules/jwt-auth/build.gradle@@ -19,7 +19,17 @@ apply plugin: 'java-library'description = 'JWT / OpenID Connect / OAuth2 authentication plugin'+// This is a hacky way to use permitTestUnusedDeclared with bom declared dependencies.+// See https://github.com/gradle-dependency-analyze/gradle-dependency-analyze/issues/108+configurations {+ constraintsOnly+ permitTestUnusedDeclared.extendsFrom constraintsOnly+ implementation.extendsFrom constraintsOnly+}+dependencies {+ constraintsOnly(platform("com.fasterxml.jackson:jackson-bom"))+implementation project(':solr:core')implementation project(':solr:solrj')@@ -48,8 +58,7 @@ dependencies {})// required by mock-oauth2-servertestImplementation 'com.fasterxml.jackson.core:jackson-databind'- // Not working currently https://github.com/gradle-dependency-analyze/gradle-dependency-analyze/issues/108- //permitTestUnusedDeclared 'com.fasterxml.jackson.core:jackson-databind'+ permitTestUnusedDeclared 'com.fasterxml.jackson.core:jackson-databind'testImplementation 'com.nimbusds:nimbus-jose-jwt'testImplementation 'com.squareup.okhttp3:mockwebserver'diff --git a/solr/packaging/build.gradle b/solr/packaging/build.gradleindex 6b993add6a5..095c9ccb6ca 100644--- a/solr/packaging/build.gradle+++ b/solr/packaging/build.gradle@@ -223,4 +223,4 @@ class BatsTask extends Exec {super.exec()}-}\ No newline at end of file+}diff --git a/solr/prometheus-exporter/build.gradle b/solr/prometheus-exporter/build.gradleindex 8d7e5d9418e..4a91969e4a9 100644--- a/solr/prometheus-exporter/build.gradle+++ b/solr/prometheus-exporter/build.gradle@@ -43,7 +43,6 @@ dependencies {testImplementation project(':solr:core')testImplementation project(':solr:test-framework')- testImplementation 'org.apache.lucene:lucene-test-framework'testImplementation 'com.carrotsearch.randomizedtesting:randomizedtesting-runner'testImplementation 'junit:junit'diff --git a/solr/server/build.gradle b/solr/server/build.gradleindex c5e715cecc1..7ff587adea5 100644--- a/solr/server/build.gradle+++ b/solr/server/build.gradle@@ -136,4 +136,4 @@ artifacts {}}-assemble.dependsOn assemblePackaging\ No newline at end of file+assemble.dependsOn assemblePackagingdiff --git a/solr/solrj/build.gradle b/solr/solrj/build.gradleindex 36d4035c84f..f12ef45703c 100644--- a/solr/solrj/build.gradle+++ b/solr/solrj/build.gradle@@ -51,7 +51,6 @@ dependencies {testImplementation 'org.apache.zookeeper:zookeeper'permitTestUnusedDeclared 'org.apache.zookeeper:zookeeper'- testImplementation 'org.apache.lucene:lucene-analysis-common'testImplementation 'org.apache.lucene:lucene-core'testImplementation 'org.apache.lucene:lucene-test-framework'diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.javaindex 266d05377bf..8a4877f5142 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java@@ -160,6 +160,5 @@ public class CloudHttp2SolrClientBuilderTest extends SolrTestCase {}// it's external, should be NOT closed when closing CloudSolrClientverify(http2Client, never()).close();- http2Client.close();}}diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.javaindex 0a1230123d1..637bb8ca68d 100644--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java@@ -20,7 +20,6 @@ import java.util.Arrays;import java.util.HashMap;import java.util.List;import java.util.Map;-import junit.framework.Assert;import org.apache.solr.SolrTestCase;import org.apache.solr.client.solrj.io.Tuple;import org.apache.solr.client.solrj.io.eval.AscEvaluator;@@ -49,8 +48,8 @@ public class AscEvaluatorTest extends SolrTestCase {values.clear();values.put("a", Arrays.asList(2, 4, 1, 3, 5, 8, 7));result = evaluator.evaluate(new Tuple(values));- Assert.assertTrue(result instanceof List<?>);- Assert.assertEquals(7, ((List<?>) result).size());+ assertTrue(result instanceof List<?>);+ assertEquals(7, ((List<?>) result).size());checkOrder(Arrays.asList(1D, 2D, 3D, 4D, 5D, 7D, 8D), (List<Object>) result);}@@ -63,8 +62,8 @@ public class AscEvaluatorTest extends SolrTestCase {values.clear();values.put("a", Arrays.asList(2.3, 2.1, 2.7, 2.6, 2.5));result = evaluator.evaluate(new Tuple(values));- Assert.assertTrue(result instanceof List<?>);- Assert.assertEquals(5, ((List<?>) result).size());+ assertTrue(result instanceof List<?>);+ assertEquals(5, ((List<?>) result).size());checkOrder(Arrays.asList(2.1, 2.3, 2.5, 2.6, 2.7), (List<Object>) result);}@@ -77,8 +76,8 @@ public class AscEvaluatorTest extends SolrTestCase {values.clear();values.put("a", Arrays.asList(2.3, 2.1, 2.0, 2.7, 2.6, 2.5, 3));result = evaluator.evaluate(new Tuple(values));- Assert.assertTrue(result instanceof List<?>);- Assert.assertEquals(7, ((List<?>) result).size());+ assertTrue(result instanceof List<?>);+ assertEquals(7, ((List<?>) result).size());checkOrder(Arrays.asList(2D, 2.1, 2.3, 2.5, 2.6, 2.7, 3D), (List<Object>) result);}@@ -91,20 +90,20 @@ public class AscEvaluatorTest extends SolrTestCase {values.clear();values.put("a", Arrays.asList("a", "c", "b", "e", "d"));result = evaluator.evaluate(new Tuple(values));- Assert.assertTrue(result instanceof List<?>);- Assert.assertEquals(5, ((List<?>) result).size());+ assertTrue(result instanceof List<?>);+ assertEquals(5, ((List<?>) result).size());checkOrder(Arrays.asList("a", "b", "c", "d", "e"), (List<Object>) result);}- private <T> void checkOrder(List<?> expected, List<?> actual) {- Assert.assertEquals(expected.size(), actual.size());+ private void checkOrder(List<?> expected, List<?> actual) {+ assertEquals(expected.size(), actual.size());for (int idx = 0; idx < expected.size(); ++idx) {@SuppressWarnings({"unchecked"})Comparable<Object> expectedValue = (Comparable<Object>) expected.get(idx);@SuppressWarnings({"unchecked"})Comparable<Object> actualValue = (Comparable<Object>) actual.get(idx);- Assert.assertEquals(0, expectedValue.compareTo(actualValue));+ assertEquals(0, expectedValue.compareTo(actualValue));}}}diff --git a/versions.lock b/versions.lockindex fe7351f9d14..437aecb4186 100644--- a/versions.lock+++ b/versions.lock@@ -2,7 +2,7 @@com.adobe.xmp:xmpcore:6.1.10 (1 constraints: fd0d5947)com.beust:jcommander:1.82 (2 constraints: 2b123714)com.carrotsearch:hppc:0.9.1 (2 constraints: ad0fc9a6)-com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.0 (2 constraints: cd15cfe1)+com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.8.1 (2 constraints: ce1500e2)com.cybozu.labs:langdetect:1.1-20120112 (1 constraints: 5c066d5e)com.epam:parso:2.0.14 (1 constraints: 8e0c750e)com.esri.geometry:esri-geometry-api:2.2.0 (1 constraints: 5c0db22c)@@ -17,7 +17,7 @@ com.github.ben-manes.caffeine:caffeine:3.1.1 (1 constraints: 0705fe35)com.github.jai-imageio:jai-imageio-core:1.4.0 (1 constraints: 5c0ced01)com.github.junrar:junrar:7.5.2 (1 constraints: 650c1002)com.github.openjson:openjson:1.0.12 (1 constraints: 8b0c6d0e)-com.github.spotbugs:spotbugs-annotations:4.5.3 (1 constraints: 0e051136)+com.github.spotbugs:spotbugs-annotations:4.7.2 (1 constraints: 0f051636)com.github.virtuald:curvesapi:1.07 (1 constraints: 9e0ac7c0)com.github.zafarkhaja:java-semver:0.9.0 (1 constraints: 0b050636)com.google.api:api-common:2.2.1 (5 constraints: 8543fda1)@@ -35,7 +35,7 @@ com.google.cloud:google-cloud-core:2.8.6 (3 constraints: cc2e39e1)com.google.cloud:google-cloud-core-http:2.8.6 (1 constraints: f40ff795)com.google.cloud:google-cloud-storage:2.11.3 (2 constraints: cf1cb826)com.google.code.gson:gson:2.9.1 (6 constraints: de586bc0)-com.google.errorprone:error_prone_annotations:2.14.0 (4 constraints: 5e3861e5)+com.google.errorprone:error_prone_annotations:2.15.0 (4 constraints: 5e3861e5)com.google.guava:failureaccess:1.0.1 (2 constraints: f9199e37)com.google.guava:guava:31.1-jre (17 constraints: 7c0afe78)com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (2 constraints: 4b35b0a0)@@ -153,7 +153,7 @@ org.apache.kerby:kerby-pkix:1.0.1 (1 constraints: 710bfce4)org.apache.kerby:kerby-util:1.0.1 (2 constraints: 6518bdb6)org.apache.logging.log4j:log4j-1.2-api:2.17.2 (1 constraints: 3e05463b)org.apache.logging.log4j:log4j-api:2.17.2 (9 constraints: 886f1688)-org.apache.logging.log4j:log4j-core:2.17.2 (4 constraints: 8b390a2a)+org.apache.logging.log4j:log4j-core:2.17.2 (5 constraints: 6f55c3ab)org.apache.logging.log4j:log4j-layout-template-json:2.17.2 (1 constraints: 3e05463b)org.apache.logging.log4j:log4j-slf4j-impl:2.17.2 (1 constraints: 3e05463b)org.apache.logging.log4j:log4j-web:2.17.2 (1 constraints: 3e05463b)@@ -271,7 +271,7 @@ org.itadaki:bzip2:0.9.1 (2 constraints: bd0c4b2c)org.javassist:javassist:3.25.0-GA (1 constraints: 2a110ef1)org.jctools:jctools-core:3.3.0 (1 constraints: 08050336)org.jdom:jdom2:2.0.6.1 (1 constraints: be0c371b)-org.junit:junit-bom:5.8.2 (1 constraints: c8116cde)+org.junit:junit-bom:5.9.0 (1 constraints: c7116dde)org.locationtech.spatial4j:spatial4j:0.8 (1 constraints: 59105498)org.opengis:geoapi:3.0.1 (7 constraints: 1361d046)org.openjdk.jmh:jmh-core:1.32 (1 constraints: da04f730)diff --git a/versions.props b/versions.propsindex 212d8d04299..8fbf4266f70 100644--- a/versions.props+++ b/versions.props@@ -1,14 +1,14 @@com.adobe.testing:s3mock-junit4=2.1.34-com.carrotsearch.randomizedtesting:*=2.8.0+com.carrotsearch.randomizedtesting:*=2.8.1com.carrotsearch:hppc=0.9.1com.cybozu.labs:langdetect=1.1-20120112com.fasterxml.jackson:jackson-bom=2.13.3com.fasterxml.woodstox:woodstox-core=6.2.8com.github.ben-manes.caffeine:caffeine=3.1.1-com.github.spotbugs:*=4.5.3+com.github.spotbugs:*=4.7.2com.github.zafarkhaja:java-semver=0.9.0com.google.cloud:google-cloud-bom=0.178.0-com.google.errorprone:*=2.11.0+com.google.errorprone:*=2.15.0com.google.guava:guava=31.1-jrecom.google.re2j:re2j=1.2com.jayway.jsonpath:json-path=2.4.0