diff --git a/src/main/java/org/opensearch/sdk/ActionListener.java b/src/main/java/org/opensearch/sdk/ActionListener.java index 75b9ee2ee..0468a15d6 100644 --- a/src/main/java/org/opensearch/sdk/ActionListener.java +++ b/src/main/java/org/opensearch/sdk/ActionListener.java @@ -32,7 +32,7 @@ public class ActionListener { * @throws UnknownHostException if the local host name could not be resolved into an address. */ @SuppressForbidden(reason = "need local ephemeral port") - protected static InetSocketAddress getLocalEphemeral() throws UnknownHostException { + private static InetSocketAddress createLocalEphemeralAddress() throws UnknownHostException { return new InetSocketAddress(InetAddress.getLocalHost(), 0); } @@ -50,7 +50,7 @@ public void runActionListener(boolean flag, int timeout) { // for testing considerations, otherwise zero which is interpreted as an infinite timeout socket.setSoTimeout(timeout); - socket.bind(getLocalEphemeral(), 1); + socket.bind(createLocalEphemeralAddress(), 1); socket.setReuseAddress(true); Thread t = new Thread() {