Follow Oracle Javadoc conventions

This commit is contained in:
Elliotte Rusty Harold
2025-09-17 10:01:25 -04:00
parent b6bddf2ceb
commit f6293205c2
33 changed files with 126 additions and 115 deletions

View File

@@ -63,11 +63,13 @@ public class DocMojo extends AbstractMojo {
@Parameter(readonly = true, defaultValue = "${project.basedir}") @Parameter(readonly = true, defaultValue = "${project.basedir}")
File baseDir; File baseDir;
/** A list of fully qualified enum names to process */ /** A list of fully qualified enum names to process. */
@Parameter(defaultValue = "org.mvndaemon.mvnd.common.Environment,org.mvndaemon.mvnd.common.OptionType") @Parameter(defaultValue = "org.mvndaemon.mvnd.common.Environment,org.mvndaemon.mvnd.common.OptionType")
String[] enums; String[] enums;
/** If {@code true} the execution of this mojo will be skipped altogether; otherwise this mojo will be executed. */ /**
* If {@code true} the execution of this mojo will be skipped altogether; otherwise this mojo will be executed.
*/
@Parameter(defaultValue = "false", property = "mvnd.build.doc.skip") @Parameter(defaultValue = "false", property = "mvnd.build.doc.skip")
boolean skip; boolean skip;

View File

@@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DaemonClientConnection.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DaemonClientConnection.java.
*/ */
public class DaemonClientConnection implements Closeable { public class DaemonClientConnection implements Closeable {
@@ -176,7 +176,7 @@ public class DaemonClientConnection implements Closeable {
public interface StaleAddressDetector { public interface StaleAddressDetector {
/** /**
* @return true if the failure should be considered due to a stale address. * @return true if the failure should be considered due to a stale address
*/ */
boolean maybeStaleAddress(Exception failure); boolean maybeStaleAddress(Exception failure);
} }

View File

@@ -64,7 +64,7 @@ import static org.mvndaemon.mvnd.common.DaemonState.Canceled;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java.
*/ */
public class DaemonConnector { public class DaemonConnector {

View File

@@ -31,7 +31,7 @@ import java.util.stream.Collector;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/diagnostics/DaemonDiagnostics.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/diagnostics/DaemonDiagnostics.java.
*/ */
public class DaemonDiagnostics { public class DaemonDiagnostics {
@@ -82,8 +82,8 @@ public class DaemonDiagnostics {
} }
/** /**
* @param path to read from tail * @param path to read from tail
* @return tail content * @return tail content
* @throws IOException when reading failed * @throws IOException when reading failed
*/ */
static String tail(Path path) throws IOException { static String tail(Path path) throws IOException {

View File

@@ -55,7 +55,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* Hold all daemon configuration * Hold all daemon configuration.
*/ */
public class DaemonParameters { public class DaemonParameters {
@@ -289,7 +289,7 @@ public class DaemonParameters {
/** /**
* @return the number of threads (same syntax as Maven's {@code -T}/{@code --threads} option) to pass to the daemon * @return the number of threads (same syntax as Maven's {@code -T}/{@code --threads} option) to pass to the daemon
* unless the user passes his own `-T` or `--threads`. * unless the user passes his own `-T` or `--threads`
*/ */
public String threads() { public String threads() {
return property(Environment.MVND_THREADS) return property(Environment.MVND_THREADS)
@@ -326,7 +326,7 @@ public class DaemonParameters {
} }
/** /**
* @return <code>true</code> if maven should be executed within this process instead of spawning a daemon. * @return <code>true</code> if maven should be executed within this process instead of spawning a daemon
*/ */
public boolean noDaemon() { public boolean noDaemon() {
return value(Environment.MVND_NO_DAEMON) return value(Environment.MVND_NO_DAEMON)
@@ -337,7 +337,7 @@ public class DaemonParameters {
} }
/** /**
* @return <code>true</code> if maven should be executed in debug mode. * @return <code>true</code> if maven should be executed in debug mode
*/ */
public boolean debug() { public boolean debug() {
return value(Environment.MVND_DEBUG).orSystemProperty().orDefault().asBoolean(); return value(Environment.MVND_DEBUG).orSystemProperty().orDefault().asBoolean();
@@ -570,7 +570,7 @@ public class DaemonParameters {
} }
/** /**
* Mostly for debugging * Mostly for debugging.
*/ */
@Override @Override
public String toString() { public String toString() {

View File

@@ -22,12 +22,12 @@ import java.nio.Buffer;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/base-services/src/main/java/org/gradle/internal/io/BufferCaster.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/base-services/src/main/java/org/gradle/internal/io/BufferCaster.java.
*/ */
public class BufferCaster { public class BufferCaster {
/** /**
* Without this cast, when the code compiled by Java 9+ is executed on Java 8, it will throw * Without this cast, when the code compiled by Java 9+ is executed on Java 8, it will throw
* java.lang.NoSuchMethodError: Method flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer * java.lang.NoSuchMethodError: Method flip()Ljava/nio/ByteBuffer; does not exist in class java.nio.ByteBuffer.
*/ */
@SuppressWarnings("RedundantCast") @SuppressWarnings("RedundantCast")
public static <T extends Buffer> Buffer cast(T byteBuffer) { public static <T extends Buffer> Buffer cast(T byteBuffer) {

View File

@@ -50,8 +50,8 @@ public class BufferHelper {
/** /**
* Attempts to clean a direct {@link ByteBuffer}, releasing its underlying memory. * Attempts to clean a direct {@link ByteBuffer}, releasing its underlying memory.
* *
* @param byteBuffer The direct ByteBuffer to clean. * @param byteBuffer the direct ByteBuffer to clean
* @return {@code true} if the cleaner was successfully invoked, {@code false} otherwise. * @return {@code true} if the cleaner was successfully invoked, {@code false} otherwise
*/ */
public static boolean closeDirectByteBuffer(ByteBuffer byteBuffer) { public static boolean closeDirectByteBuffer(ByteBuffer byteBuffer) {
return closeDirectByteBuffer(byteBuffer, null); return closeDirectByteBuffer(byteBuffer, null);
@@ -61,9 +61,9 @@ public class BufferHelper {
* Attempts to clean a direct {@link ByteBuffer}, releasing its underlying memory. * Attempts to clean a direct {@link ByteBuffer}, releasing its underlying memory.
* Logs any errors via the provided logger. * Logs any errors via the provided logger.
* *
* @param byteBuffer The direct ByteBuffer to clean. * @param byteBuffer the direct ByteBuffer to clean
* @param log A consumer to log any potential errors, may be {@code null}. * @param log a consumer to log any potential errors, may be {@code null}
* @return {@code true} if the cleaner was successfully invoked, {@code false} otherwise. * @return {@code true} if the cleaner was successfully invoked, {@code false} otherwise
*/ */
public static boolean closeDirectByteBuffer(ByteBuffer byteBuffer, Consumer<String> log) { public static boolean closeDirectByteBuffer(ByteBuffer byteBuffer, Consumer<String> log) {
if (byteBuffer != null && byteBuffer.isDirect()) { if (byteBuffer != null && byteBuffer.isDirect()) {

View File

@@ -26,7 +26,7 @@ import java.util.function.Supplier;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/context/DaemonCompatibilitySpec.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/context/DaemonCompatibilitySpec.java.
*/ */
public class DaemonCompatibilitySpec { public class DaemonCompatibilitySpec {

View File

@@ -40,8 +40,7 @@ import org.slf4j.LoggerFactory;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/messaging/src/main/java/org/gradle/internal/remote/internal/inet/SocketConnection.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/messaging/src/main/java/org/gradle/internal/remote/internal/inet/SocketConnection.java.
*
*/ */
public class DaemonConnection implements AutoCloseable { public class DaemonConnection implements AutoCloseable {

View File

@@ -25,7 +25,7 @@ package org.mvndaemon.mvnd.common;
* results. * results.
* *
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v6.5.1/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/expiry/DaemonExpirationStatus.java * https://github.com/gradle/gradle/blob/v6.5.1/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/expiry/DaemonExpirationStatus.java.
*/ */
public enum DaemonExpirationStatus { public enum DaemonExpirationStatus {
DO_NOT_EXPIRE, DO_NOT_EXPIRE,

View File

@@ -25,7 +25,7 @@ import static org.mvndaemon.mvnd.common.DaemonState.Idle;
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonInfo.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonInfo.java.
*/ */
public class DaemonInfo { public class DaemonInfo {

View File

@@ -51,7 +51,7 @@ import static org.mvndaemon.mvnd.common.DaemonState.Idle;
* <p> * <p>
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonRegistry.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonRegistry.java
* https://github.com/OpenHFT/Java-Lang/blob/master/lang/src/main/java/net/openhft/lang/io/AbstractBytes.java * https://github.com/OpenHFT/Java-Lang/blob/master/lang/src/main/java/net/openhft/lang/io/AbstractBytes.java.
*/ */
public class DaemonRegistry implements AutoCloseable { public class DaemonRegistry implements AutoCloseable {

View File

@@ -20,7 +20,7 @@ package org.mvndaemon.mvnd.common;
/** /**
* File origin * File origin
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/api/DaemonStateControl.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/api/DaemonStateControl.java.
*/ */
public enum DaemonState { public enum DaemonState {
Idle, Idle,

View File

@@ -27,7 +27,7 @@ import java.util.Objects;
* Information regarding when and why a daemon was stopped. * Information regarding when and why a daemon was stopped.
* *
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonStopEvent.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/registry/DaemonStopEvent.java.
*/ */
public class DaemonStopEvent implements Serializable { public class DaemonStopEvent implements Serializable {

View File

@@ -55,13 +55,13 @@ public enum Environment {
* Delete log files under the <code>mvnd.registry</code> directory that are older than <code>mvnd.logPurgePeriod</code> * Delete log files under the <code>mvnd.registry</code> directory that are older than <code>mvnd.logPurgePeriod</code>
*/ */
PURGE(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--purge"), PURGE(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--purge"),
/** Prints the status of daemon instances registered in the registry specified by <code>mvnd.registry</code> */ /** Prints the status of daemon instances registered in the registry specified by <code>mvnd.registry</code>. */
STATUS(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--status"), STATUS(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--status"),
/** Stop all daemon instances registered in the registry specified by <code>mvnd.registry</code> */ /** Stop all daemon instances registered in the registry specified by <code>mvnd.registry</code>. */
STOP(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--stop"), STOP(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--stop"),
/** Terminal diagnosis */ /** Terminal diagnosis. */
DIAG(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--diag"), DIAG(null, null, null, OptionType.VOID, Flags.OPTIONAL, "mvnd:--diag"),
/** Use one thread, no log buffering and the default project builder to behave like a standard maven */ /** Use one thread, no log buffering and the default project builder to behave like a standard maven. */
SERIAL("mvnd.serial", null, Boolean.FALSE, OptionType.VOID, Flags.OPTIONAL, "mvnd:-1", "mvnd:--serial"), SERIAL("mvnd.serial", null, Boolean.FALSE, OptionType.VOID, Flags.OPTIONAL, "mvnd:-1", "mvnd:--serial"),
// //
@@ -71,22 +71,22 @@ public enum Environment {
JAVA_HOME("java.home", "JAVA_HOME", null, OptionType.PATH, Flags.DOCUMENTED_AS_DISCRIMINATING), JAVA_HOME("java.home", "JAVA_HOME", null, OptionType.PATH, Flags.DOCUMENTED_AS_DISCRIMINATING),
/** /**
* The daemon installation directory. The client normally sets this according to where its <code>mvnd</code> * The daemon installation directory. The client normally sets this according to where its <code>mvnd</code>
* executable is located * executable is located.
*/ */
MVND_HOME("mvnd.home", "MVND_HOME", null, OptionType.PATH, Flags.DISCRIMINATING), MVND_HOME("mvnd.home", "MVND_HOME", null, OptionType.PATH, Flags.DISCRIMINATING),
/** The user home directory */ /** The user home directory. */
USER_HOME("user.home", null, null, OptionType.PATH, Flags.NONE), USER_HOME("user.home", null, null, OptionType.PATH, Flags.NONE),
/** The current working directory */ /** The current working directory. */
USER_DIR("user.dir", null, null, OptionType.PATH, Flags.NONE), USER_DIR("user.dir", null, null, OptionType.PATH, Flags.NONE),
/** The JDK_JAVA_OPTIONS option */ /** The JDK_JAVA_OPTIONS option. */
JDK_JAVA_OPTIONS("jdk.java.options", "JDK_JAVA_OPTIONS", "", OptionType.STRING, Flags.DISCRIMINATING), JDK_JAVA_OPTIONS("jdk.java.options", "JDK_JAVA_OPTIONS", "", OptionType.STRING, Flags.DISCRIMINATING),
// //
// Maven properties // Maven properties
// //
/** The path to the Maven local repository */ /** The path to the Maven local repository. */
MAVEN_REPO_LOCAL("maven.repo.local", null, null, OptionType.PATH, Flags.DISCRIMINATING | Flags.OPTIONAL), MAVEN_REPO_LOCAL("maven.repo.local", null, null, OptionType.PATH, Flags.DISCRIMINATING | Flags.OPTIONAL),
/** The location of the maven settings file */ /** The location of the maven settings file. */
MAVEN_SETTINGS( MAVEN_SETTINGS(
"maven.settings", "maven.settings",
null, null,
@@ -95,23 +95,23 @@ public enum Environment {
Flags.DISCRIMINATING | Flags.OPTIONAL, Flags.DISCRIMINATING | Flags.OPTIONAL,
"mvn:-s", "mvn:-s",
"mvn:--settings"), "mvn:--settings"),
/** The pom or directory to build */ /** The pom or directory to build. */
MAVEN_FILE(null, null, null, OptionType.PATH, Flags.NONE, "mvn:-f", "mvn:--file"), MAVEN_FILE(null, null, null, OptionType.PATH, Flags.NONE, "mvn:-f", "mvn:--file"),
/** The root directory of the current multi module Maven project */ /** The root directory of the current multi module Maven project. */
MAVEN_MULTIMODULE_PROJECT_DIRECTORY("maven.multiModuleProjectDirectory", null, null, OptionType.PATH, Flags.NONE), MAVEN_MULTIMODULE_PROJECT_DIRECTORY("maven.multiModuleProjectDirectory", null, null, OptionType.PATH, Flags.NONE),
/** Log file */ /** Log file. */
MAVEN_LOG_FILE(null, null, null, OptionType.PATH, Flags.INTERNAL, "mvn:-l", "mvn:--log-file"), MAVEN_LOG_FILE(null, null, null, OptionType.PATH, Flags.INTERNAL, "mvn:-l", "mvn:--log-file"),
/** Batch mode */ /** Batch mode. */
MAVEN_BATCH_MODE(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-B", "mvn:--batch-mode"), MAVEN_BATCH_MODE(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-B", "mvn:--batch-mode"),
/** Verbose */ /** Verbose. */
MAVEN_VERBOSE(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-X", "mvn:--verbose"), MAVEN_VERBOSE(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-X", "mvn:--verbose"),
/** Version */ /** Version. */
MAVEN_VERSION(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-v", "mvn:-version", "mvn:--version"), MAVEN_VERSION(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-v", "mvn:-version", "mvn:--version"),
/** Show version */ /** Show version. */
MAVEN_SHOW_VERSION(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-V", "mvn:--show-version"), MAVEN_SHOW_VERSION(null, null, null, OptionType.BOOLEAN, Flags.INTERNAL, "mvn:-V", "mvn:--show-version"),
/** Define */ /** Define. */
MAVEN_DEFINE(null, null, null, OptionType.STRING, Flags.INTERNAL, "mvn:-D", "mvn:--define"), MAVEN_DEFINE(null, null, null, OptionType.STRING, Flags.INTERNAL, "mvn:-D", "mvn:--define"),
/** Whether the output should be styled using ANSI color codes; possible values: auto, always, never */ /** Whether the output should be styled using ANSI color codes; possible values: auto, always, never. */
MAVEN_COLOR("maven.style.color", null, "auto", OptionType.STRING, Flags.OPTIONAL, "mvnd:--color"), MAVEN_COLOR("maven.style.color", null, "auto", OptionType.STRING, Flags.OPTIONAL, "mvnd:--color"),
// //
@@ -271,7 +271,7 @@ public enum Environment {
MVND_DUPLICATE_DAEMON_GRACE_PERIOD( MVND_DUPLICATE_DAEMON_GRACE_PERIOD(
"mvnd.duplicateDaemonGracePeriod", null, "10 seconds", OptionType.DURATION, Flags.DISCRIMINATING), "mvnd.duplicateDaemonGracePeriod", null, "10 seconds", OptionType.DURATION, Flags.DISCRIMINATING),
/** /**
* Internal property to tell the daemon the width of the terminal * Internal property to tell the daemon the width of the terminal.
*/ */
MVND_TERMINAL_WIDTH("mvnd.terminalWidth", null, 0, OptionType.INTEGER, Flags.INTERNAL), MVND_TERMINAL_WIDTH("mvnd.terminalWidth", null, 0, OptionType.INTEGER, Flags.INTERNAL),
/** /**
@@ -284,7 +284,7 @@ public enum Environment {
*/ */
MVND_BUILD_TIME("mvnd.buildTime", null, null, OptionType.BOOLEAN, Flags.NONE), MVND_BUILD_TIME("mvnd.buildTime", null, null, OptionType.BOOLEAN, Flags.NONE),
/** /**
* Socket family to use * Socket family to use.
*/ */
MVND_SOCKET_FAMILY("mvnd.socketFamily", null, "inet", OptionType.STRING, Flags.DISCRIMINATING), MVND_SOCKET_FAMILY("mvnd.socketFamily", null, "inet", OptionType.STRING, Flags.DISCRIMINATING),
/** /**
@@ -632,7 +632,9 @@ public enum Environment {
private static final int INTERNAL = 0b10; private static final int INTERNAL = 0b10;
private static final int OPTIONAL = 0b100; private static final int OPTIONAL = 0b100;
/** Set automatically for entries having {@link #DISCRIMINATING} */ /**
* Set automatically for entries having {@link #DISCRIMINATING}
*/
private static final int DOCUMENTED_AS_DISCRIMINATING = 0b1000; private static final int DOCUMENTED_AS_DISCRIMINATING = 0b1000;
} }
} }

View File

@@ -40,7 +40,7 @@ public class InterpolationHelper {
private static final String MARKER = "$__"; private static final String MARKER = "$__";
/** /**
* Callback for substitution * Callback for substitution.
*/ */
@FunctionalInterface @FunctionalInterface
public interface SubstitutionCallback { public interface SubstitutionCallback {
@@ -49,11 +49,11 @@ public class InterpolationHelper {
} }
/** /**
* Perform substitution on a property set * Perform substitution on a property set.
* *
* @param properties the property set to perform substitution on * @param properties the property set to perform substitution on
* @param callback the callback to obtain substitution values * @param callback the callback to obtain substitution values
* @param substituteFromConfig If substitute from configuration * @param substituteFromConfig if substitute from configuration
* @param defaultsToEmptyString sets an empty string if a replacement value is not found, leaves intact * @param defaultsToEmptyString sets an empty string if a replacement value is not found, leaves intact
* otherwise * otherwise
*/ */
@@ -84,19 +84,19 @@ public class InterpolationHelper {
* properties override system properties. * properties override system properties.
* </p> * </p>
* *
* @param val The string on which to perform property substitution. * @param val The string on which to perform property substitution
* @param currentKey The key of the property being evaluated used to * @param currentKey The key of the property being evaluated used to
* detect cycles. * detect cycles
* @param cycleMap Map of variable references used to detect nested cycles. * @param cycleMap Map of variable references used to detect nested cycles
* @param configProps Set of configuration properties. * @param configProps Set of configuration properties
* @param callback the callback to obtain substitution values * @param callback the callback to obtain substitution values
* @param substituteFromConfig If substitute from configuration * @param substituteFromConfig If substitute from configuration
* @param defaultsToEmptyString sets an empty string if a replacement value is not found, leaves intact * @param defaultsToEmptyString sets an empty string if a replacement value is not found, leaves intact
* otherwise * otherwise
* @return The value of the specified string after system property substitution. * @return The value of the specified string after system property substitution
* @throws IllegalArgumentException If there was a syntax error in the * @throws IllegalArgumentException if there was a syntax error in the
* property placeholder syntax or a recursive variable reference. * property placeholder syntax or a recursive variable reference
**/ */
public static String substVars( public static String substVars(
String val, String val,
String currentKey, String currentKey,

View File

@@ -37,9 +37,13 @@ public abstract class Message {
public static final int BUILD_REQUEST = 1; public static final int BUILD_REQUEST = 1;
public static final int BUILD_STARTED = 2; public static final int BUILD_STARTED = 2;
public static final int BUILD_FINISHED = 3; public static final int BUILD_FINISHED = 3;
/** A {@link StringMessage} bearing the {@code artifactId} of the project whose build just started */ /**
* A {@link StringMessage} bearing the {@code artifactId} of the project whose build just started.
*/
public static final int PROJECT_STARTED = 4; public static final int PROJECT_STARTED = 4;
/** A {@link StringMessage} bearing the {@code artifactId} of the project whose build just finished */ /**
* A {@link StringMessage} bearing the {@code artifactId} of the project whose build just finished.
*/
public static final int PROJECT_STOPPED = 5; public static final int PROJECT_STOPPED = 5;
public static final int MOJO_STARTED = 6; public static final int MOJO_STARTED = 6;

View File

@@ -46,18 +46,18 @@ public enum OptionType {
return TimeUtils.printDuration(TimeUtils.toMilliSeconds(value)); return TimeUtils.printDuration(TimeUtils.toMilliSeconds(value));
} }
}, },
/** A whole number */ /** A whole number. */
INTEGER, INTEGER,
/** /**
* An amount of memory as accepted by the <code>-Xm*</code> family of HotSpot JVM options. Examples: * An amount of memory as accepted by the <code>-Xm*</code> family of HotSpot JVM options. Examples:
* <code>1024m</code>, <code>2g</code>, <code>5G</code> * <code>1024m</code>, <code>2g</code>, <code>5G</code>
*/ */
MEMORY_SIZE, MEMORY_SIZE,
/** A local file system path */ /** A local file system path. */
PATH, PATH,
/** A string */ /** A string. */
STRING, STRING,
/** No value */ /** No value. */
VOID; VOID;
public String normalize(String value) { public String normalize(String value) {

View File

@@ -193,7 +193,7 @@ public class OsUtils {
} }
/** /**
* Simple CSV line parser that handles quoted fields * Simple CSV line parser that handles quoted fields.
*/ */
private static String[] parseCsvLine(String line) { private static String[] parseCsvLine(String line) {
List<String> fields = new ArrayList<>(); List<String> fields = new ArrayList<>();
@@ -220,9 +220,9 @@ public class OsUtils {
* Executes the given {@code javaExecutable} with {@code -XshowSettings:properties -version} parameters and extracts * Executes the given {@code javaExecutable} with {@code -XshowSettings:properties -version} parameters and extracts
* the value of {@code java.home} from the output. * the value of {@code java.home} from the output.
* *
* @param javaExecutable pass {@code "java"} to get {@code java} binary available in {@code PATH} environment * @param javaExecutable pass {@code "java"} to get {@code java} binary available in {@code PATH} environment
* variable or pass an absolute path to a {@code "java"} executable * variable or pass an absolute path to a {@code "java"} executable
* @return a {@code java.home} value or null * @return a {@code java.home} value or null
*/ */
public static String findJavaHomeFromJavaExecutable(String javaExecutable) { public static String findJavaHomeFromJavaExecutable(String javaExecutable) {
String[] cmd = {javaExecutable, "-XshowSettings:properties", "-version"}; String[] cmd = {javaExecutable, "-XshowSettings:properties", "-version"};

View File

@@ -21,7 +21,7 @@ package org.mvndaemon.mvnd.common;
public class SignalHelper { public class SignalHelper {
/** /**
* Ignore signals to that stopping the mvnd client won't stop the daemon * Ignore signals to that stopping the mvnd client won't stop the daemon.
*/ */
public static void ignoreStopSignals() throws Exception { public static void ignoreStopSignals() throws Exception {
sun.misc.Signal.handle(new sun.misc.Signal("INT"), sun.misc.SignalHandler.SIG_IGN); sun.misc.Signal.handle(new sun.misc.Signal("INT"), sun.misc.SignalHandler.SIG_IGN);

View File

@@ -61,10 +61,10 @@ public final class TimeUtils {
* 500 -> 500ms * 500 -> 500ms
* 1300 -> 1s300ms * 1300 -> 1s300ms
* 310300 -> 5m10s300ms * 310300 -> 5m10s300ms
* 6600000 -> 1h50m * 6600000 -> 1h50m.
* *
* @param millis time in milliseconds * @param millis time in milliseconds
* @return time in string * @return time in string
*/ */
public static String printDuration(long millis) { public static String printDuration(long millis) {
if (millis < 0) { if (millis < 0) {

View File

@@ -50,7 +50,7 @@ import org.mvndaemon.mvnd.common.Message;
* *
* Input handling differs based on terminal type: * Input handling differs based on terminal type:
* - Normal terminals: Handle all input types including control keys * - Normal terminals: Handle all input types including control keys
* - Dumb terminals: Only handle project input and prompts, ignore control keys * - Dumb terminals: Only handle project input and prompts, ignore control keys.
*/ */
public class TerminalInputHandler implements AutoCloseable { public class TerminalInputHandler implements AutoCloseable {
private final Terminal terminal; private final Terminal terminal;

View File

@@ -104,9 +104,9 @@ public class TerminalOutput implements ClientOutput {
private final boolean dumb; private final boolean dumb;
private final TerminalInputHandler inputHandler; private final TerminalInputHandler inputHandler;
/** A sink for sending messages back to the daemon */ /** A sink for sending messages back to the daemon. */
private volatile Consumer<Message> daemonDispatch; private volatile Consumer<Message> daemonDispatch;
/** A sink for queuing messages to the main queue */ /** A sink for queuing messages to the main queue. */
private volatile Consumer<Message> daemonReceive; private volatile Consumer<Message> daemonReceive;
/* /*
@@ -119,12 +119,14 @@ public class TerminalOutput implements ClientOutput {
private String name; private String name;
private String daemonId; private String daemonId;
private int totalProjects; private int totalProjects;
/** String format for formatting the number of projects done with padding based on {@link #totalProjects} */ /**
* String format for formatting the number of projects done with padding based on {@link #totalProjects}
*/
private String projectsDoneFomat; private String projectsDoneFomat;
private int maxThreads; private int maxThreads;
private String artifactIdFormat; private String artifactIdFormat;
/** String format for formatting the actual/hidden/max thread counts */ /** String format for formatting the actual/hidden/max thread counts. */
private String threadsFormat; private String threadsFormat;
private int linesPerProject = 0; private int linesPerProject = 0;

View File

@@ -187,8 +187,8 @@ public class CommonsCliDaemonMavenOptions extends CommonsCliMavenOptions {
/** /**
* Append {@code count} spaces to the given {@code stringBuilder} * Append {@code count} spaces to the given {@code stringBuilder}
* *
* @param stringBuilder the {@link StringBuilder} to append to * @param stringBuilder the {@link StringBuilder} to append to
* @param count the number of spaces to append * @param count the number of spaces to append
*/ */
static void spaces(StringBuilder stringBuilder, int count) { static void spaces(StringBuilder stringBuilder, int count) {
stringBuilder.append(" ".repeat(Math.max(0, count))); stringBuilder.append(" ".repeat(Math.max(0, count)));

View File

@@ -26,7 +26,7 @@ import java.util.Map;
import org.apache.maven.logging.BuildEventListener; import org.apache.maven.logging.BuildEventListener;
/** /**
* Simple interface to bridge maven 3.9.x and 4.0.x CLI * Simple interface to bridge maven 3.9.x and 4.0.x CLI.
*/ */
public interface DaemonCli extends AutoCloseable { public interface DaemonCli extends AutoCloseable {
int main( int main(

View File

@@ -33,15 +33,15 @@ import java.util.function.Function;
public interface Cache<K, V extends CacheRecord> { public interface Cache<K, V extends CacheRecord> {
/** /**
* Check if the cache contains the given key * Check if the cache contains the given key.
*/ */
boolean contains(K key); boolean contains(K key);
/** /**
* Get the cached record for the key * Get the cached record for the key.
* *
* @param key the key to search for * @param key the key to search for
* @return the {@link CacheRecord} associated with the given {@code key} * @return the {@link CacheRecord} associated with the given {@code key}
*/ */
V get(K key); V get(K key);
@@ -54,22 +54,22 @@ public interface Cache<K, V extends CacheRecord> {
void put(K key, V value); void put(K key, V value);
/** /**
* Remove all cached records * Remove all cached records.
*/ */
void clear(); void clear();
/** /**
* Remove all records satisfying the given predicate * Remove all records satisfying the given predicate.
*/ */
void removeIf(BiPredicate<K, V> predicate); void removeIf(BiPredicate<K, V> predicate);
/** /**
* Get or compute the cached value if absent and return it. * Get or compute the cached value if absent and return it.
* *
* @param key the key to search for * @param key the key to search for
* @param mappingFunction the function to use for the computation of the new {@link CacheRecord} if the key is not * @param mappingFunction the function to use for the computation of the new {@link CacheRecord} if the key is not
* available in this {@link Cache} yet * available in this {@link Cache} yet
* @return the existing or newly computed {@link CacheRecord} * @return the existing or newly computed {@link CacheRecord}
*/ */
V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction); V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction);
} }

View File

@@ -19,14 +19,14 @@
package org.mvndaemon.mvnd.cache; package org.mvndaemon.mvnd.cache;
/** /**
* A factory for cache objects * A factory for cache objects.
*/ */
public interface CacheFactory { public interface CacheFactory {
/** /**
* @param <K> the type of {@link Cache} keys * @param <K> the type of {@link Cache} keys
* @param <V> the type of {@link Cache} values * @param <V> the type of {@link Cache} values
* @return a new {@link Cache} * @return a new {@link Cache}
*/ */
<K, V extends CacheRecord> Cache<K, V> newCache(); <K, V extends CacheRecord> Cache<K, V> newCache();
} }

View File

@@ -28,7 +28,7 @@ public interface CacheRecord {
/** /**
* @return a {@link Stream} of file (not directory) {@link Path}s whose modification or deletion causes invalidation * @return a {@link Stream} of file (not directory) {@link Path}s whose modification or deletion causes invalidation
* of this {@link CacheRecord}. * of this {@link CacheRecord}
*/ */
Stream<Path> getDependencyPaths(); Stream<Path> getDependencyPaths();

View File

@@ -98,7 +98,9 @@ public class TimestampCacheFactory implements CacheFactory {
static class Record<V extends CacheRecord> { static class Record<V extends CacheRecord> {
final V record; final V record;
/** {@link Set} of {@link FileState}s at the creation time of this {@link Record} */ /**
* {@link Set} of {@link FileState}s at the creation time of this {@link Record}
*/
final Set<FileState> fileStates; final Set<FileState> fileStates;
public Record(V record) { public Record(V record) {

View File

@@ -53,7 +53,7 @@ import static org.mvndaemon.mvnd.daemon.DaemonExpiration.DaemonExpirationResult.
/** /**
* File origin: * File origin:
* https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/MasterExpirationStrategy.java * https://github.com/gradle/gradle/blob/v5.6.2/subprojects/launcher/src/main/java/org/gradle/launcher/daemon/server/MasterExpirationStrategy.java.
*/ */
public class DaemonExpiration { public class DaemonExpiration {

View File

@@ -56,7 +56,7 @@ import org.apache.maven.logging.ProjectBuildLogAppender;
* This implementation is particularly important for: * This implementation is particularly important for:
* 1. Handling piped input (e.g., cat file | mvnd ...) * 1. Handling piped input (e.g., cat file | mvnd ...)
* 2. Supporting interactive input during builds * 2. Supporting interactive input during builds
* 3. Managing input across multiple project builds * 3. Managing input across multiple project builds.
*/ */
class DaemonInputStream extends InputStream { class DaemonInputStream extends InputStream {
private final BiConsumer<String, Integer> startReadingFromProject; private final BiConsumer<String, Integer> startReadingFromProject;

View File

@@ -24,7 +24,7 @@ package org.mvndaemon.mvnd.nativ;
* as <code>jansi</code> library. * as <code>jansi</code> library.
* *
* @author <a href="http://hiramchirino.com">Hiram Chirino</a> * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
* @see MvndNativeLoader * @see MvndNativeLoader
*/ */
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class CLibrary { public class CLibrary {

View File

@@ -51,8 +51,8 @@ public class MvndNativeLoader {
/** /**
* Loads mvndnative native library. * Loads mvndnative native library.
* *
* @return True if mvndnative native library is successfully loaded; false * @return true if mvndnative native library is successfully loaded; false
* otherwise. * otherwise
*/ */
public static synchronized boolean initialize() { public static synchronized boolean initialize() {
// only cleanup before the first extract // only cleanup before the first extract
@@ -151,11 +151,11 @@ public class MvndNativeLoader {
} }
/** /**
* Extracts and loads the specified library file to the target folder * Extracts and loads the specified library file to the target folder.
* *
* @param libFolderForCurrentOS Library path. * @param libFolderForCurrentOS Library path
* @param libraryFileName Library name. * @param libraryFileName Library name
* @param targetFolder Target folder. * @param targetFolder Target folder
* @return * @return
*/ */
private static boolean extractAndLoadLibraryFile( private static boolean extractAndLoadLibraryFile(
@@ -229,8 +229,8 @@ public class MvndNativeLoader {
/** /**
* Loads native library using the given path and name of the library. * Loads native library using the given path and name of the library.
* *
* @param libPath Path of the native library. * @param libPath Path of the native library
* @return True for successfully loading; false otherwise. * @return True for successfully loading; false otherwise
*/ */
private static boolean loadNativeLibrary(File libPath) { private static boolean loadNativeLibrary(File libPath) {
if (libPath.exists()) { if (libPath.exists()) {
@@ -333,7 +333,7 @@ public class MvndNativeLoader {
} }
/** /**
* @return The major version of the mvndnative library. * @return the major version of the mvndnative library
*/ */
public static int getMajorVersion() { public static int getMajorVersion() {
String[] c = getVersion().split("\\."); String[] c = getVersion().split("\\.");
@@ -341,7 +341,7 @@ public class MvndNativeLoader {
} }
/** /**
* @return The minor version of the mvndnative library. * @return the minor version of the mvndnative library
*/ */
public static int getMinorVersion() { public static int getMinorVersion() {
String[] c = getVersion().split("\\."); String[] c = getVersion().split("\\.");
@@ -349,7 +349,7 @@ public class MvndNativeLoader {
} }
/** /**
* @return The version of the mvndnative library. * @return the version of the mvndnative library
*/ */
public static String getVersion() { public static String getVersion() {