Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-5547

Javadoc for ReuseIfModelsEqualStrategy should mention that models must implement hashCode() method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0-M1, 6.15.0
    • Component/s: wicket
    • Labels:

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              svenmeier Sven Meier
              Reporter:
              chris.snyder Chris Snyder
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: