RFR: JDK-8291509 Minor cleanup could be done in sun.security [v4]

Mark Powers mpowers at openjdk.org
Thu Sep 1 22:12:57 UTC 2022

On Thu, 1 Sep 2022 21:46:38 GMT, Mark Powers <mpowers at openjdk.org> wrote:

>> 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.

Regarding your `return switch (res)...` comment:
You're suggesting to eliminate `resultString` and `return` after each `case`?


PR: https://git.openjdk.org/jdk/pull/9972

More information about the security-dev mailing list