You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <de...@uima.apache.org> on 2017/03/02 15:04:45 UTC

[jira] [Created] (UIMA-5346) sort compare method not following contract, sometimes get IllegalArgExcptn

Marshall Schor created UIMA-5346:
------------------------------------

             Summary: sort compare method not following contract, sometimes get IllegalArgExcptn
                 Key: UIMA-5346
                 URL: https://issues.apache.org/jira/browse/UIMA-5346
             Project: UIMA
          Issue Type: Bug
          Components: Core Java Framework
            Reporter: Marshall Schor
            Assignee: Marshall Schor
             Fix For: 3.0.0SDK-alpha02


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.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)