You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by yh...@apache.org on 2022/12/08 17:17:27 UTC

[beam] branch master updated: Replaced finalize with DoFn Teardown in Neo4jIO (#24571)

This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new dd7a581188e Replaced finalize with DoFn Teardown in Neo4jIO (#24571)
dd7a581188e is described below

commit dd7a581188ee0e1085ceed76f3b73d5a32d47808
Author: Dejan Spasic <de...@trivago.com>
AuthorDate: Thu Dec 8 18:17:19 2022 +0100

    Replaced finalize with DoFn Teardown in Neo4jIO (#24571)
    
    Since the finalize() method depreciates in Java 9, it is recommended to
    replace the method with the DoFn.Teardown annotation.
    
    Performed the renaming of the method to tearDown and increased
    the visibility to public.
---
 .../io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java b/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java
index 633529280d0..b19210ce668 100644
--- a/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java
+++ b/sdks/java/io/neo4j/src/main/java/org/apache/beam/sdk/io/neo4j/Neo4jIO.java
@@ -728,8 +728,8 @@ public class Neo4jIO {
       cleanUpDriverSession();
     }
 
-    @Override
-    protected void finalize() {
+    @Teardown
+    public void tearDown() {
       cleanUpDriverSession();
     }