diff --git a/solr/core/src/java/org/apache/solr/cloud/rule/RemoteCallback.java b/solr/core/src/java/org/apache/solr/cloud/rule/RemoteCallback.java index 5b6987dcd9f..ca3662ec21f 100644 --- a/solr/core/src/java/org/apache/solr/cloud/rule/RemoteCallback.java +++ b/solr/core/src/java/org/apache/solr/cloud/rule/RemoteCallback.java @@ -19,5 +19,5 @@ package org.apache.solr.cloud.rule; import java.util.Map; public interface RemoteCallback { - public void remoteCallback(SnitchContext ctx, Map returnedVal) ; + void remoteCallback(SnitchContext ctx, Map returnedVal); } diff --git a/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java index d940974d99c..947a3398183 100644 --- a/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/NestedRequestHandler.java @@ -24,5 +24,5 @@ import org.apache.solr.request.SolrRequestHandler; public interface NestedRequestHandler { /** Return a Requestandler to handle a subpath from the path this handler is registered. */ - public SolrRequestHandler getSubHandler(String subPath); + SolrRequestHandler getSubHandler(String subPath); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java index 75238ab30d3..58da1e967ed 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java +++ b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java @@ -794,14 +794,9 @@ public class QueryComponent extends SearchComponent rb.resultIds = new HashMap<>(); } - EndResultTransformer.SolrDocumentSource solrDocumentSource = new EndResultTransformer.SolrDocumentSource() { - - @Override - public SolrDocument retrieve(ScoreDoc doc) { - ShardDoc solrDoc = (ShardDoc) doc; - return rb.retrievedDocuments.get(solrDoc.id); - } - + EndResultTransformer.SolrDocumentSource solrDocumentSource = doc -> { + ShardDoc solrDoc = (ShardDoc) doc; + return rb.retrievedDocuments.get(solrDoc.id); }; EndResultTransformer endResultTransformer; if (groupSpec.isMain()) { diff --git a/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/EndResultTransformer.java b/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/EndResultTransformer.java index 40cd8d40eac..4645830e3ca 100644 --- a/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/EndResultTransformer.java +++ b/solr/core/src/java/org/apache/solr/search/grouping/endresulttransformer/EndResultTransformer.java @@ -42,7 +42,7 @@ public interface EndResultTransformer { * Abstracts the source for {@link SolrDocument} instances. * The source of documents is different for a distributed search than local search */ - public interface SolrDocumentSource { + interface SolrDocumentSource { SolrDocument retrieve(ScoreDoc doc); diff --git a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java index fc0bca8a125..89e286a7d67 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrCoreState.java +++ b/solr/core/src/java/org/apache/solr/update/SolrCoreState.java @@ -140,7 +140,7 @@ public abstract class SolrCoreState { public interface IndexWriterCloser { - public void closeWriter(IndexWriter writer) throws IOException; + void closeWriter(IndexWriter writer) throws IOException; } public abstract void doRecovery(CoreContainer cc, CoreDescriptor cd); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java b/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java index a8e206376db..72ebc5b0acb 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestCryptoKeys.java @@ -46,12 +46,7 @@ public class TestCryptoKeys extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient) client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java b/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java index 63afe6c6e7e..6570e4ab073 100644 --- a/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java +++ b/solr/core/src/test/org/apache/solr/core/TestDynamicLoading.java @@ -45,12 +45,7 @@ public class TestDynamicLoading extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/handler/TestConfigReload.java b/solr/core/src/test/org/apache/solr/handler/TestConfigReload.java index 3d89c4dd6f4..832ee1f9698 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestConfigReload.java +++ b/solr/core/src/test/org/apache/solr/handler/TestConfigReload.java @@ -60,12 +60,7 @@ public class TestConfigReload extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java index a4bc0ea81f6..aca6227b639 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReqParamsAPI.java @@ -43,12 +43,7 @@ public class TestReqParamsAPI extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient) client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java index 76ba9c54deb..8448ec7e16f 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java +++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerCloud.java @@ -49,12 +49,7 @@ public class TestSolrConfigHandlerCloud extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java index 43b83e20c71..003900c6652 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java +++ b/solr/core/src/test/org/apache/solr/handler/TestSolrConfigHandlerConcurrent.java @@ -61,12 +61,7 @@ public class TestSolrConfigHandlerConcurrent extends AbstractFullDistribZkTestBa private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java b/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java index 013bd900a16..24b073fe6a8 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java +++ b/solr/core/src/test/org/apache/solr/schema/TestBulkSchemaConcurrent.java @@ -60,12 +60,7 @@ public class TestBulkSchemaConcurrent extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaConcurrent.java b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaConcurrent.java index 0993ba113db..d22f11bb0a5 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaConcurrent.java +++ b/solr/core/src/test/org/apache/solr/schema/TestCloudManagedSchemaConcurrent.java @@ -90,12 +90,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } @@ -352,11 +347,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB final String coreUrl = (new ZkCoreNodeProps(shard1Leader)).getCoreUrl(); assertNotNull(coreUrl); - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - public String getBaseURL() { - return coreUrl.endsWith("/") ? coreUrl.substring(0, coreUrl.length()-1) : coreUrl; - } - }); + RestTestHarness harness = new RestTestHarness(() -> coreUrl.endsWith("/") ? coreUrl.substring(0, coreUrl.length()-1) : coreUrl); try { addFieldTypePut(harness, "fooInt", 15); } finally { @@ -413,11 +404,7 @@ public class TestCloudManagedSchemaConcurrent extends AbstractFullDistribZkTestB */ protected void validateZkVersion(Replica replica, int schemaZkVersion, int waitSecs, boolean retry) throws Exception { final String replicaUrl = (new ZkCoreNodeProps(replica)).getCoreUrl(); - RestTestHarness testHarness = new RestTestHarness(new RESTfulServerProvider() { - public String getBaseURL() { - return replicaUrl.endsWith("/") ? replicaUrl.substring(0, replicaUrl.length()-1) : replicaUrl; - } - }); + RestTestHarness testHarness = new RestTestHarness(() -> replicaUrl.endsWith("/") ? replicaUrl.substring(0, replicaUrl.length()-1) : replicaUrl); try { long waitMs = waitSecs * 1000L; if (waitMs > 0) Thread.sleep(waitMs); // wait a moment for the zk watcher to fire diff --git a/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java b/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java index dd5794d5615..e8a2f856022 100644 --- a/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java +++ b/solr/core/src/test/org/apache/solr/schema/TestCloudSchemaless.java @@ -81,12 +81,7 @@ public class TestCloudSchemaless extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient)client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient)client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java b/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java index d3304f45074..7e540c9069b 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java +++ b/solr/core/src/test/org/apache/solr/update/processor/TestNamedUpdateProcessors.java @@ -49,12 +49,7 @@ public class TestNamedUpdateProcessors extends AbstractFullDistribZkTestBase { private void setupHarnesses() { for (final SolrClient client : clients) { - RestTestHarness harness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return ((HttpSolrClient) client).getBaseURL(); - } - }); + RestTestHarness harness = new RestTestHarness(() -> ((HttpSolrClient) client).getBaseURL()); restTestHarnesses.add(harness); } } diff --git a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java index fe9ad08ee48..7de28b682b8 100644 --- a/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java +++ b/solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java @@ -898,7 +898,7 @@ public class JavaBinCodec { *

* Implementors of this interface write a method to serialize a given object using an existing {@link JavaBinCodec} */ - public static interface ObjectResolver { + public interface ObjectResolver { /** * Examine and attempt to serialize the given object, using a {@link JavaBinCodec} to write it to a stream. * @@ -907,12 +907,12 @@ public class JavaBinCodec { * @return the object {@code o} itself if it could not be serialized, or {@code null} if the whole object was successfully serialized. * @see JavaBinCodec */ - public Object resolve(Object o, JavaBinCodec codec) throws IOException; + Object resolve(Object o, JavaBinCodec codec) throws IOException; } public interface WritableDocFields { - public boolean isWritable(String name); - public boolean wantsAllFields(); + boolean isWritable(String name); + boolean wantsAllFields(); } diff --git a/solr/test-framework/src/java/org/apache/solr/util/RESTfulServerProvider.java b/solr/test-framework/src/java/org/apache/solr/util/RESTfulServerProvider.java index 7c591675c81..d4da5d9a7f4 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/RESTfulServerProvider.java +++ b/solr/test-framework/src/java/org/apache/solr/util/RESTfulServerProvider.java @@ -16,5 +16,5 @@ */ package org.apache.solr.util; public interface RESTfulServerProvider { - public String getBaseURL(); + String getBaseURL(); } diff --git a/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java b/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java index 06f578206ab..b6209bff906 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java @@ -51,12 +51,7 @@ abstract public class RestTestBase extends SolrJettyTestBase { createJetty(solrHome, configFile, schemaFile, context, stopAtShutdown, extraServlets); - restTestHarness = new RestTestHarness(new RESTfulServerProvider() { - @Override - public String getBaseURL() { - return jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME; - } - }); + restTestHarness = new RestTestHarness(() -> jetty.getBaseUrl().toString() + "/" + DEFAULT_TEST_CORENAME); } /** Validates an update XML String is successful