Casey Marshall wrote:
On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote:

Hey guys

java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as shown in ComparatorTest.java. Arrays.patch fixes it.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30061


This exact problem bit me once. I developed code on the RI that inadvertently had a comparator that depended on the order of the arguments.

I freely admit that my code was incorrect, but it did take me a while to figure out what was happening.

I feel that if there is no performance penalty, then we should follow the behavior of the RI.

David Daney.

Reply via email to