Lucene - Core
  1. Lucene - Core
  2. LUCENE-828

Term's equals() throws ClassCastException if passed something other than a Term

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Term.equals(Object) does a cast to Term without checking if the other object is a Term.

      It's unlikely that this would ever crop up but it violates the implied contract of Object.equals().

        Activity

        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12562294 ] jira [ 12583296 ]
        Mark Thomas made changes -
        Workflow jira [ 12399048 ] Default workflow, editable Closed status [ 12562294 ]
        Otis Gospodnetic made changes -
        Resolution Fixed [ 1 ]
        Lucene Fields [Patch Available, New] [New, Patch Available]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Otis Gospodnetic added a comment -

        Patch applied, thanks Paul!

        Show
        Otis Gospodnetic added a comment - Patch applied, thanks Paul!
        Paul Cowan made changes -
        Field Original Value New Value
        Attachment termequals.patch [ 12352901 ]
        Hide
        Paul Cowan added a comment -

        Amendment to .equals() to deal with non-Term objects.

        Also includes standard performance optimisation in the case that the two objects are identity-equal, and a test case (the last assertion of which fails on current trunk, but passes after patch is applies to Term).

        Show
        Paul Cowan added a comment - Amendment to .equals() to deal with non-Term objects. Also includes standard performance optimisation in the case that the two objects are identity-equal, and a test case (the last assertion of which fails on current trunk, but passes after patch is applies to Term).
        Paul Cowan created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Paul Cowan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development