Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v3]
> 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. > 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 > 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) > java.management Andrey Turbanov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: - Merge remote-tracking branch 'origin/master' into cleanup_use_enhanced-for_in_jdk.internal.jvmstat # Conflicts: # src/jdk.internal.jvmstat/share/classes/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java - 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat update copyright - [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=5580=02 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
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v2]
On Tue, 28 Sep 2021 07:32:47 GMT, Andrey Turbanov wrote: >> 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. >> 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 >> 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) >> java.management > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat > update copyright Can someone sponsor the changes please? - PR: https://git.openjdk.java.net/jdk/pull/5580
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v2]
On Tue, 28 Sep 2021 07:32:47 GMT, Andrey Turbanov wrote: >> 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. >> 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 >> 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) >> java.management > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat > update copyright Looks good. Thanks, Serguei - Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5580
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v2]
On Tue, 28 Sep 2021 07:32:47 GMT, Andrey Turbanov wrote: >> 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. >> 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 >> 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) >> java.management > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat > update copyright Marked as reviewed by amenkov (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5580
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v2]
On Tue, 28 Sep 2021 07:32:47 GMT, Andrey Turbanov wrote: >> 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. >> 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 >> 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) >> java.management > > Andrey Turbanov has updated the pull request incrementally with one > additional commit since the last revision: > > 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat > update copyright Marked as reviewed by cjplummer (Reviewer). - PR: https://git.openjdk.java.net/jdk/pull/5580
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat [v2]
> 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. > 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 > 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) > java.management Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat update copyright - Changes: - all: https://git.openjdk.java.net/jdk/pull/5580/files - new: https://git.openjdk.java.net/jdk/pull/5580/files/7967fb43..5ecf5960 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk=5580=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk=5580=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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
Re: RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat
On Mon, 20 Sep 2021 08:15:13 GMT, Andrey Turbanov wrote: > 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. > 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 > 4. [JDK-8274318](https://bugs.openjdk.java.net/browse/JDK-8274318) > java.management You need a copyright update in TypeCode.java. Otherwise the changes look good. - Marked as reviewed by cjplummer (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5580
RFR: 8274395: Use enhanced-for instead of plain 'for' in jdk.internal.jvmstat
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=5580=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