DATAMONGO-2003 - Polishing.

Remove superfluous throws declarations and trailing whitespaces.

Original pull request: #570.
This commit is contained in:
Mark Paluch
2018-06-11 14:03:01 +02:00
parent 626dfa4f9a
commit d9bf13cc1e
3 changed files with 15 additions and 17 deletions

View File

@@ -23,7 +23,7 @@ import org.springframework.data.repository.query.ParameterAccessor;
/**
* Mongo-specific {@link ParameterAccessor} exposing a maximum distance parameter.
*
*
* @author Oliver Gierke
* @author Christoph Strobl
* @author Thomas Darimont
@@ -32,7 +32,7 @@ public interface MongoParameterAccessor extends ParameterAccessor {
/**
* Returns a {@link Distance} to be applied to Mongo geo queries.
*
*
* @return the maximum distance to apply to the geo query or {@literal null} if there's no {@link Distance} parameter
* at all or the given value for it was {@literal null}.
*/
@@ -40,14 +40,14 @@ public interface MongoParameterAccessor extends ParameterAccessor {
/**
* Returns the {@link Point} to use for a geo-near query.
*
*
* @return
*/
Point getGeoNearLocation();
/**
* Returns the {@link TextCriteria} to be used for full text query.
*
*
* @return null if not set.
* @since 1.6
*/
@@ -55,7 +55,7 @@ public interface MongoParameterAccessor extends ParameterAccessor {
/**
* Returns the raw parameter values of the underlying query method.
*
*
* @return
* @since 1.8
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 the original author or authors.
* Copyright 2010-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -114,9 +114,8 @@ class MongoQueryCreator extends AbstractQueryCreator<Query, Criteria> {
PersistentPropertyPath<MongoPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
MongoPersistentProperty property = path.getLeafProperty();
Criteria criteria = from(part, property, where(path.toDotPath()), (PotentiallyConvertingIterator) iterator);
return criteria;
return from(part, property, where(path.toDotPath()), iterator);
}
/*
@@ -133,7 +132,7 @@ class MongoQueryCreator extends AbstractQueryCreator<Query, Criteria> {
PersistentPropertyPath<MongoPersistentProperty> path = context.getPersistentPropertyPath(part.getProperty());
MongoPersistentProperty property = path.getLeafProperty();
return from(part, property, base.and(path.toDotPath()), (PotentiallyConvertingIterator) iterator);
return from(part, property, base.and(path.toDotPath()), iterator);
}
/*

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2017 the original author or authors.
* Copyright 2011-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,6 @@ import java.lang.reflect.Method;
import java.util.List;
import java.util.regex.Pattern;
import org.bson.Document;
import org.bson.types.ObjectId;
import org.junit.Before;
import org.junit.Rule;
@@ -79,7 +78,7 @@ public class MongoQueryCreatorUnitTests {
@Rule public ExpectedException expection = ExpectedException.none();
@Before
public void setUp() throws SecurityException, NoSuchMethodException {
public void setUp() {
context = new MongoMappingContext();
@@ -88,7 +87,7 @@ public class MongoQueryCreatorUnitTests {
}
@Test
public void createsQueryCorrectly() throws Exception {
public void createsQueryCorrectly() {
PartTree tree = new PartTree("findByFirstName", Person.class);
@@ -149,7 +148,7 @@ public class MongoQueryCreatorUnitTests {
}
@Test
public void createsLessThanEqualQueryCorrectly() throws Exception {
public void createsLessThanEqualQueryCorrectly() {
PartTree tree = new PartTree("findByAgeLessThanEqual", Person.class);
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, 18), context);
@@ -159,7 +158,7 @@ public class MongoQueryCreatorUnitTests {
}
@Test
public void createsGreaterThanEqualQueryCorrectly() throws Exception {
public void createsGreaterThanEqualQueryCorrectly() {
PartTree tree = new PartTree("findByAgeGreaterThanEqual", Person.class);
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, 18), context);
@@ -630,7 +629,7 @@ public class MongoQueryCreatorUnitTests {
}
@Test // DATAMONGO-2003
public void createsRegexQueryForPatternCorrectly() throws Exception {
public void createsRegexQueryForPatternCorrectly() {
PartTree tree = new PartTree("findByFirstNameRegex", Person.class);
MongoQueryCreator creator = new MongoQueryCreator(tree, getAccessor(converter, Pattern.compile(".*")), context);
@@ -639,7 +638,7 @@ public class MongoQueryCreatorUnitTests {
}
@Test // DATAMONGO-2003
public void createsRegexQueryForPatternWithOptionsCorrectly() throws Exception {
public void createsRegexQueryForPatternWithOptionsCorrectly() {
Pattern pattern = Pattern.compile(".*", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);