vkozhukhova commented on a change in pull request #8591:
URL: https://github.com/apache/ignite/pull/8591#discussion_r547763530
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/util/HostAndPortRange.java
##########
@@ -53,60 +53,89 @@ public static HostAndPortRange parse(String addrStr, int
dfltPortFrom, int dfltP
String host;
+ String portStr;
int portFrom;
int portTo;
if (F.isEmpty(addrStr))
throw createParseError(addrStr, errMsgPrefix, "Address is empty");
- final int colIdx = addrStr.indexOf(':');
+ if (addrStr.contains("[")) { // IPv6
+ int hostEndIdx = addrStr.indexOf(']');
+ if (hostEndIdx == -1) {
+ throw createParseError(addrStr, errMsgPrefix, "IPv6 host is
incorrect");
+ }
+ host = addrStr.substring(1, hostEndIdx);
Review comment:
Now it checks for `addrStr.charAt(0) == '['`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]