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

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

     [ https://issues.apache.org/jira/browse/WICKET-5547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-5547.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 6.15.0
                   7.0.0
         Assignee: Sven Meier

Thanks!

> 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
>            Assignee: Sven Meier
>            Priority: Trivial
>              Labels: javadoc
>             Fix For: 7.0.0, 6.15.0
>
>
> 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)