Fix Javadoc warnings due to Java 21 update (+ some other warnings)

The default implicit constructor must also have a doc comment, so I have to make it explicit and either properly restrict the visibility of the constructor, or actually document it.
This commit is contained in:
Marc Baloup 2024-06-06 23:59:32 +02:00
parent decf302851
commit d411618e63
58 changed files with 188 additions and 12 deletions

View File

@ -25,7 +25,6 @@ import java.util.function.Function;
*/ */
public class PandalibBungeePermissions implements Listener { public class PandalibBungeePermissions implements Listener {
/** /**
* Registers event listener to redirect permission checks to {@code pandalib-permissions}. * Registers event listener to redirect permission checks to {@code pandalib-permissions}.
* @param bungeePlugin a BungeeCord plugin. * @param bungeePlugin a BungeeCord plugin.
@ -35,6 +34,8 @@ public class PandalibBungeePermissions implements Listener {
} }
private PandalibBungeePermissions() {}
/** /**
* Event handler called when a plugin asks if a player has a permission. * Event handler called when a plugin asks if a player has a permission.
* @param event the permission check event. * @param event the permission check event.

View File

@ -43,4 +43,7 @@ public class PandaLibBungee {
public static Plugin getPlugin() { public static Plugin getPlugin() {
return plugin; return plugin;
} }
private PandaLibBungee() {}
} }

View File

@ -35,4 +35,11 @@ public class BungeeBackupConfig {
* A list of ignored files or directory in the workdir to exclude from the backup. * A list of ignored files or directory in the workdir to exclude from the backup.
*/ */
public List<String> workdirIgnoreList = new ArrayList<>(); public List<String> workdirIgnoreList = new ArrayList<>();
/**
* Creates a new {@link BungeeBackupConfig}.
*/
public BungeeBackupConfig() {
}
} }

View File

@ -22,6 +22,11 @@ public class ChatColorGradient {
private final List<GradientColor> colors = new ArrayList<>(); private final List<GradientColor> colors = new ArrayList<>();
/**
* Create the custom gradient.
*/
public ChatColorGradient() {}
/** /**
* Put a specific color at a specific location in the gradient. * Put a specific color at a specific location in the gradient.
* @param gradientLocation the location in the gradient. * @param gradientLocation the location in the gradient.

View File

@ -293,4 +293,7 @@ public class ChatColorUtil {
} }
private ChatColorUtil() {}
} }

View File

@ -157,5 +157,9 @@ public class ChatConfig {
.thenText("] "); .thenText("] ");
} }
private PandaTheme() {}
} }
private ChatConfig() {}
} }

View File

@ -679,5 +679,10 @@ public abstract class ChatStatic {
return builder.style(c.style()).append(c.children()); return builder.style(c.style()).append(c.children());
} }
/**
* Creates a new {@link ChatStatic} instance.
*/
protected ChatStatic() {}
} }

View File

@ -657,5 +657,6 @@ public class ChatUtil {
return str; return str;
} }
private ChatUtil() {}
} }

View File

@ -25,6 +25,9 @@ public class CLIBrigadierDispatcher extends BrigadierDispatcher<CLICommandSender
public static final CLICommandSender CLI_CONSOLE_COMMAND_SENDER = new CLIConsoleCommandSender(); public static final CLICommandSender CLI_CONSOLE_COMMAND_SENDER = new CLIConsoleCommandSender();
private CLIBrigadierDispatcher() {}
/** /**
* Executes the provided command as the console. * Executes the provided command as the console.
* @param commandWithoutSlash the command, without the eventual slash at the beginning. * @param commandWithoutSlash the command, without the eventual slash at the beginning.

View File

@ -11,6 +11,12 @@ import org.jetbrains.annotations.NotNull;
* The console command sender. * The console command sender.
*/ */
public class CLIConsoleCommandSender implements CLICommandSender { public class CLIConsoleCommandSender implements CLICommandSender {
/**
* Creates a new console command sender.
*/
protected CLIConsoleCommandSender() {}
public String getName() { public String getName() {
return "Console"; return "Console";
} }

View File

@ -36,6 +36,11 @@ import static fr.pandacube.lib.chat.ChatStatic.text;
*/ */
public class CommandAdmin extends CLIBrigadierCommand { public class CommandAdmin extends CLIBrigadierCommand {
/**
* Initializes the admin command.
*/
public CommandAdmin() {}
@Override @Override
protected LiteralArgumentBuilder<CLICommandSender> buildCommand() { protected LiteralArgumentBuilder<CLICommandSender> buildCommand() {
return literal("admin") return literal("admin")

View File

@ -9,6 +9,11 @@ import fr.pandacube.lib.cli.CLIApplication;
*/ */
public class CommandStop extends CLIBrigadierCommand { public class CommandStop extends CLIBrigadierCommand {
/**
* Initializes the admin command.
*/
public CommandStop() {}
@Override @Override
protected LiteralArgumentBuilder<CLICommandSender> buildCommand() { protected LiteralArgumentBuilder<CLICommandSender> buildCommand() {
return literal("stop") return literal("stop")

View File

@ -98,4 +98,6 @@ public class CLILogger {
return ps; return ps;
} }
private CLILogger() {}
} }

View File

@ -25,6 +25,11 @@ import java.util.function.Predicate;
*/ */
public abstract class BrigadierCommand<S> { public abstract class BrigadierCommand<S> {
/**
* Creates a Brigadier command.
*/
public BrigadierCommand() {}
/** /**
* Returns a builder for this command. * Returns a builder for this command.

View File

@ -21,6 +21,11 @@ public abstract class BrigadierDispatcher<S> {
private final CommandDispatcher<S> dispatcher = new CommandDispatcher<>(); private final CommandDispatcher<S> dispatcher = new CommandDispatcher<>();
/**
* Creates a new Dispatcher instance.
*/
public BrigadierDispatcher() {}
/** /**
* Registers the provided command node into this dispatcher. * Registers the provided command node into this dispatcher.

View File

@ -140,4 +140,8 @@ public class BrigadierSuggestionsUtil {
} }
private BrigadierSuggestionsUtil() {}
} }

View File

@ -70,6 +70,11 @@ public abstract class BackupCleaner implements UnaryOperator<TreeSet<LocalDateTi
}; };
} }
/**
* Create a backup cleaner.
*/
public BackupCleaner() {}
/** /**
* Creates a new {@link BackupCleaner} that keeps the archives kept by this {@link BackupCleaner} or by the provided * Creates a new {@link BackupCleaner} that keeps the archives kept by this {@link BackupCleaner} or by the provided

View File

@ -54,7 +54,7 @@ public class CronScheduler {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
if (!tasks.isEmpty()) { if (!tasks.isEmpty()) {
CronTask next = tasks.get(0); CronTask next = tasks.getFirst();
if (next.nextRun <= now) { if (next.nextRun <= now) {
next.runAsync(); next.runAsync();
setLastRun(next.taskId, now); setLastRun(next.taskId, now);
@ -224,5 +224,6 @@ public class CronScheduler {
.toEpochMilli(); .toEpochMilli();
} }
private CronScheduler() {}
} }

View File

@ -163,4 +163,6 @@ public class Json {
} }
}*/ }*/
private Json() {}
} }

View File

@ -30,6 +30,8 @@ public class ThrowableAdapter implements JsonSerializer<Throwable>, JsonDeserial
/* package */ static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newTypeHierarchyFactory(Throwable.class, new ThrowableAdapter()); /* package */ static final TypeAdapterFactory FACTORY = TreeTypeAdapter.newTypeHierarchyFactory(Throwable.class, new ThrowableAdapter());
private ThrowableAdapter() {}
@Override @Override
public Throwable deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { public Throwable deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {

View File

@ -238,4 +238,7 @@ public class TypeConverter {
} }
private TypeConverter() {}
} }

View File

@ -58,6 +58,9 @@ public record MinecraftVersionList(
private static final TypeToken<Map<String, Integer>> MAP_STR_INT_TYPE = new TypeToken<>() { }; private static final TypeToken<Map<String, Integer>> MAP_STR_INT_TYPE = new TypeToken<>() { };
private static final TypeToken<Map<Integer, List<String>>> MAP_INT_LIST_STRING_TYPE = new TypeToken<>() { }; private static final TypeToken<Map<Integer, List<String>>> MAP_INT_LIST_STRING_TYPE = new TypeToken<>() { };
private MinecraftVersionListAdapter() {}
@Override @Override
public MinecraftVersionList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { public MinecraftVersionList deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
if (!(json instanceof JsonObject jsonObj)) if (!(json instanceof JsonObject jsonObj))

View File

@ -135,4 +135,7 @@ public class MinecraftVersionUtil {
return set; return set;
} }
private MinecraftVersionUtil() {}
} }

View File

@ -56,18 +56,21 @@
<artifact>org.apache.commons:commons-dbcp2</artifact> <artifact>org.apache.commons:commons-dbcp2</artifact>
<excludes> <excludes>
<exclude>META-INF/MANIFEST.MF</exclude> <exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/versions/9/**</exclude>
</excludes> </excludes>
</filter> </filter>
<filter> <filter>
<artifact>org.apache.commons:commons-pool2</artifact> <artifact>org.apache.commons:commons-pool2</artifact>
<excludes> <excludes>
<exclude>META-INF/MANIFEST.MF</exclude> <exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/versions/9/**</exclude>
</excludes> </excludes>
</filter> </filter>
<filter> <filter>
<artifact>commons-logging:commons-logging</artifact> <artifact>commons-logging:commons-logging</artifact>
<excludes> <excludes>
<exclude>META-INF/MANIFEST.MF</exclude> <exclude>META-INF/MANIFEST.MF</exclude>
<exclude>META-INF/versions/9/**</exclude>
</excludes> </excludes>
</filter> </filter>
</filters> </filters>

View File

@ -16,6 +16,11 @@ import java.util.stream.Collectors;
*/ */
public class SQLElementList<E extends SQLElement<E>> extends ArrayList<E> { public class SQLElementList<E extends SQLElement<E>> extends ArrayList<E> {
/**
* Creates an empty list of sql elements.
*/
public SQLElementList() {}
/** /**
* Stores all the values modified by {@link #setCommon(SQLField, Object)}. * Stores all the values modified by {@link #setCommon(SQLField, Object)}.
*/ */

View File

@ -232,12 +232,8 @@ public class SQLField<E extends SQLElement<E>, T> {
} }
@SuppressWarnings({"rawtypes", "unchecked"}) @SuppressWarnings({"rawtypes", "unchecked"})
public Object fromJavaTypeToJDBCType(Object value) throws DBException { /* package */ Object fromJavaTypeToJDBCType(Object value) throws DBException {
Object ret = value; Object ret = value;
if (value != null && type instanceof SQLCustomType customType) { if (value != null && type instanceof SQLCustomType customType) {
try { try {
@ -250,7 +246,7 @@ public class SQLField<E extends SQLElement<E>, T> {
return ret; return ret;
} }
public Collection<Object> fromListJavaTypeToJDBCType(Collection<?> values) throws DBException { /* package */ Collection<Object> fromListJavaTypeToJDBCType(Collection<?> values) throws DBException {
if (values == null) if (values == null)
return null; return null;
List<Object> ret = new ArrayList<>(values.size()); List<Object> ret = new ArrayList<>(values.size());

View File

@ -13,6 +13,11 @@ import fr.pandacube.lib.util.log.Log;
*/ */
public abstract class SQLWhere<E extends SQLElement<E>> { public abstract class SQLWhere<E extends SQLElement<E>> {
/**
* Creates a SQL WHERE expression.
*/
protected SQLWhere() {}
/* package */ abstract ParameterizedSQLString toSQL() throws DBException; /* package */ abstract ParameterizedSQLString toSQL() throws DBException;
@Override @Override
@ -69,6 +74,7 @@ public abstract class SQLWhere<E extends SQLElement<E>> {
* Create a custom SQL {@code WHERE} expression. * Create a custom SQL {@code WHERE} expression.
* @param whereExpr the raw SQL {@code WHERE} expression. * @param whereExpr the raw SQL {@code WHERE} expression.
* @return a new SQL {@code WHERE} expression. * @return a new SQL {@code WHERE} expression.
* @param <E> the table type.
*/ */
public static <E extends SQLElement<E>> SQLWhere<E> expression(String whereExpr) { public static <E extends SQLElement<E>> SQLWhere<E> expression(String whereExpr) {
return expression(whereExpr, List.of()); return expression(whereExpr, List.of());
@ -79,6 +85,7 @@ public abstract class SQLWhere<E extends SQLElement<E>> {
* @param whereExpr the raw SQL {@code WHERE} expression. * @param whereExpr the raw SQL {@code WHERE} expression.
* @param params the parameters of the provided expression. * @param params the parameters of the provided expression.
* @return a new SQL {@code WHERE} expression. * @return a new SQL {@code WHERE} expression.
* @param <E> the table type.
*/ */
public static <E extends SQLElement<E>> SQLWhere<E> expression(String whereExpr, List<Object> params) { public static <E extends SQLElement<E>> SQLWhere<E> expression(String whereExpr, List<Object> params) {
return new SQLWhereCustomExpression<>(whereExpr, params); return new SQLWhereCustomExpression<>(whereExpr, params);
@ -89,6 +96,7 @@ public abstract class SQLWhere<E extends SQLElement<E>> {
* @param leftExpr the raw SQL left operand. * @param leftExpr the raw SQL left operand.
* @param valuesIn the values on the right of the {@code IN} operator. * @param valuesIn the values on the right of the {@code IN} operator.
* @return a new SQL {@code WHERE} expression. * @return a new SQL {@code WHERE} expression.
* @param <E> the table type.
*/ */
public static <E extends SQLElement<E>> SQLWhere<E> expressionIn(String leftExpr, Collection<?> valuesIn) { public static <E extends SQLElement<E>> SQLWhere<E> expressionIn(String leftExpr, Collection<?> valuesIn) {
return expressionIn(leftExpr, List.of(), valuesIn); return expressionIn(leftExpr, List.of(), valuesIn);
@ -100,6 +108,7 @@ public abstract class SQLWhere<E extends SQLElement<E>> {
* @param leftParams the parameters of the left operand. * @param leftParams the parameters of the left operand.
* @param valuesIn the values on the right of the {@code IN} operator. * @param valuesIn the values on the right of the {@code IN} operator.
* @return a new SQL {@code WHERE} expression. * @return a new SQL {@code WHERE} expression.
* @param <E> the table type.
*/ */
public static <E extends SQLElement<E>> SQLWhere<E> expressionIn(String leftExpr, List<Object> leftParams, Collection<?> valuesIn) { public static <E extends SQLElement<E>> SQLWhere<E> expressionIn(String leftExpr, List<Object> leftParams, Collection<?> valuesIn) {
return new SQLWhereInCustom<>(leftExpr, leftParams, valuesIn); return new SQLWhereInCustom<>(leftExpr, leftParams, valuesIn);

View File

@ -21,4 +21,8 @@
</dependency> </dependency>
</dependencies> </dependencies>
<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
</project> </project>

View File

@ -82,6 +82,12 @@ public class PandalibPaperPermissions implements Listener {
} }
} }
/**
* Creates a {@link PandalibPaperPermissions} instance.
*/
private PandalibPaperPermissions() {}
/** /**
* Player login event handler. * Player login event handler.
* @param event the event. * @param event the event.

View File

@ -120,4 +120,6 @@ public class PermissionExpressionParser {
} }
} }
private PermissionExpressionParser() {}
} }

View File

@ -200,4 +200,6 @@ public class Permissions {
return backendReader.getFullPermissionsList(); return backendReader.getFullPermissionsList();
} }
private Permissions() {}
} }

View File

@ -48,4 +48,5 @@ public class Reflect {
} }
private Reflect() {}
} }

View File

@ -78,4 +78,7 @@ public class WrapperRegistry {
ReflectConstructor<? extends ReflectWrapperI> objectWrapperConstructor) { ReflectConstructor<? extends ReflectWrapperI> objectWrapperConstructor) {
} }
private WrapperRegistry() {}
} }

View File

@ -104,4 +104,7 @@ public class DistanceUtil {
} }
} }
private DistanceUtil() {}
} }

View File

@ -84,4 +84,6 @@ public class EnumUtil {
return RandomUtil.arrayElement(enumType.getEnumConstants()); return RandomUtil.arrayElement(enumType.getEnumConstants());
} }
private EnumUtil() {}
} }

View File

@ -52,4 +52,7 @@ public class FileUtils {
Files.copy(source.toPath(), target.toPath()); Files.copy(source.toPath(), target.toPath());
} }
} }
private FileUtils() {}
} }

View File

@ -21,4 +21,8 @@ public class ListUtil {
list.add(i); list.add(i);
} }
} }
private ListUtil() {}
} }

View File

@ -159,4 +159,6 @@ public class MemoryUtil {
} }
} }
private MemoryUtil() {}
} }

View File

@ -98,6 +98,8 @@ public class MinecraftWebUtil {
} }
private MinecraftWebUtil() {}
} }

View File

@ -10,7 +10,7 @@ import java.util.UUID;
* <p> * <p>
* You can generate the UUID programmatically using {@link #getFromNickName(String)} and * You can generate the UUID programmatically using {@link #getFromNickName(String)} and
* {@link #getFromNickNames(String[])}. * {@link #getFromNickNames(String[])}.
* * <p>
* To use this class as a program, type * To use this class as a program, type
* <pre> * <pre>
* java -cp&lt;anyClassPathContainingThisClass&gt; fr.pandacube.lib.util.OfflineUUID [playernames...] * java -cp&lt;anyClassPathContainingThisClass&gt; fr.pandacube.lib.util.OfflineUUID [playernames...]
@ -67,4 +67,6 @@ public class OfflineUUID {
System.out.println(arg + "\t" + getFromNickName(arg)); System.out.println(arg + "\t" + getFromNickName(arg));
} }
} }
private OfflineUUID() {}
} }

View File

@ -172,7 +172,7 @@ public class RandomUtil {
return String.valueOf(pw); return String.valueOf(pw);
} }
private RandomUtil() {}
} }

View File

@ -146,6 +146,6 @@ public class StringUtil {
private StringUtil() {}
} }

View File

@ -147,5 +147,6 @@ public class ThrowableUtil {
return new RuntimeException(t); return new RuntimeException(t);
} }
private ThrowableUtil() {}
} }

View File

@ -56,4 +56,6 @@ public class Tick {
return Duration.ofMillis(toMs(tick)); return Duration.ofMillis(toMs(tick));
} }
private Tick() {}
} }

View File

@ -481,4 +481,7 @@ public class TimeUtil {
} }
private TimeUtil() {}
} }

View File

@ -2,6 +2,9 @@ package fr.pandacube.lib.util.function;
/** /**
* A consumer that can possibly throw a checked exception. * A consumer that can possibly throw a checked exception.
* @param <T> the first parameter for this bi-consumer.
* @param <U> the second parameter for this bi-consumer.
* @param <E> the exception type that this interface method can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface BiConsumerException<T, U, E extends Exception> { public interface BiConsumerException<T, U, E extends Exception> {

View File

@ -2,6 +2,8 @@ package fr.pandacube.lib.util.function;
/** /**
* A predicate that can possibly throw a checked exception. * A predicate that can possibly throw a checked exception.
* @param <T> the parameter for this predicate.
* @param <E> the exception type that this predicate can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface PredicateException<T, E extends Exception> { public interface PredicateException<T, E extends Exception> {

View File

@ -2,6 +2,7 @@ package fr.pandacube.lib.util.function;
/** /**
* A runnable that can possibly throw a checked exception. * A runnable that can possibly throw a checked exception.
* @param <E> the exception type that this interface method can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface RunnableException<E extends Exception> { public interface RunnableException<E extends Exception> {

View File

@ -2,6 +2,8 @@ package fr.pandacube.lib.util.function;
/** /**
* A supplier that can possibly throw a checked exception. * A supplier that can possibly throw a checked exception.
* @param <T> the return type of this supplier.
* @param <E> the exception type that this interface method can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface SupplierException<T, E extends Exception> { public interface SupplierException<T, E extends Exception> {

View File

@ -2,6 +2,9 @@ package fr.pandacube.lib.util.function;
/** /**
* A function that can possibly throw a checked exception. * A function that can possibly throw a checked exception.
* @param <T> the first parameter for this bi-function.
* @param <U> the second parameter for this bi-function.
* @param <E> the exception type that this interface method can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface ToIntBiFunctionException<T, U, E extends Exception> { public interface ToIntBiFunctionException<T, U, E extends Exception> {

View File

@ -2,6 +2,10 @@ package fr.pandacube.lib.util.function;
/** /**
* A consumer that can possibly throw a checked exception. * A consumer that can possibly throw a checked exception.
* @param <T> the first parameter for this tri-consumer.
* @param <U> the second parameter for this tri-consumer.
* @param <V> the third parameter for this tri-consumer.
* @param <E> the exception type that this interface method can throw.
*/ */
@FunctionalInterface @FunctionalInterface
public interface TriConsumerException<T, U, V, E extends Exception> { public interface TriConsumerException<T, U, V, E extends Exception> {

View File

@ -30,6 +30,11 @@ public class DailyLogRotateFileHandler extends Handler {
private String currentFileDate = getCurrentDay(); private String currentFileDate = getCurrentDay();
private boolean closed = false; private boolean closed = false;
/**
* Creates a new {@link DailyLogRotateFileHandler}.
*/
public DailyLogRotateFileHandler() {}
@Override @Override
public synchronized void close() throws SecurityException { public synchronized void close() throws SecurityException {

View File

@ -159,4 +159,6 @@ public final class Log {
logger.info(message); logger.info(message);
} }
private Log() {}
} }

View File

@ -15,6 +15,11 @@ public abstract class AbstractServerWS extends WebSocketAdapter implements Abstr
private boolean isClosed = false; private boolean isClosed = false;
/**
* Creates a Websocket server endpoint.
*/
public AbstractServerWS() {}
@Override @Override
public final void onWebSocketConnect(Session session) public final void onWebSocketConnect(Session session)
{ {

View File

@ -100,4 +100,6 @@ public class PayloadRegistry {
registerPayloadType("login-succeed", LoginSucceedPayload.class); registerPayloadType("login-succeed", LoginSucceedPayload.class);
} }
private PayloadRegistry() {}
} }

View File

@ -4,4 +4,9 @@ package fr.pandacube.lib.ws.payloads;
* Payload used by the server in inform the client the login was successful. * Payload used by the server in inform the client the login was successful.
*/ */
public class LoginSucceedPayload extends Payload { public class LoginSucceedPayload extends Payload {
/**
* Creates a new {@link LoginSucceedPayload}.
*/
public LoginSucceedPayload() {}
} }

View File

@ -5,4 +5,8 @@ package fr.pandacube.lib.ws.payloads;
*/ */
public abstract class Payload { public abstract class Payload {
/**
* Creates a new {@link Payload}.
*/
public Payload() {}
} }

View File

@ -25,7 +25,7 @@
</developer> </developer>
</developers> </developers>
<inceptionYear>2015</inceptionYear> <inceptionYear>2011</inceptionYear>
<ciManagement> <ciManagement>
<system>jenkins</system> <system>jenkins</system>