nutch-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NUTCH-2450) Remove FixMe in ParseOutputFormat
Date Tue, 19 Dec 2017 04:09:00 GMT

    [ https://issues.apache.org/jira/browse/NUTCH-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16296169#comment-16296169
] 

ASF GitHub Bot commented on NUTCH-2450:
---------------------------------------

kpm1985 closed pull request #235: Fix for NUTCH-2450 by Kenneth McFarland
URL: https://github.com/apache/nutch/pull/235
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/java/org/apache/nutch/parse/ParseOutputFormat.java b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
index 2c8396a75..9cf147790 100644
--- a/src/java/org/apache/nutch/parse/ParseOutputFormat.java
+++ b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
@@ -362,7 +362,6 @@ public static String filterNormalize(String fromUrl, String toUrl,
       if (ignoreExternalLinks) {
         if ("bydomain".equalsIgnoreCase(ignoreExternalLinksMode)) {
           String toDomain = URLUtil.getDomainName(targetURL).toLowerCase();
-          //FIXME: toDomain will never be null, correct?
           if (toDomain == null || !toDomain.equals(origin)) {
             return null; // skip it
           }
@@ -379,15 +378,16 @@ public static String filterNormalize(String fromUrl, String toUrl,
       if (ignoreInternalLinks) {
         if ("bydomain".equalsIgnoreCase(ignoreExternalLinksMode)) {
           String toDomain = URLUtil.getDomainName(targetURL).toLowerCase();
-          //FIXME: toDomain will never be null, correct?
           if (toDomain == null || toDomain.equals(origin)) {
             return null; // skip it
           }
         } else {
           String toHost = targetURL.getHost().toLowerCase();
-          //FIXME: toDomain will never be null, correct?
           if (toHost == null || toHost.equals(origin)) {
-            return null; // skip it
+            if (exemptionFilters == null // check if it is exempted?
+                || !exemptionFilters.isExempted(fromUrl, toUrl)) {
+              return null; ///skip it, This external url is not exempted.
+            }
           }
         }
       }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Remove FixMe in ParseOutputFormat
> ---------------------------------
>
>                 Key: NUTCH-2450
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2450
>             Project: Nutch
>          Issue Type: Bug
>         Environment: master branch
>            Reporter: Kenneth McFarland
>            Assignee: Kenneth McFarland
>            Priority: Minor
>
> ParseOutputFormat contains a few FixMe's that I've looked at. If a valid url is created,
it will always return valid results. There is a spot in the code where the try catch is already
done, so the predicate is satisfied and there is no need to keep checking it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message