Skip to content

Commit

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

Reviewers: Ziming Deng [email protected].
  • Loading branch information
roon-replica authored Sep 11, 2023
1 parent 07a1847 commit 7fc6500
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 7fc6500

Please sign in to comment.