Skip to content

Commit 0f6aa3f

Browse files
JavaSaBrCopilot
andauthored
Update rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractMutableArray.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 5d68f41 commit 0f6aa3f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rlib-collections/src/main/java/javasabr/rlib/collections/array/impl/AbstractMutableArray.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ protected void sortInternalArray(@Nullable E[] array, int size) {
243243
Comparable[] wrapped = (Comparable[]) array;
244244
Arrays.sort(wrapped, 0, size, Comparator.naturalOrder());
245245
} else {
246-
Arrays.sort(array, 0, size, Comparator.comparingInt(ObjectUtils::hash));
246+
throw new IllegalStateException(
247+
"Cannot sort array of non-Comparable elements without an explicit comparator");
247248
}
248249
}
249250

0 commit comments

Comments
 (0)