RFR: 8267587: Update java.util to use enhanced switch
Inspired by PR#4088. Most of the changes are done automatically using IntelliJ IDEA refactoring. Some manual adjustments are also performed, including indentations, moving comments, extracting common cast out of switch expression branches, etc. I also noticed that there are some switches having one branch only in JapaneseImperialCalendar.java. Probably it would be better to replace them with `if` statement? - Commit messages: - 8267587: Update java.util to use enhanced switch Changes: https://git.openjdk.java.net/jdk/pull/4161/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4161=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8267587 Stats: 887 lines in 17 files changed: 113 ins; 339 del; 435 mod Patch: https://git.openjdk.java.net/jdk/pull/4161.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4161/head:pull/4161 PR: https://git.openjdk.java.net/jdk/pull/4161
Re: RFR: 8267587: Update java.util to use enhanced switch
On Mon, 24 May 2021 04:20:23 GMT, Tagir F. Valeev wrote: > Inspired by PR#4088. Most of the changes are done automatically using > IntelliJ IDEA refactoring. Some manual adjustments are also performed, > including indentations, moving comments, extracting common cast out of switch > expression branches, etc. > > I also noticed that there are some switches having one branch only in > JapaneseImperialCalendar.java. Probably it would be better to replace them > with `if` statement? src/java.base/share/classes/java/util/jar/JarFile.java line 201: > 199: MULTI_RELEASE_FORCED = true; > 200: } > 201: default -> { Here, explicit `case "true"` disappeared. Not sure if it's important to keep it. - PR: https://git.openjdk.java.net/jdk/pull/4161
RFR: 8267584: The java.security.krb5.realm system property only needs to be defined once
A system property only needs to be put in a `{@systemProperty}` tag where it's first defined. For this one, it's https://github.com/openjdk/jdk/blob/cf21c5ef116c136f09ac5be0d68f02553d0c7a70/src/java.security.jgss/share/classes/javax/security/auth/kerberos/package-info.java#L41. - Commit messages: - 8267584: The java.security.krb5.realm system property only needs to be defined once Changes: https://git.openjdk.java.net/jdk/pull/4159/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk=4159=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8267584 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/jdk/pull/4159.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/4159/head:pull/4159 PR: https://git.openjdk.java.net/jdk/pull/4159
Re: RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v3]
On Fri, 21 May 2021 15:27:39 GMT, Daniel Fuchs wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java > > src/java.base/share/classes/java/lang/SecurityManager.java line 104: > >> 102: * method will throw an {@code UnsupportedOperationException}). If the >> 103: * {@systemProperty java.security.manager} system property is set to the >> 104: * special token "{@code allow}", then a security manager will not be >> set at > > Can/should the `{@systemProperty ...}` tag be used more than once for a given > system property? I thought it should be used only once, at the place where > the system property is defined. Maybe @jonathan-gibbons can offer some more > guidance on this. Good point. I would remove the extra @systemProperty tags on lines 103, 106, and 113. Also, in `System.setSecurityManager` there are 3 @systemProperty java.security.manager tags, I would just keep the first one. (I think it's ok to have more than one, if they are defined in different APIs). - PR: https://git.openjdk.java.net/jdk/pull/4073