Skip to content

Commit 2bbc852

Browse files
authored
[ISSUE #8906] Handle string toUpperCase outside the loop
1 parent 7eb16ff commit 2bbc852

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

proxy/src/main/java/org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ private static ClientAuth parseClientAuthMode(String authMode) {
102102
return ClientAuth.NONE;
103103
}
104104

105+
String authModeUpper = authMode.toUpperCase();
105106
for (ClientAuth clientAuth : ClientAuth.values()) {
106-
if (clientAuth.name().equals(authMode.toUpperCase())) {
107+
if (clientAuth.name().equals(authModeUpper)) {
107108
return clientAuth;
108109
}
109110
}

remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ private static ClientAuth parseClientAuthMode(String authMode) {
216216
return ClientAuth.NONE;
217217
}
218218

219+
String authModeUpper = authMode.toUpperCase();
219220
for (ClientAuth clientAuth : ClientAuth.values()) {
220-
if (clientAuth.name().equals(authMode.toUpperCase())) {
221+
if (clientAuth.name().equals(authModeUpper)) {
221222
return clientAuth;
222223
}
223224
}

0 commit comments

Comments
 (0)