wangjialing218 commented on code in PR #3158:
URL: https://github.com/apache/bookkeeper/pull/3158#discussion_r931817702
##########
bookkeeper-common/src/main/java/org/apache/bookkeeper/common/net/ServiceURI.java:
##########
@@ -215,21 +249,21 @@ public static ServiceURI create(URI uri) {
}
private static String validateHostName(String serviceName, String
hostname) {
- String[] parts = hostname.split(":");
- if (parts.length >= 3) {
+ URI uri = null;
+ try {
+ uri = URI.create("dummyscheme://" + hostname);
Review Comment:
In fact any one of testcase in ServiceURITest could cover this,
`ServiceURI#create` call `ServiceURI#validateHostName` to validate the format
of host name.
--
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]