Browse Source

KAFKA-15315: Use getOrDefault rather than get in TransactionState (#14167)

Reviewers: Ziming Deng dengziming1993@gmail.com.
pull/14361/head
Roon 1 year ago committed by GitHub
parent
commit
7fc65003fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      clients/src/main/java/org/apache/kafka/clients/admin/TransactionState.java

3
clients/src/main/java/org/apache/kafka/clients/admin/TransactionState.java

@ -49,8 +49,7 @@ public enum TransactionState {
} }
public static TransactionState parse(String name) { public static TransactionState parse(String name) {
TransactionState state = NAME_TO_ENUM.get(name); return NAME_TO_ENUM.getOrDefault(name, UNKNOWN);
return state == null ? UNKNOWN : state;
} }
} }

Loading…
Cancel
Save