This fixes issue 887, and is essentially sandymac's patch with comments and test cases.
This change is in /changes/jat/jre-binarysearch and was forked from r841. You can switch a clean working copy to it with:
or you can merge the changes into a recent trunk with:
Otherwise, looks great to me.
--
Sandy McArthur
"He who dares not offend cannot be honest."
- Thomas Paine
For the binarySearch(Object[], Object) version, the "official" term
for "default comparison function" is "natural ordering".
I found two emulation bugs in this code that was committed described
in comment 7 and 8 of issue 887:
http://code.google.com/p/google-web-toolkit/issues/detail?id=887#c7
I've included a fix for these and added Collections.binarySearch
methods in a patch attached to issue 1018:
http://code.google.com/p/google-web-toolkit/issues/detail?id=1018