yashmayya commented on code in PR #14304:
URL: https://github.com/apache/kafka/pull/14304#discussion_r1312895366


##########
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:
   The other `closeQuietly` variants have `AutoCloseable` parameters whereas 
this one accepts any objects though?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to