Skip to content

Commit d9bf13c

Browse files
committed
DATAMONGO-2003 - Polishing.
Remove superfluous throws declarations and trailing whitespaces. Original pull request: #570.
1 parent 626dfa4 commit d9bf13c

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
/**
2525
* Mongo-specific {@link ParameterAccessor} exposing a maximum distance parameter.
26-
*
26+
*
2727
* @author Oliver Gierke
2828
* @author Christoph Strobl
2929
* @author Thomas Darimont
@@ -32,30 +32,30 @@ public interface MongoParameterAccessor extends ParameterAccessor {
3232

3333
/**
3434
* Returns a {@link Distance} to be applied to Mongo geo queries.
35-
*
35+
*
3636
* @return the maximum distance to apply to the geo query or {@literal null} if there's no {@link Distance} parameter
3737
* at all or the given value for it was {@literal null}.
3838
*/
3939
Range<Distance> getDistanceRange();
4040

4141
/**
4242
* Returns the {@link Point} to use for a geo-near query.
43-
*
43+
*
4444
* @return
4545
*/
4646
Point getGeoNearLocation();
4747

4848
/**
4949
* Returns the {@link TextCriteria} to be used for full text query.
50-
*
50+
*
5151
* @return null if not set.
5252
* @since 1.6
5353
*/
5454
TextCriteria getFullText();
5555

5656
/**
5757
* Returns the raw parameter values of the underlying query method.
58-
*
58+
*
5959
* @return
6060
* @since 1.8
6161
*/

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2010-2017 the original author or authors.
2+
* Copyright 2010-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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
/*

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/query/MongoQueryCreatorUnitTests.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2017 the original author or authors.
2+
* Copyright 2011-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@
2626
import java.util.List;
2727
import java.util.regex.Pattern;
2828

29-
import org.bson.Document;
3029
import org.bson.types.ObjectId;
3130
import org.junit.Before;
3231
import org.junit.Rule;
@@ -79,7 +78,7 @@ public class MongoQueryCreatorUnitTests {
7978
@Rule public ExpectedException expection = ExpectedException.none();
8079

8180
@Before
82-
public void setUp() throws SecurityException, NoSuchMethodException {
81+
public void setUp() {
8382

8483
context = new MongoMappingContext();
8584

@@ -88,7 +87,7 @@ public void setUp() throws SecurityException, NoSuchMethodException {
8887
}
8988

9089
@Test
91-
public void createsQueryCorrectly() throws Exception {
90+
public void createsQueryCorrectly() {
9291

9392
PartTree tree = new PartTree("findByFirstName", Person.class);
9493

@@ -149,7 +148,7 @@ public void bindsDistanceParameterToNearCorrectly() throws Exception {
149148
}
150149

151150
@Test
152-
public void createsLessThanEqualQueryCorrectly() throws Exception {
151+
public void createsLessThanEqualQueryCorrectly() {
153152

154153
PartTree tree = new PartTree("findByAgeLessThanEqual", Person.class);
155154
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, 18), context);
@@ -159,7 +158,7 @@ public void createsLessThanEqualQueryCorrectly() throws Exception {
159158
}
160159

161160
@Test
162-
public void createsGreaterThanEqualQueryCorrectly() throws Exception {
161+
public void createsGreaterThanEqualQueryCorrectly() {
163162

164163
PartTree tree = new PartTree("findByAgeGreaterThanEqual", Person.class);
165164
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, 18), context);
@@ -630,7 +629,7 @@ public void queryShouldThrowExceptionWhenArgumentDoesNotMatchDeclaration() {
630629
}
631630

632631
@Test // DATAMONGO-2003
633-
public void createsRegexQueryForPatternCorrectly() throws Exception {
632+
public void createsRegexQueryForPatternCorrectly() {
634633

635634
PartTree tree = new PartTree("findByFirstNameRegex", Person.class);
636635
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, Pattern.compile(".*")), context);
@@ -639,7 +638,7 @@ public void createsRegexQueryForPatternCorrectly() throws Exception {
639638
}
640639

641640
@Test // DATAMONGO-2003
642-
public void createsRegexQueryForPatternWithOptionsCorrectly() throws Exception {
641+
public void createsRegexQueryForPatternWithOptionsCorrectly() {
643642

644643
Pattern pattern = Pattern.compile(".*", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
645644

0 commit comments

Comments
 (0)