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:
2024-06-06 23:59:32 +02:00
parent decf302851
commit d411618e63
58 changed files with 188 additions and 12 deletions

View File

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

View File

@@ -16,6 +16,11 @@ import java.util.stream.Collectors;
*/
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)}.
*/

View File

@@ -232,12 +232,8 @@ public class SQLField<E extends SQLElement<E>, T> {
}
@SuppressWarnings({"rawtypes", "unchecked"})
public Object fromJavaTypeToJDBCType(Object value) throws DBException {
/* package */ Object fromJavaTypeToJDBCType(Object value) throws DBException {
Object ret = value;
if (value != null && type instanceof SQLCustomType customType) {
try {
@@ -250,7 +246,7 @@ public class SQLField<E extends SQLElement<E>, T> {
return ret;
}
public Collection<Object> fromListJavaTypeToJDBCType(Collection<?> values) throws DBException {
/* package */ Collection<Object> fromListJavaTypeToJDBCType(Collection<?> values) throws DBException {
if (values == null)
return null;
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>> {
/**
* Creates a SQL WHERE expression.
*/
protected SQLWhere() {}
/* package */ abstract ParameterizedSQLString toSQL() throws DBException;
@Override
@@ -69,6 +74,7 @@ public abstract class SQLWhere<E extends SQLElement<E>> {
* Create a custom SQL {@code WHERE} expression.
* @param whereExpr the raw 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) {
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 params the parameters of the provided 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) {
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 valuesIn the values on the right of the {@code IN} operator.
* @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) {
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 valuesIn the values on the right of the {@code IN} operator.
* @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) {
return new SQLWhereInCustom<>(leftExpr, leftParams, valuesIn);