File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
client/rest-high-level/src/main/java/org/elasticsearch/client Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 2222 * Defines a validation layer for Requests.
2323 */
2424public interface Validatable {
25+ ValidationException EMPTY_VALIDATION = new ValidationException () {
26+ @ Override
27+ public void addValidationError (String error ) { }
28+ };
2529
2630 /**
2731 * Perform validation. This method does not have to be overridden in the event that no validation needs to be done.
@@ -30,6 +34,6 @@ public interface Validatable {
3034 * {@link ValidationException} that contains a list of all failed validation.
3135 */
3236 default ValidationException validate () {
33- return new ValidationException () ;
37+ return EMPTY_VALIDATION ;
3438 }
3539}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public class ValidationException extends IllegalArgumentException {
3131 * Add a new validation error to the accumulating validation errors
3232 * @param error the error to add
3333 */
34- public final void addValidationError (String error ) {
34+ public void addValidationError (String error ) {
3535 validationErrors .add (error );
3636 }
3737
You can’t perform that action at this time.
0 commit comments