From aa225cce86d34fc656e091f5eb62f73d17351345 Mon Sep 17 00:00:00 2001 From: Ahmed Ashour Date: Mon, 18 Sep 2017 19:47:48 +0200 Subject: Remove unneeded ArrayList construction --- server/src/main/java/com/vaadin/data/BinderValidationStatus.java | 8 ++++---- server/src/main/java/com/vaadin/data/ValidationException.java | 4 ++-- .../src/main/java/com/vaadin/data/provider/HierarchyMapper.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server') 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 implements Serializable { * @return a list of all validation errors */ public List getValidationErrors() { - ArrayList errors = new ArrayList<>( + List 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 implements Serializable { /** * Gets the field level validation statuses. *

- * 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 implements Serializable { /** * Gets the failed field level validation statuses. *

- * 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 getValidationErrors() { - ArrayList errors = new ArrayList<>( + List 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 implements DataGenerator { * */ public Integer getParentIndex(T item) { - // TODO: This can be optimised. + // TODO: This can be optimized. List flatHierarchy = getHierarchy(null).collect(Collectors.toList()); return flatHierarchy.indexOf(getParentOfItem(item)); } -- cgit v1.2.3