@@ -234,8 +234,8 @@ public Class<?>[] determineValidationGroups(Object target, Method method) {
234234
235235 @ Override
236236 public final MethodValidationResult validateArguments (
237- Object target , Method method , @ Nullable MethodParameter [] parameters , Object [] arguments ,
238- Class <?>[] groups ) {
237+ Object target , Method method , @ Nullable MethodParameter [] parameters ,
238+ Object [] arguments , Class <?>[] groups ) {
239239
240240 Set <ConstraintViolation <Object >> violations =
241241 invokeValidatorForArguments (target , method , arguments , groups );
@@ -256,23 +256,21 @@ public final Set<ConstraintViolation<Object>> invokeValidatorForArguments(
256256 Object target , Method method , Object [] arguments , Class <?>[] groups ) {
257257
258258 ExecutableValidator execVal = this .validator .get ().forExecutables ();
259- Set <ConstraintViolation <Object >> violations ;
260259 try {
261- violations = execVal .validateParameters (target , method , arguments , groups );
260+ return execVal .validateParameters (target , method , arguments , groups );
262261 }
263262 catch (IllegalArgumentException ex ) {
264263 // Probably a generic type mismatch between interface and impl as reported in SPR-12237 / HV-1011
265264 // Let's try to find the bridged method on the implementation class...
266265 Method bridgedMethod = BridgeMethodResolver .getMostSpecificMethod (method , target .getClass ());
267- violations = execVal .validateParameters (target , bridgedMethod , arguments , groups );
266+ return execVal .validateParameters (target , bridgedMethod , arguments , groups );
268267 }
269- return violations ;
270268 }
271269
272270 @ Override
273271 public final MethodValidationResult validateReturnValue (
274- Object target , Method method , @ Nullable MethodParameter returnType , @ Nullable Object returnValue ,
275- Class <?>[] groups ) {
272+ Object target , Method method , @ Nullable MethodParameter returnType ,
273+ @ Nullable Object returnValue , Class <?>[] groups ) {
276274
277275 Set <ConstraintViolation <Object >> violations =
278276 invokeValidatorForReturnValue (target , method , returnValue , groups );
@@ -305,9 +303,9 @@ private MethodValidationResult adaptViolations(
305303 Map <Path .Node , ParamErrorsBuilder > nestedViolations = new LinkedHashMap <>();
306304
307305 for (ConstraintViolation <Object > violation : violations ) {
308- Iterator <Path .Node > itr = violation .getPropertyPath ().iterator ();
309- while (itr .hasNext ()) {
310- Path .Node node = itr .next ();
306+ Iterator <Path .Node > nodes = violation .getPropertyPath ().iterator ();
307+ while (nodes .hasNext ()) {
308+ Path .Node node = nodes .next ();
311309
312310 MethodParameter parameter ;
313311 if (node .getKind ().equals (ElementKind .PARAMETER )) {
@@ -328,8 +326,8 @@ else if (node.getKind().equals(ElementKind.RETURN_VALUE)) {
328326 // https://github.com/jakartaee/validation/issues/194
329327
330328 Path .Node parameterNode = node ;
331- if (itr .hasNext ()) {
332- node = itr .next ();
329+ if (nodes .hasNext ()) {
330+ node = nodes .next ();
333331 }
334332
335333 Object value ;
@@ -425,7 +423,6 @@ public interface ObjectNameResolver {
425423 * @return the name to use
426424 */
427425 String resolveName (MethodParameter parameter , @ Nullable Object value );
428-
429426 }
430427
431428
@@ -456,6 +453,7 @@ private final class ParamValidationResultBuilder {
456453 public ParamValidationResultBuilder (
457454 Object target , MethodParameter parameter , @ Nullable Object value , @ Nullable Object container ,
458455 @ Nullable Integer containerIndex , @ Nullable Object containerKey ) {
456+
459457 this .target = target ;
460458 this .parameter = parameter ;
461459 this .value = value ;
@@ -473,7 +471,6 @@ public ParameterValidationResult build() {
473471 this .parameter , this .value , this .resolvableErrors , this .container ,
474472 this .containerIndex , this .containerKey );
475473 }
476-
477474 }
478475
479476
@@ -527,8 +524,7 @@ public ParameterErrors build() {
527524
528525
529526 /**
530- * Default algorithm to select an object name, as described in
531- * {@link #setObjectNameResolver(ObjectNameResolver)}.
527+ * Default algorithm to select an object name, as described in {@link #setObjectNameResolver}.
532528 */
533529 private static class DefaultObjectNameResolver implements ObjectNameResolver {
534530
0 commit comments