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

[maven-linkcheck-plugin] branch master updated: Fix JavaDoc

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

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-linkcheck-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 3953483  Fix JavaDoc
3953483 is described below

commit 39534833f284dfdcb3a8c491062c04452f2c15a4
Author: rfscholte <rf...@apache.org>
AuthorDate: Thu Oct 14 19:18:04 2021 +0200

    Fix JavaDoc
---
 .../apache/maven/plugins/linkcheck/LinkcheckReport.java | 17 ++++++-----------
 .../org/apache/maven/plugins/linkcheck/SiteInvoker.java |  7 ++++---
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java b/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
index e758e0f..54f4eb0 100644
--- a/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
+++ b/src/main/java/org/apache/maven/plugins/linkcheck/LinkcheckReport.java
@@ -40,8 +40,6 @@ import org.codehaus.plexus.util.StringUtils;
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Properties;
@@ -345,7 +343,7 @@ public class LinkcheckReport
             basedir = new File( linkcheckOutput.getParentFile(), "tmpsite" );
             basedir.mkdirs();
 
-            List documents = null;
+            List<File> documents = null;
             try
             {
                 documents = FileUtils.getFiles( basedir, "**/*.html", null );
@@ -357,7 +355,7 @@ public class LinkcheckReport
             }
 
             // if the site was not already generated, invoke it
-            if ( documents == null || ( documents != null && documents.size() == 0 ) )
+            if ( documents == null || documents.size() == 0 )
             {
                 getLog().info( "Invoking the maven-site-plugin to ensure that all files are generated..." );
 
@@ -432,13 +430,10 @@ public class LinkcheckReport
      */
     private String[] getExcludedPages()
     {
-        List pagesToExclude =
-            ( excludedPages != null ? new ArrayList( Arrays.asList( excludedPages ) ) : new ArrayList() );
-
-        // Exclude this report
-        pagesToExclude.add( getOutputName() + ".html" );
-
-        return (String[]) pagesToExclude.toArray( new String[pagesToExclude.size()] );
+        String[] pagesToExclude = new String[excludedPages.length + 1];
+        System.arraycopy( excludedPages, 0, pagesToExclude, 0, excludedPages.length );
+        pagesToExclude[excludedPages.length] = getOutputName() + ".html";
+        return pagesToExclude;
     }
 
     // ----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java b/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
index 317469d..38eab4d 100644
--- a/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
+++ b/src/main/java/org/apache/maven/plugins/linkcheck/SiteInvoker.java
@@ -71,11 +71,12 @@ public class SiteInvoker
     }
 
     /**
-     * Invoke Maven for the <code>site</code> phase for a temporary Maven project using
+     * <p>Invoke Maven for the <code>site</code> phase for a temporary Maven project using
      * <code>tmpReportingOutputDirectory</code> as <code>${project.reporting.outputDirectory}</code>. This is a
-     * workaround to be sure that all site files have been correctly generated. <br/>
+     * workaround to be sure that all site files have been correctly generated.
+     * </p>
      * <b>Note 1</b>: the Maven Home should be defined in the <code>maven.home</code> Java system property or defined in
-     * <code>M2_HOME</code> system env variables. <b>Note 2</be>: we can't use <code>siteOutputDirectory</code> param
+     * <code>M2_HOME</code> system env variables. <b>Note 2</b>: we can't use <code>siteOutputDirectory</code> param
      * from site plugin because some plugins <code>${project.reporting.outputDirectory}</code> in their conf.
      *
      * @param project the MavenProject to invoke the site on. Not null.