RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat
Andrey Turbanov
github.com+741251+turbanoff at openjdk.java.net
Mon Sep 27 19:48:14 UTC 2021
There are few places in code where manual `for` loop is used with Iterator to iterate over Collection or Array.
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.
-------------
Commit messages:
- [PATCH] Use enhanced-for instead of plain for in jdk.internal.jvmstat
Changes: https://git.openjdk.java.net/jdk/pull/5580/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5580&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8274395
Stats: 49 lines in 7 files changed: 3 ins; 11 del; 35 mod
Patch: https://git.openjdk.java.net/jdk/pull/5580.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5580/head:pull/5580
PR: https://git.openjdk.java.net/jdk/pull/5580
More information about the serviceability-dev
mailing list