diff options
author | Artur <artur@vaadin.com> | 2017-02-20 17:25:13 +0200 |
---|---|---|
committer | Aleksi Hietanen <aleksi@vaadin.com> | 2017-02-20 17:25:13 +0200 |
commit | a720d998f5241fc71050b29a00cfc120ba8c7620 (patch) | |
tree | 45c5251ac2d731ddc8fc6f3c5a1858a7f74107fc /server | |
parent | 02666227a2550b8e918dbc86f7c59ec7b1daff05 (diff) | |
download | vaadin-framework-a720d998f5241fc71050b29a00cfc120ba8c7620.tar.gz vaadin-framework-a720d998f5241fc71050b29a00cfc120ba8c7620.zip |
Use an informative exception message when Binder is incorrectly constructed (#8631)
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/data/Binder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java index 50bb182920..d678bdd321 100644 --- a/server/src/main/java/com/vaadin/data/Binder.java +++ b/server/src/main/java/com/vaadin/data/Binder.java @@ -1110,14 +1110,16 @@ public class Binder<BEAN> implements Serializable { @Override public Stream<PropertyDefinition<BEAN, ?>> getProperties() { throw new IllegalStateException( - "A Binder created with the default constructor doesn't support listing properties."); + "This Binder instance was created using the default constructor. " + + "To be able to use property names and bind to instance fields, create the binder using the Binder(Class<BEAN> beanType) constructor instead."); } @Override public Optional<PropertyDefinition<BEAN, ?>> getProperty( String name) { throw new IllegalStateException( - "A Binder created with the default constructor doesn't support finding properties by name."); + "This Binder instance was created using the default constructor. " + + "To be able to use property names and bind to instance fields, create the binder using the Binder(Class<BEAN> beanType) constructor instead."); } }); } |