This is an automated email from the ASF dual-hosted git repository.
yuzhou pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new e3d173bbc [ISSUE #6087] fix typos (#6091)
e3d173bbc is described below
commit e3d173bbc55f2b96021550de5396c9c148a50e14
Author: hardyfish <[email protected]>
AuthorDate: Tue Feb 21 22:17:16 2023 +0800
[ISSUE #6087] fix typos (#6091)
---
.../org/apache/rocketmq/acl/common/AclUtils.java | 82 +++++++++++-----------
1 file changed, 41 insertions(+), 41 deletions(-)
diff --git a/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java
b/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java
index de26cb743..c50448ec5 100644
--- a/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java
+++ b/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java
@@ -68,75 +68,75 @@ public class AclUtils {
return signature;
}
- public static void IPv6AddressCheck(String netaddress) {
- if (isAsterisk(netaddress) || isMinus(netaddress)) {
- int asterisk = netaddress.indexOf("*");
- int minus = netaddress.indexOf("-");
-// '*' must be the end of netaddress if it exists
- if (asterisk > -1 && asterisk != netaddress.length() - 1) {
- throw new AclException(String.format("Netaddress examine scope
Exception netaddress is %s", netaddress));
+ public static void IPv6AddressCheck(String netAddress) {
+ if (isAsterisk(netAddress) || isMinus(netAddress)) {
+ int asterisk = netAddress.indexOf("*");
+ int minus = netAddress.indexOf("-");
+// '*' must be the end of netAddress if it exists
+ if (asterisk > -1 && asterisk != netAddress.length() - 1) {
+ throw new AclException(String.format("NetAddress examine scope
Exception netAddress is %s", netAddress));
}
// format like "2::ac5:78:1-200:*" or "2::ac5:78:1-200" is legal
if (minus > -1) {
if (asterisk == -1) {
- if (minus <= netaddress.lastIndexOf(":")) {
- throw new AclException(String.format("Netaddress
examine scope Exception netaddress is %s", netaddress));
+ if (minus <= netAddress.lastIndexOf(":")) {
+ throw new AclException(String.format("NetAddress
examine scope Exception netAddress is %s", netAddress));
}
} else {
- if (minus <= netaddress.lastIndexOf(":",
netaddress.lastIndexOf(":") - 1)) {
- throw new AclException(String.format("Netaddress
examine scope Exception netaddress is %s", netaddress));
+ if (minus <= netAddress.lastIndexOf(":",
netAddress.lastIndexOf(":") - 1)) {
+ throw new AclException(String.format("NetAddress
examine scope Exception netAddress is %s", netAddress));
}
}
}
}
}
- public static String v6ipProcess(String netaddress) {
+ public static String v6ipProcess(String netAddress) {
int part;
String subAddress;
- boolean isAsterisk = isAsterisk(netaddress);
- boolean isMinus = isMinus(netaddress);
+ boolean isAsterisk = isAsterisk(netAddress);
+ boolean isMinus = isMinus(netAddress);
if (isAsterisk && isMinus) {
part = 6;
- int lastColon = netaddress.lastIndexOf(':');
- int secondLastColon = netaddress.substring(0,
lastColon).lastIndexOf(':');
- subAddress = netaddress.substring(0, secondLastColon);
+ int lastColon = netAddress.lastIndexOf(':');
+ int secondLastColon = netAddress.substring(0,
lastColon).lastIndexOf(':');
+ subAddress = netAddress.substring(0, secondLastColon);
} else if (!isAsterisk && !isMinus) {
part = 8;
- subAddress = netaddress;
+ subAddress = netAddress;
} else {
part = 7;
- subAddress = netaddress.substring(0, netaddress.lastIndexOf(':'));
+ subAddress = netAddress.substring(0, netAddress.lastIndexOf(':'));
}
return expandIP(subAddress, part);
}
- public static void verify(String netaddress, int index) {
- if (!AclUtils.isScope(netaddress, index)) {
- throw new AclException(String.format("Netaddress examine scope
Exception netaddress is %s", netaddress));
+ public static void verify(String netAddress, int index) {
+ if (!AclUtils.isScope(netAddress, index)) {
+ throw new AclException(String.format("NetAddress examine scope
Exception netAddress is %s", netAddress));
}
}
- public static String[] getAddresses(String netaddress, String
partialAddress) {
+ public static String[] getAddresses(String netAddress, String
partialAddress) {
String[] parAddStrArray =
StringUtils.split(partialAddress.substring(1, partialAddress.length() - 1),
",");
- String address = netaddress.substring(0, netaddress.indexOf("{"));
- String[] addreeStrArray = new String[parAddStrArray.length];
+ String address = netAddress.substring(0, netAddress.indexOf("{"));
+ String[] addressStrArray = new String[parAddStrArray.length];
for (int i = 0; i < parAddStrArray.length; i++) {
- addreeStrArray[i] = address + parAddStrArray[i];
+ addressStrArray[i] = address + parAddStrArray[i];
}
- return addreeStrArray;
+ return addressStrArray;
}
- public static boolean isScope(String netaddress, int index) {
+ public static boolean isScope(String netAddress, int index) {
// IPv6 Address
- if (isColon(netaddress)) {
- netaddress = expandIP(netaddress, 8);
- String[] strArray = StringUtils.split(netaddress, ":");
+ if (isColon(netAddress)) {
+ netAddress = expandIP(netAddress, 8);
+ String[] strArray = StringUtils.split(netAddress, ":");
return isIPv6Scope(strArray, index);
}
- String[] strArray = StringUtils.split(netaddress, ".");
+ String[] strArray = StringUtils.split(netAddress, ".");
if (strArray.length != 4) {
return false;
}
@@ -157,8 +157,8 @@ public class AclUtils {
}
- public static boolean isColon(String netaddress) {
- return netaddress.indexOf(':') > -1;
+ public static boolean isColon(String netAddress) {
+ return netAddress.indexOf(':') > -1;
}
public static boolean isScope(String num) {
@@ -203,21 +203,21 @@ public class AclUtils {
return num >= min && num <= max;
}
- public static String expandIP(String netaddress, int part) {
- netaddress = netaddress.toUpperCase();
- // expand netaddress
- int separatorCount = StringUtils.countMatches(netaddress, ":");
+ public static String expandIP(String netAddress, int part) {
+ netAddress = netAddress.toUpperCase();
+ // expand netAddress
+ int separatorCount = StringUtils.countMatches(netAddress, ":");
int padCount = part - separatorCount;
if (padCount > 0) {
StringBuilder padStr = new StringBuilder(":");
for (int i = 0; i < padCount; i++) {
padStr.append(":");
}
- netaddress = StringUtils.replace(netaddress, "::",
padStr.toString());
+ netAddress = StringUtils.replace(netAddress, "::",
padStr.toString());
}
- // pad netaddress
- String[] strArray = StringUtils.splitPreserveAllTokens(netaddress,
":");
+ // pad netAddress
+ String[] strArray = StringUtils.splitPreserveAllTokens(netAddress,
":");
for (int i = 0; i < strArray.length; i++) {
if (strArray[i].length() < 4) {
strArray[i] = StringUtils.leftPad(strArray[i], 4, '0');