[#8210] Fix a variety of compiler warnings when building jOOQ

This commit is contained in:
lukaseder 2019-01-11 17:30:27 +01:00
parent ac702a121f
commit c457d7ef40
19 changed files with 32 additions and 29 deletions

View File

@ -137,7 +137,7 @@ public final class ChartFormat {
}
/**
* The new chart type, defaulting to {@link Area}.
* The new chart type, defaulting to {@link Type#AREA}.
*/
public ChartFormat type(Type newType) {
return new ChartFormat(
@ -490,6 +490,7 @@ public final class ChartFormat {
/**
* The areas are located in front of one another.
*/
@SuppressWarnings("hiding")
DEFAULT,
/**

View File

@ -3491,7 +3491,7 @@ extends
/**
* @see DSL#extract(Field, DatePart)
* @deprecated - 3.11 - [#7538] - Use {@link DSL#extract(DatePart)} instead.
* @deprecated - 3.11 - [#7538] - Use {@link DSL#extract(Field, DatePart)} instead.
*/
@Deprecated
@Support

View File

@ -62,10 +62,6 @@ public interface QueryPart extends Serializable {
* <code>QueryPart</code> instances are not attached to a
* {@link Configuration}, and thus there is no guarantee that the SQL string
* will make sense in the context of a specific database.
* <p>
* If you wish to gain more control over the concrete SQL rendering of this
* <code>QueryPart</code>, use {@link DSLContext#renderContext()} to obtain
* a configurable render context for SQL rendering.
*
* @return A SQL string representation of this <code>QueryPart</code>
*/

View File

@ -101,6 +101,7 @@ public interface QueryPartInternal extends QueryPart {
* <code>null</code> or an empty array if this query part does not
* represent a clause.
*/
@SuppressWarnings("javadoc")
Clause[] clauses(Context<?> ctx);
/**

View File

@ -50,7 +50,7 @@ import org.jooq.impl.DefaultRecordMapperProvider;
* <h3><code>Cursor</code></h3>
* <ul>
* <li>{@link Cursor#fetchInto(Class)}</li>
* <li>{@link Cursor#fetchOneInto(Class)}</li>
* <li>{@link Cursor#fetchNextInto(Class)}</li>
* </ul>
* <h3><code>Record</code></h3>
* <ul>

View File

@ -51,6 +51,7 @@ public interface VisitContext extends Scope {
* The most recent clause that was encountered through
* {@link Context#start(Clause)}.
*/
@SuppressWarnings("javadoc")
Clause clause();
/**
@ -61,6 +62,7 @@ public interface VisitContext extends Scope {
* {@link Context#end(Clause)}. In other words, <code>VisitContext</code>
* contains a stack of clauses.
*/
@SuppressWarnings("javadoc")
Clause[] clauses();
/**

View File

@ -93,6 +93,7 @@ import java.util.EventListener;
*
* @author Lukas Eder
*/
@SuppressWarnings("javadoc")
public interface VisitListener extends EventListener {
/**

View File

@ -582,8 +582,8 @@ abstract class AbstractContext<C extends Context<C>> extends AbstractScope imple
}
void scopeStart0() {}
void scopeMarkStart0(QueryPart part) {}
void scopeMarkEnd0(QueryPart part) {}
void scopeMarkStart0(@SuppressWarnings("unused") QueryPart part) {}
void scopeMarkEnd0(@SuppressWarnings("unused") QueryPart part) {}
void scopeEnd0() {}
@Override

View File

@ -41,9 +41,7 @@ import java.util.Arrays;
import java.util.function.BiFunction;
import java.util.function.Function;
import org.jooq.Clause;
import org.jooq.CommonTableExpression;
import org.jooq.Context;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.Record;

View File

@ -115,10 +115,10 @@ final class ArrayTable extends AbstractTable<Record> {
this.array = array;
this.alias = alias;
this.fieldAliases = fieldAliases;
this.field = init(arrayType, alias, fieldAliases);
this.field = init(arrayType, alias);
}
private static final Fields<Record> init(Class<?> arrayType, Name alias, Name[] fields) {
private static final Fields<Record> init(Class<?> arrayType, Name alias) {
List<Field<?>> result = new ArrayList<Field<?>>();
// [#1114] VARRAY/TABLE of OBJECT have more than one field

View File

@ -59,7 +59,6 @@ import static org.jooq.impl.Keywords.K_VIEW;
import java.util.EnumSet;
import org.jooq.Clause;
import org.jooq.Comment;
import org.jooq.CommentOnFinalStep;
import org.jooq.CommentOnIsStep;

View File

@ -139,8 +139,8 @@ final class CreateIndexImpl extends AbstractQuery implements
}
@Override
public final CreateIndexImpl on(Table<?> t, Collection<? extends OrderField<?>> fields) {
return on(t, fields.toArray(EMPTY_ORDERFIELD));
public final CreateIndexImpl on(Table<?> t, Collection<? extends OrderField<?>> f) {
return on(t, f.toArray(EMPTY_ORDERFIELD));
}
@Override
@ -180,8 +180,8 @@ final class CreateIndexImpl extends AbstractQuery implements
}
@Override
public final CreateIndexImpl include(Collection<? extends Field<?>> fields) {
return include(fields.toArray(EMPTY_FIELD));
public final CreateIndexImpl include(Collection<? extends Field<?>> f) {
return include(f.toArray(EMPTY_FIELD));
}
@Override

View File

@ -278,7 +278,7 @@ final class Expression<T> extends AbstractFunction<T> {
return getNumberExpression(configuration);
}
private final Field<T> getYTSExpression(Configuration configuration) {
private final Field<T> getYTSExpression() {
YearToSecond yts = rhsAsYTS();
return new DateExpression<T>(
@ -302,7 +302,7 @@ final class Expression<T> extends AbstractFunction<T> {
case MARIADB:
case MYSQL: {
if (rhs.getType() == YearToSecond.class)
return getYTSExpression(configuration);
return getYTSExpression();
Interval interval = rhsAsInterval();
@ -326,7 +326,7 @@ final class Expression<T> extends AbstractFunction<T> {
case DERBY:
case HSQLDB: {
if (rhs.getType() == YearToSecond.class)
return getYTSExpression(configuration);
return getYTSExpression();
Field<T> result;
@ -347,7 +347,7 @@ final class Expression<T> extends AbstractFunction<T> {
case FIREBIRD: {
if (rhs.getType() == YearToSecond.class)
return getYTSExpression(configuration);
return getYTSExpression();
else if (rhs.getType() == YearToMonth.class)
return DSL.field("{dateadd}({month}, {0}, {1})", getDataType(), p(sign * rhsAsYTM().intValue()), lhs);
else
@ -356,7 +356,7 @@ final class Expression<T> extends AbstractFunction<T> {
case H2: {
if (rhs.getType() == YearToSecond.class)
return getYTSExpression(configuration);
return getYTSExpression();
else if (rhs.getType() == YearToMonth.class)
return DSL.field("{dateadd}('month', {0}, {1})", getDataType(), p(sign * rhsAsYTM().intValue()), lhs);
else
@ -365,7 +365,7 @@ final class Expression<T> extends AbstractFunction<T> {
case SQLITE: {
if (rhs.getType() == YearToSecond.class)
return getYTSExpression(configuration);
return getYTSExpression();
boolean ytm = rhs.getType() == YearToMonth.class;
Field<?> interval = p(ytm ? rhsAsYTM().intValue() : rhsAsDTS().getTotalSeconds());

View File

@ -61,7 +61,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.jooq.Clause;
import org.jooq.Context;
import org.jooq.Field;
import org.jooq.Param;

View File

@ -45,7 +45,6 @@ import java.sql.SQLWarning;
import java.util.Arrays;
import java.util.Collection;
import org.jooq.Clause;
import org.jooq.Context;
import org.jooq.DataType;
import org.jooq.Field;

View File

@ -456,7 +456,7 @@ final class LoaderImpl<R extends Record> implements
}
@Override
public final LoaderImpl<R> loadXML(InputSource source) {
public final LoaderImpl<R> loadXML(InputSource s) {
content = CONTENT_XML;
throw new UnsupportedOperationException("This is not yet implemented");
}

View File

@ -1090,7 +1090,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
// synthetic parentheses
boolean wrapQueryExpressionInDerivedTable;
boolean wrapQueryExpressionBodyInDerivedTable = false;
boolean applySeekOnDerivedTable = applySeekOnDerivedTable(context);
boolean applySeekOnDerivedTable = applySeekOnDerivedTable();
wrapQueryExpressionInDerivedTable = false
@ -1602,7 +1602,7 @@ final class SelectQueryImpl<R extends Record> extends AbstractResultQuery<R> imp
ctx.visit(actualLimit);
}
private final boolean applySeekOnDerivedTable(Context<?> ctx) {
private final boolean applySeekOnDerivedTable() {
return !getSeek().isEmpty() && !getOrderBy().isEmpty() && !unionOp.isEmpty();
}

View File

@ -347,6 +347,7 @@ final class Tools {
* {@link Clause#FIELD_REFERENCE} may contain a
* {@link Clause#TABLE_REFERENCE}.
*/
@SuppressWarnings("javadoc")
DATA_OMIT_CLAUSE_EVENT_EMISSION,
/**
@ -358,6 +359,7 @@ final class Tools {
* practice should no longer be pursued, as such "sub-renderers" will emit /
* divert {@link Clause} events.
*/
@SuppressWarnings("javadoc")
DATA_WRAP_DERIVED_TABLES_IN_PARENTHESES,
/**
@ -416,6 +418,7 @@ final class Tools {
/**
* [#3381] The table to be used for the {@link Clause#SELECT_INTO} clause.
*/
@SuppressWarnings("javadoc")
DATA_SELECT_INTO_TABLE,
@ -425,6 +428,7 @@ final class Tools {
/**
* [#7139] No data must be selected in the <code>SELECT</code> statement.
*/
@ -433,6 +437,7 @@ final class Tools {
/**
* [#3381] Omit the {@link Clause#SELECT_INTO}, as it is being emulated.
*/
@SuppressWarnings("javadoc")
DATA_OMIT_INTO_CLAUSE,
/**

View File

@ -39,10 +39,12 @@ public final class CompileOptions {
this.processors = processors;
}
@SuppressWarnings("hiding")
public CompileOptions processors(Processor... processors) {
return processors(Arrays.asList(processors));
}
@SuppressWarnings("hiding")
public CompileOptions processors(List<? extends Processor> processors) {
return new CompileOptions(processors);
}