RFR: Here are some URLClassPath patches

Peter Levart peter.levart at gmail.com
Wed Feb 21 11:39:37 UTC 2018


Hi Martin,

I checked this one...

On 02/21/2018 07:08 AM, Martin Buchholz wrote:
> 8198484: URLClassPath should use an ArrayDeque instead of a Stack
> http://cr.openjdk.java.net/~martin/webrevs/jdk/URLClassPath-ArrayDeque/
> https://bugs.openjdk.java.net/browse/JDK-8198484

I admit I had to study the Stack API first as I don't regularly use it 
nowadays ;-). You seem to be using the following replacements consistently:

Stack vs. ArrayDequeue

push(e) vs. addFirst(e)
add(0, e) vs. addLast(e)
isEmpty() / pop() vs. pollFirst()

...but then in push(URL[]), you use:

push(e) vs. push(e)

Deque.addFirst(e) is equivalent to Deque.push(e), but it would be nice 
to keep using the same method consistently in one class.


Regards, Peter



More information about the core-libs-dev mailing list