This is an automated email from the ASF dual-hosted git repository.

jinrongtong 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 2bbc852361  [ISSUE #8906] Handle string toUpperCase outside the loop
2bbc852361 is described below

commit 2bbc852361132db8697a5788197aa31f5e89d4a1
Author: mawen12 <118196301...@gmail.com>
AuthorDate: Tue Nov 12 19:29:21 2024 +0800

     [ISSUE #8906] Handle string toUpperCase outside the loop
---
 .../org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java     | 3 ++-
 .../src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/proxy/src/main/java/org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java
 
b/proxy/src/main/java/org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java
index 59342ca3cd..5a21ec68e5 100644
--- 
a/proxy/src/main/java/org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java
+++ 
b/proxy/src/main/java/org/apache/rocketmq/proxy/remoting/MultiProtocolTlsHelper.java
@@ -102,8 +102,9 @@ public class MultiProtocolTlsHelper extends TlsHelper {
             return ClientAuth.NONE;
         }
 
+        String authModeUpper = authMode.toUpperCase();
         for (ClientAuth clientAuth : ClientAuth.values()) {
-            if (clientAuth.name().equals(authMode.toUpperCase())) {
+            if (clientAuth.name().equals(authModeUpper)) {
                 return clientAuth;
             }
         }
diff --git 
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java 
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java
index 9e73ad7ae0..2a67512b14 100644
--- a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java
+++ b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/TlsHelper.java
@@ -216,8 +216,9 @@ public class TlsHelper {
             return ClientAuth.NONE;
         }
 
+        String authModeUpper = authMode.toUpperCase();
         for (ClientAuth clientAuth : ClientAuth.values()) {
-            if (clientAuth.name().equals(authMode.toUpperCase())) {
+            if (clientAuth.name().equals(authModeUpper)) {
                 return clientAuth;
             }
         }

Reply via email to