-
Notifications
You must be signed in to change notification settings - Fork 397
Closed
Labels
bugBugs and bugfixesBugs and bugfixes
Description
Reproduce the problem with:
Structure pdb = StructureIO.getStructure("BIO:5TLS:1");
Fails with exception "Comparison method violates its general contract!". The problem is in the code below, which returns 0 ("equal") if transformation IDs are not equal, which leads in this particular case to
...
JA=HA
HA=GA
JA > GA
(and probably other contradictions, but here it breaks). Comparators in Java must establish total order.
Lines 143 to 148 in 8a7b651
| public int compare(BiologicalAssemblyTransformation t1, BiologicalAssemblyTransformation t2) { | |
| // set sort order only if the two ids are identical | |
| if (t1.getId().equals(t2.getId())) { | |
| return chainIds.indexOf(t1.getChainId()) - chainIds.indexOf(t2.getChainId()); | |
| } | |
| return 0; |
lafita
Metadata
Metadata
Assignees
Labels
bugBugs and bugfixesBugs and bugfixes