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.

Looks fine

Or maybe not, did you check that the order of pushing and the order of 
iteration for the stack and ArrayDeque are the same? I am not sure about it.

src/java.desktop/share/classes/com/sun/media/sound/DLSSoundbank.java line 34:

> 32: import java.io.OutputStream;
> 33: import java.net.URL;
> 34: import java.util.ArrayDeque;

Can we remove the Stack from the list of imports?

src/java.desktop/share/classes/javax/swing/text/html/HTMLDocument.java line 
2719:

> 2717:             }
> 2718:             Element[] retValue = new Element[elements.size()];
> 2719:             elements.toArray(retValue);

Same comment as in some other review, the copyInto and toArray works 
differently, it is better to use return elements.toArray(new Element[0]);

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

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

Reply via email to