harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Closed: (HARMONY-5446) [classlib][luni][java6] Arrays.binarySearch(Object[],Object) will throw ClassCastException while RI won't
Date Thu, 31 Jan 2008 09:33:34 GMT

     [ https://issues.apache.org/jira/browse/HARMONY-5446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Hindess closed HARMONY-5446.
---------------------------------

    Resolution: Invalid

It will be fixed by the business-as-usual merge of java 5 fix/test - which is correct thanks
to Stepan.  Please don't open JIRA for duplicates without good reason - it just creates confusion.


> [classlib][luni][java6] Arrays.binarySearch(Object[],Object) will throw ClassCastException
while RI won't
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-5446
>                 URL: https://issues.apache.org/jira/browse/HARMONY-5446
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sean Qiu
>            Assignee: Mark Hindess
>         Attachments: Harmony-5446.diff
>
>
> Harmony's Arrays.binarySearch(Object[],Object o) will throw ClassCastException when second
parameter does not implement Comparable interface.
> It means that RI will call compareTo from the first parameter rather than the second
parameter.
> Here is the test case
> ---------------------------------
> public class MethodTest extends TestCase {
> public void testMethod() throws Exception{
> Object object = new Object();
> Object[] objects = new MockComparable[] { new MockComparable() };
> assertEquals("Should always return 0", 0, Arrays.binarySearch(objects, object));
> }
> static class MockComparable implements Comparable{
> public int compareTo(Object o) {
> return 0;
> }
> }
> }
> ------------------------------
> Result:
> RI passed
> Harmony failed
> ------------------------------
> Java 5 relate: HARMONY-5443

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message