Skip to content

Commit

Permalink
NUTCH-2812 Methods returning array may expose internal representation
Browse files Browse the repository at this point in the history
Fix Java compilation error because of ignored MalformedURLException.
  • Loading branch information
sebastian-nagel committed Sep 17, 2024
1 parent c137b4e commit d6f55b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/java/org/apache/nutch/fetcher/FetchNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -37,7 +39,11 @@ public Outlink[] getOutlinks() {
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;
Expand Down

0 comments on commit d6f55b8

Please sign in to comment.