You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2021/01/17 16:12:53 UTC

[maven-doxia-linkcheck] branch http updated: fix Javadoc

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch http
in repository https://gitbox.apache.org/repos/asf/maven-doxia-linkcheck.git


The following commit(s) were added to refs/heads/http by this push:
     new 56cb3aa  fix Javadoc
56cb3aa is described below

commit 56cb3aa6f917f00209308401224c3cf5a5a72a74
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sun Jan 17 11:12:42 2021 -0500

    fix Javadoc
---
 .../validation/OnlineHTTPLinkValidator.java        | 28 +++++++++++-----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java b/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
index 055e229..2a124a9 100644
--- a/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
+++ b/src/main/java/org/apache/maven/doxia/linkcheck/validation/OnlineHTTPLinkValidator.java
@@ -54,7 +54,7 @@ import org.apache.maven.doxia.linkcheck.model.LinkcheckFileResult;
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * Checks links which are normal URLs
+ * Checks links which are normal URLs.
  *
  * @author <a href="mailto:bwalding@apache.org">Ben Walding</a>
  * @author <a href="mailto:aheritier@apache.org">Arnaud Heritier</a>
@@ -79,7 +79,7 @@ public final class OnlineHTTPLinkValidator
     private transient HttpClient cl;
 
     /**
-     * Constructor: initialize settings, use "head" method.
+     * Constructor: initialize settings, use HEAD method.
      */
     public OnlineHTTPLinkValidator()
     {
@@ -173,35 +173,35 @@ public final class OnlineHTTPLinkValidator
                 link = getBaseURL() + link;
             }
 
-            HttpResponse hm = null;
+            HttpResponse response = null;
             try
             {
-                hm = checkLink( link, 0 );
+                response = checkLink( link, 0 );
             }
-            catch ( IOException t )
+            catch ( IOException ex )
             {
                 if ( LOG.isDebugEnabled() )
                 {
-                    LOG.debug( "Received: [" + t + "] for [" + link + "] in page [" + lvi.getSource() + "]", t );
+                    LOG.debug( "Received: [" + ex + "] for [" + link + "] in page [" + lvi.getSource() + "]", ex );
                 }
 
-                return new LinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false, t.getClass().getName()
-                    + " : " + t.getMessage() );
+                return new LinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false, ex.getClass().getName()
+                    + " : " + ex.getMessage() );
             }
 
-            if ( hm == null )
+            if ( response == null )
             {
                 return new LinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false,
                                                  "Cannot retrieve HTTP Status" );
             }
 
-            int statusCode = hm.getStatusLine().getStatusCode();
+            int statusCode = response.getStatusLine().getStatusCode();
             if ( statusCode == HttpStatus.SC_OK )
             {
                 // check if the anchor is present
                 if ( anchor.length() > 0 )
                 {
-                    String content = EntityUtils.toString( hm.getEntity() );
+                    String content = EntityUtils.toString( response.getEntity() );
 
                     if ( !Anchors.matchesAnchor( content, anchor ) )
                     {
@@ -210,7 +210,7 @@ public final class OnlineHTTPLinkValidator
                     }
                 }
                 return new HTTPLinkValidationResult( LinkcheckFileResult.VALID_LEVEL, true,
-                        statusCode, hm.getStatusLine().getReasonPhrase() );
+                        statusCode, response.getStatusLine().getReasonPhrase() );
             }
 
             String msg = "Received: [" + statusCode + "] for [" + link + "] in page ["
@@ -223,13 +223,13 @@ public final class OnlineHTTPLinkValidator
                 LOG.warn( msg );
 
                 return new HTTPLinkValidationResult( LinkcheckFileResult.WARNING_LEVEL, true, statusCode,
-                        hm.getStatusLine().getReasonPhrase() );
+                        response.getStatusLine().getReasonPhrase() );
             }
 
             LOG.debug( msg );
 
             return new HTTPLinkValidationResult( LinkcheckFileResult.ERROR_LEVEL, false, statusCode,
-                    hm.getStatusLine().getReasonPhrase() );
+                    response.getStatusLine().getReasonPhrase() );
         }
         catch ( Exception t )
         {