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

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

GitHub user sebastian-nagel opened a pull request:

    https://github.com/apache/nutch/pull/169

    NUTCH-2349 urlnormalizer-basic: NPE for URLs without authority

    - check whether URL.getAuthority() returns null
    - recompose URLs without authority with empty authority/host

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/sebastian-nagel/nutch 
NUTCH-2349-basic-url-normalizer-npe

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/nutch/pull/169.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #169
    
----
commit 1a718e0cc9a0c3811111e40f4bf8351e26f73522
Author: Sebastian Nagel <[email protected]>
Date:   2017-01-11T14:46:46Z

    NUTCH-2349 urlnormalizer-basic: NPE for URLs without authority
    - check whether URL.getAuthority() returns null
    - recompose URLs without authority with empty authority/host

----


> urlnormalizer-basic NPE for ill-formed URL "http:/"
> ---------------------------------------------------
>
>                 Key: NUTCH-2349
>                 URL: https://issues.apache.org/jira/browse/NUTCH-2349
>             Project: Nutch
>          Issue Type: Bug
>    Affects Versions: 1.13
>            Reporter: Sebastian Nagel
>             Fix For: 1.13
>
>
> NUTCH-2337 introduced a potential (though rare) NullPointerException when an 
> ill-formed URL (just the protocol followed by "{{:}}", "{{:/}}", "{{:////}}" 
> or even more slashes):
> {noformat}
> % echo "http://///"; \
>   | runtime/local/bin/nutch org.apache.nutch.net.URLNormalizerChecker \
>      -normalizer org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer 
> Checking URLNormalizer 
> org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer
> Exception in thread "main" java.lang.NullPointerException
>         at 
> org.apache.nutch.net.urlnormalizer.basic.BasicURLNormalizer.normalize(BasicURLNormalizer.java:120)
>         at 
> org.apache.nutch.net.URLNormalizerChecker.checkOne(URLNormalizerChecker.java:72)
>         at 
> org.apache.nutch.net.URLNormalizerChecker.main(URLNormalizerChecker.java:110)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to