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/05 15:36:04 UTC

[beam] branch master updated: Replaced deprecated finalize with DoFn Teardown (#24516)

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 12d0ba99d19 Replaced deprecated finalize with DoFn Teardown (#24516)
12d0ba99d19 is described below

commit 12d0ba99d194d0dc3f426886f91f420cd8d337af
Author: Dejan Spasic <de...@bitweise.biz>
AuthorDate: Mon Dec 5 16:35:57 2022 +0100

    Replaced deprecated finalize with DoFn Teardown (#24516)
    
    Since the deprecation of the finalize() method in Java 9, it is
    recommended replacing the method with the DoFn.Teardown
    annotation.
    
    Performed the renaming of the method to tearDown and increasing the
    visibility to public.
    
    [Task: #24181]
---
 .../io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
index 97fd2a41ed1..1c103989972 100644
--- a/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
+++ b/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java
@@ -1409,8 +1409,8 @@ public class JdbcIO {
       cleanUpConnection();
     }
 
-    @Override
-    protected void finalize() throws Throwable {
+    @Teardown
+    public void tearDown() throws Exception {
       cleanUpConnection();
     }