Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
Windows XP
-
Novice
Description
Harmony: classlib + VM revision 421248
If we try to find a non-comparable item in an empty array, RI returns -1 while Harmony throws ClassCastException.
Code to reproduce:
import java.util.*;
public class Test {
public static void main (String[] args) {
System.err.println(Arrays.binarySearch(new Object[] {}, new Object()) == -1 ? "PASSED" : "FAILED");
}
}
-------
Please see the patch with unit test for this case and fix for classlib code attached