@@ -69,12 +69,12 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
69
69
Assert .notNull (metadata , "Repository metadata must not be null!" );
70
70
Assert .notNull (factory , "ProjectionFactory must not be null!" );
71
71
72
- Parameters .TYPES .stream ()//
73
- .filter (type -> getNumberOfOccurences (method , type ) > 1 )//
72
+ Parameters .TYPES .stream ()
73
+ .filter (type -> getNumberOfOccurences (method , type ) > 1 )
74
74
.findFirst ().ifPresent (type -> {
75
75
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 ));
78
78
});
79
79
80
80
this .method = method ;
@@ -89,8 +89,8 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
89
89
}
90
90
91
91
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 ));
94
94
}
95
95
}
96
96
@@ -99,7 +99,7 @@ public QueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory
99
99
100
100
if (isPageQuery ()) {
101
101
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 ));
103
103
}
104
104
105
105
this .domainClass = Lazy .of (() -> {
@@ -315,6 +315,6 @@ private static void assertReturnTypeAssignable(Method method, Set<Class<?>> type
315
315
}
316
316
}
317
317
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 );
319
319
}
320
320
}
0 commit comments