From a720d998f5241fc71050b29a00cfc120ba8c7620 Mon Sep 17 00:00:00 2001 From: Artur Date: Mon, 20 Feb 2017 17:25:13 +0200 Subject: Use an informative exception message when Binder is incorrectly constructed (#8631) --- server/src/main/java/com/vaadin/data/Binder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server') 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 implements Serializable { @Override public Stream> 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 beanType) constructor instead."); } @Override public Optional> 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 beanType) constructor instead."); } }); } -- cgit v1.2.3