harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-6139) [classlib][luni][java6] java.util.Arrays.binarySearch(short[] array, int startIndex, int endIndex, short value) should return (-(insertion point) - 1) rather than -1 if value is not found in the given range
Date Tue, 15 Dec 2009 06:29:18 GMT

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

Ray Chen updated HARMONY-6139:
------------------------------

    Attachment: Harmony6139_v2.diff

There are some bugs in the patch of 1st version, fixed in 2nd version

> [classlib][luni][java6] java.util.Arrays.binarySearch(short[] array, int startIndex,
int endIndex, short value) should return (-(insertion point) - 1) rather than -1 if value
is not found in the given range
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6139
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6139
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M8
>            Reporter: Kevin Zhou
>             Fix For: 5.0M9
>
>         Attachments: Harmony6139.diff, Harmony6139_v2.diff
>
>
> Given a test case [1] below, RI passes while HY6 fails.
> The testcase is used to test the binarySearch(short[] array, int startIndex, int endIndex,
short value) of java.util.Arrays class.
> According to java spec, if the given value is not found in the given range of array,
this method should return (-(insertion point) - 1) rather than -1.
> Here, "insertion point" is defined as the point at which the key would be inserted into
the array or endIndex if all elements in the range are less than the specified key. And HY6
doesn't implement this.
> [1] Test Case:
> public void test_Arrays_binaraySearch_short() {
>     assertEquals(-2, Arrays.binarySearch(new short[] { (short) -1 }, 1, 1, (short)0));
> }

-- 
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