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 d6f55b8ea NUTCH-2812 Methods returning array may expose internal 
representation
d6f55b8ea is described below

commit d6f55b8ea6f5809cef5a31239e5760be23742c00
Author: Sebastian Nagel <[email protected]>
AuthorDate: Tue Sep 17 17:27:37 2024 +0200

    NUTCH-2812 Methods returning array may expose internal representation
    
    Fix Java compilation error because of ignored MalformedURLException.
---
 src/java/org/apache/nutch/fetcher/FetchNode.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/java/org/apache/nutch/fetcher/FetchNode.java 
b/src/java/org/apache/nutch/fetcher/FetchNode.java
index eb659f13f..837c6515d 100644
--- a/src/java/org/apache/nutch/fetcher/FetchNode.java
+++ b/src/java/org/apache/nutch/fetcher/FetchNode.java
@@ -16,6 +16,8 @@
  */
 package org.apache.nutch.fetcher;
 
+import java.net.MalformedURLException;
+
 import org.apache.hadoop.io.Text;
 import org.apache.nutch.parse.Outlink;
 
@@ -37,7 +39,11 @@ public class FetchNode {
     for (int i = copyOutlinks.length-1; i>=0; i--) {
       Outlink o = outlinks[i];
       if (o != null) {
-        copyOutlinks[i] = new Outlink(o.getToUrl(), o.getAnchor());
+        try {
+          copyOutlinks[i] = new Outlink(o.getToUrl(), o.getAnchor());
+        } catch (MalformedURLException e) {
+          // ignore
+        }
       }
     }
     return outlinks;

Reply via email to