Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-5346

sort compare method not following contract, sometimes get IllegalArgExcptn

    XMLWordPrintableJSON

Details

    Description

      BinaryCasSerDes6 has a method used for sort comparison. At one point in testing, a test case threw an IllegalArgumentException from TimSort, one of the implementations of sort in Java, where it determined some invalid state due to the sortCompare not obeying the contract.

      This could be due to equals(fs1, fs2) == false and sortCompare(fs1, fs2) == 0.

      Fix this in two places: Add equals method for FeatureStructureImplC that returns 0 if the _id fields are the same. This matches the hashcode for that.

      Change the sortCompare function to only return 0 if the id's are the same.

      Attachments

        Activity

          People

            schor Marshall Schor
            schor Marshall Schor
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: