Skip to content

Commit c8e693b

Browse files
sbrannencbeams
authored andcommitted
Polish SmartValidator and SpringValidatorAdapter
- Improve wording & grammar in SmartValidator Javadoc - Suppress 'rawtypes' warnings in SpringValidatorAdapter
1 parent f75c01d commit c8e693b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

spring-context/src/main/java/org/springframework/validation/SmartValidator.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,20 +21,21 @@
2121
* validation 'hints'.
2222
*
2323
* @author Juergen Hoeller
24+
* @author Sam Brannen
2425
* @since 3.1
2526
*/
2627
public interface SmartValidator extends Validator {
2728

2829
/**
29-
* Validate the supplied {@code target} object, which must be of a {@link Class} for
30-
* which the {@link #supports(Class)} method typically has (or would) return {@code true}.
30+
* Validate the supplied {@code target} object, which must be of a type of {@link Class}
31+
* for which the {@link #supports(Class)} method typically returns {@code true}.
3132
* <p>The supplied {@link Errors errors} instance can be used to report any
3233
* resulting validation errors.
33-
* <p><b>This variant of {@code validate} supports validation hints, such as
34-
* validation groups against a JSR-303 provider</b> (in this case, the provided hint
34+
* <p><b>This variant of {@code validate()} supports validation hints, such as
35+
* validation groups against a JSR-303 provider</b> (in which case, the provided hint
3536
* objects need to be annotation arguments of type {@code Class}).
3637
* <p>Note: Validation hints may get ignored by the actual target {@code Validator},
37-
* in which case this method is supposed to be behave just like its regular
38+
* in which case this method should behave just like its regular
3839
* {@link #validate(Object, Errors)} sibling.
3940
* @param target the object that is to be validated (can be {@code null})
4041
* @param errors contextual state about the validation process (never {@code null})

spring-context/src/main/java/org/springframework/validation/beanvalidation/SpringValidatorAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public void validate(Object target, Errors errors) {
8989
processConstraintViolations(this.targetValidator.validate(target), errors);
9090
}
9191

92+
@SuppressWarnings("rawtypes")
9293
public void validate(Object target, Errors errors, Object... validationHints) {
9394
Set<Class> groups = new LinkedHashSet<Class>();
9495
if (validationHints != null) {

0 commit comments

Comments
 (0)