From github.com+741251+turbanoff at openjdk.java.net Fri Oct 1 21:12:57 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Fri, 1 Oct 2021 21:12:57 GMT Subject: jmx-dev RFR: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management [v2] In-Reply-To: References: Message-ID: > 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 Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management small code-style fixes ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/5695/files - new: https://git.openjdk.java.net/jdk/pull/5695/files/e3884614..263e8682 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=5695&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=5695&range=00-01 Stats: 7 lines in 1 file changed: 0 ins; 3 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/5695.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5695/head:pull/5695 PR: https://git.openjdk.java.net/jdk/pull/5695 From sspitsyn at openjdk.java.net Fri Oct 1 23:00:29 2021 From: sspitsyn at openjdk.java.net (Serguei Spitsyn) Date: Fri, 1 Oct 2021 23:00:29 GMT Subject: jmx-dev RFR: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management [v2] In-Reply-To: References: Message-ID: On Fri, 1 Oct 2021 21:12:57 GMT, Andrey Turbanov 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 > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management > small code-style fixes Thank you for the update. It looks good. Thanks, Serguei ------------- Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5695 From github.com+741251+turbanoff at openjdk.java.net Tue Oct 5 07:17:20 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Tue, 5 Oct 2021 07:17:20 GMT Subject: jmx-dev RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module Message-ID: Pass cause exception as constructor parameter is shorter and easier to read. ------------- Commit messages: - [PATCH] Cleanup unnecessary calls to Throwable.initCause() in java.management - [PATCH] Cleanup unnecessary calls to Throwable.initCause() in java.management Changes: https://git.openjdk.java.net/jdk/pull/5552/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5552&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8274757 Stats: 50 lines in 10 files changed: 0 ins; 32 del; 18 mod Patch: https://git.openjdk.java.net/jdk/pull/5552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5552/head:pull/5552 PR: https://git.openjdk.java.net/jdk/pull/5552 From dfuchs at openjdk.java.net Tue Oct 5 10:39:09 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Tue, 5 Oct 2021 10:39:09 GMT Subject: jmx-dev RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module In-Reply-To: References: Message-ID: On Thu, 16 Sep 2021 20:45:36 GMT, Andrey Turbanov wrote: > Pass cause exception as constructor parameter is shorter and easier to read. Nice simplification. ------------- Marked as reviewed by dfuchs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5552 From sspitsyn at openjdk.java.net Tue Oct 5 20:07:10 2021 From: sspitsyn at openjdk.java.net (Serguei Spitsyn) Date: Tue, 5 Oct 2021 20:07:10 GMT Subject: jmx-dev RFR: 8274757: Cleanup unnecessary calls to Throwable.initCause() in java.management module In-Reply-To: References: Message-ID: <3BIxmo44EZZsMWwxDu4G1AqiCKo_qYQuwWpeXGQZJsI=.273b7e4b-b16b-4df0-983f-2139931c67f0@github.com> On Thu, 16 Sep 2021 20:45:36 GMT, Andrey Turbanov wrote: > Pass cause exception as constructor parameter is shorter and easier to read. I agree with Daniel, it is nice simplification. Looks good. Thanks, Serguei ------------- Marked as reviewed by sspitsyn (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/5552 From github.com+741251+turbanoff at openjdk.java.net Wed Oct 6 18:15:15 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Wed, 6 Oct 2021 18:15:15 GMT Subject: jmx-dev Integrated: 8274464: Remove redundant stream() call before forEach in java.* modules In-Reply-To: References: Message-ID: On Wed, 15 Sep 2021 07:12:25 GMT, Andrey Turbanov wrote: > 8274464: Remove redundant stream() call before forEach in java.* modules This pull request has now been integrated. Changeset: f3cedbe9 Author: Andrey Turbanov Committer: Daniel Fuchs URL: https://git.openjdk.java.net/jdk/commit/f3cedbe9288e7aea8d5603a2dc9bdc2661c391a6 Stats: 8 lines in 4 files changed: 0 ins; 3 del; 5 mod 8274464: Remove redundant stream() call before forEach in java.* modules Reviewed-by: dfuchs, amenkov, vtewari ------------- PR: https://git.openjdk.java.net/jdk/pull/5520 From github.com+741251+turbanoff at openjdk.java.net Wed Oct 6 18:27:13 2021 From: github.com+741251+turbanoff at openjdk.java.net (Andrey Turbanov) Date: Wed, 6 Oct 2021 18:27:13 GMT Subject: jmx-dev Integrated: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management In-Reply-To: References: Message-ID: On Sat, 25 Sep 2021 10:51:12 GMT, Andrey Turbanov 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 Committer: Daniel Fuchs 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 From dfuchs at openjdk.java.net Wed Oct 6 18:27:13 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Wed, 6 Oct 2021 18:27:13 GMT Subject: jmx-dev RFR: 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management [v2] In-Reply-To: References: Message-ID: On Fri, 1 Oct 2021 21:12:57 GMT, Andrey Turbanov 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 > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8274318: Replace 'for' cycles with iterator with enhanced-for in java.management > small code-style fixes Marked as reviewed by dfuchs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/5695 From darcy at openjdk.java.net Wed Oct 13 20:07:14 2021 From: darcy at openjdk.java.net (Joe Darcy) Date: Wed, 13 Oct 2021 20:07:14 GMT Subject: jmx-dev RFR: JDK-8275244: Suppress warnings on non-serializable array component types in jdk.management Message-ID: After a refinement to the checks under development in #5709, the new checks examine array types of serial fields and warn if the underlying component type is not serializable. Per the JLS, all array types are serializable, but if the base component is not serializable, the serialization process can throw an exception. >From "Java Object Serialization Specification: 2 - Object Output Classes": "If the object is an array, writeObject is called recursively to write the ObjectStreamClass of the array. The handle for the array is assigned. It is followed by the length of the array. Each element of the array is then written to the stream, after which writeObject returns." The jdk.management module has an instance of this coding pattern that need suppression to compile successfully under the future warning. ------------- Commit messages: - JDK-8275244: Suppress warnings on non-serializable array component types in jdk.management Changes: https://git.openjdk.java.net/jdk/pull/5934/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5934&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8275244 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/jdk/pull/5934.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/5934/head:pull/5934 PR: https://git.openjdk.java.net/jdk/pull/5934 From alanb at openjdk.java.net Wed Oct 13 20:11:48 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Wed, 13 Oct 2021 20:11:48 GMT Subject: jmx-dev RFR: JDK-8275244: Suppress warnings on non-serializable array component types in jdk.management In-Reply-To: References: Message-ID: On Wed, 13 Oct 2021 19:58:43 GMT, Joe Darcy wrote: > After a refinement to the checks under development in #5709, the new checks examine array types of serial fields and warn if the underlying component type is not serializable. Per the JLS, all array types are serializable, but if the base component is not serializable, the serialization process can throw an exception. > > From "Java Object Serialization Specification: 2 - Object Output Classes": > > "If the object is an array, writeObject is called recursively to write the ObjectStreamClass of the array. The handle for the array is assigned. It is followed by the length of the array. Each element of the array is then written to the stream, after which writeObject returns." > > The jdk.management module has an instance of this coding pattern that need suppression to compile successfully under the future warning. Marked as reviewed by alanb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/5934 From darcy at openjdk.java.net Wed Oct 13 20:21:56 2021 From: darcy at openjdk.java.net (Joe Darcy) Date: Wed, 13 Oct 2021 20:21:56 GMT Subject: jmx-dev Integrated: JDK-8275244: Suppress warnings on non-serializable array component types in jdk.management In-Reply-To: References: Message-ID: On Wed, 13 Oct 2021 19:58:43 GMT, Joe Darcy wrote: > After a refinement to the checks under development in #5709, the new checks examine array types of serial fields and warn if the underlying component type is not serializable. Per the JLS, all array types are serializable, but if the base component is not serializable, the serialization process can throw an exception. > > From "Java Object Serialization Specification: 2 - Object Output Classes": > > "If the object is an array, writeObject is called recursively to write the ObjectStreamClass of the array. The handle for the array is assigned. It is followed by the length of the array. Each element of the array is then written to the stream, after which writeObject returns." > > The jdk.management module has an instance of this coding pattern that need suppression to compile successfully under the future warning. This pull request has now been integrated. Changeset: d9e03e42 Author: Joe Darcy URL: https://git.openjdk.java.net/jdk/commit/d9e03e42afbb2e5115b67accfffad4938b8314b1 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8275244: Suppress warnings on non-serializable array component types in jdk.management Reviewed-by: alanb ------------- PR: https://git.openjdk.java.net/jdk/pull/5934