summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/AbstractField.java
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-09-24 14:41:56 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2012-09-24 15:02:12 +0300
commitdda62594f56e12590c5a3517585ad529e2df5c56 (patch)
treed984914b85e996b379ca09ff56d1e59b621712bd /server/src/com/vaadin/ui/AbstractField.java
parent8c11021ab84fec373f0c27e3a9b87b4d7e5b049e (diff)
downloadvaadin-framework-dda62594f56e12590c5a3517585ad529e2df5c56.tar.gz
vaadin-framework-dda62594f56e12590c5a3517585ad529e2df5c56.zip
Return an empty collection instead of null from Validatable.getValidators() (#9723)
Diffstat (limited to 'server/src/com/vaadin/ui/AbstractField.java')
-rw-r--r--server/src/com/vaadin/ui/AbstractField.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java
index e7d6d9a4ec..7fc5252eee 100644
--- a/server/src/com/vaadin/ui/AbstractField.java
+++ b/server/src/com/vaadin/ui/AbstractField.java
@@ -776,15 +776,16 @@ public abstract class AbstractField<T> extends AbstractComponent implements
/**
* Gets the validators of the field.
*
- * @return the Unmodifiable collection that holds all validators for the
+ * @return An unmodifiable collection that holds all validators for the
* field.
*/
@Override
public Collection<Validator> getValidators() {
- if (validators == null || validators.isEmpty()) {
- return null;
+ if (validators == null) {
+ return Collections.emptyList();
+ } else {
+ return Collections.unmodifiableCollection(validators);
}
- return Collections.unmodifiableCollection(validators);
}
/**