From vtewari at openjdk.java.net Tue Jun 1 05:34:26 2021 From: vtewari at openjdk.java.net (Vyom Tewari) Date: Tue, 1 Jun 2021 05:34:26 GMT Subject: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v9] In-Reply-To: <9qJLk6We2yEGQiMS0y-A8ggivVfCwcwrD7YP3IVC7qw=.017684f1-3e5f-4ae9-ba1e-c13b62127698@github.com> References: <9qJLk6We2yEGQiMS0y-A8ggivVfCwcwrD7YP3IVC7qw=.017684f1-3e5f-4ae9-ba1e-c13b62127698@github.com> Message-ID: On Mon, 31 May 2021 14:10:50 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.io`, `java.math`, and `java.text` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision: > > - Merge remote-tracking branch 'origin/master' into JDK-8267670 > - Merge remote-tracking branch 'origin/master' into JDK-8267670 > - Merge remote-tracking branch 'origin/master' into JDK-8267670 > - 8267670: Added missing brace > - Merge remote-tracking branch 'origin/master' into JDK-8267670 > - 8267670: Removed trailing whitespace > - 8267670: Remove redundant code from switch > - 8267670: Updated code to use yield > - Merge remote-tracking branch 'origin/master' into JDK-8267670 > - 8267670: Update java.io, java.math, and java.text to use switch expressions Marked as reviewed by vtewari (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4182 From pconcannon at openjdk.java.net Tue Jun 1 08:39:44 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 1 Jun 2021 08:39:44 GMT Subject: RFR: 8267670: Update java.io, java.math, and java.text to use switch expressions [v10] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.io`, `java.math`, and `java.text` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8267670 - Merge remote-tracking branch 'origin/master' into JDK-8267670 - Merge remote-tracking branch 'origin/master' into JDK-8267670 - Merge remote-tracking branch 'origin/master' into JDK-8267670 - 8267670: Added missing brace - Merge remote-tracking branch 'origin/master' into JDK-8267670 - 8267670: Removed trailing whitespace - 8267670: Remove redundant code from switch - 8267670: Updated code to use yield - Merge remote-tracking branch 'origin/master' into JDK-8267670 - ... and 1 more: https://git.openjdk.java.net/jdk/compare/4c495d3b...44f86889 ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4182/files - new: https://git.openjdk.java.net/jdk/pull/4182/files/44886603..44f86889 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4182&range=09 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4182&range=08-09 Stats: 10 lines in 3 files changed: 3 ins; 4 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/4182.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4182/head:pull/4182 PR: https://git.openjdk.java.net/jdk/pull/4182 From pconcannon at openjdk.java.net Tue Jun 1 10:18:26 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 1 Jun 2021 10:18:26 GMT Subject: Integrated: 8267670: Update java.io, java.math, and java.text to use switch expressions In-Reply-To: References: Message-ID: On Tue, 25 May 2021 09:37:58 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.io`, `java.math`, and `java.text` packages to make use of the switch expressions? > > Kind regards, > Patrick This pull request has now been integrated. Changeset: 4eb21682 Author: Patrick Concannon URL: https://git.openjdk.java.net/jdk/commit/4eb216824f39e3c3536972d76d778466c140df50 Stats: 354 lines in 11 files changed: 5 ins; 193 del; 156 mod 8267670: Update java.io, java.math, and java.text to use switch expressions Reviewed-by: darcy, chegar, naoto, iris, dfuchs, lancea, vtewari ------------- PR: https://git.openjdk.java.net/jdk/pull/4182 From alanb at openjdk.java.net Tue Jun 1 12:50:29 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Tue, 1 Jun 2021 12:50:29 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v6] In-Reply-To: <2BckdZPCGmN4MBYST7T7jVz08y-vJwSqRc3pcPEBTWA=.c47e0c65-f091-4c87-89d5-893f662ff892@github.com> References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> <2BckdZPCGmN4MBYST7T7jVz08y-vJwSqRc3pcPEBTWA=.c47e0c65-f091-4c87-89d5-893f662ff892@github.com> Message-ID: On Mon, 31 May 2021 15:02:57 GMT, Weijun Wang wrote: >> Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). >> >> The code change is divided into 3 commits. Please review them one by one. >> >> 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. >> 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. >> 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal >> >> The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. >> >> Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. >> >> Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. >> >> Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. > > Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: > > default behavior reverted to allow System.setSecurityManagerDirect looks a bit ugly now. Can this be renamed to implSetSecurityManager and avoid the line break in the middle of the declaration? The usage of System.err usage in setSecurityManager also needs to be re-examined as this will run arbitrary code when System.err can be changed. To fix this will require capturing the stream at startup (as was done with the illegal access logger). It's okay to integrate with what you have for the first push and we can fix this issue with System.err when the warning message is changed to the intended message. ------------- PR: https://git.openjdk.java.net/jdk/pull/4073 From weijun at openjdk.java.net Tue Jun 1 15:06:41 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Tue, 1 Jun 2021 15:06:41 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v7] In-Reply-To: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: > Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. > 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. > 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal > > The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. > > Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. > > Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. > > Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: rename setSecurityManagerDirect to implSetSecurityManager ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4073/files - new: https://git.openjdk.java.net/jdk/pull/4073/files/8fd09c39..926e4b9a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4073&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4073&range=05-06 Stats: 5 lines in 1 file changed: 0 ins; 1 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/4073.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4073/head:pull/4073 PR: https://git.openjdk.java.net/jdk/pull/4073 From weijun at openjdk.java.net Tue Jun 1 15:21:33 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Tue, 1 Jun 2021 15:21:33 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v8] In-Reply-To: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: > Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. > 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. > 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal > > The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. > > Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. > > Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. > > Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: - merge from master - rename setSecurityManagerDirect to implSetSecurityManager - default behavior reverted to allow - move one annotation to new method - merge from master, two files removed, one needs merge - keep only one systemProperty tag - fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java - feedback from Sean, Phil and Alan - add supresswarnings annotations automatically - manual change before automatic annotating - ... and 1 more: https://git.openjdk.java.net/jdk/compare/74b70a56...ea2c4b48 ------------- Changes: https://git.openjdk.java.net/jdk/pull/4073/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4073&range=07 Stats: 2132 lines in 826 files changed: 1997 ins; 20 del; 115 mod Patch: https://git.openjdk.java.net/jdk/pull/4073.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4073/head:pull/4073 PR: https://git.openjdk.java.net/jdk/pull/4073 From alanb at openjdk.java.net Tue Jun 1 16:05:29 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Tue, 1 Jun 2021 16:05:29 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v8] In-Reply-To: References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: On Tue, 1 Jun 2021 15:21:33 GMT, Weijun Wang wrote: >> Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). >> >> The code change is divided into 3 commits. Please review them one by one. >> >> 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. >> 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. >> 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal >> >> The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. >> >> Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. >> >> Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. >> >> Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. > > Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - merge from master > - rename setSecurityManagerDirect to implSetSecurityManager > - default behavior reverted to allow > - move one annotation to new method > - merge from master, two files removed, one needs merge > - keep only one systemProperty tag > - fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java > - feedback from Sean, Phil and Alan > - add supresswarnings annotations automatically > - manual change before automatic annotating > - ... and 1 more: https://git.openjdk.java.net/jdk/compare/74b70a56...ea2c4b48 Marked as reviewed by alanb (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4073 From joehw at openjdk.java.net Tue Jun 1 16:28:27 2021 From: joehw at openjdk.java.net (Joe Wang) Date: Tue, 1 Jun 2021 16:28:27 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v8] In-Reply-To: References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: On Tue, 1 Jun 2021 15:21:33 GMT, Weijun Wang wrote: >> Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). >> >> The code change is divided into 3 commits. Please review them one by one. >> >> 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. >> 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. >> 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal >> >> The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. >> >> Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. >> >> Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. >> >> Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. > > Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits: > > - merge from master > - rename setSecurityManagerDirect to implSetSecurityManager > - default behavior reverted to allow > - move one annotation to new method > - merge from master, two files removed, one needs merge > - keep only one systemProperty tag > - fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java > - feedback from Sean, Phil and Alan > - add supresswarnings annotations automatically > - manual change before automatic annotating > - ... and 1 more: https://git.openjdk.java.net/jdk/compare/74b70a56...ea2c4b48 Marked as reviewed by joehw (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4073 From weijun at openjdk.java.net Wed Jun 2 12:01:30 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Wed, 2 Jun 2021 12:01:30 GMT Subject: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v9] In-Reply-To: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: > Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. > 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. > 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal > > The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. > > Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. > > Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. > > Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits: - copyright years - merge from master, resolve one conflict - Merge branch 'master' - merge from master - rename setSecurityManagerDirect to implSetSecurityManager - default behavior reverted to allow - move one annotation to new method - merge from master, two files removed, one needs merge - keep only one systemProperty tag - fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java - ... and 4 more: https://git.openjdk.java.net/jdk/compare/19450b99...331389b5 ------------- Changes: https://git.openjdk.java.net/jdk/pull/4073/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4073&range=08 Stats: 2755 lines in 826 files changed: 1997 ins; 20 del; 738 mod Patch: https://git.openjdk.java.net/jdk/pull/4073.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4073/head:pull/4073 PR: https://git.openjdk.java.net/jdk/pull/4073 From weijun at openjdk.java.net Wed Jun 2 12:01:33 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Wed, 2 Jun 2021 12:01:33 GMT Subject: Integrated: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal In-Reply-To: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> References: <_lD3kOiYR1ulm4m7HivqnnFQBD7WxWWLBz56oP6EMVU=.1723b50b-4390-457c-878d-f726cb1ce170@github.com> Message-ID: On Mon, 17 May 2021 18:23:41 GMT, Weijun Wang wrote: > Please review this implementation of [JEP 411](https://openjdk.java.net/jeps/411). > > The code change is divided into 3 commits. Please review them one by one. > > 1. https://github.com/openjdk/jdk/commit/576161d15423f58281e384174d28c9f9be7941a1 The essential change for this JEP, including the `@Deprecate` annotations and spec change. It also update the default value of the `java.security.manager` system property to "disallow", and necessary test change following this update. > 2. https://github.com/openjdk/jdk/commit/26a54a835e9f84aa528740a7c5c35d07355a8a66 Manual changes to several files so that the next commit can be generated programatically. > 3. https://github.com/openjdk/jdk/commit/eb6c566ff9207974a03a53335e0e697cffcf0950 Automatic changes to other source files to avoid javac warnings on deprecation for removal > > The 1st and 2nd commits should be reviewed carefully. The 3rd one is generated programmatically, see the comment below for more details. If you are only interested in a portion of the 3rd commit and would like to review it as a separate file, please comment here and I'll generate an individual webrev. > > Due to the size of this PR, no attempt is made to update copyright years for any file to minimize unnecessary merge conflict. > > Furthermore, since the default value of `java.security.manager` system property is now "disallow", most of the tests calling `System.setSecurityManager()` need to launched with `-Djava.security.manager=allow`. This is covered in a different PR at https://github.com/openjdk/jdk/pull/4071. > > Update: the deprecation annotations and javadoc tags, build, compiler, core-libs, hotspot, i18n, jmx, net, nio, security, and serviceability are reviewed. Rest are 2d, awt, beans, sound, and swing. This pull request has now been integrated. Changeset: 6765f902 Author: Weijun Wang URL: https://git.openjdk.java.net/jdk/commit/6765f902505fbdd02f25b599f942437cd805cad1 Stats: 2755 lines in 826 files changed: 1997 ins; 20 del; 738 mod 8266459: Implement JEP 411: Deprecate the Security Manager for Removal Co-authored-by: Sean Mullan Co-authored-by: Lance Andersen Co-authored-by: Weijun Wang Reviewed-by: erikj, darcy, chegar, naoto, joehw, alanb, mchung, kcr, prr, lancea ------------- PR: https://git.openjdk.java.net/jdk/pull/4073 From "github.com+73116608+openjdk-notifier[bot]" at openjdk.java.net Wed Jun 2 12:02:38 2021 From: "github.com+73116608+openjdk-notifier[bot]" at openjdk.java.net (openjdk-notifier [bot]) Date: Wed, 2 Jun 2021 12:02:38 GMT Subject: RFR: 8267521: Post JEP 411 refactoring: maximum covering > 50K [v3] In-Reply-To: References: Message-ID: On Fri, 21 May 2021 20:37:30 GMT, Weijun Wang wrote: >> The code change refactors classes that have a `SuppressWarnings("removal")` annotation that covers more than 50KB of code. The big annotation is often quite faraway from the actual deprecated API usage it is suppressing, and with the annotation covering too big a portion it's easy to call other deprecated methods without being noticed. >> >> The code change shows some common solutions to avoid such too wide annotations: >> >> 1. Extract calls into a method and add annotation on that method >> 2. Assign the return value of a deprecated method call to a new local variable and add annotation on the declaration, and then assign that value to the original l-value if not void. The local variable will be called `tmp` if later reassigned or `dummy` if it will be discarded. >> 3. Put declaration and assignment into a single statement if possible. >> 4. Rewrite code to achieve #3 above. >> >> I'll add a copyright year update commit before integration. > > Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: > > update FtpClient.java The dependent pull request has now been integrated, and the target branch of this pull request has been updated. This means that changes from the dependent pull request can start to show up as belonging to this pull request, which may be confusing for reviewers. To remedy this situation, simply merge the latest changes from the new target branch into this pull request by running commands similar to these in the local repository for your personal fork: git checkout 8266459 git fetch https://git.openjdk.java.net/jdk master git merge FETCH_HEAD # if there are conflicts, follow the instructions given by git merge git commit -m "Merge master" git push ------------- PR: https://git.openjdk.java.net/jdk/pull/4138 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 12:07:35 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 12:07:35 GMT Subject: Withdrawn: 8263561: Re-examine uses of LinkedList In-Reply-To: <-lwwnneyhUB3qMqORpmnCC2vhWNTuURohJWvKb7xEtY=.a1e980bd-fc7a-49c8-89ed-4b8f294e83f6@github.com> References: <-lwwnneyhUB3qMqORpmnCC2vhWNTuURohJWvKb7xEtY=.a1e980bd-fc7a-49c8-89ed-4b8f294e83f6@github.com> Message-ID: On Fri, 26 Feb 2021 10:48:33 GMT, ?????? ??????? wrote: > The usage of `LinkedList` is senseless and can be replaced with either `ArrayList` or `ArrayDeque` which are both more compact and effective. > > jdk:tier1 and jdk:tier2 are both ok This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/2744 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 12:18:42 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 12:18:42 GMT Subject: RFR: 8263561: Re-examine uses of LinkedList Message-ID: After I've renamed remove branch GitHub for some reason has closed original https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. ------------- Commit messages: - Merge branch 'master' into 8263561 - Merge branch 'master' into purge-linked-list - 8263561: Use sized constructor where reasonable - 8263561: Use interface List instead of particular type where possible - 8263561: Rename requestList -> requests - 8263561: Re-examine uses of LinkedList Changes: https://git.openjdk.java.net/jdk/pull/4304/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4304&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8263561 Stats: 48 lines in 9 files changed: 0 ins; 2 del; 46 mod Patch: https://git.openjdk.java.net/jdk/pull/4304.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4304/head:pull/4304 PR: https://git.openjdk.java.net/jdk/pull/4304 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 14:19:42 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 14:19:42 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible Message-ID: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ------------- Commit messages: - 8268113: Re-use Long.hashCode() where possible Changes: https://git.openjdk.java.net/jdk/pull/4309/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8268113 Stats: 10 lines in 7 files changed: 1 ins; 0 del; 9 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 14:19:43 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 14:19:43 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: <_TQh_iGjI3byKr1pc0gr7GZnCiyeKubYIy4rkLwbipY=.08915956-df4e-411e-b985-edd411a5bdc3@github.com> On Wed, 2 Jun 2021 14:10:38 GMT, ?????? ??????? wrote: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). src/java.base/share/classes/java/util/BitSet.java line 1040: > 1038: h ^= words[i] * (i + 1); > 1039: > 1040: return Long.hashCode(h); Here `>>` instead of `>>>` in original code seems to be a typo ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+7806504+liach at openjdk.java.net Wed Jun 2 14:54:31 2021 From: github.com+7806504+liach at openjdk.java.net (liach) Date: Wed, 2 Jun 2021 14:54:31 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: On Wed, 2 Jun 2021 14:10:38 GMT, ?????? ??????? wrote: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). src/java.base/share/classes/java/lang/Double.java line 881: > 879: public static int hashCode(double value) { > 880: long bits = doubleToLongBits(value); > 881: return Long.hashCode(bits); Imo these should be squashed to just return Long.hashCode(doubleToLongBits(value)); since the local variable is no longer meaningful. Previously, they were required as they were retrieved twice in hash code calculation. Same for other usages. src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java line 115: > 113: public int hashCode() { > 114: final long bits = Double.doubleToLongBits(doubleValue); > 115: return Long.hashCode(bits); This one and the `DoubleDV` one should actually delegate to `Double.hashCode`, which delegates to `Long.hashCode` after this change. ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From pconcannon at openjdk.java.net Wed Jun 2 15:33:40 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 2 Jun 2021 15:33:40 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions Message-ID: Hi, Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? Kind regards, Patrick ------------- Commit messages: - 8268124: Update java.lang to use switch expressions Changes: https://git.openjdk.java.net/jdk/pull/4312/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8268124 Stats: 551 lines in 22 files changed: 7 ins; 140 del; 404 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From weijun at openjdk.java.net Wed Jun 2 15:40:55 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Wed, 2 Jun 2021 15:40:55 GMT Subject: RFR: 8267521: Post JEP 411 refactoring: maximum covering > 50K [v4] In-Reply-To: References: Message-ID: > The code change refactors classes that have a `SuppressWarnings("removal")` annotation that covers more than 50KB of code. The big annotation is often quite faraway from the actual deprecated API usage it is suppressing, and with the annotation covering too big a portion it's easy to call other deprecated methods without being noticed. > > The code change shows some common solutions to avoid such too wide annotations: > > 1. Extract calls into a method and add annotation on that method > 2. Assign the return value of a deprecated method call to a new local variable and add annotation on the declaration, and then assign that value to the original l-value if not void. The local variable will be called `tmp` if later reassigned or `dummy` if it will be discarded. > 3. Put declaration and assignment into a single statement if possible. > 4. Rewrite code to achieve #3 above. > > I'll add a copyright year update commit before integration. Weijun Wang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: 8267521: Post JEP 411 refactoring: maximum covering > 50K ------------- Changes: https://git.openjdk.java.net/jdk/pull/4138/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4138&range=03 Stats: 245 lines in 18 files changed: 140 ins; 39 del; 66 mod Patch: https://git.openjdk.java.net/jdk/pull/4138.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4138/head:pull/4138 PR: https://git.openjdk.java.net/jdk/pull/4138 From weijun at openjdk.java.net Wed Jun 2 15:51:33 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Wed, 2 Jun 2021 15:51:33 GMT Subject: Integrated: 8267521: Post JEP 411 refactoring: maximum covering > 50K In-Reply-To: References: Message-ID: On Fri, 21 May 2021 01:52:27 GMT, Weijun Wang wrote: > The code change refactors classes that have a `SuppressWarnings("removal")` annotation that covers more than 50KB of code. The big annotation is often quite faraway from the actual deprecated API usage it is suppressing, and with the annotation covering too big a portion it's easy to call other deprecated methods without being noticed. > > The code change shows some common solutions to avoid such too wide annotations: > > 1. Extract calls into a method and add annotation on that method > 2. Assign the return value of a deprecated method call to a new local variable and add annotation on the declaration, and then assign that value to the original l-value if not void. The local variable will be called `tmp` if later reassigned or `dummy` if it will be discarded. > 3. Put declaration and assignment into a single statement if possible. > 4. Rewrite code to achieve #3 above. > > I'll add a copyright year update commit before integration. This pull request has now been integrated. Changeset: 508cec75 Author: Weijun Wang URL: https://git.openjdk.java.net/jdk/commit/508cec7535cd0ad015d566389bc9e5f53ce4103b Stats: 245 lines in 18 files changed: 140 ins; 39 del; 66 mod 8267521: Post JEP 411 refactoring: maximum covering > 50K Reviewed-by: dfuchs, prr ------------- PR: https://git.openjdk.java.net/jdk/pull/4138 From forax at openjdk.java.net Wed Jun 2 16:09:30 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Wed, 2 Jun 2021 16:09:30 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java line 1663: > 1661: case D_TYPE -> mv.visitInsn(Opcodes.DCONST_0); > 1662: case L_TYPE -> mv.visitInsn(Opcodes.ACONST_NULL); > 1663: default -> throw new InternalError("unknown type: " + type); perhaps mv.visitInsn(switch(type) { ... ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From forax at openjdk.java.net Wed Jun 2 16:13:33 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Wed, 2 Jun 2021 16:13:33 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: <618GzC0qITXnu_SQ0E-V5FjpoW5nNj1ov7w1vjlemD8=.35c01194-1e74-4172-806e-d85d4aff02df@github.com> On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/MemberName.java line 331: > 329: assert(false) : this+" != "+MethodHandleNatives.refKindName((byte)originalRefKind); > 330: yield true; > 331: } this code always yield true, better to check if the assert are enabled, do the switch in that case and always return true ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From forax at openjdk.java.net Wed Jun 2 16:17:27 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Wed, 2 Jun 2021 16:17:27 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: <56RtDiVZt5ZyjQj1VSz2zfAACcA9VD4IfjP10EgtDo4=.0b291a16-b7fc-4198-8e78-74fc4fe591c0@github.com> On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line 278: > 276: private static boolean isObjectMethod(Method m) { > 277: return switch (m.getName()) { > 278: case "toString" -> (m.getReturnType() == String.class the extra parenthesis are not needed ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From forax at openjdk.java.net Wed Jun 2 16:22:37 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Wed, 2 Jun 2021 16:22:37 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 366: > 364: } > 365: default -> throw new IllegalArgumentException(methodName); > 366: }; I thinki it's simpler to have something like that var handle = switch(methodName) { ... }; return methodType != null ? new ConstantCallSite(handle) : handle; ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 16:31:55 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 16:31:55 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v2] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: 8268113: Delegate to Double.hashCode() ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/9c7ddc0c..3f5b431d Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=00-01 Stats: 4 lines in 2 files changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 16:31:56 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 16:31:56 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v2] In-Reply-To: References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: On Wed, 2 Jun 2021 14:51:35 GMT, liach wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268113: Delegate to Double.hashCode() > > src/java.desktop/macosx/classes/apple/laf/JRSUIConstants.java line 115: > >> 113: public int hashCode() { >> 114: final long bits = Double.doubleToLongBits(doubleValue); >> 115: return Long.hashCode(bits); > > This one and the `DoubleDV` one should actually delegate to `Double.hashCode`, which delegates to `Long.hashCode` after this change. Good point, done! ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 16:37:49 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 16:37:49 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v3] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: 8268113: Inline local vars where reasonable ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/3f5b431d..df8be00a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=01-02 Stats: 6 lines in 3 files changed: 0 ins; 3 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 16:37:51 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 16:37:51 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v3] In-Reply-To: References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: On Wed, 2 Jun 2021 14:50:23 GMT, liach wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268113: Inline local vars where reasonable > > src/java.base/share/classes/java/lang/Double.java line 881: > >> 879: public static int hashCode(double value) { >> 880: long bits = doubleToLongBits(value); >> 881: return Long.hashCode(bits); > > Imo these should be squashed to just > > return Long.hashCode(doubleToLongBits(value)); > > since the local variable is no longer meaningful. Previously, they were required as they were retrieved twice in hash code calculation. > > Same for other usages. Done! ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From naoto at openjdk.java.net Wed Jun 2 16:59:30 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 2 Jun 2021 16:59:30 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Hi Patrick, some minor comments. src/java.base/share/classes/java/lang/CharacterData.java line 80: > 78: case 2 -> CharacterData02.instance; > 79: case 3 -> CharacterData03.instance; > 80: case 14 -> CharacterData0E.instance; // Private Use Plane 14 is not `private use` src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 90: > 88: // findVirtual etc. > 89: return switch (refKind) { > 90: case REF_invokeSpecial: { Is ':' preferred here (and other cases too) instead of "->"? ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From darcy at openjdk.java.net Wed Jun 2 17:09:31 2021 From: darcy at openjdk.java.net (Joe Darcy) Date: Wed, 2 Jun 2021 17:09:31 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Changes to Math and Long look fine. ------------- Marked as reviewed by darcy (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4312 From vtewari at openjdk.java.net Wed Jun 2 18:01:29 2021 From: vtewari at openjdk.java.net (Vyom Tewari) Date: Wed, 2 Jun 2021 18:01:29 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v3] In-Reply-To: References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: On Wed, 2 Jun 2021 16:37:49 GMT, ?????? ??????? wrote: >> There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). > > ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: > > 8268113: Inline local vars where reasonable src/java.base/share/classes/java/util/BitSet.java line 105: > 103: * the user knows what he's doing and try harder to preserve it. > 104: */ > 105: private transient boolean sizeIsSticky = false; This change is OK, but it is not related to "8268113", do you really wants to do these changes as part of "8268113" ? ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 2 18:36:28 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 2 Jun 2021 18:36:28 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v3] In-Reply-To: References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: On Wed, 2 Jun 2021 17:58:29 GMT, Vyom Tewari wrote: >> ?????? ??????? has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268113: Inline local vars where reasonable > > src/java.base/share/classes/java/util/BitSet.java line 105: > >> 103: * the user knows what he's doing and try harder to preserve it. >> 104: */ >> 105: private transient boolean sizeIsSticky = false; > > This change is OK, but it is not related to "8268113", do you really wants to do these changes as part of "8268113" ? This is just a tiny code clean-up, so I think it's ok to go ------------- PR: https://git.openjdk.java.net/jdk/pull/4309 From pconcannon at openjdk.java.net Thu Jun 3 10:14:03 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 3 Jun 2021 10:14:03 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v2] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: Update java.lang to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4312/files - new: https://git.openjdk.java.net/jdk/pull/4312/files/72c93053..d705efbd Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=00-01 Stats: 6221 lines in 174 files changed: 4475 ins; 1291 del; 455 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Thu Jun 3 11:01:02 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 3 Jun 2021 11:01:02 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 8268124: small refactoring; fixed misplaced comment and added missing lambda operator ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4312/files - new: https://git.openjdk.java.net/jdk/pull/4312/files/d705efbd..a8706b02 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=01-02 Stats: 52 lines in 6 files changed: 9 ins; 12 del; 31 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Thu Jun 3 11:01:04 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 3 Jun 2021 11:01:04 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 16:43:25 GMT, Naoto Sato wrote: >> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268124: small refactoring; fixed misplaced comment and added missing lambda operator > > src/java.base/share/classes/java/lang/CharacterData.java line 80: > >> 78: case 2 -> CharacterData02.instance; >> 79: case 3 -> CharacterData03.instance; >> 80: case 14 -> CharacterData0E.instance; // Private Use > > Plane 14 is not `private use` Hi Naoto. Well spotted. I've corrected that now. See a8706b0 > src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java line 90: > >> 88: // findVirtual etc. >> 89: return switch (refKind) { >> 90: case REF_invokeSpecial: { > > Is ':' preferred here (and other cases too) instead of "->"? My mistake. I've replaced the colon now with the lambda operator. See a8706b0 ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Thu Jun 3 11:01:06 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 3 Jun 2021 11:01:06 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 2 Jun 2021 16:06:42 GMT, R?mi Forax wrote: >> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268124: small refactoring; fixed misplaced comment and added missing lambda operator > > src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java line 1663: > >> 1661: case D_TYPE -> mv.visitInsn(Opcodes.DCONST_0); >> 1662: case L_TYPE -> mv.visitInsn(Opcodes.ACONST_NULL); >> 1663: default -> throw new InternalError("unknown type: " + type); > > perhaps > > mv.visitInsn(switch(type) { ... Hi Remi, thanks for the suggestion. I've added that in now. See commit a8706b0 > src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java line 278: > >> 276: private static boolean isObjectMethod(Method m) { >> 277: return switch (m.getName()) { >> 278: case "toString" -> (m.getReturnType() == String.class > > the extra parenthesis are not needed Parenthesis removed, as suggested. See a8706b0 > src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 366: > >> 364: } >> 365: default -> throw new IllegalArgumentException(methodName); >> 366: }; > > I thinki it's simpler to have something like that > > var handle = switch(methodName) { > ... > }; > return methodType != null ? new ConstantCallSite(handle) : handle; I think that looks better. I've made that change now. See a8706b0 ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From forax at openjdk.java.net Thu Jun 3 11:38:40 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Thu, 3 Jun 2021 11:38:40 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 10:57:16 GMT, Patrick Concannon wrote: > My mistake. I've replaced the colon now with the lambda operator. Drive by comment, in term of name, `->` is the arrow operator not the lambda operator. - lambda = parameters + arrow + code - arrow case = case + arrow + code The difference is important because a lambda is a function while an arrow case is a block. ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From forax at openjdk.java.net Thu Jun 3 11:43:34 2021 From: forax at openjdk.java.net (=?UTF-8?B?UsOpbWk=?= Forax) Date: Thu, 3 Jun 2021 11:43:34 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 11:01:02 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8268124: small refactoring; fixed misplaced comment and added missing lambda operator Looks good to me ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From naoto at openjdk.java.net Thu Jun 3 14:52:37 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 3 Jun 2021 14:52:37 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 11:01:02 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8268124: small refactoring; fixed misplaced comment and added missing lambda operator LGTM ------------- Marked as reviewed by naoto (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4312 From duke at openjdk.java.net Thu Jun 3 16:28:41 2021 From: duke at openjdk.java.net (duke) Date: Thu, 3 Jun 2021 16:28:41 GMT Subject: Withdrawn: 8264896: Remove redundant '& 0xFF' from int-to-byte cast In-Reply-To: References: Message-ID: On Thu, 4 Mar 2021 12:16:29 GMT, ?????? ??????? wrote: > When we do > > byte b1 = (byte) (value & 0xFF); > > we keep from int only 1 lower byte and exactly the same can be achieved with plain cast. See the test below: > > public class Main { > public static void main(String[] args) throws Exception { > IntStream.range(Integer.MIN_VALUE, Integer.MAX_VALUE).forEach(value -> { > byte b1 = (byte) (value & 0xFF); > byte b2 = (byte) value; > if (b1 != b2) { > throw new RuntimeException("" + value); > } > }); > } > > > Also tier1 and tier2 are both OK. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk/pull/2826 From mchung at openjdk.java.net Thu Jun 3 17:09:39 2021 From: mchung at openjdk.java.net (Mandy Chung) Date: Thu, 3 Jun 2021 17:09:39 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 11:01:02 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8268124: small refactoring; fixed misplaced comment and added missing lambda operator Looks good with one minor comment in `DirectMethodHandleDescImpl.java`. src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java line 138: > 136: public String lookupDescriptor() { > 137: return switch (kind) { > 138: case VIRTUAL, SPECIAL, Nit: I prefer to have each case in a separate line (in this switch and also the switch in `resolveConstantDesc`. ------------- Marked as reviewed by mchung (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4312 From iris at openjdk.java.net Thu Jun 3 17:23:39 2021 From: iris at openjdk.java.net (Iris Clark) Date: Thu, 3 Jun 2021 17:23:39 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 11:01:02 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8268124: small refactoring; fixed misplaced comment and added missing lambda operator Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From github.com+10835776+stsypanov at openjdk.java.net Fri Jun 4 11:53:10 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Fri, 4 Jun 2021 11:53:10 GMT Subject: RFR: 8263561: Re-examine uses of LinkedList [v2] In-Reply-To: References: Message-ID: > After I've renamed remove branch GitHub for some reason has closed original https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Merge branch 'master' into 8263561 - Merge branch 'master' into 8263561 # Conflicts: # src/java.base/unix/classes/sun/net/dns/ResolverConfigurationImpl.java - Merge branch 'master' into purge-linked-list - 8263561: Use sized constructor where reasonable - 8263561: Use interface List instead of particular type where possible - 8263561: Rename requestList -> requests - 8263561: Re-examine uses of LinkedList ------------- Changes: https://git.openjdk.java.net/jdk/pull/4304/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4304&range=01 Stats: 48 lines in 9 files changed: 0 ins; 2 del; 46 mod Patch: https://git.openjdk.java.net/jdk/pull/4304.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4304/head:pull/4304 PR: https://git.openjdk.java.net/jdk/pull/4304 From github.com+10835776+stsypanov at openjdk.java.net Fri Jun 4 11:54:31 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Fri, 4 Jun 2021 11:54:31 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v4] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Merge branch 'master' into 8268113 - 8268113: Inline local vars where reasonable - 8268113: Delegate to Double.hashCode() - 8268113: Re-use Long.hashCode() where possible ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/df8be00a..7dc5020e Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=02-03 Stats: 454615 lines in 1482 files changed: 442781 ins; 7489 del; 4345 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From pconcannon at openjdk.java.net Fri Jun 4 15:25:58 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Fri, 4 Jun 2021 15:25:58 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 11:35:13 GMT, R?mi Forax wrote: >> My mistake. I've replaced the colon now with the lambda operator. See a8706b0 > >> My mistake. I've replaced the colon now with the lambda operator. > > Drive by comment, in term of name, `->` is the arrow operator not the lambda operator. > - lambda = parameters + arrow + code > - arrow case = case + arrow + code > > The difference is important because a lambda is a function while an arrow case is a block. Ah OK, good to know. Thanks Remi! ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From github.com+10835776+stsypanov at openjdk.java.net Tue Jun 8 07:01:53 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Tue, 8 Jun 2021 07:01:53 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v5] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision: - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - 8268113: Inline local vars where reasonable - 8268113: Delegate to Double.hashCode() - 8268113: Re-use Long.hashCode() where possible ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/7dc5020e..76af35c6 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=03-04 Stats: 30371 lines in 444 files changed: 25591 ins; 2648 del; 2132 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From pconcannon at openjdk.java.net Wed Jun 9 10:19:47 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 9 Jun 2021 10:19:47 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v4] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: small refactoring; fixed misplaced comment and added missing lambda operator - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: Update java.lang to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4312/files - new: https://git.openjdk.java.net/jdk/pull/4312/files/a8706b02..7907f3eb Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=02-03 Stats: 463928 lines in 821 files changed: 455007 ins; 5063 del; 3858 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Wed Jun 9 10:19:53 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 9 Jun 2021 10:19:53 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v4] In-Reply-To: <618GzC0qITXnu_SQ0E-V5FjpoW5nNj1ov7w1vjlemD8=.35c01194-1e74-4172-806e-d85d4aff02df@github.com> References: <618GzC0qITXnu_SQ0E-V5FjpoW5nNj1ov7w1vjlemD8=.35c01194-1e74-4172-806e-d85d4aff02df@github.com> Message-ID: On Wed, 2 Jun 2021 16:10:19 GMT, R?mi Forax wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - Merge remote-tracking branch 'origin/master' into JDK-8268124 >> - 8268124: small refactoring; fixed misplaced comment and added missing lambda operator >> - Merge remote-tracking branch 'origin/master' into JDK-8268124 >> - 8268124: Update java.lang to use switch expressions > > src/java.base/share/classes/java/lang/invoke/MemberName.java line 331: > >> 329: assert(false) : this+" != "+MethodHandleNatives.refKindName((byte)originalRefKind); >> 330: yield true; >> 331: } > > this code always yield true, better to check if the assert are enabled, do the switch in that case and always return true Thanks for your suggestion. I've incorporated it into commit a8706b0 ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Wed Jun 9 10:25:35 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 9 Jun 2021 10:25:35 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v5] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request incrementally with two additional commits since the last revision: - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4312/files - new: https://git.openjdk.java.net/jdk/pull/4312/files/7907f3eb..df5b34e5 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=03-04 Stats: 12 lines in 1 file changed: 6 ins; 0 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Wed Jun 9 10:25:36 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 9 Jun 2021 10:25:36 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 3 Jun 2021 17:04:58 GMT, Mandy Chung wrote: >> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: >> >> 8268124: small refactoring; fixed misplaced comment and added missing lambda operator > > src/java.base/share/classes/java/lang/constant/DirectMethodHandleDescImpl.java line 138: > >> 136: public String lookupDescriptor() { >> 137: return switch (kind) { >> 138: case VIRTUAL, SPECIAL, > > Nit: I prefer to have each case in a separate line (in this switch and also the switch in `resolveConstantDesc`. Hi Mandy. Thanks for your suggestion. I've now moved each case onto its own line. Please see ccc9db7 / df5b34e ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From lancea at openjdk.java.net Wed Jun 9 10:30:16 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Wed, 9 Jun 2021 10:30:16 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v5] In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 10:25:35 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with two additional commits since the last revision: > > - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II > - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl Marked as reviewed by lancea (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 9 10:32:38 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 9 Jun 2021 10:32:38 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v6] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: <5DP52RlB_Dtcy30JuehAzoGtvEXryh10kqEYoYZvN9k=.1229b4f2-f7f5-4f0b-9d40-947cbe3672f1@github.com> > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - 8268113: Inline local vars where reasonable - 8268113: Delegate to Double.hashCode() - 8268113: Re-use Long.hashCode() where possible ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/76af35c6..3a7b5515 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=04-05 Stats: 5577 lines in 149 files changed: 3466 ins; 1405 del; 706 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From dfuchs at openjdk.java.net Wed Jun 9 10:57:15 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Wed, 9 Jun 2021 10:57:15 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v5] In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 10:25:35 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with two additional commits since the last revision: > > - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II > - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl Marked as reviewed by dfuchs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Wed Jun 9 15:49:25 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 9 Jun 2021 15:49:25 GMT Subject: RFR: 8268469: Update java.time to use switch expressions Message-ID: Hi, Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? Kind regards, Patrick ------------- Commit messages: - 8268469: Update java.time to use switch expressions Changes: https://git.openjdk.java.net/jdk/pull/4433/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8268469 Stats: 388 lines in 23 files changed: 15 ins; 97 del; 276 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From lancea at openjdk.java.net Wed Jun 9 16:17:12 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Wed, 9 Jun 2021 16:17:12 GMT Subject: RFR: 8268469: Update java.time to use switch expressions In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 15:41:59 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Updates look good Patrick ------------- Marked as reviewed by lancea (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4433 From naoto at openjdk.java.net Wed Jun 9 16:57:14 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 9 Jun 2021 16:57:14 GMT Subject: RFR: 8268469: Update java.time to use switch expressions In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 15:41:59 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Looks good overall. Some misplaced comments. Also, copyright years should be updated. src/java.base/share/classes/java/time/LocalDateTime.java line 1188: > 1186: case HOURS -> plusHours(amountToAdd); > 1187: case HALF_DAYS -> plusDays(amountToAdd / 256).plusHours((amountToAdd % 256) * 12); > 1188: default -> with(date.plus(amountToAdd, unit), time); // no overflow (256 is multiple of 2) The comment is misplaced. src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java line 310: > 308: case HOURS -> plusHours(amountToAdd); > 309: case HALF_DAYS -> plusDays(amountToAdd / 256).plusHours((amountToAdd % 256) * 12); > 310: default -> with(date.plus(amountToAdd, unit), time); // no overflow (256 is multiple of 2) Misplaced comment here too. src/java.base/share/classes/java/time/format/SignStyle.java line 127: > 125: boolean parse(boolean positive, boolean strict, boolean fixedWidth) { > 126: return switch (ordinal()) { > 127: // valid if negative or (positive and lenient) The comment should apply only to the `case 0`. ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From dfuchs at openjdk.java.net Wed Jun 9 17:05:16 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Wed, 9 Jun 2021 17:05:16 GMT Subject: RFR: 8268469: Update java.time to use switch expressions In-Reply-To: References: Message-ID: <77duiMdW0OcTvKM8GHE9QSzauQK2JVPIRj2myEdqYKk=.467f310d-5c10-4f85-b222-a54b560aa9df@github.com> On Wed, 9 Jun 2021 15:41:59 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick src/java.base/share/classes/java/time/Month.java line 491: > 489: case OCTOBER -> 274 + leap; > 490: case NOVEMBER -> 305 + leap; > 491: default -> 335 + leap; It would be better to keep `DECEMBER` here for clarity - even if only in a comment - e.g: case NOVEMBER -> 305 + leap; // otherwise (DECEMBER) default -> 335 + leap; src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java line 334: > 332: > 333: default -> with(isoDate.with(field, newValue)); > 334: }; My preference would be to keep the imbricated switch structure: it is not obvious whether this change is correct. Have you verified that `getChronology().range(chronoField).checkValidIntValue(newValue, chronoField);` is a no op when chronoField == ERA? src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 4992: > 4990: } > 4991: default -> throw new IllegalStateException("unreachable"); > 4992: }; Not sure I like the new version more than the old, as it seems to lead to more duplication. Maybe the 'Y' case should be tested before entering the switch - then the switch could be used to assign `var field = switch (chr) {...};` ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From iris at openjdk.java.net Wed Jun 9 19:35:15 2021 From: iris at openjdk.java.net (Iris Clark) Date: Wed, 9 Jun 2021 19:35:15 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v5] In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 10:25:35 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with two additional commits since the last revision: > > - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II > - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From mchung at openjdk.java.net Wed Jun 9 20:37:17 2021 From: mchung at openjdk.java.net (Mandy Chung) Date: Wed, 9 Jun 2021 20:37:17 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v5] In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 10:25:35 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request incrementally with two additional commits since the last revision: > > - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II > - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl Marked as reviewed by mchung (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From scolebourne at openjdk.java.net Wed Jun 9 22:20:13 2021 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Wed, 9 Jun 2021 22:20:13 GMT Subject: RFR: 8268469: Update java.time to use switch expressions In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 15:41:59 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick My biggest comment is the spaces used to align, which I strongly object to. I agree with @dfuch comments too. src/java.base/share/classes/java/time/LocalDate.java line 608: > 606: if (chronoField.isDateBased()) { > 607: return switch (chronoField) { > 608: case DAY_OF_MONTH -> ValueRange.of(1, lengthOfMonth()); For the record, I hate code that is aligned like this. It makes refactoring much more noisy, as the author has to readjust all the associated lines. I also don't believe it is within the spirit of Java's traditional coding guidelines. src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java line 331: > 329: yield with(isoDate.withYear(nvalue - YEARS_DIFFERENCE)); > 330: } > 331: case ERA -> with(isoDate.withYear((1 - getProlepticYear()) - YEARS_DIFFERENCE)); `checkValidIntValue` performs validation, so removing it has changed the behavoiur src/java.base/share/classes/java/time/format/SignStyle.java line 129: > 127: // valid if negative or (positive and lenient) > 128: case 0 -> !positive || !strict;// NORMAL > 129: case 1, 4 -> true; // ALWAYS, EXCEEDS_PAD Extra space before `4` ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From github.com+10835776+stsypanov at openjdk.java.net Thu Jun 10 08:30:43 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Thu, 10 Jun 2021 08:30:43 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v7] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - 8268113: Inline local vars where reasonable - 8268113: Delegate to Double.hashCode() - 8268113: Re-use Long.hashCode() where possible ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/3a7b5515..f1c8cc7b Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=06 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=05-06 Stats: 4631 lines in 103 files changed: 3649 ins; 401 del; 581 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From pconcannon at openjdk.java.net Thu Jun 10 08:43:44 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 10 Jun 2021 08:43:44 GMT Subject: RFR: 8268124: Update java.lang to use switch expressions [v6] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: moved cases into separate lines in DirectMethodHandleDescImpl part II - 8268124: moved cases onto separate lines in DirectMethodHandleDescImpl - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: small refactoring; fixed misplaced comment and added missing lambda operator - Merge remote-tracking branch 'origin/master' into JDK-8268124 - 8268124: Update java.lang to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4312/files - new: https://git.openjdk.java.net/jdk/pull/4312/files/df5b34e5..c7c11939 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4312&range=04-05 Stats: 4673 lines in 106 files changed: 3649 ins; 412 del; 612 mod Patch: https://git.openjdk.java.net/jdk/pull/4312.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4312/head:pull/4312 PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Thu Jun 10 08:50:43 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 10 Jun 2021 08:50:43 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v2] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Update java.time to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4433/files - new: https://git.openjdk.java.net/jdk/pull/4433/files/e6d76af2..2abbea11 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=00-01 Stats: 1167 lines in 61 files changed: 779 ins; 153 del; 235 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Thu Jun 10 11:16:18 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 10 Jun 2021 11:16:18 GMT Subject: Integrated: 8268124: Update java.lang to use switch expressions In-Reply-To: References: Message-ID: <4YuYeMAtj3VSjiEb6c2QGr3p5v4PZ4GQvWuAbv5ghNo=.af44662a-6895-4626-897f-0bcdc1b48e3c@github.com> On Wed, 2 Jun 2021 15:25:16 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.lang` packages to make use of the switch expressions? > > Kind regards, > Patrick This pull request has now been integrated. Changeset: d43c8a74 Author: Patrick Concannon URL: https://git.openjdk.java.net/jdk/commit/d43c8a74b33692b3628c3c9c6c472ab1cf1fdeac Stats: 558 lines in 22 files changed: 6 ins; 136 del; 416 mod 8268124: Update java.lang to use switch expressions Reviewed-by: naoto, darcy, mchung, iris, lancea, dfuchs ------------- PR: https://git.openjdk.java.net/jdk/pull/4312 From pconcannon at openjdk.java.net Wed Jun 16 10:57:07 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 16 Jun 2021 10:57:07 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - 8268469: Removed excessive spacing; corrected misplaced comments - Merge remote-tracking branch 'origin/master' into JDK-8268469 - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Update java.time to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4433/files - new: https://git.openjdk.java.net/jdk/pull/4433/files/2abbea11..2ae4a574 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=01-02 Stats: 12287 lines in 307 files changed: 9481 ins; 1521 del; 1285 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Wed Jun 16 10:57:12 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 16 Jun 2021 10:57:12 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 9 Jun 2021 22:03:54 GMT, Stephen Colebourne wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/LocalDate.java line 608: > >> 606: if (chronoField.isDateBased()) { >> 607: return switch (chronoField) { >> 608: case DAY_OF_MONTH -> ValueRange.of(1, lengthOfMonth()); > > For the record, I hate code that is aligned like this. It makes refactoring much more noisy, as the author has to readjust all the associated lines. I also don't believe it is within the spirit of Java's traditional coding guidelines. Hi Stephen. Thanks for your comments. I've tried removing the excessive spacing as you suggested. Please let me know what you think. See commit 2ae4a57 > src/java.base/share/classes/java/time/format/SignStyle.java line 129: > >> 127: // valid if negative or (positive and lenient) >> 128: case 0 -> !positive || !strict;// NORMAL >> 129: case 1, 4 -> true; // ALWAYS, EXCEEDS_PAD > > Extra space before `4` Extra space removed. Please see commit 2ae4a57 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Wed Jun 16 10:57:19 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 16 Jun 2021 10:57:19 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: <66Q2Tvm4vf5IZJKVW2wA9HhvFsNrtDLsdegxtkPB2Mo=.136c3947-16f3-4115-9c14-01b61dc79742@github.com> On Wed, 9 Jun 2021 16:25:55 GMT, Naoto Sato wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/LocalDateTime.java line 1188: > >> 1186: case HOURS -> plusHours(amountToAdd); >> 1187: case HALF_DAYS -> plusDays(amountToAdd / 256).plusHours((amountToAdd % 256) * 12); >> 1188: default -> with(date.plus(amountToAdd, unit), time); // no overflow (256 is multiple of 2) > > The comment is misplaced. Hi Naoto. Thanks for spotting this. I've corrected that now. Please see commit 2ae4a57 > src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java line 310: > >> 308: case HOURS -> plusHours(amountToAdd); >> 309: case HALF_DAYS -> plusDays(amountToAdd / 256).plusHours((amountToAdd % 256) * 12); >> 310: default -> with(date.plus(amountToAdd, unit), time); // no overflow (256 is multiple of 2) > > Misplaced comment here too. Comment corrected. Please see commit 2ae4a57 > src/java.base/share/classes/java/time/format/SignStyle.java line 127: > >> 125: boolean parse(boolean positive, boolean strict, boolean fixedWidth) { >> 126: return switch (ordinal()) { >> 127: // valid if negative or (positive and lenient) > > The comment should apply only to the `case 0`. Comment corrected. Please see commit 2ae4a57 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Wed Jun 16 10:57:28 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 16 Jun 2021 10:57:28 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: <77duiMdW0OcTvKM8GHE9QSzauQK2JVPIRj2myEdqYKk=.467f310d-5c10-4f85-b222-a54b560aa9df@github.com> References: <77duiMdW0OcTvKM8GHE9QSzauQK2JVPIRj2myEdqYKk=.467f310d-5c10-4f85-b222-a54b560aa9df@github.com> Message-ID: <-UiqdJDiRVGPRlICiOE0TyF1YgY6gTnK42JAG4ceT3Y=.9df4e507-437c-4e59-819b-1d2eb2466406@github.com> On Wed, 9 Jun 2021 16:31:10 GMT, Daniel Fuchs wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/Month.java line 491: > >> 489: case OCTOBER -> 274 + leap; >> 490: case NOVEMBER -> 305 + leap; >> 491: default -> 335 + leap; > > It would be better to keep `DECEMBER` here for clarity - even if only in a comment - e.g: > > > case NOVEMBER -> 305 + leap; > // otherwise (DECEMBER) > default -> 335 + leap; Hi Daniel. Thanks for your suggestion. Comment added. Please see commit 2ae4a57 > src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java line 334: > >> 332: >> 333: default -> with(isoDate.with(field, newValue)); >> 334: }; > > My preference would be to keep the imbricated switch structure: it is not obvious whether this change is correct. Have you verified that `getChronology().range(chronoField).checkValidIntValue(newValue, chronoField);` is a no op when chronoField == ERA? I've reverted these changes as requested. Please see commit 2ae4a57 > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 4992: > >> 4990: } >> 4991: default -> throw new IllegalStateException("unreachable"); >> 4992: }; > > Not sure I like the new version more than the old, as it seems to lead to more duplication. > Maybe the 'Y' case should be tested before entering the switch - then the switch could be used to assign > `var field = switch (chr) {...};` Reverted these changes as requested. Please see commit 2ae4a57 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From scolebourne at openjdk.java.net Wed Jun 16 11:06:43 2021 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Wed, 16 Jun 2021 11:06:43 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 16 Jun 2021 10:57:07 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions src/java.base/share/classes/java/time/LocalDate.java line 607: > 605: if (field instanceof ChronoField chronoField) { > 606: if (chronoField.isDateBased()) { > 607: int n = switch (chronoField) { This logic is harder to read than before, and it requires the CPU to perform an extra branch on `(n == -1)`. It should just be a `return switch ...` src/java.base/share/classes/java/time/LocalDateTime.java line 1181: > 1179: if (unit instanceof ChronoUnit chronoUnit) { > 1180: return switch (chronoUnit) { > 1181: case NANOS -> plusNanos(amountToAdd); Still has unnecessary alignment There are lots of cases in the PR where `->` is still aligned. I'd like to see all of them unaligned. src/java.base/share/classes/java/time/Month.java line 480: > 478: int leap = leapYear ? 1 : 0; > 479: return switch (this) { > 480: case JANUARY -> 1; Unnecessary alignment ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Wed Jun 16 11:14:45 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 16 Jun 2021 11:14:45 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: <7asoItHRvYVjU9eCFoI75KZFFKHooZG9wUJ3qoZkA64=.f20271ce-6653-4d6b-bb39-664106d6e498@github.com> On Wed, 9 Jun 2021 22:11:59 GMT, Stephen Colebourne wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java line 331: > >> 329: yield with(isoDate.withYear(nvalue - YEARS_DIFFERENCE)); >> 330: } >> 331: case ERA -> with(isoDate.withYear((1 - getProlepticYear()) - YEARS_DIFFERENCE)); > > `checkValidIntValue` performs validation, so removing it has changed the behavoiur Changes reverted. See 2ae4a57 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From chegar at openjdk.java.net Wed Jun 16 11:14:40 2021 From: chegar at openjdk.java.net (Chris Hegarty) Date: Wed, 16 Jun 2021 11:14:40 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 16 Jun 2021 10:59:59 GMT, Stephen Colebourne wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/Month.java line 480: > >> 478: int leap = leapYear ? 1 : 0; >> 479: return switch (this) { >> 480: case JANUARY -> 1; > > Unnecessary alignment The vertical alignment improves readability in these short-line cases. Removing the spaces before the arrows will make it a little harder to discern the difference between the cases. ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From scolebourne at openjdk.java.net Wed Jun 16 16:46:41 2021 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Wed, 16 Jun 2021 16:46:41 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 16 Jun 2021 11:11:30 GMT, Chris Hegarty wrote: >> src/java.base/share/classes/java/time/Month.java line 480: >> >>> 478: int leap = leapYear ? 1 : 0; >>> 479: return switch (this) { >>> 480: case JANUARY -> 1; >> >> Unnecessary alignment > > The vertical alignment improves readability in these short-line cases. Removing the spaces before the arrows will make it a little harder to discern the difference between the cases. It is your codebase, not mine, so it is up to you. Aligning things by column is generally frowned on in most style guides because it handles refactoring poorly, resulting in lots of needless change (or people forgetting to realign things - I had to deal with a rogue aligned Javadoc signature today in a PR where exactly that had happened). I also don't see how you write a style guide rule for when these should be aligned and when they should not. Anyway, this PR isn't really the right place for this discussion - I'm not blocking the PR on this basis (and I'm not an official Reviewer anyway). ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From dfuchs at openjdk.java.net Thu Jun 17 14:00:49 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Thu, 17 Jun 2021 14:00:49 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 16 Jun 2021 16:43:20 GMT, Stephen Colebourne wrote: >> The vertical alignment improves readability in these short-line cases. Removing the spaces before the arrows will make it a little harder to discern the difference between the cases. > > It is your codebase, not mine, so it is up to you. Aligning things by column is generally frowned on in most style guides because it handles refactoring poorly, resulting in lots of needless change (or people forgetting to realign things - I had to deal with a rogue aligned Javadoc signature today in a PR where exactly that had happened). I also don't see how you write a style guide rule for when these should be aligned and when they should not. > > Anyway, this PR isn't really the right place for this discussion - I'm not blocking the PR on this basis (and I'm not an official Reviewer anyway). I have a slight preference for the aligned version in the cases where the lines are short and the number of spaces used for padding is not unreasonable. I find the code gains in readability in these cases. In the case where the lines are long - I agree with Stephen that the alignment doesn't bring much readability - and sometime it may even be detrimental as it makes long lines longer. Stephen, would that be an acceptable compromise? ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From dfuchs at openjdk.java.net Thu Jun 17 14:01:04 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Thu, 17 Jun 2021 14:01:04 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Wed, 16 Jun 2021 10:57:07 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 2793: > 2791: case NOT_NEGATIVE -> throw new DateTimeException("Field " + field + > 2792: " cannot be printed as the value " + value + > 2793: " cannot be negative according to the SignStyle"); Maybe in this case you could revert the alignment. In this case it would allow lines 2792 to 2793 to be shorter ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From scolebourne at openjdk.java.net Thu Jun 17 16:31:34 2021 From: scolebourne at openjdk.java.net (Stephen Colebourne) Date: Thu, 17 Jun 2021 16:31:34 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: On Thu, 17 Jun 2021 13:56:00 GMT, Daniel Fuchs wrote: >> It is your codebase, not mine, so it is up to you. Aligning things by column is generally frowned on in most style guides because it handles refactoring poorly, resulting in lots of needless change (or people forgetting to realign things - I had to deal with a rogue aligned Javadoc signature today in a PR where exactly that had happened). I also don't see how you write a style guide rule for when these should be aligned and when they should not. >> >> Anyway, this PR isn't really the right place for this discussion - I'm not blocking the PR on this basis (and I'm not an official Reviewer anyway). > > I have a slight preference for the aligned version in the cases where the lines are short and the number of spaces used for padding is not unreasonable. I find the code gains in readability in these cases. In the case where the lines are long - I agree with Stephen that the alignment doesn't bring much readability - and sometime it may even be detrimental as it makes long lines longer. Stephen, would that be an acceptable compromise? Its certainly a reasonable position to take (ie. if thats what OpenJDK wants to do, its fine by me). I'm more interested to see how you would write such a thing down in the coding standards that doesn't make the standard worthless. ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Tue Jun 22 09:59:01 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 09:59:01 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: <5PcPYmea4OthvEzXmzewVOaAknTANVzZFt0V_DV7vDo=.9913ea2e-4030-4a58-a1ab-4c2c88f0ff68@github.com> On Wed, 16 Jun 2021 10:58:22 GMT, Stephen Colebourne wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/LocalDate.java line 607: > >> 605: if (field instanceof ChronoField chronoField) { >> 606: if (chronoField.isDateBased()) { >> 607: int n = switch (chronoField) { > > This logic is harder to read than before, and it requires the CPU to perform an extra branch on `(n == -1)`. It should just be a `return switch ...` Reverted logic as requested. See 24ae9e5 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Tue Jun 22 09:58:55 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 09:58:55 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v4] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Removed excessive spacing; corrected misplaced comments - Merge remote-tracking branch 'origin/master' into JDK-8268469 - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Update java.time to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4433/files - new: https://git.openjdk.java.net/jdk/pull/4433/files/2ae4a574..24ae9e53 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=02-03 Stats: 24105 lines in 400 files changed: 15347 ins; 7613 del; 1145 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Tue Jun 22 09:59:07 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 09:59:07 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v3] In-Reply-To: References: Message-ID: <3J4XzQ5wF3AYVa3P5TzsxFLezZY7AGhkVLpy-pDI0Lw=.d429c232-01ab-4522-945e-9690e6f4fd53@github.com> On Thu, 17 Jun 2021 13:51:27 GMT, Daniel Fuchs wrote: >> Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - 8268469: Removed excessive spacing; corrected misplaced comments >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - Merge remote-tracking branch 'origin/master' into JDK-8268469 >> - 8268469: Update java.time to use switch expressions > > src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java line 2793: > >> 2791: case NOT_NEGATIVE -> throw new DateTimeException("Field " + field + >> 2792: " cannot be printed as the value " + value + >> 2793: " cannot be negative according to the SignStyle"); > > Maybe in this case you could revert the alignment. In this case it would allow lines 2792 to 2793 to be shorter I've removed the alignment of arrow operators as requested. See 24ae9e5 ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Tue Jun 22 10:57:45 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 10:57:45 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) Message-ID: Hi, Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? This PR was split into two parts due to the large number of files affected. Kind regards, Patrick ------------- Commit messages: - 8269124: Update java.time to use switch expressions (part II) Changes: https://git.openjdk.java.net/jdk/pull/4552/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269124 Stats: 359 lines in 16 files changed: 0 ins; 48 del; 311 mod Patch: https://git.openjdk.java.net/jdk/pull/4552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4552/head:pull/4552 PR: https://git.openjdk.java.net/jdk/pull/4552 From dfuchs at openjdk.java.net Tue Jun 22 13:48:32 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Tue, 22 Jun 2021 13:48:32 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v4] In-Reply-To: References: Message-ID: <3ORyUGmElcdn5tU2Boe0yfaUhmljtdlCdTwXOhEe4Qw=.2d7d8371-a43d-4c13-9336-c9c8e6bf63a3@github.com> On Tue, 22 Jun 2021 09:58:55 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions Marked as reviewed by dfuchs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From dfuchs at openjdk.java.net Tue Jun 22 13:56:26 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Tue, 22 Jun 2021 13:56:26 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 10:50:17 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick The proposed changes look reasonable to me. Make sure to run all the tests of course. ------------- Marked as reviewed by dfuchs (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4552 From vtewari at openjdk.java.net Tue Jun 22 14:51:34 2021 From: vtewari at openjdk.java.net (Vyom Tewari) Date: Tue, 22 Jun 2021 14:51:34 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 10:50:17 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Changes looks OK to me, although i can see, in existing code couple of places we are doing conversion from long to int((int) newValue * 1000_000;) ------------- Marked as reviewed by vtewari (Committer). PR: https://git.openjdk.java.net/jdk/pull/4552 From aefimov at openjdk.java.net Tue Jun 22 15:44:29 2021 From: aefimov at openjdk.java.net (Aleksei Efimov) Date: Tue, 22 Jun 2021 15:44:29 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 10:50:17 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Changes requested by aefimov (Committer). src/java.base/share/classes/java/time/Instant.java line 852: > 850: public Instant plus(long amountToAdd, TemporalUnit unit) { > 851: if (unit instanceof ChronoUnit) { > 852: switch ((ChronoUnit) unit) { It looks like we need to put `return` here, otherwise `UnsupportedTemporalTypeException` will be thrown every time the method is called: jshell> Instant.now() $2 ==> 2021-06-22T15:35:28.771128667Z jshell> $2.plus(10L, ChronoUnit.SECONDS) | Exception java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Seconds | at Instant.plus (Instant.java:862) | at (#5:1) src/java.base/share/classes/java/time/ZonedDateTime.java line 1311: > 1309: } > 1310: default -> resolveLocal(dateTime.with(field, newValue)); > 1311: }; It looks like that the closing braces `}` is missing here. ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Tue Jun 22 16:07:16 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 16:07:16 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 15:40:12 GMT, Aleksei Efimov wrote: >> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: >> >> 8269124: Added missing brace; fixed build issue > > src/java.base/share/classes/java/time/Instant.java line 852: > >> 850: public Instant plus(long amountToAdd, TemporalUnit unit) { >> 851: if (unit instanceof ChronoUnit) { >> 852: switch ((ChronoUnit) unit) { > > It looks like we need to put `return` here, otherwise `UnsupportedTemporalTypeException` will be thrown every time the method is called: > > jshell> Instant.now() > $2 ==> 2021-06-22T15:35:28.771128667Z > > jshell> $2.plus(10L, ChronoUnit.SECONDS) > | Exception java.time.temporal.UnsupportedTemporalTypeException: Unsupported unit: Seconds > | at Instant.plus (Instant.java:862) > | at (#5:1) I've made that change now. See 5fa4e3c > src/java.base/share/classes/java/time/ZonedDateTime.java line 1311: > >> 1309: } >> 1310: default -> resolveLocal(dateTime.with(field, newValue)); >> 1311: }; > > It looks like that the closing braces `}` is missing here. Hi Aleksei, thanks for spotting this. I've added that in now. See 5fa4e3c ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Tue Jun 22 16:07:12 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 16:07:12 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 8269124: Added missing brace; fixed build issue ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4552/files - new: https://git.openjdk.java.net/jdk/pull/4552/files/a9497fd4..5fa4e3c5 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=00-01 Stats: 5 lines in 2 files changed: 1 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk/pull/4552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4552/head:pull/4552 PR: https://git.openjdk.java.net/jdk/pull/4552 From aefimov at openjdk.java.net Tue Jun 22 16:17:31 2021 From: aefimov at openjdk.java.net (Aleksei Efimov) Date: Tue, 22 Jun 2021 16:17:31 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 16:07:12 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing brace; fixed build issue Thanks for quickly addressing the issues. The latest version looks good to me. ------------- Marked as reviewed by aefimov (Committer). PR: https://git.openjdk.java.net/jdk/pull/4552 From naoto at openjdk.java.net Tue Jun 22 17:31:36 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 22 Jun 2021 17:31:36 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v4] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 09:58:55 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions Marked as reviewed by naoto (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From iris at openjdk.java.net Tue Jun 22 17:39:33 2021 From: iris at openjdk.java.net (Iris Clark) Date: Tue, 22 Jun 2021 17:39:33 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 16:07:12 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing brace; fixed build issue Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From iris at openjdk.java.net Tue Jun 22 17:43:36 2021 From: iris at openjdk.java.net (Iris Clark) Date: Tue, 22 Jun 2021 17:43:36 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v4] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 09:58:55 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Tue Jun 22 17:50:05 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Tue, 22 Jun 2021 17:50:05 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v3] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 8269124: Added missing return ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4552/files - new: https://git.openjdk.java.net/jdk/pull/4552/files/5fa4e3c5..9c629c82 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk/pull/4552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4552/head:pull/4552 PR: https://git.openjdk.java.net/jdk/pull/4552 From naoto at openjdk.java.net Tue Jun 22 17:50:10 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Tue, 22 Jun 2021 17:50:10 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 16:07:12 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing brace; fixed build issue src/java.base/share/classes/java/time/Instant.java line 562: > 560: public int get(TemporalField field) { > 561: if (field instanceof ChronoField) { > 562: return switch ((ChronoField) field) { Not really comment on the change itself, but Is this a leftover from the `instanceof` pattern variable exercise, or will we have another round for that? I see other locations which could be leftovers. ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From chegar at openjdk.java.net Tue Jun 22 17:56:32 2021 From: chegar at openjdk.java.net (Chris Hegarty) Date: Tue, 22 Jun 2021 17:56:32 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v4] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 09:58:55 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? >> >> Kind regards, >> Patrick > > Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: > > - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Removed excessive spacing; corrected misplaced comments > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - Merge remote-tracking branch 'origin/master' into JDK-8268469 > - 8268469: Update java.time to use switch expressions Marked as reviewed by chegar (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From lancea at openjdk.java.net Tue Jun 22 18:12:30 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Tue, 22 Jun 2021 18:12:30 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v3] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 17:50:05 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing return Marked as reviewed by lancea (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From iris at openjdk.java.net Tue Jun 22 19:58:36 2021 From: iris at openjdk.java.net (Iris Clark) Date: Tue, 22 Jun 2021 19:58:36 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v3] In-Reply-To: References: Message-ID: <6AFaFw_5BAh18JyEH-KSfxhXyI9yHkIgD3Ig5LfkVJ0=.f8d06878-f307-4ace-8cb2-f11a14621c56@github.com> On Tue, 22 Jun 2021 17:50:05 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing return Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Wed Jun 23 10:42:27 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Wed, 23 Jun 2021 10:42:27 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 17:27:58 GMT, Naoto Sato wrote: >> Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: >> >> 8269124: Added missing brace; fixed build issue > > src/java.base/share/classes/java/time/Instant.java line 562: > >> 560: public int get(TemporalField field) { >> 561: if (field instanceof ChronoField) { >> 562: return switch ((ChronoField) field) { > > Not really comment on the change itself, but Is this a leftover from the `instanceof` pattern variable exercise, or will we have another round for that? I see other locations which could be leftovers. Hi Naoto, I decided to only introduce the`instanceof` pattern variable where I thought it would add additional value to the code. In situations like this one, I thought there wasn't much point as the cast variable is only used once (in the switch). However, if you think I've overlooked something that would be beneficial to change, I'd be happy to take a look. ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From aefimov at openjdk.java.net Wed Jun 23 12:06:31 2021 From: aefimov at openjdk.java.net (Aleksei Efimov) Date: Wed, 23 Jun 2021 12:06:31 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v3] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 17:50:05 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing return Marked as reviewed by aefimov (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From naoto at openjdk.java.net Wed Jun 23 16:38:30 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 23 Jun 2021 16:38:30 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: On Wed, 23 Jun 2021 10:39:06 GMT, Patrick Concannon wrote: >> src/java.base/share/classes/java/time/Instant.java line 562: >> >>> 560: public int get(TemporalField field) { >>> 561: if (field instanceof ChronoField) { >>> 562: return switch ((ChronoField) field) { >> >> Not really comment on the change itself, but Is this a leftover from the `instanceof` pattern variable exercise, or will we have another round for that? I see other locations which could be leftovers. > > Hi Naoto, I decided to only introduce the`instanceof` pattern variable where I thought it would add additional value to the code. In situations like this one, I thought there wasn't much point as the cast variable is only used once (in the switch). However, if you think I've overlooked something that would be beneficial to change, I'd be happy to take a look. I'd personally replace all the applicable locations, as otherwise, it would confuse why there are two idioms. But it is outside of this PR so probably for another day. ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From naoto at openjdk.java.net Wed Jun 23 16:38:30 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 23 Jun 2021 16:38:30 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v3] In-Reply-To: References: Message-ID: On Tue, 22 Jun 2021 17:50:05 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added missing return Marked as reviewed by naoto (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From dfuchs at openjdk.java.net Wed Jun 23 17:57:31 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Wed, 23 Jun 2021 17:57:31 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: References: Message-ID: <-8itTd_L5z6m5xtgGIpw48oN06RxiTT83WNFWfFg4V0=.fbe7c07b-c454-4ba3-b350-e21bc38306f3@github.com> On Wed, 23 Jun 2021 16:35:30 GMT, Naoto Sato wrote: >> Hi Naoto, I decided to only introduce the`instanceof` pattern variable where I thought it would add additional value to the code. In situations like this one, I thought there wasn't much point as the cast variable is only used once (in the switch). However, if you think I've overlooked something that would be beneficial to change, I'd be happy to take a look. > > I'd personally replace all the applicable locations, as otherwise, it would confuse why there are two idioms. But it is outside of this PR so probably for another day. I agree with Naoto that it's a bit strange. ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Thu Jun 24 10:16:09 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 24 Jun 2021 10:16:09 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v5] In-Reply-To: References: Message-ID: <9gU8YD8xnBhGjhJ9u-KjtoTpw4h-56KQMuv3F9-rXiY=.93419fdc-560a-4135-a807-76a3f9c75634@github.com> > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains seven additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Removed excessive spacing; corrected misplaced comments - Merge remote-tracking branch 'origin/master' into JDK-8268469 - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Update java.time to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4433/files - new: https://git.openjdk.java.net/jdk/pull/4433/files/24ae9e53..a841c3cf Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=03-04 Stats: 5886 lines in 182 files changed: 2055 ins; 3315 del; 516 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Thu Jun 24 11:15:55 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 24 Jun 2021 11:15:55 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v4] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8269124 - 8269124: Added missing return - 8269124: Added missing brace; fixed build issue - 8269124: Update java.time to use switch expressions (part II) ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4552/files - new: https://git.openjdk.java.net/jdk/pull/4552/files/9c629c82..0c6c4a2a Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=02-03 Stats: 5886 lines in 182 files changed: 2055 ins; 3315 del; 516 mod Patch: https://git.openjdk.java.net/jdk/pull/4552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4552/head:pull/4552 PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Thu Jun 24 12:01:05 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 24 Jun 2021 12:01:05 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v2] In-Reply-To: <-8itTd_L5z6m5xtgGIpw48oN06RxiTT83WNFWfFg4V0=.fbe7c07b-c454-4ba3-b350-e21bc38306f3@github.com> References: <-8itTd_L5z6m5xtgGIpw48oN06RxiTT83WNFWfFg4V0=.fbe7c07b-c454-4ba3-b350-e21bc38306f3@github.com> Message-ID: On Wed, 23 Jun 2021 17:54:30 GMT, Daniel Fuchs wrote: >> I'd personally replace all the applicable locations, as otherwise, it would confuse why there are two idioms. But it is outside of this PR so probably for another day. > > I agree with Naoto that it's a bit strange. OK. If you guys think it's worthwhile. I've added in those changes now. Please see commit 3a1b716 ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Thu Jun 24 12:01:04 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Thu, 24 Jun 2021 12:01:04 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: > Hi, > > Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? > > This PR was split into two parts due to the large number of files affected. > > Kind regards, > > Patrick Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: 8269124: Added instanceof pattern variables ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4552/files - new: https://git.openjdk.java.net/jdk/pull/4552/files/0c6c4a2a..3a1b7161 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=04 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4552&range=03-04 Stats: 12 lines in 3 files changed: 0 ins; 1 del; 11 mod Patch: https://git.openjdk.java.net/jdk/pull/4552.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4552/head:pull/4552 PR: https://git.openjdk.java.net/jdk/pull/4552 From dfuchs at openjdk.java.net Thu Jun 24 15:38:35 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Thu, 24 Jun 2021 15:38:35 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: On Thu, 24 Jun 2021 12:01:04 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added instanceof pattern variables Marked as reviewed by dfuchs (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From naoto at openjdk.java.net Thu Jun 24 17:27:31 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Thu, 24 Jun 2021 17:27:31 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: On Thu, 24 Jun 2021 12:01:04 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added instanceof pattern variables Marked as reviewed by naoto (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From lancea at openjdk.java.net Thu Jun 24 17:55:30 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Thu, 24 Jun 2021 17:55:30 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: <4E_jVbjEJQueUaM1VDj3g5nIXTbC76Tm8Ld5K7ffgDI=.7d0552c0-dfcc-468e-9b81-3339389c7aad@github.com> On Thu, 24 Jun 2021 12:01:04 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added instanceof pattern variables Marked as reviewed by lancea (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From iris at openjdk.java.net Thu Jun 24 18:03:27 2021 From: iris at openjdk.java.net (Iris Clark) Date: Thu, 24 Jun 2021 18:03:27 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: On Thu, 24 Jun 2021 12:01:04 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added instanceof pattern variables Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From aefimov at openjdk.java.net Fri Jun 25 10:22:04 2021 From: aefimov at openjdk.java.net (Aleksei Efimov) Date: Fri, 25 Jun 2021 10:22:04 GMT Subject: RFR: 8269124: Update java.time to use switch expressions (part II) [v5] In-Reply-To: References: Message-ID: On Thu, 24 Jun 2021 12:01:04 GMT, Patrick Concannon wrote: >> Hi, >> >> Could someone please review the second half of my update for the `java.time` package to make use of switch expressions? >> >> This PR was split into two parts due to the large number of files affected. >> >> Kind regards, >> >> Patrick > > Patrick Concannon has updated the pull request incrementally with one additional commit since the last revision: > > 8269124: Added instanceof pattern variables Marked as reviewed by aefimov (Committer). ------------- PR: https://git.openjdk.java.net/jdk/pull/4552 From pconcannon at openjdk.java.net Fri Jun 25 14:01:39 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Fri, 25 Jun 2021 14:01:39 GMT Subject: RFR: 8268469: Update java.time to use switch expressions [v6] In-Reply-To: References: Message-ID: <_S-W524nYA-9n6JslzK4lZ6Nh_uohDPAclBLKkEV3Pg=.3b36641e-43f2-4a47-938a-1511062d486a@github.com> > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick Patrick Concannon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision: - Merge remote-tracking branch 'origin/master' into JDK-8268469 - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Removed alignment of arrow operators in some cases; reverted logic of switch/case in LocalDate - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Removed excessive spacing; corrected misplaced comments - Merge remote-tracking branch 'origin/master' into JDK-8268469 - Merge remote-tracking branch 'origin/master' into JDK-8268469 - 8268469: Update java.time to use switch expressions ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4433/files - new: https://git.openjdk.java.net/jdk/pull/4433/files/a841c3cf..c8c1ab55 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=05 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4433&range=04-05 Stats: 7048 lines in 208 files changed: 1680 ins; 5063 del; 305 mod Patch: https://git.openjdk.java.net/jdk/pull/4433.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4433/head:pull/4433 PR: https://git.openjdk.java.net/jdk/pull/4433 From pconcannon at openjdk.java.net Fri Jun 25 15:46:07 2021 From: pconcannon at openjdk.java.net (Patrick Concannon) Date: Fri, 25 Jun 2021 15:46:07 GMT Subject: Integrated: 8268469: Update java.time to use switch expressions In-Reply-To: References: Message-ID: <22x8QVnC2tuHPg-JQpi-WYksxTGQsfjdUWSOWrLfj0Y=.9a564411-20dd-4d20-935e-bf0b3b3f5937@github.com> On Wed, 9 Jun 2021 15:41:59 GMT, Patrick Concannon wrote: > Hi, > > Could someone please review my code for updating the code in the `java.time` packages to make use of the switch expressions? > > Kind regards, > Patrick This pull request has now been integrated. Changeset: 1d167978 Author: Patrick Concannon URL: https://git.openjdk.java.net/jdk/commit/1d167978e53603ccf1599f476143391e7db51992 Stats: 342 lines in 22 files changed: 6 ins; 87 del; 249 mod 8268469: Update java.time to use switch expressions Reviewed-by: lancea, naoto, dfuchs, iris, chegar ------------- PR: https://git.openjdk.java.net/jdk/pull/4433 From weijun at openjdk.java.net Fri Jun 25 20:11:27 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Fri, 25 Jun 2021 20:11:27 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K Message-ID: More refactoring to limit the scope of `@SuppressWarnings` annotations. Sometimes I introduce new methods. Please feel free to suggest method names you like to use. ------------- Commit messages: - 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K Changes: https://git.openjdk.java.net/jdk17/pull/152/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=152&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269409 Stats: 289 lines in 21 files changed: 161 ins; 64 del; 64 mod Patch: https://git.openjdk.java.net/jdk17/pull/152.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/152/head:pull/152 PR: https://git.openjdk.java.net/jdk17/pull/152 From lancea at openjdk.java.net Fri Jun 25 20:27:59 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Fri, 25 Jun 2021 20:27:59 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K In-Reply-To: References: Message-ID: On Fri, 25 Jun 2021 20:04:37 GMT, Weijun Wang wrote: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. Changes look good Max ------------- Marked as reviewed by lancea (Reviewer). PR: https://git.openjdk.java.net/jdk17/pull/152 From naoto at openjdk.java.net Fri Jun 25 23:11:02 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Fri, 25 Jun 2021 23:11:02 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K In-Reply-To: References: Message-ID: On Fri, 25 Jun 2021 20:04:37 GMT, Weijun Wang wrote: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. LGTM. ------------- Marked as reviewed by naoto (Reviewer). PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Fri Jun 25 23:40:27 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Fri, 25 Jun 2021 23:40:27 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: References: Message-ID: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: one more ------------- Changes: - all: https://git.openjdk.java.net/jdk17/pull/152/files - new: https://git.openjdk.java.net/jdk17/pull/152/files/d8b384df..774eb9da Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=152&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=152&range=00-01 Stats: 2 lines in 1 file changed: 1 ins; 1 del; 0 mod Patch: https://git.openjdk.java.net/jdk17/pull/152.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/152/head:pull/152 PR: https://git.openjdk.java.net/jdk17/pull/152 From lancea at openjdk.java.net Sat Jun 26 11:09:00 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Sat, 26 Jun 2021 11:09:00 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: On Fri, 25 Jun 2021 23:40:27 GMT, Weijun Wang wrote: >> More refactoring to limit the scope of `@SuppressWarnings` annotations. >> >> Sometimes I introduce new methods. Please feel free to suggest method names you like to use. > > Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: > > one more Marked as reviewed by lancea (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From alanb at openjdk.java.net Sat Jun 26 16:55:59 2021 From: alanb at openjdk.java.net (Alan Bateman) Date: Sat, 26 Jun 2021 16:55:59 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: On Fri, 25 Jun 2021 23:40:27 GMT, Weijun Wang wrote: >> More refactoring to limit the scope of `@SuppressWarnings` annotations. >> >> Sometimes I introduce new methods. Please feel free to suggest method names you like to use. > > Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: > > one more src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java line 53: > 51: private static final long CURRENT_PID = AccessController.doPrivileged( > 52: (PrivilegedAction) ProcessHandle::current).pid(); > 53: The original code separated out the declaration of the PrivilegedAction to avoid this cast. If you move the code from the original static initializer into a static method that it called from initializer then it might provide you with a cleaner way to refactor this. There are several other places in this patch that could do with similar cleanup. ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Sat Jun 26 23:59:03 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Sat, 26 Jun 2021 23:59:03 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: On Sat, 26 Jun 2021 16:53:30 GMT, Alan Bateman wrote: >> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: >> >> one more > > src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java line 53: > >> 51: private static final long CURRENT_PID = AccessController.doPrivileged( >> 52: (PrivilegedAction) ProcessHandle::current).pid(); >> 53: > > The original code separated out the declaration of the PrivilegedAction to avoid this cast. If you move the code from the original static initializer into a static method that it called from initializer then it might provide you with a cleaner way to refactor this. There are several other places in this patch that could do with similar cleanup. This cast is only to tell the compiler which overloaded method to call, and I don't think there will be a real cast at runtime. It might look a little ugly but extracting it into a variable declaration/definition plus a new `initStatic` method seems not worth doing, IMHO. ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From dfuchs at openjdk.java.net Mon Jun 28 12:24:05 2021 From: dfuchs at openjdk.java.net (Daniel Fuchs) Date: Mon, 28 Jun 2021 12:24:05 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: On Sat, 26 Jun 2021 23:55:46 GMT, Weijun Wang wrote: >> src/jdk.attach/share/classes/sun/tools/attach/HotSpotVirtualMachine.java line 53: >> >>> 51: private static final long CURRENT_PID = AccessController.doPrivileged( >>> 52: (PrivilegedAction) ProcessHandle::current).pid(); >>> 53: >> >> The original code separated out the declaration of the PrivilegedAction to avoid this cast. If you move the code from the original static initializer into a static method that it called from initializer then it might provide you with a cleaner way to refactor this. There are several other places in this patch that could do with similar cleanup. > > This cast is only to tell the compiler which overloaded method to call, and I don't think there will be a real cast at runtime. It might look a little ugly but extracting it into a variable declaration/definition plus a new `initStatic` method seems not worth doing, IMHO. Why not simply declare a local variable in the static initializer below? private static final long CURRENT_PID; private static final boolean ALLOW_ATTACH_SELF; static { PrivilegedAction pa = ProcessHandle::current; @SuppressWarnings("removal") long pid = AccessController.doPrivileged(pa).pid(); CURRENT_PID = pid; String s = VM.getSavedProperty("jdk.attach.allowAttachSelf"); ALLOW_ATTACH_SELF = "".equals(s) || Boolean.parseBoolean(s); } ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Mon Jun 28 14:22:47 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 14:22:47 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v3] In-Reply-To: References: Message-ID: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: one more refinement ------------- Changes: - all: https://git.openjdk.java.net/jdk17/pull/152/files - new: https://git.openjdk.java.net/jdk17/pull/152/files/774eb9da..2e4a8ba7 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=152&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=152&range=01-02 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk17/pull/152.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/152/head:pull/152 PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Mon Jun 28 14:22:49 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 14:22:49 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: On Fri, 25 Jun 2021 23:40:27 GMT, Weijun Wang wrote: >> More refactoring to limit the scope of `@SuppressWarnings` annotations. >> >> Sometimes I introduce new methods. Please feel free to suggest method names you like to use. > > Weijun Wang has updated the pull request incrementally with one additional commit since the last revision: > > one more I'm going to move this to jdk18. ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Mon Jun 28 14:22:51 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 14:22:51 GMT Subject: [jdk17] RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K [v2] In-Reply-To: References: <8espagHVTHv183MA_Cj9mpzXcYnu7fMSx-1xCzWV4IQ=.032f7cdc-6372-41c7-b1ef-a447a2491480@github.com> Message-ID: <921aev1Be6BDt-9x6qkx-DqcgpCdUxkxD5nM8WQsNLs=.adbfc2ef-25cf-468a-8b6e-e8aa92aa8e3c@github.com> On Mon, 28 Jun 2021 12:20:38 GMT, Daniel Fuchs wrote: >> This cast is only to tell the compiler which overloaded method to call, and I don't think there will be a real cast at runtime. It might look a little ugly but extracting it into a variable declaration/definition plus a new `initStatic` method seems not worth doing, IMHO. > > Why not simply declare a local variable in the static initializer below? > > > private static final long CURRENT_PID; > private static final boolean ALLOW_ATTACH_SELF; > static { > PrivilegedAction pa = ProcessHandle::current; > @SuppressWarnings("removal") > long pid = AccessController.doPrivileged(pa).pid(); > CURRENT_PID = pid; > String s = VM.getSavedProperty("jdk.attach.allowAttachSelf"); > ALLOW_ATTACH_SELF = "".equals(s) || Boolean.parseBoolean(s); > } I've just pushed a commit with a different fix: private static final long CURRENT_PID = pid(); @SuppressWarnings("removal") private static long pid() { PrivilegedAction pa = () -> ProcessHandle.current(); return AccessController.doPrivileged(pa).pid(); } ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From naoto at openjdk.java.net Mon Jun 28 17:06:18 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 28 Jun 2021 17:06:18 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property Message-ID: Please review this small doc change to the system property. Accompanying CSR has also been created. ------------- Commit messages: - 8269513: Clarify the spec wrt `useOldISOCodes` system property Changes: https://git.openjdk.java.net/jdk17/pull/163/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269513 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk17/pull/163.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/163/head:pull/163 PR: https://git.openjdk.java.net/jdk17/pull/163 From lancea at openjdk.java.net Mon Jun 28 17:56:07 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Mon, 28 Jun 2021 17:56:07 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 16:57:15 GMT, Naoto Sato wrote: > Please review this small doc change to the system property. Accompanying CSR has also been created. Looks good Naoto ------------- Marked as reviewed by lancea (Reviewer). PR: https://git.openjdk.java.net/jdk17/pull/163 From weijun at openjdk.java.net Mon Jun 28 18:11:07 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 18:11:07 GMT Subject: [jdk17] Withdrawn: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K In-Reply-To: References: Message-ID: On Fri, 25 Jun 2021 20:04:37 GMT, Weijun Wang wrote: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.java.net/jdk17/pull/152 From weijun at openjdk.java.net Mon Jun 28 18:15:30 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 18:15:30 GMT Subject: RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K Message-ID: More refactoring to limit the scope of `@SuppressWarnings` annotations. Sometimes I introduce new methods. Please feel free to suggest method names you like to use. Note: this is copied from https://github.com/openjdk/jdk17/pull/152. ------------- Commit messages: - copy all code change from jdk17 Changes: https://git.openjdk.java.net/jdk/pull/4615/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4615&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269409 Stats: 293 lines in 21 files changed: 165 ins; 64 del; 64 mod Patch: https://git.openjdk.java.net/jdk/pull/4615.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4615/head:pull/4615 PR: https://git.openjdk.java.net/jdk/pull/4615 From naoto at openjdk.java.net Mon Jun 28 18:37:34 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 28 Jun 2021 18:37:34 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: > Please review this small doc change to the system property. Accompanying CSR has also been created. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Refined wording. ------------- Changes: - all: https://git.openjdk.java.net/jdk17/pull/163/files - new: https://git.openjdk.java.net/jdk17/pull/163/files/92a8bfc6..3d25418c Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=01 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=00-01 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/jdk17/pull/163.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/163/head:pull/163 PR: https://git.openjdk.java.net/jdk17/pull/163 From lancea at openjdk.java.net Mon Jun 28 18:44:06 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Mon, 28 Jun 2021 18:44:06 GMT Subject: RFR: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:03:56 GMT, Weijun Wang wrote: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. > > Note: this is copied from https://github.com/openjdk/jdk17/pull/152. The revisions you made as part of the push to JDK 18 look fine Max. ------------- Marked as reviewed by lancea (Reviewer). PR: https://git.openjdk.java.net/jdk/pull/4615 From bpb at openjdk.java.net Mon Jun 28 18:45:09 2021 From: bpb at openjdk.java.net (Brian Burkhalter) Date: Mon, 28 Jun 2021 18:45:09 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:37:34 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Refined wording. Looks fine. ------------- Marked as reviewed by bpb (Reviewer). PR: https://git.openjdk.java.net/jdk17/pull/163 From lancea at openjdk.java.net Mon Jun 28 19:03:08 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Mon, 28 Jun 2021 19:03:08 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:37:34 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Refined wording. src/java.base/share/classes/java/util/Locale.java line 460: > 458: * back to that of before Java SE 17. If the system property is set to > 459: * {@code true}, those three current language codes are mapped to their > 460: * backward compatible forms. It is only read at Java runtime startup, so a I had thought about some of some minor word smithing in your prior commit, but chose not to request a change. In the above sentence, It could be clearer what "It" is. Perhaps something along the lines of: This property is only read at Java runtime startup and subsequents calls to ...." ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From weijun at openjdk.java.net Mon Jun 28 19:09:15 2021 From: weijun at openjdk.java.net (Weijun Wang) Date: Mon, 28 Jun 2021 19:09:15 GMT Subject: Integrated: 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:03:56 GMT, Weijun Wang wrote: > More refactoring to limit the scope of `@SuppressWarnings` annotations. > > Sometimes I introduce new methods. Please feel free to suggest method names you like to use. > > Note: this is copied from https://github.com/openjdk/jdk17/pull/152. This pull request has now been integrated. Changeset: e9b2c058 Author: Weijun Wang URL: https://git.openjdk.java.net/jdk/commit/e9b2c058a4ed5de29b991360f78fc1c5263c9268 Stats: 293 lines in 21 files changed: 165 ins; 64 del; 64 mod 8269409: Post JEP 411 refactoring: core-libs with maximum covering > 10K Reviewed-by: lancea, naoto ------------- PR: https://git.openjdk.java.net/jdk/pull/4615 From iris at openjdk.java.net Mon Jun 28 19:20:07 2021 From: iris at openjdk.java.net (Iris Clark) Date: Mon, 28 Jun 2021 19:20:07 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:37:34 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Refined wording. Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From joehw at openjdk.java.net Mon Jun 28 19:27:12 2021 From: joehw at openjdk.java.net (Joe Wang) Date: Mon, 28 Jun 2021 19:27:12 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:37:34 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Refined wording. Marked as reviewed by joehw (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From joehw at openjdk.java.net Mon Jun 28 19:27:13 2021 From: joehw at openjdk.java.net (Joe Wang) Date: Mon, 28 Jun 2021 19:27:13 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:45:31 GMT, Lance Andersen wrote: >> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: >> >> Refined wording. > > src/java.base/share/classes/java/util/Locale.java line 460: > >> 458: * back to that of before Java SE 17. If the system property is set to >> 459: * {@code true}, those three current language codes are mapped to their >> 460: * backward compatible forms. It is only read at Java runtime startup, so a > > I had thought about some of some minor word smithing in your prior commit, but chose not to request a change. > > In the above sentence, It could be clearer what "It" is. Perhaps something along the lines of: > > This property is only read at Java runtime startup and subsequents calls to ...." Also, "backward compatible behavior" maybe not needed to be repeated, e.g. "subsequent calls to ... will have no effect. "back to that of before Java SE 17" -- "of" may be removed. ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From naoto at openjdk.java.net Mon Jun 28 20:29:37 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 28 Jun 2021 20:29:37 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v2] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 18:37:34 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Refined wording. Thanks. I updated the PR and CSR accordingly. As to removing "of", I think the current form is fine, but I am not a native English speaker, so happy to correct it if it is wrong. ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From naoto at openjdk.java.net Mon Jun 28 20:29:33 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 28 Jun 2021 20:29:33 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v3] In-Reply-To: References: Message-ID: > Please review this small doc change to the system property. Accompanying CSR has also been created. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Refined wording #2. ------------- Changes: - all: https://git.openjdk.java.net/jdk17/pull/163/files - new: https://git.openjdk.java.net/jdk17/pull/163/files/3d25418c..da119219 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=02 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/jdk17/pull/163.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/163/head:pull/163 PR: https://git.openjdk.java.net/jdk17/pull/163 From naoto at openjdk.java.net Mon Jun 28 20:33:29 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Mon, 28 Jun 2021 20:33:29 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v4] In-Reply-To: References: Message-ID: > Please review this small doc change to the system property. Accompanying CSR has also been created. Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: Missed one. ------------- Changes: - all: https://git.openjdk.java.net/jdk17/pull/163/files - new: https://git.openjdk.java.net/jdk17/pull/163/files/da119219..3b6ff65d Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=03 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=163&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk17/pull/163.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/163/head:pull/163 PR: https://git.openjdk.java.net/jdk17/pull/163 From iris at openjdk.java.net Mon Jun 28 20:39:03 2021 From: iris at openjdk.java.net (Iris Clark) Date: Mon, 28 Jun 2021 20:39:03 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v4] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 20:33:29 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Missed one. Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From lancea at openjdk.java.net Mon Jun 28 21:07:08 2021 From: lancea at openjdk.java.net (Lance Andersen) Date: Mon, 28 Jun 2021 21:07:08 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v4] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 20:33:29 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Missed one. Marked as reviewed by lancea (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From joehw at openjdk.java.net Mon Jun 28 22:27:07 2021 From: joehw at openjdk.java.net (Joe Wang) Date: Mon, 28 Jun 2021 22:27:07 GMT Subject: [jdk17] RFR: 8269513: Clarify the spec wrt `useOldISOCodes` system property [v4] In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 20:33:29 GMT, Naoto Sato wrote: >> Please review this small doc change to the system property. Accompanying CSR has also been created. > > Naoto Sato has updated the pull request incrementally with one additional commit since the last revision: > > Missed one. Marked as reviewed by joehw (Reviewer). Thanks for the update. As for "of", apparently the native speakers were fine with it ;-) ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 30 08:47:24 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 30 Jun 2021 08:47:24 GMT Subject: RFR: 8269665: Clean-up toString() methods of some primitive wrappers Message-ID: <-UpwLOaXO_2aSn1SpXnPNBu1NluvTcoWgBfz1XvZSv4=.6f3e58b9-d4c4-4004-ac64-b4debe32b3cd@github.com> As of JDK 17 some of primitive wrappers, e.g. `Long`, `Integer`, `Double` and `Float` in their implementations of `Object.toString()` delegate to own utility `toString(primitive)` methods. Unlike those, `Boolean`, `Byte`, `Character` and `Short` just duplicate the contents of utility methods in implementations of `Object.toString()`. Yet another issue is a tiny discrepancy in implementation related to `Byte` and `Short` (see the first): public static String toString(byte b) { return Integer.toString((int)b, 10); } public String toString() { return Integer.toString((int)value); } Unlike in overriden method, In utility one they explicitly specify radix which can be skipped, as implementation of `Integer.toString(int,int)` has a fast-path for radix 10, ending in `Integer.toString(int)`. This simplification gives tiny improvement, see benchmark: @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) @Fork(jvmArgsAppend = {"-Xms2g", "-Xmx2g"}) public class ByteToStringBenchmark { @Benchmark public String byteToString() { return Byte.toString((byte) 1); } } Results: before Benchmark Mode Cnt Score Error Units ByteToStringBenchmark.byteToString avgt 30 11,648 ? 1,906 ns/op ByteToStringBenchmark.byteToString:?gc.alloc.rate avgt 30 3288,576 ? 418,119 MB/sec ByteToStringBenchmark.byteToString:?gc.alloc.rate.norm avgt 30 48,001 ? 0,001 B/op ByteToStringBenchmark.byteToString:?gc.churn.G1_Eden_Space avgt 30 3301,804 ? 455,932 MB/sec ByteToStringBenchmark.byteToString:?gc.churn.G1_Eden_Space.norm avgt 30 48,158 ? 2,085 B/op ByteToStringBenchmark.byteToString:?gc.churn.G1_Survivor_Space avgt 30 0,004 ? 0,001 MB/sec ByteToStringBenchmark.byteToString:?gc.churn.G1_Survivor_Space.norm avgt 30 ? 10?? B/op ByteToStringBenchmark.byteToString:?gc.count avgt 30 202,000 counts ByteToStringBenchmark.byteToString:?gc.time avgt 30 413,000 ms after Benchmark Mode Cnt Score Error Units ByteToStringBenchmark.byteToString avgt 30 10,016 ? 0,530 ns/op ByteToStringBenchmark.byteToString:?gc.alloc.rate avgt 30 3673,700 ? 167,450 MB/sec ByteToStringBenchmark.byteToString:?gc.alloc.rate.norm avgt 30 48,001 ? 0,001 B/op ByteToStringBenchmark.byteToString:?gc.churn.G1_Eden_Space avgt 30 3662,406 ? 205,978 MB/sec ByteToStringBenchmark.byteToString:?gc.churn.G1_Eden_Space.norm avgt 30 47,870 ? 1,750 B/op ByteToStringBenchmark.byteToString:?gc.churn.G1_Survivor_Space avgt 30 0,004 ? 0,002 MB/sec ByteToStringBenchmark.byteToString:?gc.churn.G1_Survivor_Space.norm avgt 30 ? 10?? B/op ByteToStringBenchmark.byteToString:?gc.count avgt 30 224,000 counts ByteToStringBenchmark.byteToString:?gc.time avgt 30 358,000 ms ------------- Commit messages: - 8269665: Clean-up toString() methods of some primitive wrappers Changes: https://git.openjdk.java.net/jdk/pull/4633/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4633&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269665 Stats: 10 lines in 4 files changed: 4 ins; 0 del; 6 mod Patch: https://git.openjdk.java.net/jdk/pull/4633.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4633/head:pull/4633 PR: https://git.openjdk.java.net/jdk/pull/4633 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 30 11:50:52 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 30 Jun 2021 11:50:52 GMT Subject: RFR: 8268113: Re-use Long.hashCode() where possible [v8] In-Reply-To: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> References: <7TGw6Vzvw38bqmNOQsuVuGXMe98OqH25nmexLUghcMU=.5e7b347c-0d83-4e54-acc3-9847c08cdc29@github.com> Message-ID: > There is a few JDK classes duplicating the contents of Long.hashCode() for hash code calculation. They should explicitly delegate to Long.hashCode(). ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision: - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - Merge branch 'master' into 8268113 - 8268113: Inline local vars where reasonable - 8268113: Delegate to Double.hashCode() - 8268113: Re-use Long.hashCode() where possible ------------- Changes: - all: https://git.openjdk.java.net/jdk/pull/4309/files - new: https://git.openjdk.java.net/jdk/pull/4309/files/f1c8cc7b..4ec7c829 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=07 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4309&range=06-07 Stats: 56052 lines in 1127 files changed: 32406 ins; 19375 del; 4271 mod Patch: https://git.openjdk.java.net/jdk/pull/4309.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4309/head:pull/4309 PR: https://git.openjdk.java.net/jdk/pull/4309 From github.com+10835776+stsypanov at openjdk.java.net Wed Jun 30 11:52:25 2021 From: github.com+10835776+stsypanov at openjdk.java.net (=?UTF-8?B?0KHQtdGA0LPQtdC5?= =?UTF-8?B?IA==?= =?UTF-8?B?0KbRi9C/0LDQvdC+0LI=?=) Date: Wed, 30 Jun 2021 11:52:25 GMT Subject: RFR: 8263561: Re-examine uses of LinkedList [v3] In-Reply-To: References: Message-ID: > After I've renamed remove branch GitHub for some reason has closed original https://github.com/openjdk/jdk/pull/2744, so I've decided to recreate it. ?????? ??????? has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: - Merge branch 'master' into 8263561 - Merge branch 'master' into 8263561 - Merge branch 'master' into 8263561 # Conflicts: # src/java.base/unix/classes/sun/net/dns/ResolverConfigurationImpl.java - Merge branch 'master' into purge-linked-list - 8263561: Use sized constructor where reasonable - 8263561: Use interface List instead of particular type where possible - 8263561: Rename requestList -> requests - 8263561: Re-examine uses of LinkedList ------------- Changes: https://git.openjdk.java.net/jdk/pull/4304/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=4304&range=02 Stats: 48 lines in 9 files changed: 0 ins; 2 del; 46 mod Patch: https://git.openjdk.java.net/jdk/pull/4304.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4304/head:pull/4304 PR: https://git.openjdk.java.net/jdk/pull/4304 From naoto at openjdk.java.net Wed Jun 30 21:45:13 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 30 Jun 2021 21:45:13 GMT Subject: [jdk17] RFR: 8269704: Typo in j.t.Normalizer.normalize() Message-ID: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> A trivial typo fix. ------------- Commit messages: - 8269704: Typo in j.t.Normalizer.normalize() Changes: https://git.openjdk.java.net/jdk17/pull/187/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk17&pr=187&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8269704 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/jdk17/pull/187.diff Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/187/head:pull/187 PR: https://git.openjdk.java.net/jdk17/pull/187 From naoto at openjdk.java.net Wed Jun 30 22:15:01 2021 From: naoto at openjdk.java.net (Naoto Sato) Date: Wed, 30 Jun 2021 22:15:01 GMT Subject: [jdk17] Integrated: 8269513: Clarify the spec wrt `useOldISOCodes` system property In-Reply-To: References: Message-ID: On Mon, 28 Jun 2021 16:57:15 GMT, Naoto Sato wrote: > Please review this small doc change to the system property. Accompanying CSR has also been created. This pull request has now been integrated. Changeset: 3e022247 Author: Naoto Sato URL: https://git.openjdk.java.net/jdk17/commit/3e022247d2e80c43393bfdb5888b03210c6975d3 Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod 8269513: Clarify the spec wrt `useOldISOCodes` system property Reviewed-by: lancea, bpb, iris, joehw ------------- PR: https://git.openjdk.java.net/jdk17/pull/163 From joehw at openjdk.java.net Wed Jun 30 22:29:57 2021 From: joehw at openjdk.java.net (Joe Wang) Date: Wed, 30 Jun 2021 22:29:57 GMT Subject: [jdk17] RFR: 8269704: Typo in j.t.Normalizer.normalize() In-Reply-To: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> References: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> Message-ID: <5GIkGnI9eqE0ktm3I7q3uw3yNMy0Ufa80gxmqvzKUpQ=.4a4c7d5f-a6c3-414e-8a0c-3c72c6996fa3@github.com> On Wed, 30 Jun 2021 21:38:43 GMT, Naoto Sato wrote: > A trivial typo fix. Marked as reviewed by joehw (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/187 From prappo at openjdk.java.net Wed Jun 30 22:35:01 2021 From: prappo at openjdk.java.net (Pavel Rappo) Date: Wed, 30 Jun 2021 22:35:01 GMT Subject: [jdk17] RFR: 8269704: Typo in j.t.Normalizer.normalize() In-Reply-To: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> References: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> Message-ID: On Wed, 30 Jun 2021 21:38:43 GMT, Naoto Sato wrote: > A trivial typo fix. Marked as reviewed by prappo (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/187 From iris at openjdk.java.net Wed Jun 30 23:05:02 2021 From: iris at openjdk.java.net (Iris Clark) Date: Wed, 30 Jun 2021 23:05:02 GMT Subject: [jdk17] RFR: 8269704: Typo in j.t.Normalizer.normalize() In-Reply-To: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> References: <5tcQNfqKKkO41BoxbhS8uzWis7SfJAGtyTJsFt0UFm4=.61b2691d-d8f1-4242-be27-9937d6c0ab0d@github.com> Message-ID: On Wed, 30 Jun 2021 21:38:43 GMT, Naoto Sato wrote: > A trivial typo fix. Marked as reviewed by iris (Reviewer). ------------- PR: https://git.openjdk.java.net/jdk17/pull/187