AndrewJSchofield commented on code in PR #18929: URL: https://github.com/apache/kafka/pull/18929#discussion_r2083621752
########## clients/src/main/java/org/apache/kafka/common/requests/AlterShareGroupOffsetsRequest.java: ########## @@ -65,7 +65,8 @@ public AbstractResponse getErrorResponse(int throttleTimeMs, Throwable e) { .setPartitions(topicResult.partitions().stream() .map(partitionData -> new AlterShareGroupOffsetsResponseData.AlterShareGroupOffsetsResponsePartition() .setPartitionIndex(partitionData.partitionIndex()) - .setErrorCode(Errors.forException(e).code())) + .setErrorCode(Errors.forException(e).code()) Review Comment: `Errors.forException()` scans the list of Errors matching on exception class. I would prefer this to be done just once, such as assigning a local Errors variable and then using it to set the error code and message on each loop iteration. -- 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