aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-06-15 20:04:38 +0300
committerGitHub <noreply@github.com>2017-06-15 20:04:38 +0300
commit2c5dd49f00672b8df3c81609a9e82a04b9aabd03 (patch)
tree56d5cd81559f00487c3143981f41ac4af3f2c972 /server/src/main/java/com/vaadin
parent620b413478976474a00ddd368309931e7417b41b (diff)
downloadvaadin-framework-2c5dd49f00672b8df3c81609a9e82a04b9aabd03.tar.gz
vaadin-framework-2c5dd49f00672b8df3c81609a9e82a04b9aabd03.zip
Only throw from Binder.bindInstanceFields if there are no bindings at all (#9487)8.1.0.beta2
Fixes #8986
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r--server/src/main/java/com/vaadin/data/Binder.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/main/java/com/vaadin/data/Binder.java b/server/src/main/java/com/vaadin/data/Binder.java
index 98a9c65b2b..c36029aa83 100644
--- a/server/src/main/java/com/vaadin/data/Binder.java
+++ b/server/src/main/java/com/vaadin/data/Binder.java
@@ -2141,10 +2141,15 @@ public class Binder<BEAN> implements Serializable {
(property, type) -> bindProperty(objectWithMemberFields,
memberField, property, type)))
.reduce(0, this::accumulate, Integer::sum);
- if (numberOfBoundFields == 0) {
+ if (numberOfBoundFields == 0 && bindings.isEmpty()
+ && incompleteBindings.isEmpty()) {
+ // Throwing here for incomplete bindings would be wrong as they
+ // may be completed after this call. If they are not, setBean and
+ // other methods will throw for those cases
throw new IllegalStateException("There are no instance fields "
+ "found for automatic binding");
}
+
}
private boolean isFieldBound(Field memberField,