Skip to content

Commit bdba447

Browse files
committed
[refactor] Processed feedback review (repair build) java21 upgrade
1 parent 584a93a commit bdba447

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

exist-core/src/main/java/org/exist/xquery/value/ItemComparator.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,16 @@ public ItemComparator(@Nullable final Collator collator) {
6666
}
6767

6868
@Override
69-
public int compare(final Item left, final Item right) {
70-
return switch (left) {
71-
case AtomicValue atomicValue when right instanceof AtomicValue -> {
69+
public int compare(final Item n1, final Item n2) {
70+
return switch (n1) {
71+
case NodeImpl node when (!(n2 instanceof org.exist.dom.memtree.NodeImpl)) -> Constants.INFERIOR;
72+
case AtomicValue atomicValue when n2 instanceof AtomicValue -> {
7273
if (atomicValueComparator == null) {
7374
atomicValueComparator = new AtomicValueComparator(collator);
7475
}
75-
yield atomicValueComparator.compare(atomicValue, (AtomicValue) right);
76+
yield atomicValueComparator.compare(atomicValue, (AtomicValue) n2);
7677
}
77-
case Comparable comparable -> comparable.compareTo(right);
78+
case Comparable comparable -> comparable.compareTo(n2);
7879
case null, default -> Constants.INFERIOR;
7980
};
8081
}

0 commit comments

Comments
 (0)