Internal: make ValidationException methods final and fix javadocs

This commit is contained in:
javanna 2015-08-28 09:41:47 +02:00 committed by Luca Cavanna
parent 37ec221df5
commit 9b2e77903d
1 changed files with 4 additions and 5 deletions

View File

@ -36,7 +36,7 @@ public class ValidationException extends IllegalArgumentException {
* Add a new validation error to the accumulating validation errors * Add a new validation error to the accumulating validation errors
* @param error the error to add * @param error the error to add
*/ */
public void addValidationError(String error) { public final void addValidationError(String error) {
validationErrors.add(error); validationErrors.add(error);
} }
@ -44,7 +44,7 @@ public class ValidationException extends IllegalArgumentException {
* Add a sequence of validation errors to the accumulating validation errors * Add a sequence of validation errors to the accumulating validation errors
* @param errors the errors to add * @param errors the errors to add
*/ */
public void addValidationErrors(Iterable<String> errors) { public final void addValidationErrors(Iterable<String> errors) {
for (String error : errors) { for (String error : errors) {
validationErrors.add(error); validationErrors.add(error);
} }
@ -52,14 +52,13 @@ public class ValidationException extends IllegalArgumentException {
/** /**
* Returns the validation errors accumulated * Returns the validation errors accumulated
* @return
*/ */
public List<String> validationErrors() { public final List<String> validationErrors() {
return validationErrors; return validationErrors;
} }
@Override @Override
public String getMessage() { public final String getMessage() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Validation Failed: "); sb.append("Validation Failed: ");
int index = 0; int index = 0;