RFR: Here are some URLClassPath patches

mandy chung mandy.chung at oracle.com
Mon Feb 26 23:38:43 UTC 2018



On 2/26/18 3:26 PM, Martin Buchholz wrote:
>
>
>     Looks okay.  I also think no need to have a separate
>     copyToArrayDeque method and just inline in the constructor.
>
>
> It's used twice.  Also, it's likely to be replaced someday when we 
> decide what to do with lambdas, so good to keep as a separate method.

The first use can be replaced with very simple code:

ArrayList<URL> path = new ArrayList<>(urls.length);
ArrayDeque<T> unopenedUrls = new ArrayDeque<>(urls.length);
for (URL url : urls) {
     path.add(url);
     unopenedUrls.add(url);
}

Mandy



More information about the core-libs-dev mailing list