RFR: JDK-8290975 Minor cleanup could be done in javax.security

Mark Powers mpowers at openjdk.org
Thu Aug 4 20:28:56 UTC 2022


On Thu, 4 Aug 2022 16:45:36 GMT, Bradford Wetmore <wetmore at openjdk.org> wrote:

>> https://bugs.openjdk.org/browse/JDK-8290975
>
> src/java.base/share/classes/javax/security/auth/Subject.java line 36:
> 
>> 34: import java.security.*;
>> 35: import java.text.MessageFormat;
>> 36: import java.util.*;
> 
> What is the style convention you're trying to conform to here?

I'm letting IJ optimize imports. I didn't see anything in the style guide.

> src/java.base/share/classes/javax/security/auth/Subject.java line 1230:
> 
>> 1228:                     if (sm != null) {
>> 1229:                         switch (which) {
>> 1230:                             case Subject.PRINCIPAL_SET:
> 
> The original style guide convention has the switch and case at the same level.  
> 
> https://www.oracle.com/technetwork/java/codeconventions-150003.pdf
> 
> Is this a reformat from IJ (Settings->Editor->Code Style->Java->Wrapping Braces->'switch statement'?  IIRC, this is one setting where the default value isn't what we used to do.

I changed my IJ settings: switch and case now at same level.

> src/java.base/share/classes/javax/security/auth/spi/LoginModule.java line 29:
> 
>> 27: 
>> 28: import javax.security.auth.Subject;
>> 29: import javax.security.auth.callback.CallbackHandler;
> 
> Out of curiosity, did IJ point this out somehow?

Yes. IJ complained about unused imports and offered to optimize them for me.

-------------

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



More information about the security-dev mailing list