Amar3tto commented on code in PR #40685:
URL: https://github.com/apache/beam/pull/40685#discussion_r4325830936


##########
sdks/java/io/jms/src/main/java/org/apache/beam/sdk/io/jms/JmsIO.java:
##########
@@ -1001,12 +1001,6 @@ private void closeAutoscaler() {
         LOG.error("Error closing autoscaler", e);
       }
     }
-
-    @Override
-    @SuppressWarnings({"Finalize", "removal"})
-    protected void finalize() {
-      doClose();
-    }

Review Comment:
   The `finalize()` method is deprecated and marked for removal in newer Java 
versions. Since `UnboundedJmsReader` already implements `close()` to release 
JMS resources, the finalizer is redundant. Resource cleanup should be handled 
explicitly through the reader lifecycle rather than relying on GC, which does 
not guarantee finalizer execution.



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