Some of the data structures in the regalloc package don't obey the contracts of equals(), hashCode() and compareTo().
- BasicInterval and MappedBasicInterval implement equals() but not hashCode()
- equals() isn't symmetric between BasicInterval and MappedBasicInterval
- StartComparator in IncreasingStartIntervalSet would consider instances of MappedBasicInterval and BasicInterval equivalent even if a correct equals() implementation would return false. The same applies for the comparators in IncreasingEndMappedIntervalSet and IncreasingStartMappedIntervalSet
Moreover, IncreasingStartMappedIntervalSet is currently unused. BasicInterval is only used as an internal helper class.
We should refactor and/or redesign the data structures to ensure that they work correctly. After that, the documentation needs to be updated. Unit tests would also be very helpful.