Skip to content

Commit f93e40f

Browse files
committed
Polishing.
Reformat code. Add since tags. See #3395 Original pull request: #3554.
1 parent dca508f commit f93e40f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/MongoRegexCreator.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,13 @@ public String toRegularExpression(@Nullable String source, @Nullable MatchMode m
103103
}
104104
}
105105

106+
/**
107+
* @param source
108+
* @return
109+
* @since 2.2.14
110+
*/
106111
public Object toCaseInsensitiveMatch(Object source) {
107-
return source instanceof String ? new BsonRegularExpression(Pattern.quote((String)source), "i") : source;
112+
return source instanceof String ? new BsonRegularExpression(Pattern.quote((String) source), "i") : source;
108113
}
109114

110115
private String prepareAndEscapeStringBeforeApplyingLikeRegex(String source, MatchMode matcherType) {

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/MongoQueryCreator.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ private <T> T nextAs(Iterator<Object> iterator, Class<T> type) {
402402
}
403403

404404
private java.util.List<?> nextAsList(Iterator<Object> iterator, Part part) {
405-
405+
406406
Streamable<?> streamable = asStreamable(iterator.next());
407-
if(!isSimpleComparisionPossible(part)) {
407+
if (!isSimpleComparisionPossible(part)) {
408408
streamable = streamable.map(MongoRegexCreator.INSTANCE::toCaseInsensitiveMatch);
409409
}
410-
410+
411411
return streamable.toList();
412412
}
413413

0 commit comments

Comments
 (0)