You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@any23.apache.org by HansBrende <gi...@git.apache.org> on 2018/04/03 18:37:17 UTC

[GitHub] any23 pull request #71: ANY23-341 Remove dependency on defunct commons-httpc...

GitHub user HansBrende opened a pull request:

    https://github.com/apache/any23/pull/71

    ANY23-341 Remove dependency on defunct commons-httpclient

    This is my first stab at removing the decade-out-of-date `commons-httpclient` dependency.
    
    All tests are passing, but I want another set of eyes on this.
    
    @lewismc any comments?

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

    $ git pull https://github.com/HansBrende/any23 ANY23-341

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

    https://github.com/apache/any23/pull/71.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 #71
    
----
commit 355e288406d2f8fc673f4a399edba737791d17aa
Author: Hans <fi...@...>
Date:   2018-04-03T18:33:20Z

    ANY23-341 Remove dependency on defunct commons-httpclient

----


---

[GitHub] any23 pull request #71: ANY23-341 Remove dependency on defunct commons-httpc...

Posted by HansBrende <gi...@git.apache.org>.
Github user HansBrende commented on a diff in the pull request:

    https://github.com/apache/any23/pull/71#discussion_r178926732
  
    --- Diff: core/src/main/java/org/apache/any23/extractor/html/HTMLDocument.java ---
    @@ -375,15 +376,16 @@ public String getDefaultLanguage() {
     
         private java.net.URI getBaseIRI() throws ExtractionException {
             if (baseIRI == null) {
    +            String uri = (document instanceof Document ? (Document)document : document.getOwnerDocument()).getDocumentURI();
                 try {
    -                if (document.getBaseURI() == null) {
    -                    log.warn("document.getBaseURI() is null, this should not happen");
    +                if (uri == null) {
    +                    log.warn("document.getBaseURI() is null, this should not happen", new Exception());
    --- End diff --
    
    @lewismc Oops, yeah, I added that exception in there just to get the stacktrace for debugging purposes, but forgot to take it out again!


---

[GitHub] any23 pull request #71: ANY23-341 Remove dependency on defunct commons-httpc...

Posted by lewismc <gi...@git.apache.org>.
Github user lewismc commented on a diff in the pull request:

    https://github.com/apache/any23/pull/71#discussion_r178925133
  
    --- Diff: core/src/main/java/org/apache/any23/extractor/html/HTMLDocument.java ---
    @@ -375,15 +376,16 @@ public String getDefaultLanguage() {
     
         private java.net.URI getBaseIRI() throws ExtractionException {
             if (baseIRI == null) {
    +            String uri = (document instanceof Document ? (Document)document : document.getOwnerDocument()).getDocumentURI();
                 try {
    -                if (document.getBaseURI() == null) {
    -                    log.warn("document.getBaseURI() is null, this should not happen");
    +                if (uri == null) {
    +                    log.warn("document.getBaseURI() is null, this should not happen", new Exception());
    --- End diff --
    
    Can the Exception be more specific?


---

[GitHub] any23 pull request #71: ANY23-341 Remove dependency on defunct commons-httpc...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/any23/pull/71


---