@@ -208,7 +208,9 @@ public Set<DocumentKey> getDocumentsMatchingTarget(Target target) {
208
208
@ Nullable FieldIndex fieldIndex = getMatchingIndex (target );
209
209
if (fieldIndex == null ) return null ;
210
210
211
+ // Can this be an empty list?
211
212
@ Nullable List <Value > arrayValues = target .getArrayValues (fieldIndex );
213
+ // Can this be non-nullable again?
212
214
@ Nullable Bound lowerBound = target .getLowerBound (fieldIndex );
213
215
@ Nullable Bound upperBound = target .getUpperBound (fieldIndex );
214
216
@@ -224,9 +226,9 @@ public Set<DocumentKey> getDocumentsMatchingTarget(Target target) {
224
226
}
225
227
226
228
Object [] lowerBoundValues = encodeDirectionalBound (fieldIndex , target , lowerBound );
227
- String lowerBoundOp = lowerBound != null ? ( lowerBound .isInclusive () ? ">=" : ">" ) : null ;
229
+ String lowerBoundOp = lowerBound != null && lowerBound .isInclusive () ? ">=" : ">" ;
228
230
Object [] upperBoundValues = encodeDirectionalBound (fieldIndex , target , upperBound );
229
- String upperBoundOp = upperBound != null ? ( upperBound .isInclusive () ? "<=" : "<" ) : null ;
231
+ String upperBoundOp = upperBound != null && upperBound .isInclusive () ? "<=" : "<" ;
230
232
231
233
SQLitePersistence .Query query =
232
234
generateQuery (
@@ -252,9 +254,9 @@ private SQLitePersistence.Query generateQuery(
252
254
int indexId ,
253
255
@ Nullable List <Value > arrayValues ,
254
256
@ Nullable Object [] lowerBounds ,
255
- @ Nullable String lowerBoundOp ,
257
+ String lowerBoundOp ,
256
258
@ Nullable Object [] upperBounds ,
257
- @ Nullable String upperBoundOp ) {
259
+ String upperBoundOp ) {
258
260
StringBuilder statement = new StringBuilder ();
259
261
statement .append (
260
262
"SELECT document_name, directional_value FROM index_entries WHERE index_id = ? " );
0 commit comments