On Sun, 29 Aug 2021 21:14:19 GMT, Andrey Turbanov 
<github.com+741251+turban...@openjdk.org> wrote:

> Usage of thread-safe collection Stack is unnecessary. It's recommended to use 
> ArrayDequeue if a thread-safe implementation is not needed.

Yeah. You are right! TIL that order of iteration is different in ArrayDequeu vs 
Stack: Stack.push() adds to the "end of stack" (it just calls Vector.add()), 
while ArrayDeque.push adds "first element"
Luckily for us there was only one place which depend on this. It's small method 
`javax.swing.text.html.HTMLDocument.HTMLReader#getPathTo`. I've changed method 
to use ArrayList instead.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5294

Reply via email to