RFR: 8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

2021-09-02 Thread Andrey Turbanov
There are few places in code where manual while loop is used with Iterator to iterate over Collection. Instead of manual while 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: j

Re: RFR: 8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

2021-09-02 Thread Andrey Turbanov
On Wed, 1 Sep 2021 07:37:53 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read a

Re: RFR: 8273243: Fix indentations in java.net.InetAddress methods [v2]

2021-09-02 Thread Daniel Fuchs
On Wed, 1 Sep 2021 23:11:53 GMT, Aleksei Efimov wrote: >> Hi, >> >> The fix changes indentations in the following `java.net.InetAddress` methods: >> - getAddressesFromNameService >> - getHostFromNameService >> >> It helps to improve code readability. Can't say the same about >> `getHostFromNam

Re: RFR: 8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

2021-09-02 Thread Daniel Fuchs
On Wed, 1 Sep 2021 07:37:53 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read a

Integrated: 8273243: Fix indentations in java.net.InetAddress methods

2021-09-02 Thread Aleksei Efimov
On Wed, 1 Sep 2021 16:53:50 GMT, Aleksei Efimov wrote: > Hi, > > The fix changes indentations in the following `java.net.InetAddress` methods: > - getAddressesFromNameService > - getHostFromNameService > > It helps to improve code readability. Can't say the same about > `getHostFromNameService

Re: RFR: 8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

2021-09-02 Thread Roger Riggs
On Wed, 1 Sep 2021 07:37:53 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read a

Re: RFR: 8238274: (sctp) JDK-7118373 is not fixed for SctpChannel

2021-09-02 Thread Daniel Fuchs
On Fri, 27 Aug 2021 08:37:46 GMT, Masanori Yano wrote: > Please review this change to the Unix implementations of > sun.nio.ch.sctp.Sctp*ChannelImpl#implCloseSelectableChannel() > to be same as SocketChannelImpl at JDK-7118373. (The preClose is missing a > check for the ST_KILLED state.) I ha

Re: RFR: 8263364: sun/net/www/http/KeepAliveStream/KeepAliveStreamCloseWithWrongContentLength.java wedged in getInputStream [v5]

2021-09-02 Thread Daniel Fuchs
On Wed, 7 Jul 2021 12:55:32 GMT, Ivan Šipka wrote: >> @dfuch could you please review, thank you. > > Ivan Šipka has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains seven commits: > > - 8263364: output > - 8263364: removing surplus i

Re: RFR: 8273261: Replace 'while' cycles with iterator with enhanced-for in java.base

2021-09-02 Thread Iris Clark
On Wed, 1 Sep 2021 07:37:53 GMT, Andrey Turbanov wrote: > There are few places in code where manual while loop is used with Iterator to > iterate over Collection. > Instead of manual while cycles it's preferred to use enhanced-for cycle > instead: it's less verbose, makes code easier to read a

RFR: JDK-8273142 : Remove dependancy of TestHttpServer, HttpTransaction, HttpCallback from open/test/jdk/sun/net/www/protocol/http/ tests

2021-09-02 Thread Mahendra Chhipa
Dependencies of TestHttpServre, HttpTransaction, HttpCallback are removed from following tests: open/test/jdk/sun/net/www/protocol/http/ResponseCacheStream.java open/test/jdk/sun/net/www/protocol/http/SetChunkedStreamingMode.java open/test/jdk/sun/net/www/protocol/http/RelativeRedirect.java open/t

Integrated: 8272805: Avoid looking up standard charsets

2021-09-02 Thread Sergey Bylokhov
On Sun, 22 Aug 2021 02:53:44 GMT, Sergey Bylokhov wrote: > This is the continuation of JDK-8233884, JDK-8271456, and JDK-8272120. > > In many places standard charsets are looked up via their names, for example: > absolutePath.getBytes("UTF-8"); > > This could be done more efficiently(up to x20