@@ -445,25 +445,32 @@ public void verify() {
445445 if (isCollectionQuery () || isScrollQuery () || isSliceQuery () || isPageQuery () || isGeoNearQuery ()
446446 || !isNumericOrVoidReturnValue ()) { //
447447 throw new IllegalStateException (
448- String .format ("Update method may be void or return a numeric value (the number of updated documents)."
449- + "Offending method: %s" , method ));
448+ String .format (
449+ "Update method may be void or return a numeric value (the number of updated documents)."
450+ + " Offending Method: %s.%s" ,
451+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
450452 }
451453
452454 if (hasAnnotatedUpdate ()) { // must define either an update or an update pipeline
453455 if (!StringUtils .hasText (getUpdateSource ().update ()) && ObjectUtils .isEmpty (getUpdateSource ().pipeline ())) {
454456 throw new IllegalStateException (
455- String .format ("Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
456- + " Offending method: %s" , method ));
457+ String .format (
458+ "Update method must define either 'Update#update' or 'Update#pipeline' attribute;"
459+ + " Offending Method: %s.%s" ,
460+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
457461 }
458462 }
459463 }
464+
460465 if (hasAnnotatedAggregation ()) {
461466 for (String stage : getAnnotatedAggregation ()) {
462467 if (BsonUtils .isJsonArray (stage )) {
463- throw new IllegalStateException ("""
464- Invalid aggregation pipeline. Please split Aggregation.pipeline from "[{...}, {...}]" to "{...}", "{...}".
465- Offending Method: %s.%s
466- """ .formatted (method .getDeclaringClass ().getSimpleName (), method .getName ()));
468+ throw new IllegalStateException (String .format (
469+ """
470+ Invalid aggregation pipeline. Please split the definition from @Aggregation("[{...}, {...}]") to @Aggregation({ "{...}", "{...}" }).
471+ Offending Method: %s.%s
472+ """ ,
473+ ClassUtils .getShortName (method .getDeclaringClass ()), method .getName ()));
467474 }
468475 }
469476 }
0 commit comments