From 0df39ac871db8c28b1d44f32e3fd78711ef42c15 Mon Sep 17 00:00:00 2001 From: John Blum Date: Thu, 24 Sep 2020 13:40:23 -0700 Subject: [PATCH] DATACMNS-1804 - Correct grammar in Exception messages thrown by Repository classes. Original pull request: #467. --- .../core/support/QueryExecutorMethodInterceptor.java | 8 ++++---- .../repository/core/support/RepositoryFactorySupport.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java b/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java index c1940b014..e009498a0 100644 --- a/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java +++ b/src/main/java/org/springframework/data/repository/core/support/QueryExecutorMethodInterceptor.java @@ -27,7 +27,6 @@ import java.util.Optional; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.reactivestreams.Publisher; - import org.springframework.core.KotlinDetector; import org.springframework.core.ResolvableType; import org.springframework.data.projection.ProjectionFactory; @@ -51,6 +50,7 @@ import org.springframework.util.ConcurrentReferenceHashMap; * * @author Oliver Gierke * @author Mark Paluch + * @author John Blum */ class QueryExecutorMethodInterceptor implements MethodInterceptor { @@ -75,9 +75,9 @@ class QueryExecutorMethodInterceptor implements MethodInterceptor { if (!queryLookupStrategy.isPresent() && repositoryInformation.hasQueryMethods()) { - throw new IllegalStateException("You have defined query method in the repository but " - + "you don't have any query lookup strategy defined. The " - + "infrastructure apparently does not support query methods!"); + throw new IllegalStateException("You have defined query methods in the repository" + + " but do not have any query lookup strategy defined." + + " The infrastructure apparently does not support query methods!"); } this.queries = queryLookupStrategy // diff --git a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java index 28f226a38..8be572a64 100644 --- a/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java +++ b/src/main/java/org/springframework/data/repository/core/support/RepositoryFactorySupport.java @@ -78,6 +78,7 @@ import org.springframework.util.ConcurrentReferenceHashMap.ReferenceType; * @author Mark Paluch * @author Christoph Strobl * @author Jens Schauder + * @author John Blum */ @Slf4j public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, BeanFactoryAware { @@ -477,7 +478,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware, if (composition.isEmpty()) { throw new IllegalArgumentException( - String.format("You have custom methods in %s but not provided a custom implementation!", + String.format("You have custom methods in %s but have not provided a custom implementation!", repositoryInformation.getRepositoryInterface())); }