scwhittle commented on a change in pull request #14704:
URL: https://github.com/apache/beam/pull/14704#discussion_r625322809



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/io/Read.java
##########
@@ -386,6 +387,8 @@ protected void finalize() throws Throwable {
             currentReader.close();
           } catch (IOException e) {
             LOG.error("Failed to close BoundedReader due to failure processing 
bundle.", e);
+          } finally {
+            currentReader = null;

Review comment:
       Thanks! Fixed spotbugs issue about setting field to null in finalize() 
method, which is not recommended as it is being GC'd anyway.




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

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


Reply via email to