On Sat, 25 Sep 2021 10:51:12 GMT, Andrey Turbanov 
<github.com+741251+turban...@openjdk.org> wrote:

> There are a few places in code, where manual `for` loop is used with Iterator 
> to iterate over Collection.
> Instead of manual `for` cycles, it's preferred to use enhanced-for cycle 
> instead: it's less verbose, makes code easier to read and it's less 
> error-prone.
> It doesn't have any performance impact: javac compiler generates similar code 
> when compiling enhanced-for cycle.
> Similar cleanups:
> 1. [JDK-8274016](https://bugs.openjdk.java.net/browse/JDK-8274016) 
> java.desktop
> 2. [JDK-8274237](https://bugs.openjdk.java.net/browse/JDK-8274237) java.base
> 3. [JDK-8274261](https://bugs.openjdk.java.net/browse/JDK-8274261) jdk.jcmd

This pull request has now been integrated.

Changeset: 9945f7a0
Author:    Andrey Turbanov <turban...@gmail.com>
Committer: Daniel Fuchs <dfu...@openjdk.org>
URL:       
https://git.openjdk.java.net/jdk/commit/9945f7a0744db2470bcfa856e8f831b6a6eb2de8
Stats:     19 lines in 3 files changed: 0 ins; 10 del; 9 mod

8274318: Replace 'for' cycles with iterator with enhanced-for in java.management

Reviewed-by: cjplummer, sspitsyn, dfuchs

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

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

Reply via email to