yashmayya commented on code in PR #14304: URL: https://github.com/apache/kafka/pull/14304#discussion_r1318291411
########## clients/src/main/java/org/apache/kafka/common/utils/Utils.java: ########## @@ -1090,6 +1090,23 @@ public interface UncheckedCloseable extends AutoCloseable { void close(); } + /** + * Closes {@code maybeCloseable} if it implements the {@link AutoCloseable} interface, + * and if an exception is thrown, it is logged at the WARN level. + * <b>Be cautious when passing method references as an argument.</b> For example: + * <p> + * {@code closeQuietly(task::stop, "source task");} + * <p> + * Although this method gracefully handles null {@link AutoCloseable} objects, attempts to take a method Review Comment: Thanks, looks good 👍 ########## clients/src/main/java/org/apache/kafka/common/utils/Utils.java: ########## @@ -1090,6 +1090,23 @@ public interface UncheckedCloseable extends AutoCloseable { void close(); } + /** + * Closes {@code maybeCloseable} if it implements the {@link AutoCloseable} interface, + * and if an exception is thrown, it is logged at the WARN level. + * <b>Be cautious when passing method references as an argument.</b> For example: + * <p> + * {@code closeQuietly(task::stop, "source task");} + * <p> + * Although this method gracefully handles null {@link AutoCloseable} objects, attempts to take a method Review Comment: Thanks, looks good 👍 -- 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