aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-02-20 17:25:13 +0200
committerHenri Sara <henri.sara@gmail.com>2017-02-27 11:25:50 +0200
commit4974d6923f4ab4c42028ce7f7a6d3d6ec1c93437 (patch)
tree931f752f826dc7a88d2370c9263ce5a30cc54e6f /server
parent0d348f509c518af88e6320ef6f2b3d9a8e935168 (diff)
downloadvaadin-framework-4974d6923f4ab4c42028ce7f7a6d3d6ec1c93437.tar.gz
vaadin-framework-4974d6923f4ab4c42028ce7f7a6d3d6ec1c93437.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.java6
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.");
}
});
}