You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Chris Snyder (JIRA)" <ji...@apache.org> on 2014/03/28 12:07:18 UTC

[jira] [Created] (WICKET-5547) Javadoc for ReuseIfModelsEqualStrategy should mention that models must implement hashCode() method

Chris Snyder created WICKET-5547:
------------------------------------

             Summary: Javadoc for ReuseIfModelsEqualStrategy should mention that models must implement hashCode() method
                 Key: WICKET-5547
                 URL: https://issues.apache.org/jira/browse/WICKET-5547
             Project: Wicket
          Issue Type: Bug
          Components: wicket
            Reporter: Chris Snyder
            Priority: Trivial


According to the Javadoc for ReuseIfModelsEqualStrategy:
"Reuse strategy that will reuse an old item if its model is equal to a model inside the newModels iterator..."
"Notice that the model and not the model object needs to implement the equals * method..."

However, in addition to overriding the equals() method, models must also override the hashCode() method in order to work properly. While it's always good practice to override hashCode() when overriding equals(), the Javadoc for ReuseIfModelsEqualStrategy could be updated to mention this requirement.



--
This message was sent by Atlassian JIRA
(v6.2#6252)