Fix: invert the "natural" order when ordering by id lexicographically

This commit is contained in:
Giambattista Bloisi 2024-02-24 16:54:30 +01:00
parent fe70caa33c
commit d175a9745f
2 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@ public class MergeEntitiesComparator implements Comparator<Oaf> {
// id
if (res == 0) {
if (left instanceof OafEntity && right instanceof OafEntity) {
res = ((OafEntity) left).getId().compareTo(((OafEntity) right).getId());
res = ((OafEntity) right).getId().compareTo(((OafEntity) left).getId());
}
}

View File

@ -200,7 +200,7 @@ public class SparkPublicationRootsTest2 implements Serializable {
assertEquals("2022-01-01", root.getDateofacceptance().getValue());
assertEquals(crossref_duplicate.getJournal().getName(), root.getJournal().getName());
assertEquals(crossref_duplicate.getJournal().getIssnPrinted(), root.getJournal().getIssnPrinted());
// assertEquals(crossref_duplicate.getPublisher().getValue(), root.getPublisher().getValue());
assertEquals(crossref_duplicate.getPublisher().getValue(), root.getPublisher().getValue());
Set<String> rootPids = root
.getPid()