yuz10 commented on a change in pull request #3305:
URL: https://github.com/apache/rocketmq/pull/3305#discussion_r701949928
##########
File path: acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java
##########
@@ -206,61 +206,31 @@ public static boolean isIPv6Scope(int num) {
}
public static String expandIP(String netaddress, int part) {
- boolean compress = false;
- int compressIndex = -1;
- String[] strArray = StringUtils.split(netaddress, ":");
- ArrayList<Integer> indexes = new ArrayList<>();
- for (int i = 0; i < netaddress.length(); i++) {
- if (netaddress.charAt(i) == ':') {
- if (indexes.size() > 0 && i - indexes.get(indexes.size() - 1)
== 1) {
- compressIndex = i;
- compress = true;
- }
- indexes.add(i);
+ // expand netaddress
+ int separatorCount = StringUtils.countMatches(netaddress, ":");
+ int padCount = part - separatorCount;
+ if(padCount > 0){
Review comment:
make sure the checkstyle pass. run `mvn -Prelease-all -DskipTests
install -U` to check build
--
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]