@@ -493,25 +493,32 @@ public void verify() {
493493 if (isCollectionQuery () || isScrollQuery () || isSliceQuery () || isPageQuery () || isGeoNearQuery ()
494494 || !isNumericOrVoidReturnValue ()) { //
495495 throw new IllegalStateException (
496- String .format ("Update method may be void or return a numeric value (the number of updated documents)."
497- + "Offending method: %s" , method ));
496+ String .format (
497+ "Update method may be void or return a numeric value (the number of updated documents)."
498+ + " Offending Method: %s.%s" ,
499+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
498500 }
499501
500502 if (hasAnnotatedUpdate ()) { // must define either an update or an update pipeline
501503 if (!StringUtils .hasText (getUpdateSource ().update ()) && ObjectUtils .isEmpty (getUpdateSource ().pipeline ())) {
502504 throw new IllegalStateException (
503- String .format ("Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
504- + " Offending method: %s" , method ));
505+ String .format (
506+ "Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
507+ + " Offending Method: %s.%s" ,
508+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
505509 }
506510 }
507511 }
512+
508513 if (hasAnnotatedAggregation ()) {
509514 for (String stage : getAnnotatedAggregation ()) {
510515 if (BsonUtils .isJsonArray (stage )) {
511- throw new IllegalStateException ("""
512- Invalid aggregation pipeline. Please split Aggregation.pipeline from "[{...}, {...}]" to "{...}", "{...}".
513- Offending Method: %s.%s
514- """ .formatted (method .getDeclaringClass ().getSimpleName (), method .getName ()));
516+ throw new IllegalStateException (String .format (
517+ """
518+ Invalid aggregation pipeline. Please split the definition from @Aggregation("[{...}, {...}]") to @Aggregation({ "{...}", "{...}" }).
519+ Offending Method: %s.%s
520+ """ ,
521+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
515522 }
516523 }
517524 }
0 commit comments