RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]
Mark Powers
mpowers at openjdk.org
Thu Sep 1 21:49:15 UTC 2022
On Thu, 1 Sep 2022 02:55:21 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> Mark Powers has updated the pull request incrementally with one additional commit since the last revision:
>>
>> comments from Sean and Max
>
> src/java.base/share/classes/sun/security/provider/certpath/BasicChecker.java line 105:
>
>> 103: prevPubKey = trustedPubKey;
>> 104: if (PKIX.isDSAPublicKeyWithoutParams(prevPubKey)) {
>> 105: // If TrustAnchor is a DSA public key, and it has no params, it
>
> Not a native English speaker, but I found the sentence more fluent without the comma.
Removing the comma.
> src/java.base/share/classes/sun/security/provider/certpath/BuildStep.java line 192:
>
>> 190: String resultString;
>> 191: switch (res) {
>> 192: case POSSIBLE:
>
> `case` should be indented here. See http://cr.openjdk.java.net/~alundblad/styleguide/index-v6.html#toc-indentation.
>
> That said, I think this is a good chance to use the switch expressions syntax, i.e `return switch (res)...`.
Brad pointed me to this:
https://www.oracle.com/technetwork/java/codeconventions-150003.pdf
I think your reference is better since we're working on OpenJDK.
-------------
PR: https://git.openjdk.org/jdk/pull/9972
More information about the security-dev
mailing list