srinireddy2020 commented on code in PR #6456:
URL: https://github.com/apache/hbase/pull/6456#discussion_r2301847185


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java:
##########
@@ -1496,6 +1505,32 @@ protected void handleReportForDutyResponse(final 
RegionServerStartupResponse c)
     }
   }
 
+  /**
+   * Normalizes an IPv6 address string by removing leading and trailing square 
brackets if present,
+   * returning the canonical IPv6 address form.
+   * <p>
+   * This method is intended to convert IPv6 addresses from URI or config 
contexts, where brackets
+   * may be used, into a format accepted by standard Java networking APIs.
+   * <p>
+   * Examples:
+   *
+   * <pre>
+   *   normalizeIPv6Address("[2001:db8::1]") returns "2001:db8::1"
+   *   normalizeIPv6Address("2001:db8::1")  returns "2001:db8::1"
+   *   normalizeIPv6Address("[::1]")        returns "::1"
+   * </pre>
+   *
+   * @param address the input IPv6 address, possibly with square brackets
+   * @return the normalized IPv6 address string without brackets
+   */
+  private String normalizeIPv6Address(String address) {

Review Comment:
   code comment added, pls check



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to