RFR: 8295670: Remove duplication in java/util/Formatter/Basic*.java [v2]
Justin Lu
duke at openjdk.org
Mon Oct 31 17:50:47 UTC 2022
On Sat, 29 Oct 2022 18:05:50 GMT, Сергей Цыпанов <duke at openjdk.org> wrote:
>> Justin Lu has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove old ids hack, has no usage
>
> test/jdk/java/util/Formatter/Basic-X.java.template line 1608:
>
>> 1606: // time zone ID. See JDK-8254865.
>> 1607: final List<String> list = new ArrayList<String>();
>> 1608: Collections.addAll(list, ids);
>
> I think
>
> final List<String> list = new ArrayList<>(Arrays.asList(ids));
>
> is going to be faster than
>
> final List<String> list = new ArrayList<String>();
> Collections.addAll(list, ids);
>
> Alternatively you can contruct presized ArrayList.
Thank you,
I will be removing this portion since it is outdated. But I will consider this and your other comment for future uses of List and ArrayList :-)
-------------
PR: https://git.openjdk.org/jdk/pull/10910
More information about the core-libs-dev
mailing list