SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated

(cherry picked from commit 603be023fe)
This commit is contained in:
Chris Hostetter 2019-11-12 13:41:46 -07:00
parent 26b7799af6
commit b872863da9
2 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,9 @@ Other Changes
* SOLR-13824: Strictly reject anything after JSON in most APIs (Mikhail Khludnev, Munendra S N)
* SOLR-13864: SolrTestCaseJ4.getNextAvailablePort() has been deprecated (and will be removed in 9.0) since
it is fundementally flawed. Users with tests that depend on this method should restructure them. (hossman)
================== 8.3.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -902,7 +902,10 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
* 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)) {