summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/declarative/FieldBinder.java
diff options
context:
space:
mode:
authorMatti Hosio <mhosio@vaadin.com>2014-12-17 14:08:59 +0200
committerArtur Signell <artur@vaadin.com>2014-12-17 12:51:14 +0000
commit6d75a89e8d16e0fd1370fe080a5b5b78d1f4679d (patch)
tree0a7224c3008b3dca20b4de453cb346554be1735c /server/src/com/vaadin/ui/declarative/FieldBinder.java
parent7818595589e73b3da119d3c51e3950515f900bb6 (diff)
downloadvaadin-framework-6d75a89e8d16e0fd1370fe080a5b5b78d1f4679d.tar.gz
vaadin-framework-6d75a89e8d16e0fd1370fe080a5b5b78d1f4679d.zip
Do not throw exception when trying to bind a preinitialized instance field (#7749)
Change-Id: I8b40e667d03b63e05f006e7cedf108345591d118
Diffstat (limited to 'server/src/com/vaadin/ui/declarative/FieldBinder.java')
-rw-r--r--server/src/com/vaadin/ui/declarative/FieldBinder.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/server/src/com/vaadin/ui/declarative/FieldBinder.java b/server/src/com/vaadin/ui/declarative/FieldBinder.java
index af82d9c58c..fcc78db414 100644
--- a/server/src/com/vaadin/ui/declarative/FieldBinder.java
+++ b/server/src/com/vaadin/ui/declarative/FieldBinder.java
@@ -135,8 +135,6 @@ public class FieldBinder implements Serializable {
/**
* Tries to bind the given {@link Component} instance to a member field of
* the bind target. The fields are matched based on localId, id and caption.
- * If a field is already bound (not null), {@link FieldBindingException} is
- * thrown.
*
* @param instance
* the instance to be bound to a field
@@ -197,14 +195,13 @@ public class FieldBinder implements Serializable {
Object fieldValue = ReflectTools.getJavaFieldValue(bindTarget,
field);
if (fieldValue != null) {
- getLogger().severe(
- "The field with identifier \"" + identifier
- + "\" already mapped");
- throw new FieldBindingException(
- "Duplicate identifier found for a field: " + fieldName);
+ getLogger().fine(
+ "The field \"" + fieldName
+ + "\" was already mapped. Ignoring.");
+ } else {
+ // set the field value
+ ReflectTools.setJavaFieldValue(bindTarget, field, instance);
}
- // set the field value
- ReflectTools.setJavaFieldValue(bindTarget, field, instance);
return true;
} catch (IllegalAccessException e) {
throw new FieldBindingException("Field binding failed", e);