On Thu, 29 May 2025 01:58:37 GMT, Artur Barashev <[email protected]> wrote:
>> test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java line 107:
>>
>>> 105:
>>> 106: switch (testMode) {
>>> 107: case BASIC:
>>
>> Minor nit, Oracle Code Style is (was?) to keep case at the same level as the
>> switch. I noticed this was updated in all the different cases here.
>>
>> If you're using IJ, you'll need to set the Settings->Editor->Code
>> Style->Java->switch statement/expression->Indent case branches
>
> Could you please post a link to the guide where it says so? I've found a
> couple of Oracle examples and both use different switch/case levels:
>
> 1. https://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html
> 2.
> https://docs.oracle.com/en/java/javase/17/language/switch-expressions-and-statements.html
>
> Also, I couldn't find a single occurrence of the same switch/case level in
> our SSL code. `SSLKeyExchange.java` for example has multiple switch/case
> statement - all indented.
This isn't a big deal, and I'm ok with way. I probably wouldn't have
mentioned it in new code (Xuelei was apparently a fan :) ), but it was
surprising to see you change the existing switch indention style in two places
in this test.
See the PDF [Java Coding
Conventions](https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.oracle.com/docs/tech/java/codeconventions.pdf&ved=2ahUKEwiNqLPMz8eNAxVXJDQIHY33NrEQFnoECBkQAQ&usg=AOvVaw0D2xdWb0D3hvB-nDkKWcU9),
section 7.8 on Page 13.
My personal preference is as doc'd, as it reduces the indention creep by 1
level and gives more vertical room for code before hitting the recommended 80
char/line max.
If you Yah-oogl-ing (combo of Yahoo/Google/Bing :) ), you might [find the
newer HTML
version](https://www.oracle.com/java/technologies/javase/codeconventions-contents.html),
but the spacing in the article is completely broken!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25310#discussion_r2113086029