Skip to content

Commit 6f1d836

Browse files
committed
QueryCondition: fix nullability and other warnings
1 parent b63a011 commit 6f1d836

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
import java.util.Date;
1919

20+
import javax.annotation.Nullable;
21+
2022
import io.objectbox.Property;
2123
import io.objectbox.annotation.apihint.Experimental;
2224
import io.objectbox.annotation.apihint.Internal;
@@ -42,12 +44,12 @@ abstract class AbstractCondition implements QueryCondition {
4244
public final Object value;
4345
protected final Object[] values;
4446

45-
public AbstractCondition(Object value) {
47+
AbstractCondition(Object value) {
4648
this.value = value;
4749
this.values = null;
4850
}
4951

50-
public AbstractCondition(Object[] values) {
52+
AbstractCondition(Object[] values) {
5153
this.value = null;
5254
this.values = values;
5355
}
@@ -166,7 +168,7 @@ public void applyTo(QueryBuilder queryBuilder, StringOrder stringOrder) {
166168
}
167169
}
168170

169-
private static Object checkValueForType(Property property, Object value) {
171+
private static Object checkValueForType(Property property, @Nullable Object value) {
170172
if (value != null && value.getClass().isArray()) {
171173
throw new DbException("Illegal value: found array, but simple object required");
172174
}
@@ -203,7 +205,7 @@ private static Object checkValueForType(Property property, Object value) {
203205
return value;
204206
}
205207

206-
private static Object[] checkValuesForType(Property property, Operation operation, Object[] values) {
208+
private static Object[] checkValuesForType(Property property, Operation operation, @Nullable Object[] values) {
207209
if (values == null) {
208210
if (operation == Operation.IS_NULL || operation == Operation.IS_NOT_NULL) {
209211
return null;

0 commit comments

Comments
 (0)