[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Re: RFR: 8274261: Use enhanced-for instead of plain 'for' in jdk.jcmd
From:       Chris Plummer <cjplummer () openjdk ! java ! net>
Date:       2021-09-27 21:44:03
Message-ID: thZvOOrNav25AcNorj1VEWGkcZnvdfYWdu8SH20iYJ0=.2add2024-26f6-41f6-abf2-43f81b30fdc7 () github ! com
[Download RAW message or body]

On Fri, 24 Sep 2021 07:30:02 GMT, Andrey Turbanov \
<github.com+741251+turbanoff@openjdk.org> 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. 
> One strange thing I also noticed is static field \
> `sun.tools.jstat.Parser#reservedWords`, which filled in `Parser` constructor. \
> Reworked to initialize it once.

Marked as reviewed by cjplummer (Reviewer).

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic