@@ -69,12 +69,12 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
6969 Assert .notNull (metadata , "Repository metadata must not be null!" );
7070 Assert .notNull (factory , "ProjectionFactory must not be null!" );
7171
72- Parameters .TYPES .stream ()//
73- .filter (type -> getNumberOfOccurences (method , type ) > 1 )//
72+ Parameters .TYPES .stream ()
73+ .filter (type -> getNumberOfOccurences (method , type ) > 1 )
7474 .findFirst ().ifPresent (type -> {
7575 throw new IllegalStateException (
76- String .format ("Method must only one argument of type %s! Offending method: %s" , type . getSimpleName () ,
77- method . toString () ));
76+ String .format ("Method must have only one argument of type %s! Offending method: %s" ,
77+ type . getSimpleName (), method ));
7878 });
7979
8080 this .method = method ;
@@ -89,8 +89,8 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
8989 }
9090
9191 if (hasParameterOfType (method , Sort .class )) {
92- throw new IllegalStateException (String .format ("Method must not have Pageable *and* Sort parameter . "
93- + "Use sorting capabilities on Pageable instead! Offending method: %s" , method . toString () ));
92+ throw new IllegalStateException (String .format ("Method must not have Pageable *and* Sort parameters . "
93+ + "Use sorting capabilities on Pageable instead! Offending method: %s" , method ));
9494 }
9595 }
9696
@@ -99,7 +99,7 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
9999
100100 if (isPageQuery ()) {
101101 Assert .isTrue (this .parameters .hasPageableParameter (),
102- String .format ("Paging query needs to have a Pageable parameter! Offending method %s" , method . toString () ));
102+ String .format ("Paging query needs to have a Pageable parameter! Offending method: %s" , method ));
103103 }
104104
105105 this .domainClass = Lazy .of (() -> {
@@ -315,6 +315,6 @@ private static void assertReturnTypeAssignable(Method method, Set<Class<?>> type
315315 }
316316 }
317317
318- throw new IllegalStateException ("Method has to have one of the following return types! " + types . toString () );
318+ throw new IllegalStateException ("Method has to have one of the following return types! " + types );
319319 }
320320}
0 commit comments