aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/data
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-05-11 06:13:55 +0000
committerArtur Signell <artur.signell@itmill.com>2010-05-11 06:13:55 +0000
commit08e2ffc2b52b36fcd18434116d717bbd4de96007 (patch)
tree99f147a6e022344e3636a675e25fc51db46d6b15 /src/com/vaadin/data
parentf1ba50a99884baa7d38e401b1fdc1f2976c564ba (diff)
downloadvaadin-framework-08e2ffc2b52b36fcd18434116d717bbd4de96007.tar.gz
vaadin-framework-08e2ffc2b52b36fcd18434116d717bbd4de96007.zip
Clarified why hashCode/equals must be implemented in a certain way
svn changeset:13136/svn branch:6.4
Diffstat (limited to 'src/com/vaadin/data')
-rw-r--r--src/com/vaadin/data/util/BeanItemContainer.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/vaadin/data/util/BeanItemContainer.java b/src/com/vaadin/data/util/BeanItemContainer.java
index b39929ff21..6d62e892ea 100644
--- a/src/com/vaadin/data/util/BeanItemContainer.java
+++ b/src/com/vaadin/data/util/BeanItemContainer.java
@@ -37,11 +37,13 @@ import com.vaadin.data.Property.ValueChangeNotifier;
* </p>
*
* <p>
- * BeanItemContainer uses the beans themselves as identifiers. For this reason,
- * they should implement {@link Object#equals(Object)} and
- * {@link Object#hashCode()}. The {@link Object#equals(Object)} implementation
- * should be stable and not depend on the contents of the bean as this may cause
- * problems when the bean is updated.
+ * BeanItemContainer uses the beans themselves as identifiers. The
+ * {@link Object#hashCode()} of a bean is used when storing and looking up beans
+ * so it must not change during the lifetime of the bean. Typically this
+ * restricts the implementation of {@link Object#equals(Object)} as well so it
+ * does not depend on the contents of the bean. This is not strictly needed but
+ * the contract between {@code equals()} and {@code hashCode()} must be
+ * fulfilled.
* </p>
*
* <p>