Skip to content

Apache Lucene open-source search software

SOLR-13869: remove deprecated SolrTestCaseJ4.getNextAvailablePort() from master

Chris Hostetter3a5d67b87b2c
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index b9130745804..26709518276 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -34,7 +34,6 @@ import java.lang.invoke.MethodHandles;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
-import java.net.ServerSocket;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@@ -898,23 +897,6 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
initCoreDataDir = null;
}
- /**
- * Find next available local port.
- * @return available port number or -1 if none could be found
- * @throws Exception on IO errors
- * @see <a href="https://issues.apache.org/jira/browse/SOLR-13869">SOLR-13869</a>
- * @deprecated This method is inherently flawed, see SOLR-13869
- */
- @Deprecated
- protected static int getNextAvailablePort() throws Exception {
- int port = -1;
- try (ServerSocket s = new ServerSocket(0)) {
- port = s.getLocalPort();
- }
- return port;
- }
-
-
/** Validates an update XML String is successful
*/
public static void assertU(String update) {