You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mt...@apache.org on 2021/04/26 12:53:16 UTC
[maven-shared-utils] branch master updated: [NOJIRA] Javadoc
cleanup in preparation of release
This is an automated email from the ASF dual-hosted git repository.
mthmulders pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git
The following commit(s) were added to refs/heads/master by this push:
new 9f40037 [NOJIRA] Javadoc cleanup in preparation of release
9f40037 is described below
commit 9f40037bfb04d54dd997a9ab837390045c9a4348
Author: Maarten Mulders <mt...@apache.org>
AuthorDate: Fri Apr 23 17:37:00 2021 +0200
[NOJIRA] Javadoc cleanup in preparation of release
Closes #85.
---
.../java/org/apache/maven/shared/utils/Os.java | 4 +-
.../org/apache/maven/shared/utils/PathTool.java | 14 ++---
.../org/apache/maven/shared/utils/StringUtils.java | 34 +++++------
.../org/apache/maven/shared/utils/cli/Arg.java | 1 +
.../apache/maven/shared/utils/cli/Commandline.java | 9 ++-
.../maven/shared/utils/cli/StreamConsumer.java | 9 ++-
.../utils/cli/javatool/AbstractJavaTool.java | 4 +-
.../cli/javatool/AbstractJavaToolRequest.java | 2 +-
.../maven/shared/utils/cli/javatool/JavaTool.java | 33 +++++------
.../utils/cli/javatool/JavaToolException.java | 11 ++--
.../shared/utils/cli/javatool/JavaToolRequest.java | 16 +++--
.../shared/utils/cli/javatool/JavaToolResult.java | 2 +-
.../maven/shared/utils/cli/shell/BourneShell.java | 1 -
.../maven/shared/utils/cli/shell/CmdShell.java | 2 -
.../apache/maven/shared/utils/cli/shell/Shell.java | 2 +-
.../maven/shared/utils/introspection/ClassMap.java | 13 ++---
.../introspection/ReflectionValueExtractor.java | 7 +--
.../maven/shared/utils/io/DirectoryScanner.java | 68 +++++++++++++---------
.../apache/maven/shared/utils/io/FileUtils.java | 61 +++++++++----------
.../org/apache/maven/shared/utils/io/IOUtil.java | 34 +++++------
.../apache/maven/shared/utils/io/MatchPattern.java | 6 +-
.../maven/shared/utils/io/MatchPatterns.java | 5 +-
.../maven/shared/utils/io/ScanConductor.java | 2 -
.../maven/shared/utils/io/SelectorUtils.java | 17 +++---
.../shared/utils/logging/AnsiMessageBuilder.java | 16 ++---
.../shared/utils/logging/LoggerLevelRenderer.java | 28 +++++----
.../maven/shared/utils/logging/MessageBuilder.java | 30 ++++++++++
.../maven/shared/utils/logging/MessageUtils.java | 13 +++--
.../shared/utils/logging/PlainMessageBuilder.java | 16 ++---
.../maven/shared/utils/xml/XmlReaderException.java | 29 +++------
.../shared/utils/xml/XmlStreamReaderException.java | 10 ++--
.../shared/utils/xml/PrettyPrintXmlWriterTest.java | 2 +-
32 files changed, 253 insertions(+), 248 deletions(-)
diff --git a/src/main/java/org/apache/maven/shared/utils/Os.java b/src/main/java/org/apache/maven/shared/utils/Os.java
index c4c5f33..a2c3d52 100644
--- a/src/main/java/org/apache/maven/shared/utils/Os.java
+++ b/src/main/java/org/apache/maven/shared/utils/Os.java
@@ -26,12 +26,10 @@ import java.util.Set;
/**
* <p>Condition that tests the OS type.</p>
- * <p/>
* <p>This class got copied over from Apache ANT.
* Even the version from plexus-utils was
- * only an ANT fork!<br/>
+ * only an ANT fork!
* The last time it got copied was on 2011-08-12</p>
- * <p/>
* <p>When merging changes please take care of the special
* OS_FAMILY handling in this version of Os.java!</p>
*
diff --git a/src/main/java/org/apache/maven/shared/utils/PathTool.java b/src/main/java/org/apache/maven/shared/utils/PathTool.java
index 28bc308..2a0b0fe 100644
--- a/src/main/java/org/apache/maven/shared/utils/PathTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/PathTool.java
@@ -26,12 +26,13 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
- * Path tool contains static methods to assist in determining path-related
- * information such as relative paths.
- * <p/>
+ * <p>Path tool contains static methods to assist in determining path-related
+ * information such as relative paths.</p>
+ * <p>
* This class originally got developed at Apache Anakia and later maintained
* in maven-utils of Apache Maven-1.
* Some external fixes by Apache Committers have been applied later.
+ * </p>
*/
public class PathTool
{
@@ -55,9 +56,9 @@ public class PathTool
* file separators. The relative path returned is formed using
* forward slashes as it is expected this path is to be used as a
* link in a web page (again mimicking Anakia's behavior).
- * <p/>
+ * <p>
* This method is thread-safe.
- * <br/>
+ * </p>
* <pre>
* PathTool.getRelativePath( null, null ) = ""
* PathTool.getRelativePath( null, "/usr/local/java/bin" ) = ""
@@ -111,8 +112,7 @@ public class PathTool
}
/**
- * This method can calculate the relative path between two pathes on a file system.
- * <br/>
+ * <p>This method can calculate the relative path between two paths on a file system.</p>
* <pre>
* PathTool.getRelativeFilePath( null, null ) = ""
* PathTool.getRelativeFilePath( null, "/usr/local/java/bin" ) = ""
diff --git a/src/main/java/org/apache/maven/shared/utils/StringUtils.java b/src/main/java/org/apache/maven/shared/utils/StringUtils.java
index b70cdae..de4a1e8 100644
--- a/src/main/java/org/apache/maven/shared/utils/StringUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/StringUtils.java
@@ -104,7 +104,6 @@ public class StringUtils
*
* @param str String target to delete whitespace from
* @return the String without whitespace
- * @throws NullPointerException
*/
@Nonnull public static String deleteWhitespace( @Nonnull String str )
{
@@ -122,7 +121,7 @@ public class StringUtils
/**
* <p>Checks if a String is non <code>null</code> and is
- * not empty (<code>length > 0</code>).</p>
+ * not empty (<code>length > 0</code>).</p>
*
* @param str the String to check
* @return true if the String is non-null, and not length zero
@@ -816,7 +815,7 @@ public class StringUtils
//--------------------------------------------------------------------------
/**
- * <p>Center a String in a larger String of size <code>n</code>.<p>
+ * <p>Center a String in a larger String of size <code>n</code>.</p>
*
* <p>Uses spaces as the value to buffer the String with.
* Equivalent to <code>center(str, size, " ")</code>.</p>
@@ -1174,7 +1173,7 @@ public class StringUtils
* @param str String to repeat
* @param repeat number of times to repeat str
* @return String with repeated String
- * @throws NegativeArraySizeException if <code>repeat < 0</code>
+ * @throws NegativeArraySizeException if <code>repeat < 0</code>
* @throws NullPointerException if str is <code>null</code>
*/
@Nonnull public static String repeat( @Nonnull String str, int repeat )
@@ -1979,14 +1978,12 @@ public class StringUtils
//--------------------------------------------------------------------------
/**
- * Turn "Now is the time for all good men" into "Now is the time for..."
- * <p/>
- * Specifically:
- * <p/>
- * If str is less than max characters long, return it.
+ * <p>Turn "Now is the time for all good men" into "Now is the time for..."</p>
+ * <p>Specifically:</p>
+ * <p>If str is less than max characters long, return it.
* Else abbreviate it to (substring(str, 0, max-3) + "...").
* If maxWidth is less than 3, throw an IllegalArgumentException.
- * In no case will it return a string of length greater than maxWidth.
+ * In no case will it return a string of length greater than maxWidth.</p>
*
* @param s The string to be abbreviated.
* @param maxWidth maximum length of result string
@@ -1999,12 +1996,13 @@ public class StringUtils
/**
* Turn "Now is the time for all good men" into "...is the time for..."
- * <p/>
+ * <p>
* Works like abbreviate(String, int), but allows you to specify a "left edge"
* offset. Note that this left edge is not necessarily going to be the leftmost
* character in the result, or the first
* character following the ellipses, but it will appear somewhere in the result.
* In no case will it return a string of length greater than maxWidth.
+ * </p>
*
* @param s String to abbreviate.
* @param offset left edge of source string
@@ -2051,8 +2049,9 @@ public class StringUtils
* Compare two strings, and return the portion where they differ.
* (More precisely, return the remainder of the second string,
* starting from where it's different from the first.)
- * <p/>
- * E.g. strdiff("i am a machine", "i am a robot") -> "robot"
+ * <p>
+ * E.g. strdiff("i am a machine", "i am a robot") → "robot"
+ * </p>
*
* @param s1 The first string.
* @param s2 The second string.
@@ -2071,7 +2070,7 @@ public class StringUtils
/**
* Compare two strings, and return the index at which the strings begin to differ.
* <p>
- * E.g. strdiff("i am a machine", "i am a robot") -> 7
+ * E.g. strdiff("i am a machine", "i am a robot") → 7
* </p>
*
* @param s1 The first string.
@@ -2188,7 +2187,6 @@ public class StringUtils
/**
* Converts the first character of the given String to lowercase.
* This method does <i>not</i> trim spaces!
- * <p/>
*
* @param data the String to get it's first character lower-cased.
* @return data string with the first character transformed to lowercase
@@ -2205,9 +2203,8 @@ public class StringUtils
}
/**
- * Take the input string and un-camel-case it.
- * <p/>
- * 'ThisIsIt' will become 'this-is-it'.
+ * <p>Take the input string and un-camel-case it.</p>
+ * <p>'ThisIsIt' will become 'this-is-it'.</p>
*
* @param view the view
* @return deHumped String
@@ -2519,7 +2516,6 @@ public class StringUtils
/**
* <p>Checks if String ends with a search String, handling <code>null</code>.</p>
- * <p/>
* <p>A <code>null</code> String will return <code>false</code>.</p>
*
* <pre>
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/Arg.java b/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
index 094cbba..62f14ea 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/Arg.java
@@ -33,6 +33,7 @@ public interface Arg
/**
* @param line the line of arguments
+ * @throws CommandLineException in case of unbalanced quotes.
*/
void setLine( String line ) throws CommandLineException;
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
index f430332..e03e905 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/Commandline.java
@@ -37,15 +37,14 @@ import org.apache.maven.shared.utils.cli.shell.CmdShell;
import org.apache.maven.shared.utils.cli.shell.Shell;
/**
- * <p/>
+ * <p>
* Commandline objects help handling command lines specifying processes to
* execute.
* </p>
- * <p/>
+ * <p>
* The class can be used to define a command line as nested elements or as a
* helper to define a command line by an application.
* </p>
- * <p/>
* <code>
* <someelement><br>
* <acommandline executable="/executable/to/run"><br>
@@ -55,8 +54,7 @@ import org.apache.maven.shared.utils.cli.shell.Shell;
* </acommandline><br>
* </someelement><br>
* </code>
- * </p>
- * <p/>
+ * <p>
* The element <code>someelement</code> must provide a method
* <code>createAcommandline</code> which returns an instance of this class.
* </p>
@@ -89,6 +87,7 @@ public class Commandline
* Shell is autodetected from operating system.
*
* @param toProcess the command to process
+ * @throws CommandLineException in case of unbalanced quotes.
*/
public Commandline( String toProcess ) throws CommandLineException
{
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/StreamConsumer.java b/src/main/java/org/apache/maven/shared/utils/cli/StreamConsumer.java
index 0cde961..d64fba9 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/StreamConsumer.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/StreamConsumer.java
@@ -22,12 +22,11 @@ package org.apache.maven.shared.utils.cli;
import java.io.IOException;
/**
- * Works in concert with the StreamPumper class to
+ * <p>Works in concert with the StreamPumper class to
* allow implementations to gain access to the lines being
- * "Pumped".
- * <p/>
- * Please note that implementations of this interface can be expected to be
- * called from arbitrary threads and must therefore be threadsafe.
+ * "Pumped".</p>
+ * <p>Please note that implementations of this interface can be expected to be
+ * called from arbitrary threads and must therefore be threadsafe.</p>
*
* @author <a href="mailto:fvancea@maxiq.com">Florin Vancea</a>
* @author <a href="mailto:pj@thoughtworks.com">Paul Julius</a>
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
index 2282680..738f660 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaTool.java
@@ -36,9 +36,9 @@ import java.util.Map;
/**
* Abstract implementation of a {@link JavaTool}.
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
* @since 0.5
- * @param <Request>
+ * @param <Request> Tool-specific request type
*/
public abstract class AbstractJavaTool<Request extends JavaToolRequest>
extends AbstractLogEnabled
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
index 6e18178..597041b 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/AbstractJavaToolRequest.java
@@ -24,7 +24,7 @@ import org.apache.maven.shared.utils.cli.StreamConsumer;
/**
* Abstract implementation of a {@link JavaToolRequest}.
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
* @since 0.5
*/
public class AbstractJavaToolRequest
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaTool.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaTool.java
index b4bc3a9..78b0170 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaTool.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaTool.java
@@ -20,26 +20,23 @@ package org.apache.maven.shared.utils.cli.javatool;
*/
/**
- * Describes a java tool, means a executable available in the jdk.
- * <p/>
- * The name of the tool ({@link #getJavaToolName()}) reflects the name of the executable that should exists as an
- * executable in the jdk, like {@code jarsigner, keytool, javadoc, ...}.
- * <p/>
- * An abstract implementation of the {@link JavaTool} named {@link AbstractJavaTool} use the command line API to execute
- * any user requests of this tool.
+ * <p>Describes a java tool, means a executable available in the jdk.</p>
+ * <p>The name of the tool ({@link #getJavaToolName()}) reflects the name of the executable that should exists as an
+ * executable in the jdk, like {@code jarsigner, keytool, javadoc, ...}.</p>
+ * <p>An abstract implementation of the {@link JavaTool} named {@link AbstractJavaTool} use the command line API to
+ * execute any user requests of this tool.</p>
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
* @since 0.5
- * @param <Request>
+ * @param <Request> Tool-specific request type
*/
public interface JavaTool<Request extends JavaToolRequest>
{
/**
- * Return the name of the java tool. This is exactly the name (without his extension) of the executable to
- * find in the {@code jdk/bin} directory.
- * <p/>
- * For example: {@code jarsigner, keytool, javadoc, ...}
+ * <p>Return the name of the java tool. This is exactly the name (without his extension) of the executable to
+ * find in the {@code jdk/bin} directory.</p>
+ * <p>For example: {@code jarsigner, keytool, javadoc, ...}</p>
*
* @return the name of the java tool.
*/
@@ -55,13 +52,11 @@ public interface JavaTool<Request extends JavaToolRequest>
void setToolchain( Object toolchain );
/**
- * Execute the input request and then returns the result of the execution.
- * <p/>
- * If could not create the java tool invocation, a {@link JavaToolException} will be thrown.
- * <p/>
- * If execution fails, then the result will have a none-zero {@link JavaToolResult#getExitCode()} and his
+ * <p>Execute the input request and then returns the result of the execution.</p>
+ * <p>If could not create the java tool invocation, a {@link JavaToolException} will be thrown.</p>
+ * <p>If execution fails, then the result will have a none-zero {@link JavaToolResult#getExitCode()} and his
* {@link JavaToolResult#getExecutionException()} will be filled with the error, otherwise the exist code will be
- * zero.
+ * zero.</p>
*
* @param request the request to perform
* @return the result of the tool execution
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
index fa10b33..fb9d694 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolException.java
@@ -20,13 +20,12 @@ package org.apache.maven.shared.utils.cli.javatool;
*/
/**
- * Signals an error during the construction of the command line used to invoke java tool, e.g. illegal invocation
- * arguments.
- * <p/>
- * This should not be confused with a failure of the invoked java tool build itself which will be reported by means of a
- * non-zero exit code.
+ * <p>Signals an error during the construction of the command line used to invoke java tool, e.g. illegal invocation
+ * arguments.</p>
+ * <p>This should not be confused with a failure of the invoked java tool build itself which will be reported by means
+ * of a non-zero exit code.</p>
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
*
* @see JavaToolResult#getExitCode()
* @since 0.5
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolRequest.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolRequest.java
index 7227774..6ad86b1 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolRequest.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolRequest.java
@@ -24,27 +24,25 @@ import org.apache.maven.shared.utils.cli.StreamConsumer;
/**
* Specifies the minimum parameters used to control a {@link JavaTool} invocation.
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
* @since 0.5
*/
public interface JavaToolRequest
{
/**
- * Gets the value of the {@code systemOutStreamConsumer} field.
- * <p/>
- * This option field if filled is used by the commandline tool to consume system ouput stream of the jarsigner
- * command.
+ * <p>Gets the value of the {@code systemOutStreamConsumer} field.</p>
+ * <p>This option field if filled is used by the commandline tool to consume system ouput stream of the jarsigner
+ * command.</p>
*
* @return the value of the {@code systemOutStreamConsumer} field.
*/
StreamConsumer getSystemOutStreamConsumer();
/**
- * Gets the value of the {@code systemErrorStreamConsumer} field.
- * <p/>
- * This option field if filled is used by the commandline tool to consume system error stream of the jarsigner
- * command.
+ * <p>Gets the value of the {@code systemErrorStreamConsumer} field.</p>
+ * <p>This option field if filled is used by the commandline tool to consume system error stream of the jarsigner
+ * command.</p>
*
* @return the value of the {@code systemErrorStreamConsumer} field.
*/
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolResult.java b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolResult.java
index f3a6a77..deb830e 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolResult.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/javatool/JavaToolResult.java
@@ -25,7 +25,7 @@ import org.apache.maven.shared.utils.cli.Commandline;
/**
* Describes the result of a {@link JavaTool} invocation.
*
- * @author Tony Chemit <ch...@codelutin.com>
+ * @author <a href="mailto:chemit@codelutin.com">Tony Chemit</a>
* @since 0.5
*/
public class JavaToolResult
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
index e3af665..f04864e 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/BourneShell.java
@@ -111,7 +111,6 @@ public class BourneShell
/**
* <p>Unify quotes in a path for the Bourne Shell.</p>
- * <p/>
* <pre>
* BourneShell.quoteOneItem(null) = null
* BourneShell.quoteOneItem("") = ''
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
index 04aa6de..06b7df7 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/CmdShell.java
@@ -51,7 +51,6 @@ public class CmdShell
* <p>
* From cmd.exe /? output:
* </p>
- * <p/>
* <pre>
* If /C or /K is specified, then the remainder of the command line after
* the switch is processed as a command line, where the following logic is
@@ -74,7 +73,6 @@ public class CmdShell
* remove the last quote character on the command line, preserving
* any text after the last quote character.
* </pre>
- * <p/>
* <p>
* Always quoting the entire command line, regardless of these conditions
* appears to make Windows processes invoke successfully.
diff --git a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
index 0268108..47ec0da 100644
--- a/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
+++ b/src/main/java/org/apache/maven/shared/utils/cli/shell/Shell.java
@@ -28,7 +28,7 @@ import org.apache.maven.shared.utils.StringUtils;
/**
* Class that abstracts the Shell functionality,
- * with subclasses for shells that behave particularly, like<p>
+ * with subclasses for shells that behave particularly, like
*
* <ul>
* <li><code>command.com</code></li>
diff --git a/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java b/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
index 19b1732..357eab4 100644
--- a/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
+++ b/src/main/java/org/apache/maven/shared/utils/introspection/ClassMap.java
@@ -79,16 +79,13 @@ public class ClassMap
}
/**
- * Find a Method using the methodKey
- * provided.
- * <p/>
- * Look in the methodMap for an entry. If found,
+ * <p>Find a Method using the methodKey provided.</p>
+ * <p>Look in the methodMap for an entry. If found,
* it'll either be a CACHE_MISS, in which case we
* simply give up, or it'll be a Method, in which
- * case, we return it.
- * <p/>
- * If nothing is found, then we must actually go
- * and introspect the method from the MethodMap.
+ * case, we return it.</p>
+ * <p>If nothing is found, then we must actually go
+ * and introspect the method from the MethodMap.</p>
* @param name Method name.
* @param params Method parameters.
* @return The found method.
diff --git a/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java b/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
index 963c982..cf007cc 100644
--- a/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
+++ b/src/main/java/org/apache/maven/shared/utils/introspection/ReflectionValueExtractor.java
@@ -36,7 +36,6 @@ import javax.annotation.Nullable;
/**
* <p>Using simple dotted expressions to extract the values from an Object instance,
* For example we might want to extract a value like: <code>project.build.sourceDirectory</code></p>
- * <p/>
* <p>The implementation supports indexed, nested and mapped properties similar to the JSP way.</p>
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
@@ -146,14 +145,13 @@ public class ReflectionValueExtractor
/**
* <p>The implementation supports indexed, nested and mapped properties.</p>
- * <p/>
* <ul>
* <li>nested properties should be defined by a dot, i.e. "user.address.street"</li>
* <li>indexed properties (java.util.List or array instance) should be contains <code>(\\w+)\\[(\\d+)\\]</code>
* pattern, i.e. "user.addresses[1].street"</li>
* <li>mapped properties should be contains <code>(\\w+)\\((.+)\\)</code> pattern,
* i.e. "user.addresses(myAddress).street"</li>
- * <ul>
+ * </ul>
*
* @param expression not null expression
* @param root not null object
@@ -170,14 +168,13 @@ public class ReflectionValueExtractor
* <p>
* The implementation supports indexed, nested and mapped properties.
* </p>
- * <p/>
* <ul>
* <li>nested properties should be defined by a dot, i.e. "user.address.street"</li>
* <li>indexed properties (java.util.List or array instance) should be contains <code>(\\w+)\\[(\\d+)\\]</code>
* pattern, i.e. "user.addresses[1].street"</li>
* <li>mapped properties should be contains <code>(\\w+)\\((.+)\\)</code> pattern, i.e.
* "user.addresses(myAddress).street"</li>
- * <ul>
+ * </ul>
*
* @param expression not null expression
* @param root not null object
diff --git a/src/main/java/org/apache/maven/shared/utils/io/DirectoryScanner.java b/src/main/java/org/apache/maven/shared/utils/io/DirectoryScanner.java
index 5d03525..bd8bd7d 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/DirectoryScanner.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/DirectoryScanner.java
@@ -32,56 +32,62 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
/**
- * Class for scanning a directory for files/directories which match certain criteria.
- * <p/>
+ * <p>Class for scanning a directory for files/directories which match certain criteria.</p>
+ * <p>
* These criteria consist of selectors and patterns which have been specified. With the selectors you can select which
* files you want to have included. Files which are not selected are excluded. With patterns you can include or exclude
* files based on their filename.
- * <p/>
+ * </p>
+ * <p>
* The idea is simple. A given directory is recursively scanned for all files and directories. Each file/directory is
* matched against a set of selectors, including special support for matching against filenames with include and and
* exclude patterns. Only files/directories which match at least one pattern of the include pattern list or other file
* selector, and don't match any pattern of the exclude pattern list or fail to match against a required selector will
* be placed in the list of files/directories found.
- * <p/>
+ * </p>
+ * <p>
* When no list of include patterns is supplied, "**" will be used, which means that everything will be matched. When no
* list of exclude patterns is supplied, an empty list is used, such that nothing will be excluded. When no selectors
* are supplied, none are applied.
- * <p/>
+ * </p>
+ * <p>
* The filename pattern matching is done as follows: The name to be matched is split up in path segments. A path segment
* is the name of a directory or file, which is bounded by <code>File.separator</code> ('/' under UNIX, '\' under
* Windows). For example, "abc/def/ghi/xyz.java" is split up in the segments "abc", "def","ghi" and "xyz.java". The same
* is done for the pattern against which should be matched.
- * <p/>
+ * </p>
+ * <p>
* The segments of the name and the pattern are then matched against each other. When '**' is used for a path segment in
* the pattern, it matches zero or more path segments of the name.
- * <p/>
+ * </p>
+ * <p>
* There is a special case regarding the use of <code>File.separator</code>s at the beginning of the pattern and the
* string to match:<br>
* When a pattern starts with a <code>File.separator</code>, the string to match must also start with a
* <code>File.separator</code>. When a pattern does not start with a <code>File.separator</code>, the string to match
* may not start with a <code>File.separator</code>. When one of these rules is not obeyed, the string will not match.
- * <p/>
+ * </p>
+ * <p>
* When a name path segment is matched against a pattern path segment, the following special characters can be used:<br>
* '*' matches zero or more characters<br>
* '?' matches one character.
- * <p/>
+ * </p>
+ * <p>
* Examples:
- * <p/>
- * "**\*.class" matches all .class files/dirs in a directory tree.
- * <p/>
- * "test\a??.java" matches all files/dirs which start with an 'a', then two more characters and then ".java", in a
- * directory called test.
- * <p/>
- * "**" matches everything in a directory tree.
- * <p/>
- * "**\test\**\XYZ*" matches all files/dirs which start with "XYZ" and where there is a parent directory called test
- * (e.g. "abc\test\def\ghi\XYZ123").
- * <p/>
+ * <ul>
+ * <li>"**\*.class" matches all .class files/dirs in a directory tree.</li>
+ * <li>"test\a??.java" matches all files/dirs which start with an 'a', then two more characters and then ".java", in a
+ * directory called test.</li>
+ * <li>"**" matches everything in a directory tree.</li>
+ * <li>"**\test\**\XYZ*" matches all files/dirs which start with "XYZ" and where there is a parent directory called test
+ * (e.g. "abc\test\def\ghi\XYZ123").</li>
+ * </ul>
+ * <p>
* Case sensitivity may be turned off if necessary. By default, it is turned on.
- * <p/>
+ * </p>
+ * <p>
* Example of usage:
- * <p/>
+ * </p>
* <pre>
* String[] includes = { "**\\*.class" };
* String[] excludes = { "modules\\*\\**" };
@@ -98,11 +104,13 @@ import javax.annotation.Nullable;
* System.out.println( files[i] );
* }
* </pre>
- * <p/>
+ * <p>
* This will scan a directory called test for .class files, but excludes all files in all proper subdirectories of a
* directory called "modules"
- * <p/>
+ * </p>
+ * <p>
* This class must not be used from multiple Threads concurrently!
+ * </p>
*
* @author Arnout J. Kuiper <a href="mailto:ajkuiper@wxs.nl">ajkuiper@wxs.nl</a>
* @author Magesh Umasankar
@@ -295,8 +303,9 @@ public class DirectoryScanner
/**
* Sets the list of include patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
- * <p/>
+ * <p>
* When a pattern ends with a '/' or '\', "**" is appended.
+ * </p>
*
* @param includes A list of include patterns. May be <code>null</code>, indicating that all files should be
* included. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
@@ -326,8 +335,9 @@ public class DirectoryScanner
/**
* Sets the list of exclude patterns to use. All '/' and '\' characters are replaced by
* <code>File.separatorChar</code>, so the separator used need not match <code>File.separatorChar</code>.
- * <p/>
+ * <p>
* When a pattern ends with a '/' or '\', "**" is appended.
+ * </p>
*
* @param excludes A list of exclude patterns. May be <code>null</code>, indicating that no files should be
* excluded. If a non-<code>null</code> list is given, all elements must be non-<code>null</code>.
@@ -431,13 +441,15 @@ public class DirectoryScanner
* a previously captured list of files.
* This method will not look for a changed in content but sole in the
* list of files given.
- * <p/>
+ * <p>
* The method will compare the given array of file Strings with the result
* of the last directory scan. It will execute a {@link #scan()} if no
* result of a previous scan could be found.
- * <p/>
+ * </p>
+ * <p>
* The result of the diff can be queried by the methods
* {@link DirectoryScanResult#getFilesAdded()} and {@link DirectoryScanResult#getFilesRemoved()}
+ * </p>
*
* @param oldFiles the list of previously captured files names.
* @return the result of the directory scan.
diff --git a/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java b/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
index 4612b37..4d80e18 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
@@ -61,28 +61,28 @@ import java.util.Random;
*
* <h3>Path-related methods</h3>
*
- * <p>Methods exist to retrieve the components of a typical file path. For example
+ * Methods exist to retrieve the components of a typical file path. For example
* <code>/www/hosted/mysite/index.html</code>, can be broken into:
* <ul>
* <li><code>/www/hosted/mysite/index</code> -- retrievable through {@link #removeExtension}</li>
* <li><code>html</code> -- retrievable through {@link #getExtension}</li>
* </ul>
- * </p>
- * <p/>
+ *
* <h3>File-related methods</h3>
*
- * There are methods to create a {@link #toFile File from a URL}, copy a
+ * <p>There are methods to create a {@link #toFile File from a URL}, copy a
* {@link #copyFile File to another File},
* copy a {@link #copyURLToFile URL's contents to a File},
* as well as methods to {@link #deleteDirectory(File) delete} and {@link #cleanDirectory(File)
* clean} a directory.
- * <p/>
- * Common {@link java.io.File} manipulation routines.
- * <p/>
+ * </p>
+ * <p>Common {@link java.io.File} manipulation routines.</p>
+ * <p>
* Taken from the commons-utils repo.
* Also code from Alexandria's FileUtils.
* And from Avalon Excalibur's IO.
* And from Ant.
+ * </p>
*
* @author <a href="mailto:burton@relativity.yi.org">Kevin A. Burton</A>
* @author <a href="mailto:sanders@apache.org">Scott Sanders</a>
@@ -482,8 +482,8 @@ public class FileUtils
/**
* Given a directory and an array of extensions return an array of compliant files.
- * <p/>
- * The given extensions should be like "java" and not like ".java".
+ *
+ * <p>The given extensions should be like "java" and not like ".java".</p>
*
* @param directory the path of the directory
* @param extensions an array of expected extensions
@@ -688,9 +688,9 @@ public class FileUtils
/**
* Remove extension from a path. E.g.
* <pre>
- * foo.txt --> foo
- * a\b\c.jpg --> a\b\c
- * a\b\c --> a\b\c
+ * foo.txt → foo
+ * a\b\c.jpg → a\b\c
+ * a\b\c → a\b\c
* </pre>
*
* @param filename the path of the file
@@ -715,9 +715,9 @@ public class FileUtils
* Get extension from a path. E.g.
*
* <pre>
- * foo.txt --> "txt"
- * a\b\c.jpg --> "jpg"
- * a\b\c --> ""
+ * foo.txt → "txt"
+ * a\b\c.jpg → "jpg"
+ * a\b\c → ""
* </pre>
*
* @param filename the path of the file
@@ -962,13 +962,13 @@ public class FileUtils
* root.
* Eg:
* <pre>
- * /foo// --> /foo/
- * /foo/./ --> /foo/
- * /foo/../bar --> /bar
- * /foo/../bar/ --> /bar/
- * /foo/../bar/../baz --> /baz
- * //foo//./bar --> /foo/bar
- * /../ --> null
+ * /foo// → /foo/
+ * /foo/./ → /foo/
+ * /foo/../bar → /bar
+ * /foo/../bar/ → /bar/
+ * /foo/../bar/../baz → /baz
+ * //foo//./bar → /foo/bar
+ * /../ → null
* </pre>
*
* @param path the path to normalize
@@ -1666,8 +1666,7 @@ public class FileUtils
/**
* Copies an entire directory structure.
- * <p/>
- * Note:
+ * <p>Note:</p>
* <ul>
* <li>It will include empty directories.
* <li>The <code>sourceDirectory</code> must exist.
@@ -1766,7 +1765,6 @@ public class FileUtils
/**
* Renames a file, even if that involves crossing file system boundaries.
- * <p/>
* <p>This will remove <code>to</code> (if it exists), ensure that
* <code>to</code>'s parent directory exists and move
* <code>from</code>, which involves deleting <code>from</code> as
@@ -1804,8 +1802,7 @@ public class FileUtils
}
/**
- * Create a temporary file in a given directory.
- * <p/>
+ * <p>Create a temporary file in a given directory.</p>
* <p>The file denoted by the returned abstract pathname did not
* exist before this method was invoked, any subsequent invocation
* of this method will yield a different file name.</p>
@@ -1859,7 +1856,7 @@ public class FileUtils
}
/**
- * <b>If wrappers is null or empty, the file will be copied only if to.lastModified() < from.lastModified()</b>
+ * <b>If wrappers is null or empty, the file will be copied only if to.lastModified() < from.lastModified()</b>
*
* @param from the file to copy
* @param to the destination file
@@ -1887,7 +1884,7 @@ public class FileUtils
}
/**
- * <b>If wrappers is null or empty, the file will be copy only if to.lastModified() < from.lastModified() or if
+ * <b>If wrappers is null or empty, the file will be copy only if to.lastModified() < from.lastModified() or if
* overwrite is true</b>
*
* @param from the file to copy
@@ -1895,7 +1892,7 @@ public class FileUtils
* @param encoding the file output encoding (only if wrappers is not empty)
* @param wrappers array of {@link FilterWrapper}
* @param overwrite if true and wrappers is null or empty, the file will be copied even if
- * to.lastModified() < from.lastModified()
+ * to.lastModified() < from.lastModified()
* @throws IOException if an IO error occurs during copying or filtering
*/
public static void copyFile( @Nonnull File from, @Nonnull File to, @Nullable String encoding,
@@ -2144,8 +2141,8 @@ public class FileUtils
* @param target the target
* @return the linked file
* @throws IOException in case of an error
- * @see {@code java.nio.file.Files.createSymbolicLink(Path)} which creates a new
- * symbolic link but does not replace existing symbolic links
+ * @see Files#createSymbolicLink(Path, Path, FileAttribute[]) which creates a new symbolic link but does
+ * not replace existing symbolic links
*/
@Nonnull public static File createSymbolicLink( @Nonnull File symlink, @Nonnull File target )
throws IOException
diff --git a/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java b/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
index 11f1bdd..534a4a0 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/IOUtil.java
@@ -37,12 +37,12 @@ import java.io.Writer;
import java.nio.channels.Channel;
/**
- * General IO Stream manipulation.
+ * <p>General IO Stream manipulation.</p>
* <p>
* This class provides static utility methods for input/output operations, particularly buffered
* copying between sources (<code>InputStream</code>, <code>Reader</code>, <code>String</code> and
* <code>byte[]</code>) and destinations (<code>OutputStream</code>, <code>Writer</code>,
- * <code>String</code> and <code>byte[]</code>).
+ * <code>String</code> and <code>byte[]</code>).</p>
*
* <p>Unless otherwise noted, these <code>copy</code> methods do <em>not</em> flush or close the
* streams. Often, doing so would require making non-portable assumptions about the streams' origin
@@ -837,7 +837,7 @@ public final class IOUtil
// ----------------------------------------------------------------------
/**
- * Closes a {@code Channel} suppressing any {@code IOException}.
+ * <p>Closes a {@code Channel} suppressing any {@code IOException}.</p>
* <p>
* <b>Note:</b> The use case justifying this method is a shortcoming of the Java language up to but not including
* Java 7. For any code targeting Java 7 or later use of this method is highly discouraged and the
@@ -847,7 +847,8 @@ public final class IOUtil
* {@code finally} block incorrectly by using this method.</strong>
* </p>
* <p>
- * <b>Example:</b><br/>
+ * <b>Example:</b>
+ * </p>
* <pre>
* // Introduce variables for the resources and initialize them to null. This cannot throw an exception.
* Closeable resource1 = null;
@@ -921,7 +922,6 @@ public final class IOUtil
* // }
* }
* </pre>
- * </p>
*
* @param channel The channel to close or {@code null}.
* @deprecated use try-with-resources
@@ -943,7 +943,7 @@ public final class IOUtil
}
/**
- * Closes an {@code InputStream} suppressing any {@code IOException}.
+ * <p>Closes an {@code InputStream} suppressing any {@code IOException}.</p>
* <p>
* <b>Note:</b> The use case justifying this method is a shortcoming of the Java language up to but not including
* Java 7. For any code targeting Java 7 or later use of this method is highly discouraged and the
@@ -953,7 +953,8 @@ public final class IOUtil
* {@code finally} block incorrectly by using this method.</strong>
* </p>
* <p>
- * <b>Example:</b><br/>
+ * <b>Example:</b>
+ * </p>
* <pre>
* // Introduce variables for the resources and initialize them to null. This cannot throw an exception.
* Closeable resource1 = null;
@@ -1027,7 +1028,6 @@ public final class IOUtil
* // }
* }
* </pre>
- * </p>
*
* @param inputStream The stream to close or {@code null}.
* @deprecated use try-with-resources
@@ -1049,7 +1049,7 @@ public final class IOUtil
}
/**
- * Closes an {@code OutputStream} suppressing any {@code IOException}.
+ * <p>Closes an {@code OutputStream} suppressing any {@code IOException}.</p>
* <p>
* <b>Note:</b> The use case justifying this method is a shortcoming of the Java language up to but not including
* Java 7. For any code targeting Java 7 or later use of this method is highly discouraged and the
@@ -1059,7 +1059,8 @@ public final class IOUtil
* {@code finally} block incorrectly by using this method.</strong>
* </p>
* <p>
- * <b>Example:</b><br/>
+ * <b>Example:</b>
+ * </p>
* <pre>
* // Introduce variables for the resources and initialize them to null. This cannot throw an exception.
* Closeable resource1 = null;
@@ -1133,7 +1134,6 @@ public final class IOUtil
* // }
* }
* </pre>
- * </p>
*
* @param outputStream The stream to close or {@code null}.
* @deprecated use try-with-resources
@@ -1155,7 +1155,7 @@ public final class IOUtil
}
/**
- * Closes a {@code Reader} suppressing any {@code IOException}.
+ * <p>Closes a {@code Reader} suppressing any {@code IOException}.</p>
* <p>
* <b>Note:</b> The use case justifying this method is a shortcoming of the Java language up to but not including
* Java 7. For any code targeting Java 7 or later use of this method is highly discouraged and the
@@ -1165,7 +1165,8 @@ public final class IOUtil
* {@code finally} block incorrectly by using this method.</strong>
* </p>
* <p>
- * <b>Example:</b><br/>
+ * <b>Example:</b>
+ * </p>
* <pre>
* // Introduce variables for the resources and initialize them to null. This cannot throw an exception.
* Closeable resource1 = null;
@@ -1239,7 +1240,6 @@ public final class IOUtil
* // }
* }
* </pre>
- * </p>
*
* @param reader The reader to close or {@code null}.
* @deprecated use try-with-resources
@@ -1261,7 +1261,7 @@ public final class IOUtil
}
/**
- * Closes a {@code Writer} suppressing any {@code IOException}.
+ * <p>Closes a {@code Writer} suppressing any {@code IOException}.</p>
* <p>
* <b>Note:</b> The use case justifying this method is a shortcoming of the Java language up to but not including
* Java 7. For any code targeting Java 7 or later use of this method is highly discouraged and the
@@ -1271,7 +1271,8 @@ public final class IOUtil
* {@code finally} block incorrectly by using this method.</strong>
* </p>
* <p>
- * <b>Example:</b><br/>
+ * <b>Example:</b>
+ * </p>
* <pre>
* // Introduce variables for the resources and initialize them to null. This cannot throw an exception.
* Closeable resource1 = null;
@@ -1345,7 +1346,6 @@ public final class IOUtil
* // }
* }
* </pre>
- * </p>
*
* @param writer The writer to close or {@code null}.
* @deprecated use try-with-resources
diff --git a/src/main/java/org/apache/maven/shared/utils/io/MatchPattern.java b/src/main/java/org/apache/maven/shared/utils/io/MatchPattern.java
index 8abff42..bdce10d 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/MatchPattern.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/MatchPattern.java
@@ -28,9 +28,9 @@ import java.util.regex.Pattern;
import javax.annotation.Nonnull;
/**
- * Describes a match target for SelectorUtils.
- * <p/>
- * Significantly more efficient than using strings, since re-evaluation and re-tokenizing is avoided.
+ * <p>Describes a match target for SelectorUtils.</p>
+ * <p>
+ * Significantly more efficient than using strings, since re-evaluation and re-tokenizing is avoided.</p>
*
* @author Kristian Rosenvold
* @deprecated use {@code java.nio.filejava.nio.file.DirectoryStream.Filter<T>} and related classes
diff --git a/src/main/java/org/apache/maven/shared/utils/io/MatchPatterns.java b/src/main/java/org/apache/maven/shared/utils/io/MatchPatterns.java
index 693acb1..638586f 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/MatchPatterns.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/MatchPatterns.java
@@ -40,9 +40,8 @@ public class MatchPatterns
}
/**
- * Checks these MatchPatterns against a specified string.
- * <p/>
- * Uses far less string tokenization than any of the alternatives.
+ * <p>Checks these MatchPatterns against a specified string.</p>
+ * <p>Uses far less string tokenization than any of the alternatives.</p>
*
* @param name The name to look for
* @param isCaseSensitive If the comparison is case sensitive
diff --git a/src/main/java/org/apache/maven/shared/utils/io/ScanConductor.java b/src/main/java/org/apache/maven/shared/utils/io/ScanConductor.java
index 08d7a1c..0a0d82d 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/ScanConductor.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/ScanConductor.java
@@ -23,12 +23,10 @@ import java.io.File;
/**
* <p>Visitor pattern for the DirectoryScanner. A ScanConductor controls the scanning process.</p>
- * <p/>
* <p>Create an instance and pass it to
* {@link org.apache.maven.shared.utils.io.DirectoryScanner#setScanConductor(ScanConductor)}.
* You will get notified about every visited directory and file. You can use the {@link ScanAction}
* to control what should happen next.</p>
- * <p/>
* <p>A ScanConductor might also store own information but users must make sure that the state gets
* cleaned between two scan() invocations.</p>
*
diff --git a/src/main/java/org/apache/maven/shared/utils/io/SelectorUtils.java b/src/main/java/org/apache/maven/shared/utils/io/SelectorUtils.java
index b716e7c..56a4399 100644
--- a/src/main/java/org/apache/maven/shared/utils/io/SelectorUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/io/SelectorUtils.java
@@ -73,12 +73,12 @@ public final class SelectorUtils
}
/**
- * Tests whether or not a given path matches the start of a given
- * pattern up to the first "**".
- * <p/>
+ * <p>Tests whether or not a given path matches the start of a given
+ * pattern up to the first "**".</p>
+ * <p>
* This is not a general purpose test and should only be used if you
* can live with false positives. For example, <code>pattern=**\a</code>
- * and <code>str=b</code> will yield <code>true</code>.
+ * and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be
* <code>null</code>.
@@ -93,12 +93,11 @@ public final class SelectorUtils
}
/**
- * Tests whether or not a given path matches the start of a given
- * pattern up to the first "**".
- * <p/>
- * This is not a general purpose test and should only be used if you
+ * <p>Tests whether or not a given path matches the start of a given
+ * pattern up to the first "**".</p>
+ * <p>This is not a general purpose test and should only be used if you
* can live with false positives. For example, <code>pattern=**\a</code>
- * and <code>str=b</code> will yield <code>true</code>.
+ * and <code>str=b</code> will yield <code>true</code>.</p>
*
* @param pattern The pattern to match against. Must not be
* <code>null</code>.
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java b/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
index 2d59bc9..7f44239 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/AnsiMessageBuilder.java
@@ -50,24 +50,24 @@ class AnsiMessageBuilder
this.ansi = ansi;
}
- public String debug( String level )
+ public String debug( String message )
{
- return Style.DEBUG.apply( ansi ).a( level ).reset().toString();
+ return Style.DEBUG.apply( ansi ).a( message ).reset().toString();
}
- public String info( String level )
+ public String info( String message )
{
- return Style.INFO.apply( ansi ).a( level ).reset().toString();
+ return Style.INFO.apply( ansi ).a( message ).reset().toString();
}
- public String warning( String level )
+ public String warning( String message )
{
- return Style.WARNING.apply( ansi ).a( level ).reset().toString();
+ return Style.WARNING.apply( ansi ).a( message ).reset().toString();
}
- public String error( String level )
+ public String error( String message )
{
- return Style.ERROR.apply( ansi ).a( level ).reset().toString();
+ return Style.ERROR.apply( ansi ).a( message ).reset().toString();
}
public AnsiMessageBuilder success( Object message )
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/LoggerLevelRenderer.java b/src/main/java/org/apache/maven/shared/utils/logging/LoggerLevelRenderer.java
index 9dac0eb..6caa797 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/LoggerLevelRenderer.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/LoggerLevelRenderer.java
@@ -28,26 +28,30 @@ package org.apache.maven.shared.utils.logging;
public interface LoggerLevelRenderer
{
/**
- * Render DEBUG level.
- * By default, bold cyan
+ * Render a message at DEBUG level.
+ * @param message the message to render.
+ * @return the formatted message.
*/
- String debug( String level );
+ String debug( String message );
/**
- * Render INFO level.
- * By default, bold blue
+ * Render a message at INFO level.
+ * @param message the message to render.
+ * @return the formatted message.
*/
- String info( String level );
+ String info( String message );
/**
- * Render WARNING level.
- * By default, bold yellow
+ * Render a message at WARNING level.
+ * @param message the message to render.
+ * @return the formatted message.
*/
- String warning( String level );
+ String warning( String message );
/**
- * Render ERROR level.
- * By default, bold red
+ * Render a message at ERROR level.
+ * @param message the message to render.
+ * @return the formatted message.
*/
- String error( String level );
+ String error( String message );
}
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/MessageBuilder.java b/src/main/java/org/apache/maven/shared/utils/logging/MessageBuilder.java
index 060e824..649c086 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/MessageBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/MessageBuilder.java
@@ -29,36 +29,48 @@ public interface MessageBuilder
/**
* Append message content in success style.
* By default, bold green
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder success( Object message );
/**
* Append message content in warning style.
* By default, bold yellow
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder warning( Object message );
/**
* Append message content in failure style.
* By default, bold red
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder failure( Object message );
/**
* Append message content in strong style.
* By default, bold
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder strong( Object message );
/**
* Append message content in mojo style.
* By default, green
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder mojo( Object message );
/**
* Append message content in project style.
* By default, cyan
+ * @param message the message to append
+ * @return the current builder
*/
MessageBuilder project( Object message );
@@ -67,37 +79,55 @@ public interface MessageBuilder
//
/**
* Append content to the message buffer.
+ * @param value the content to append
+ * @param offset the index of the first {@code char} to append
+ * @param len the number of {@code char}s to append
+ * @return the current builder
*/
MessageBuilder a( char[] value, int offset, int len );
/**
* Append content to the message buffer.
+ * @param value the content to append
+ * @return the current builder
*/
MessageBuilder a( char[] value );
/**
* Append content to the message buffer.
+ * @param value the content to append
+ * @param start the starting index of the subsequence to be appended
+ * @param end the end index of the subsequence to be appended
+ * @return the current builder
*/
MessageBuilder a( CharSequence value, int start, int end );
/**
* Append content to the message buffer.
+ * @param value the content to append
+ * @return the current builder
*/
MessageBuilder a( CharSequence value );
/**
* Append content to the message buffer.
+ * @param value the content to append
+ * @return the current builder
*/
MessageBuilder a( Object value );
/**
* Append newline to the message buffer.
+ * @return the current builder
*/
MessageBuilder newline();
/**
* Append formatted content to the buffer.
* @see String#format(String, Object...)
+ * @param pattern a <a href="../util/Formatter.html#syntax">format string</a>
+ * @param args arguments referenced by the format specifiers in the format string.
+ * @return the current builder
*/
MessageBuilder format( String pattern, Object... args );
}
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/MessageUtils.java b/src/main/java/org/apache/maven/shared/utils/logging/MessageUtils.java
index 090b6a0..f28058b 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/MessageUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/MessageUtils.java
@@ -46,7 +46,7 @@ public class MessageUtils
boolean jansi = true;
try
{
- // JAnsi is provided by Maven core since 3.5.0
+ // Jansi is provided by Maven core since 3.5.0
Class.forName( "org.fusesource.jansi.Ansi" );
}
catch ( ClassNotFoundException cnfe )
@@ -79,7 +79,7 @@ public class MessageUtils
{
doSystemUninstall();
- // hook can only set when JANSI is true
+ // hook can only set when Jansi is true
if ( shutdownHook != null )
{
try
@@ -103,8 +103,8 @@ public class MessageUtils
}
/**
- * Enables message color (if JAnsi is available).
- * @param flag
+ * Enables message color (if Jansi is available).
+ * @param flag to enable Jansi
*/
public static void setColorEnabled( boolean flag )
{
@@ -127,7 +127,8 @@ public class MessageUtils
}
/**
- * Is message color enabled: requires JAnsi available (through Maven) and the color has not been disabled.
+ * Is message color enabled: requires Jansi available (through Maven) and the color has not been disabled.
+ * @return whether colored messages are enabled
*/
public static boolean isColorEnabled()
{
@@ -145,6 +146,7 @@ public class MessageUtils
/**
* Create a message buffer with defined String builder.
+ * @param builder initial content of the message buffer
* @return a new buffer
*/
public static MessageBuilder buffer( StringBuilder builder )
@@ -154,6 +156,7 @@ public class MessageUtils
/**
* Create a message buffer with an internal buffer of defined size.
+ * @param size size of the buffer
* @return a new buffer
*/
public static MessageBuilder buffer( int size )
diff --git a/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java b/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
index 6a7b56e..5ff4884 100644
--- a/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
+++ b/src/main/java/org/apache/maven/shared/utils/logging/PlainMessageBuilder.java
@@ -42,24 +42,24 @@ class PlainMessageBuilder
buffer = new StringBuilder( size );
}
- public String debug( String level )
+ public String debug( String message )
{
- return a( level ).toString();
+ return a( message ).toString();
}
- public String info( String level )
+ public String info( String message )
{
- return a( level ).toString();
+ return a( message ).toString();
}
- public String warning( String level )
+ public String warning( String message )
{
- return a( level ).toString();
+ return a( message ).toString();
}
- public String error( String level )
+ public String error( String message )
{
- return a( level ).toString();
+ return a( message ).toString();
}
public PlainMessageBuilder success( Object message )
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/XmlReaderException.java b/src/main/java/org/apache/maven/shared/utils/xml/XmlReaderException.java
index f1bc0c6..5ee48a0 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/XmlReaderException.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/XmlReaderException.java
@@ -23,12 +23,11 @@ import java.io.IOException;
import java.io.InputStream;
/**
- * The XmlReaderException is thrown by the XmlReader constructors if the charset encoding can not be determined
- * according to the XML 1.0 specification and RFC 3023.
- * <p/>
- * The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the
- * stream. Note that the original InputStream given to the XmlReader cannot be used as that one has been already read.
- * <p/>
+ * <p>The XmlReaderException is thrown by the XmlReader constructors if the charset encoding can not be determined
+ * according to the XML 1.0 specification and RFC 3023.</p>
+ * <p>The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the
+ * stream. Note that the original InputStream given to the XmlReader cannot be used as that one has been already
+ * read.</p>
*
* @author Alejandro Abdelnur
* @version revision 1.1 taken on 26/06/2007 from Rome (see https://rome.dev.java.net/source/browse/rome/src/java/com/sun/syndication/io/XmlReaderException.java)
@@ -54,10 +53,8 @@ class XmlReaderException
private final InputStream is;
/**
- * Creates an exception instance if the charset encoding could not be determined.
- * <p/>
- * Instances of this exception are thrown by the XmlReader.
- * <p/>
+ * <p>Creates an exception instance if the charset encoding could not be determined.</p>
+ * <p>Instances of this exception are thrown by the XmlReader.</p>
*
* @param msg message describing the reason for the exception.
* @param bomEnc BOM encoding.
@@ -71,10 +68,8 @@ class XmlReaderException
}
/**
- * Creates an exception instance if the charset encoding could not be determined.
- * <p/>
- * Instances of this exception are thrown by the XmlReader.
- * <p/>
+ * <p>Creates an exception instance if the charset encoding could not be determined.</p>
+ * <p>Instances of this exception are thrown by the XmlReader.</p>
*
* @param msg message describing the reason for the exception.
* @param ctMime MIME type in the content-type.
@@ -98,7 +93,6 @@ class XmlReaderException
/**
* Returns the BOM encoding found in the InputStream.
- * <p/>
*
* @return the BOM encoding, null if none.
*/
@@ -109,7 +103,6 @@ class XmlReaderException
/**
* Returns the encoding guess based on the first bytes of the InputStream.
- * <p/>
*
* @return the encoding guess, null if it couldn't be guessed.
*/
@@ -120,7 +113,6 @@ class XmlReaderException
/**
* Returns the encoding found in the XML prolog of the InputStream.
- * <p/>
*
* @return the encoding of the XML prolog, null if none.
*/
@@ -131,7 +123,6 @@ class XmlReaderException
/**
* Returns the MIME type in the content-type used to attempt determining the encoding.
- * <p/>
*
* @return the MIME type in the content-type, null if there was not content-type or the encoding detection did not
* involve HTTP.
@@ -143,7 +134,6 @@ class XmlReaderException
/**
* Returns the encoding in the content-type used to attempt determining the encoding.
- * <p/>
*
* @return the encoding in the content-type, null if there was not content-type, no encoding in it or the encoding
* detection did not involve HTTP.
@@ -156,7 +146,6 @@ class XmlReaderException
/**
* Returns the unconsumed InputStream to allow the application to do an alternate encoding detection on the
* InputStream.
- * <p/>
*
* @return the unconsumed InputStream.
*/
diff --git a/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReaderException.java b/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReaderException.java
index eeabae5..992b833 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReaderException.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/XmlStreamReaderException.java
@@ -22,13 +22,11 @@ package org.apache.maven.shared.utils.xml;
import java.io.InputStream;
/**
- * The XmlStreamReaderException is thrown by the XmlStreamReader constructors if the charset encoding can not be
- * determined according to the XML 1.0 specification and RFC 3023.
- * <p/>
- * The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the
+ * <p>The XmlStreamReaderException is thrown by the XmlStreamReader constructors if the charset encoding can not be
+ * determined according to the XML 1.0 specification and RFC 3023.</p>
+ * <p>The exception returns the unconsumed InputStream to allow the application to do an alternate processing with the
* stream. Note that the original InputStream given to the XmlStreamReader cannot be used as that one has been already
- * read.
- * <p/>
+ * read.</p>
*
* @author Alejandro Abdelnur
* @version revision 1.1 taken on 26/06/2007 from Rome (see
diff --git a/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java b/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
index d061111..fdf8130 100644
--- a/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
+++ b/src/test/java/org/apache/maven/shared/utils/xml/PrettyPrintXmlWriterTest.java
@@ -34,7 +34,7 @@ import org.junit.Test;
*/
public class PrettyPrintXmlWriterTest
{
- private StringWriter w = new StringWriter();;
+ private StringWriter w = new StringWriter();
private PrettyPrintXMLWriter writer = new PrettyPrintXMLWriter( w );
@Test