akalash commented on a change in pull request #17701:
URL: https://github.com/apache/flink/pull/17701#discussion_r755053001



##########
File path: 
flink-core/src/main/java/org/apache/flink/util/AbstractAutoCloseableRegistry.java
##########
@@ -43,33 +43,36 @@
  * @param <T> Type for potential meta data associated with the registering 
closeables
  */
 @Internal
-public abstract class AbstractCloseableRegistry<C extends Closeable, T> 
implements Closeable {
+public abstract class AbstractAutoCloseableRegistry<
+                R extends AutoCloseable, C extends R, T, E extends Exception>
+        implements AutoCloseable {
 
     /** Lock that guards state of this registry. * */
     private final Object lock;
 
     /** Map from tracked Closeables to some associated meta data. */
     @GuardedBy("lock")
-    protected final Map<Closeable, T> closeableToRef;
+    protected final Map<R, T> closeableToRef;
 
     /** Indicates if this registry is closed. */
     @GuardedBy("lock")
     private boolean closed;
 
-    public AbstractCloseableRegistry(@Nonnull Map<Closeable, T> 
closeableToRef) {
+    public AbstractAutoCloseableRegistry(@Nonnull Map<R, T> closeableToRef) {
         this.lock = new Object();
         this.closeableToRef = Preconditions.checkNotNull(closeableToRef);
         this.closed = false;
     }
 
     /**
-     * Registers a {@link Closeable} with the registry. In case the registry 
is already closed, this
-     * method throws an {@link IllegalStateException} and closes the passed 
{@link Closeable}.
+     * Registers a {@link AutoCloseable} with the registry. In case the 
registry is already closed,
+     * this method throws an {@link IllegalStateException} and closes the 
passed {@link
+     * AutoCloseable}.
      *
-     * @param closeable Closeable tor register
-     * @throws IOException exception when the registry was closed before
+     * @param closeable Closeable to register.
+     * @throws IOException exception when the registry was closed before.
      */
-    public final void registerCloseable(C closeable) throws IOException {
+    public void registerCloseable(C closeable) throws IOException {

Review comment:
       I returned it back




-- 
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