Skip to content

Commit 7f19bcc

Browse files
Query(Builder): add missing nullable flags.
1 parent 8e00833 commit 7f19bcc

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

objectbox-java/src/main/java/io/objectbox/query/Query.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ native void nativeSetParameter(long handle, int entityId, int propertyId, @Nulla
9292
final Box<T> box;
9393
private final BoxStore store;
9494
private final QueryPublisher<T> publisher;
95-
private final List<EagerRelation> eagerRelations;
96-
private final QueryFilter<T> filter;
97-
private final Comparator<T> comparator;
95+
@Nullable private final List<EagerRelation> eagerRelations;
96+
@Nullable private final QueryFilter<T> filter;
97+
@Nullable private final Comparator<T> comparator;
9898
private final int queryAttempts;
9999
private static final int INITIAL_RETRY_BACK_OFF_IN_MS = 10;
100100

101101
long handle;
102102

103-
Query(Box<T> box, long queryHandle, List<EagerRelation> eagerRelations, QueryFilter<T> filter,
104-
Comparator<T> comparator) {
103+
Query(Box<T> box, long queryHandle, @Nullable List<EagerRelation> eagerRelations, @Nullable QueryFilter<T> filter,
104+
@Nullable Comparator<T> comparator) {
105105
this.box = box;
106106
store = box.getStore();
107107
queryAttempts = store.internalQueryAttempts();
@@ -349,6 +349,7 @@ void resolveEagerRelations(List<T> entities) {
349349

350350
/** Note: no null check on eagerRelations! */
351351
void resolveEagerRelationForNonNullEagerRelations(@Nonnull T entity, int entityIndex) {
352+
//noinspection ConstantConditions No null check.
352353
for (EagerRelation eagerRelation : eagerRelations) {
353354
if (eagerRelation.limit == 0 || entityIndex < eagerRelation.limit) {
354355
resolveEagerRelation(entity, eagerRelation);

objectbox-java/src/main/java/io/objectbox/query/QueryBuilder.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,13 @@ enum Operator {
9797
private long lastCondition;
9898
private Operator combineNextWith = Operator.NONE;
9999

100+
@Nullable
100101
private List<EagerRelation> eagerRelations;
101102

103+
@Nullable
102104
private QueryFilter<T> filter;
103105

106+
@Nullable
104107
private Comparator<T> comparator;
105108

106109
private final boolean isSubQuery;

0 commit comments

Comments
 (0)