[jOOQ/jOOQ#12425] Added QOM API tests

- Validating visibilities of U, M prefixed types
- Validating nullability of methods
- Fixed some Iterable methods that should be annotated as NotNull
This commit is contained in:
Lukas Eder 2021-09-30 12:43:54 +02:00
parent ff89ad2f1d
commit bc21b67fe2
2 changed files with 17 additions and 6 deletions

View File

@ -40,6 +40,8 @@ package org.jooq;
import org.jooq.exception.DataMigrationException;
import org.jooq.exception.DataMigrationValidationException;
import org.jetbrains.annotations.NotNull;
/**
* An executable migration between two {@link Commit} instances.
* <p>
@ -64,6 +66,7 @@ public interface Migration extends Scope {
/**
* The queries that are executed by the migration.
*/
@NotNull
Queries queries();
/**

View File

@ -2793,8 +2793,10 @@ public final class QOM {
interface UOperator1<Q1, R extends MQueryPart> extends MQueryPart {
Q1 $arg1();
default R $arg1(Q1 newArg1) { return constructor().apply(newArg1); }
@NotNull default R $arg1(Q1 newArg1) { return constructor().apply(newArg1); }
@NotNull
Function1<? super Q1, ? extends R> constructor();
default <T> T transform(Function1<? super Q1, ? extends T> function) {
@ -2811,6 +2813,7 @@ public final class QOM {
return QOM.traverse(current, abort, recurse, accumulate, this, $arg1());
};
@NotNull
@Override
default MQueryPart replace(
Predicate<? super MQueryPart> recurse,
@ -2829,9 +2832,11 @@ public final class QOM {
interface UOperator2<Q1, Q2, R extends MQueryPart> extends MQueryPart {
Q1 $arg1();
Q2 $arg2();
default R $arg1(Q1 newArg1) { return constructor().apply(newArg1, $arg2()); }
default R $arg2(Q2 newArg2) { return constructor().apply($arg1(), newArg2); }
@NotNull default R $arg1(Q1 newArg1) { return constructor().apply(newArg1, $arg2()); }
@NotNull default R $arg2(Q2 newArg2) { return constructor().apply($arg1(), newArg2); }
@NotNull
Function2<? super Q1, ? super Q2, ? extends R> constructor();
default <T> T transform(Function2<? super Q1, ? super Q2, ? extends T> function) {
@ -2848,6 +2853,7 @@ public final class QOM {
return QOM.traverse(current, abort, recurse, accumulate, this, $arg1(), $arg2());
};
@NotNull
@Override
default MQueryPart replace(
Predicate<? super MQueryPart> recurse,
@ -2868,10 +2874,11 @@ public final class QOM {
Q1 $arg1();
Q2 $arg2();
Q3 $arg3();
default R $arg1(Q1 newArg1) { return constructor().apply(newArg1, $arg2(), $arg3()); }
default R $arg2(Q2 newArg2) { return constructor().apply($arg1(), newArg2, $arg3()); }
default R $arg3(Q3 newArg3) { return constructor().apply($arg1(), $arg2(), newArg3); }
@NotNull default R $arg1(Q1 newArg1) { return constructor().apply(newArg1, $arg2(), $arg3()); }
@NotNull default R $arg2(Q2 newArg2) { return constructor().apply($arg1(), newArg2, $arg3()); }
@NotNull default R $arg3(Q3 newArg3) { return constructor().apply($arg1(), $arg2(), newArg3); }
@NotNull
Function3<? super Q1, ? super Q2, ? super Q3, ? extends R> constructor();
default <T> T transform(Function3<? super Q1, ? super Q2, ? super Q3, ? extends T> function) {
@ -2888,6 +2895,7 @@ public final class QOM {
return QOM.traverse(current, abort, recurse, accumulate, this, $arg1(), $arg2(), $arg3());
};
@NotNull
@Override
default MQueryPart replace(
Predicate<? super MQueryPart> recurse,