ijuma commented on a change in pull request #9645:
URL: https://github.com/apache/kafka/pull/9645#discussion_r529180046
##########
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('-', '_');
+ return Arrays.stream(VALUES)
+ .filter(mechanism -> mechanism.name().equals(normalizedMechanism))
+ .findFirst()
+ .orElse(UNKNOWN);
Review comment:
@rondagostino do we need to cherry-pick this change to the 2.7 branch? I
am not sure under which context this method is used and whether it's important
enough to backport.
----------------------------------------------------------------
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:
[email protected]