Skip to content

Commit

Permalink
KAFKA-15315: Use getOrDefault rather than get in TransactionState (ap…
Browse files Browse the repository at this point in the history
…ache#14167)

Reviewers: Ziming Deng [email protected].
  • Loading branch information
roon-replica authored and Cerchie committed Feb 22, 2024
1 parent bce6745 commit 275b1f8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public String toString() {
}

public static TransactionState parse(String name) {
TransactionState state = NAME_TO_ENUM.get(name);
return state == null ? UNKNOWN : state;
return NAME_TO_ENUM.getOrDefault(name, UNKNOWN);
}

}

0 comments on commit 275b1f8

Please sign in to comment.