Skip to content

Commit c219f6e

Browse files
committed
DATAMONGO-2003 - Polishing.
Add nullability annotation to MongoParameterAccessor.getPoint(). Remove superfluous casts. Convert MongoQueryCreatorUnitTests to user AssertJ assertions. Original pull request: #570.
1 parent 1ab130f commit c219f6e

File tree

3 files changed

+65
-63
lines changed

3 files changed

+65
-63
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public interface MongoParameterAccessor extends ParameterAccessor {
4545
*
4646
* @return
4747
*/
48+
@Nullable
4849
Point getGeoNearLocation();
4950

5051
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,8 @@ protected Criteria create(Part part, Iterator<Object> iterator) {
114114

115115
PersistentPropertyPath<MongoPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
116116
MongoPersistentProperty property = path.getLeafProperty();
117-
Criteria criteria = from(part, property, where(path.toDotPath()), (PotentiallyConvertingIterator) iterator);
118117

119-
return criteria;
118+
return from(part, property, where(path.toDotPath()), iterator);
120119
}
121120

122121
/*
@@ -133,7 +132,7 @@ protected Criteria and(Part part, Criteria base, Iterator<Object> iterator) {
133132
PersistentPropertyPath<MongoPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
134133
MongoPersistentProperty property = path.getLeafProperty();
135134

136-
return from(part, property, base.and(path.toDotPath()), (PotentiallyConvertingIterator) iterator);
135+
return from(part, property, base.and(path.toDotPath()), iterator);
137136
}
138137

139138
/*

0 commit comments

Comments
 (0)