@@ -169,32 +169,31 @@ protected Query complete(Criteria criteria, Sort sort) {
169
169
* @param parameters
170
170
* @return
171
171
*/
172
- private Criteria from (Part part , MongoPersistentProperty property , Criteria criteria ,
173
- PotentiallyConvertingIterator parameters ) {
172
+ private Criteria from (Part part , MongoPersistentProperty property , Criteria criteria , Iterator <Object > parameters ) {
174
173
175
174
Type type = part .getType ();
176
175
177
176
switch (type ) {
178
177
case AFTER :
179
178
case GREATER_THAN :
180
- return criteria .gt (parameters .nextConverted ( property ));
179
+ return criteria .gt (parameters .next ( ));
181
180
case GREATER_THAN_EQUAL :
182
- return criteria .gte (parameters .nextConverted ( property ));
181
+ return criteria .gte (parameters .next ( ));
183
182
case BEFORE :
184
183
case LESS_THAN :
185
- return criteria .lt (parameters .nextConverted ( property ));
184
+ return criteria .lt (parameters .next ( ));
186
185
case LESS_THAN_EQUAL :
187
- return criteria .lte (parameters .nextConverted ( property ));
186
+ return criteria .lte (parameters .next ( ));
188
187
case BETWEEN :
189
- return criteria .gt (parameters .nextConverted ( property )).lt (parameters .nextConverted ( property ));
188
+ return criteria .gt (parameters .next ( )).lt (parameters .next ( ));
190
189
case IS_NOT_NULL :
191
190
return criteria .ne (null );
192
191
case IS_NULL :
193
192
return criteria .is (null );
194
193
case NOT_IN :
195
- return criteria .nin (nextAsArray (parameters , property ));
194
+ return criteria .nin (nextAsArray (parameters ));
196
195
case IN :
197
- return criteria .in (nextAsArray (parameters , property ));
196
+ return criteria .in (nextAsArray (parameters ));
198
197
case LIKE :
199
198
case STARTING_WITH :
200
199
case ENDING_WITH :
@@ -241,12 +240,12 @@ private Criteria from(Part part, MongoPersistentProperty property, Criteria crit
241
240
return criteria .within ((Shape ) parameter );
242
241
case SIMPLE_PROPERTY :
243
242
244
- return isSimpleComparisionPossible (part ) ? criteria .is (parameters .nextConverted ( property ))
243
+ return isSimpleComparisionPossible (part ) ? criteria .is (parameters .next ( ))
245
244
: createLikeRegexCriteriaOrThrow (part , property , criteria , parameters , false );
246
245
247
246
case NEGATING_SIMPLE_PROPERTY :
248
247
249
- return isSimpleComparisionPossible (part ) ? criteria .ne (parameters .nextConverted ( property ))
248
+ return isSimpleComparisionPossible (part ) ? criteria .ne (parameters .next ( ))
250
249
: createLikeRegexCriteriaOrThrow (part , property , criteria , parameters , true );
251
250
default :
252
251
throw new IllegalArgumentException ("Unsupported keyword!" );
@@ -278,7 +277,7 @@ private boolean isSimpleComparisionPossible(Part part) {
278
277
* @return the criteria extended with the like-regex.
279
278
*/
280
279
private Criteria createLikeRegexCriteriaOrThrow (Part part , MongoPersistentProperty property , Criteria criteria ,
281
- PotentiallyConvertingIterator parameters , boolean shouldNegateExpression ) {
280
+ Iterator < Object > parameters , boolean shouldNegateExpression ) {
282
281
283
282
PropertyPath path = part .getProperty ().getLeafProperty ();
284
283
@@ -297,7 +296,7 @@ private Criteria createLikeRegexCriteriaOrThrow(Part part, MongoPersistentProper
297
296
criteria = criteria .not ();
298
297
}
299
298
300
- return addAppropriateLikeRegexTo (criteria , part , parameters .nextConverted ( property ).toString ());
299
+ return addAppropriateLikeRegexTo (criteria , part , parameters .next ( ).toString ());
301
300
302
301
case NEVER :
303
302
// intentional no-op
@@ -319,10 +318,10 @@ private Criteria createLikeRegexCriteriaOrThrow(Part part, MongoPersistentProper
319
318
* @return
320
319
*/
321
320
private Criteria createContainingCriteria (Part part , MongoPersistentProperty property , Criteria criteria ,
322
- PotentiallyConvertingIterator parameters ) {
321
+ Iterator < Object > parameters ) {
323
322
324
323
if (property .isCollectionLike ()) {
325
- return criteria .in (nextAsArray (parameters , property ));
324
+ return criteria .in (nextAsArray (parameters ));
326
325
}
327
326
328
327
return addAppropriateLikeRegexTo (criteria , part , parameters .next ().toString ());
@@ -377,8 +376,9 @@ private <T> T nextAs(Iterator<Object> iterator, Class<T> type) {
377
376
String .format ("Expected parameter type of %s but got %s!" , type , parameter .getClass ()));
378
377
}
379
378
380
- private Object [] nextAsArray (PotentiallyConvertingIterator iterator , MongoPersistentProperty property ) {
381
- Object next = iterator .nextConverted (property );
379
+ private Object [] nextAsArray (Iterator <Object > iterator ) {
380
+
381
+ Object next = iterator .next ();
382
382
383
383
if (next instanceof Collection ) {
384
384
return ((Collection <?>) next ).toArray ();
0 commit comments