Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-2417

Fix IndexCommit hashCode() and equals() to be consistent

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.9.3, 3.0.2, 3.1, 4.0-ALPHA
    • core/index
    • None
    • New, Patch Available

    Description

      IndexCommit's impl of hashCode() and equals() is inconsistent. One uses Dir + version and the other uses Dir + equals. According to hashCode()'s javadoc, if o1.equals(o2), then o1.hashCode() == o2.hashCode(). Simple fix, and I'll add a test case.

      Attachments

        1. LUCENE-2417.patch
          5 kB
          Shai Erera

        Activity

          shaie Shai Erera added a comment -

          Fixes hashCode() to use getVersion and adds TestIndexCommit. All tests pass. I plan to commit shortly.

          shaie Shai Erera added a comment - Fixes hashCode() to use getVersion and adds TestIndexCommit. All tests pass. I plan to commit shortly.
          shaie Shai Erera added a comment -

          Committed revision 938989.

          shaie Shai Erera added a comment - Committed revision 938989.
          shaie Shai Erera added a comment -

          Backport to 3.1

          shaie Shai Erera added a comment - Backport to 3.1
          shaie Shai Erera added a comment -

          Committed revision 941394.

          shaie Shai Erera added a comment - Committed revision 941394.

          backport

          mikemccand Michael McCandless added a comment - backport
          tomoko Tomoko Uchida added a comment -

          This issue was moved to GitHub issue: #3492.

          tomoko Tomoko Uchida added a comment - This issue was moved to GitHub issue: #3492 .

          People

            shaie Shai Erera
            shaie Shai Erera
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: