Polishing.
Reformat code. Add since tags. See #3395 Original pull request: #3554.
This commit is contained in:
@@ -103,8 +103,13 @@ public enum MongoRegexCreator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param source
|
||||||
|
* @return
|
||||||
|
* @since 2.2.14
|
||||||
|
*/
|
||||||
public Object toCaseInsensitiveMatch(Object source) {
|
public Object toCaseInsensitiveMatch(Object source) {
|
||||||
return source instanceof String ? new BsonRegularExpression(Pattern.quote((String)source), "i") : source;
|
return source instanceof String ? new BsonRegularExpression(Pattern.quote((String) source), "i") : source;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String prepareAndEscapeStringBeforeApplyingLikeRegex(String source, MatchMode matcherType) {
|
private String prepareAndEscapeStringBeforeApplyingLikeRegex(String source, MatchMode matcherType) {
|
||||||
|
|||||||
@@ -402,12 +402,12 @@ class MongoQueryCreator extends AbstractQueryCreator<Query, Criteria> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private java.util.List<?> nextAsList(Iterator<Object> iterator, Part part) {
|
private java.util.List<?> nextAsList(Iterator<Object> iterator, Part part) {
|
||||||
|
|
||||||
Streamable<?> streamable = asStreamable(iterator.next());
|
Streamable<?> streamable = asStreamable(iterator.next());
|
||||||
if(!isSimpleComparisionPossible(part)) {
|
if (!isSimpleComparisionPossible(part)) {
|
||||||
streamable = streamable.map(MongoRegexCreator.INSTANCE::toCaseInsensitiveMatch);
|
streamable = streamable.map(MongoRegexCreator.INSTANCE::toCaseInsensitiveMatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
return streamable.toList();
|
return streamable.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user