[NO ISSUE][NET] Use Resolved Address When Parsing Net Address
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Use resolved addresses when parsing host/port to
avoid unresolved address exception.
Change-Id: I7b48647c9452ccfde44dcf0a06579502f59bc3d1
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2808
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Michael Blow <mblow@apache.org>
Contrib: Michael Blow <mblow@apache.org>
diff --git a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
index e6e21fa..c6b76fc 100644
--- a/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
+++ b/hyracks-fullstack/hyracks/hyracks-util/src/main/java/org/apache/hyracks/util/NetworkUtil.java
@@ -84,7 +84,7 @@
int lastColon = hostPortString.lastIndexOf(':');
String host = decodeIPv6LiteralHost(lastColon < 0 ? hostPortString : hostPortString.substring(0, lastColon));
int port = lastColon < 0 ? 0 : Integer.parseInt(hostPortString.substring(lastColon + 1));
- return InetSocketAddress.createUnresolved(host, port);
+ return new InetSocketAddress(host, port);
}
public static InetSocketAddress toInetSocketAddress(String maybeLiteralHost, int port) {