Lucene - Core
  1. Lucene - Core
  2. LUCENE-2417

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9.3, 3.0.2, 3.1, 4.0-ALPHA
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      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.

        Activity

        Hide
        Shai Erera added a comment -

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

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

        Committed revision 938989.

        Show
        Shai Erera added a comment - Committed revision 938989.
        Hide
        Shai Erera added a comment -

        Backport to 3.1

        Show
        Shai Erera added a comment - Backport to 3.1
        Hide
        Shai Erera added a comment -

        Committed revision 941394.

        Show
        Shai Erera added a comment - Committed revision 941394.
        Hide
        Michael McCandless added a comment -

        backport

        Show
        Michael McCandless added a comment - backport

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development