diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-18 19:47:48 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-19 10:51:57 +0300 |
commit | aa225cce86d34fc656e091f5eb62f73d17351345 (patch) | |
tree | 884500dd5f23086f0b51067ec1e9e7172375523f /server | |
parent | 797cc0104eaf291afbed913f1c748b1f76bbf522 (diff) | |
download | vaadin-framework-aa225cce86d34fc656e091f5eb62f73d17351345.tar.gz vaadin-framework-aa225cce86d34fc656e091f5eb62f73d17351345.zip |
Remove unneeded ArrayList construction
Diffstat (limited to 'server')
3 files changed, 7 insertions, 7 deletions
diff --git a/server/src/main/java/com/vaadin/data/BinderValidationStatus.java b/server/src/main/java/com/vaadin/data/BinderValidationStatus.java index c8d021ad53..90600f1800 100644 --- a/server/src/main/java/com/vaadin/data/BinderValidationStatus.java +++ b/server/src/main/java/com/vaadin/data/BinderValidationStatus.java @@ -137,10 +137,10 @@ public class BinderValidationStatus<BEAN> implements Serializable { * @return a list of all validation errors */ public List<ValidationResult> getValidationErrors() { - ArrayList<ValidationResult> errors = new ArrayList<>( + List<ValidationResult> errors = getFieldValidationErrors().stream() .map(s -> s.getResult().get()) - .collect(Collectors.toList())); + .collect(Collectors.toList()); errors.addAll(getBeanValidationErrors()); return errors; } @@ -148,7 +148,7 @@ public class BinderValidationStatus<BEAN> implements Serializable { /** * Gets the field level validation statuses. * <p> - * The field level validtors have been added with + * The field level validators have been added with * {@link BindingBuilder#withValidator(Validator)}. * * @return the field validation statuses @@ -169,7 +169,7 @@ public class BinderValidationStatus<BEAN> implements Serializable { /** * Gets the failed field level validation statuses. * <p> - * The field level validtors have been added with + * The field level validators have been added with * {@link BindingBuilder#withValidator(Validator)}. * * @return a list of failed field level validation statuses diff --git a/server/src/main/java/com/vaadin/data/ValidationException.java b/server/src/main/java/com/vaadin/data/ValidationException.java index 6b3b0a121a..92043872e2 100644 --- a/server/src/main/java/com/vaadin/data/ValidationException.java +++ b/server/src/main/java/com/vaadin/data/ValidationException.java @@ -60,10 +60,10 @@ public class ValidationException extends Exception { * @return a list of all validation errors */ public List<ValidationResult> getValidationErrors() { - ArrayList<ValidationResult> errors = new ArrayList<>( + List<ValidationResult> errors = getFieldValidationErrors().stream() .map(s -> s.getResult().get()) - .collect(Collectors.toList())); + .collect(Collectors.toList()); errors.addAll(getBeanValidationErrors()); return errors; } diff --git a/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java b/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java index 73343d8312..54914f2287 100644 --- a/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java +++ b/server/src/main/java/com/vaadin/data/provider/HierarchyMapper.java @@ -96,7 +96,7 @@ public class HierarchyMapper<T, F> implements DataGenerator<T> { * */ public Integer getParentIndex(T item) { - // TODO: This can be optimised. + // TODO: This can be optimized. List<T> flatHierarchy = getHierarchy(null).collect(Collectors.toList()); return flatHierarchy.indexOf(getParentOfItem(item)); } |