chia7712 commented on a change in pull request #9645:
URL: https://github.com/apache/kafka/pull/9645#discussion_r529180414



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/admin/ScramMechanism.java
##########
@@ -49,8 +53,11 @@ public static ScramMechanism fromType(byte type) {
      *     Salted Challenge Response Authentication Mechanism (SCRAM) SASL and 
GSS-API Mechanisms, Section 4</a>
      */
     public static ScramMechanism fromMechanismName(String mechanismName) {
-        ScramMechanism retvalFoundMechanism = 
ScramMechanism.valueOf(mechanismName.replace('-', '_'));
-        return retvalFoundMechanism != null ? retvalFoundMechanism : UNKNOWN;
+        String normalizedMechanism = mechanismName.replace('-', '_');

Review comment:
       Could we reuse ```mechanismName``` 
(https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/admin/ScramMechanism.java#L79)
 so we don't need this duplicate replacement.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to