On Mon, Feb 26, 2018 at 3:38 PM, mandy chung <mandy.ch...@oracle.com> wrote:
> > > 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); > } > > I had trouble deciding which way was better, so let's do it your way! toArrayDeque is gone.