On Fri, 8 Oct 2021 19:37:35 GMT, Andrey Turbanov <d...@openjdk.java.net> wrote:
> Cycles with 'Iterator' are error-prone. It's better to use more high-level > code, which easier to read. > We can use enhanced-for or Collection.removeIf src/java.desktop/share/classes/javax/swing/JDesktopPane.java line 330: > 328: public JInternalFrame[] getAllFramesInLayer(int layer) { > 329: Collection<JInternalFrame> allFrames = getAllFrames(this); > 330: allFrames.removeIf(jInternalFrame -> jInternalFrame.getLayer() > != layer); This line is longer than 80 char, you can rename jInternalFrame to the frame. src/java.desktop/unix/classes/sun/awt/X11/ListHelper.java line 569: > 567: > 568: private boolean isItemSelected(int index) { > 569: for (Integer val : selected) { In some other places you did unboxing for the loop var, why not in this place? ------------- PR: https://git.openjdk.java.net/jdk/pull/5871