[8u] RFR 8214687: Optimize Collections.nCopies().hashCode() and equals()
Aleksey Shipilev
shade at redhat.com
Wed Jul 31 09:02:39 UTC 2019
On 7/16/19 9:25 AM, Andrew John Hughes wrote:
> On 15/07/2019 09:27, Aleksey Shipilev wrote:
>> On 7/2/19 9:53 PM, Aleksey Shipilev wrote:
>>> Original RFE:
>>> https://bugs.openjdk.java.net/browse/JDK-8214687
>>> https://hg.openjdk.java.net/jdk/jdk/rev/cfceb4df2499
>>>
>>> Patch applies with usual reshufflings. But the test parts require touchups to compile and run on 8u:
>>> type inference is not that rich, and there is no Objects.checkIndex. 8u webrev:
>>> https://cr.openjdk.java.net/~shade/8214687/webrev.8u.01/
>
> Objects.checkIndex is simply a wrapper around Preconditions.checkIndex:
>
> public static
> int checkIndex(int index, int length) {
> return Preconditions.checkIndex(index, length, null);
> }
>
> which is in 8u. Probably worth adding the 2-argument version to
> Preconditions.
Getting back to this. Since we have moved Preconditions to private location in 8u, using it is
impossible for this patch. So, I would keep the webrev as is:
https://cr.openjdk.java.net/~shade/8214687/webrev.8u.01
It is approved for 8u and 11u push, so if there are no other comments, I would push the fix shortly.
--
Thanks,
-Aleksey
More information about the jdk8u-dev
mailing list