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

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


The following commit(s) were added to refs/heads/master by this push:
     new a1ab4333e NUTCH-2897 Do not supress deprecated API warnings - 
deprecate constructor of NutchJob - remove deprocated call to Object.finalize() 
from Plugin.finalize()
a1ab4333e is described below

commit a1ab4333e0a1a28ac2e0f9c75871f7feeb5f2f81
Author: Sebastian Nagel <sna...@apache.org>
AuthorDate: Sat Sep 30 11:12:07 2023 +0200

    NUTCH-2897 Do not supress deprecated API warnings
    - deprecate constructor of NutchJob
    - remove deprocated call to Object.finalize() from Plugin.finalize()
---
 src/java/org/apache/nutch/plugin/Plugin.java |  2 --
 src/java/org/apache/nutch/util/NutchJob.java | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/java/org/apache/nutch/plugin/Plugin.java 
b/src/java/org/apache/nutch/plugin/Plugin.java
index b2e717d20..3a0fb2e91 100644
--- a/src/java/org/apache/nutch/plugin/Plugin.java
+++ b/src/java/org/apache/nutch/plugin/Plugin.java
@@ -90,9 +90,7 @@ public class Plugin {
   }
 
   @Override
-  @SuppressWarnings("deprecation")
   protected void finalize() throws Throwable {
-    super.finalize();
     shutDown();
   }
 }
diff --git a/src/java/org/apache/nutch/util/NutchJob.java 
b/src/java/org/apache/nutch/util/NutchJob.java
index 478b24f89..068c64fef 100644
--- a/src/java/org/apache/nutch/util/NutchJob.java
+++ b/src/java/org/apache/nutch/util/NutchJob.java
@@ -35,7 +35,18 @@ public class NutchJob extends Job {
 
   private static final String JOB_FAILURE_LOG_FORMAT = "%s job did not 
succeed, job id: %s, job status: %s, reason: %s";
 
-  @SuppressWarnings("deprecation")
+  /**
+   * @deprecated, use instead {@link #getInstance(Configuration)} or
+   * {@link Job#getInstance(Configuration, String)}.
+   * 
+   * @param conf
+   *          configuration for the job
+   * @param jobName
+   *          name of the job
+   * @throws IOException
+   *           see {@link Job#Job(Configuration, String)}
+   */
+  @Deprecated
   public NutchJob(Configuration conf, String jobName) throws IOException {
     super(conf, jobName);
     if (conf != null) {

Reply via email to