cmccabe commented on code in PR #15986: URL: https://github.com/apache/kafka/pull/15986#discussion_r1619510911
########## raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java: ########## @@ -1593,6 +1644,13 @@ private Optional<Boolean> maybeHandleCommonResponse( int epoch, long currentTimeMs ) { + Optional<Node> leader = Optional.empty(); Review Comment: This would be more clearly expressed as something like ``` Optional<Node> leader = leaderId.isPresent() ? partitionState.lastVoterSet().voterNode(leaderId.getAsInt(), channel.listenerName()) : Optional.empty(); ``` -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org