RFR: 8267485: Remove the dependency on SecurityManager in JceSecurityManager.java [v7]

Bradford Wetmore wetmore at openjdk.java.net
Tue Jul 27 05:50:32 UTC 2021


On Tue, 27 Jul 2021 03:51:01 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Bradford Wetmore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Additional codereview comments
>
> src/java.base/share/classes/javax/crypto/JceSecurityManager.java line 76:
> 
>> 74:         StackWalker dummyWalker = AccessController.doPrivileged(
>> 75:                 (PrivilegedAction<StackWalker>) (() -> StackWalker.getInstance(
>> 76:                         Option.RETAIN_CLASS_REFERENCE)));
> 
> An alternative is to declare a local variable of `PrivilegedAction<StackWalker>` to avoid the cast:
> 
> 
>    PrivilegedAction<StackWalker> pa =
>                () -> StackWalker.getInstance(Option.RETAIN_CLASS_REFERENCE);
>    StackWalker dummyWalker = AccessController.doPrivileged(pa);

Reverted to the original style without the cast.

> src/java.base/share/classes/javax/crypto/JceSecurityManager.java line 114:
> 
>> 112:                     return (callerCodeBase != null) ?
>> 113:                             getCryptoPermissionFromURL(callerCodeBase,
>> 114:                                     alg, defaultPerm) : defaultPerm;})
> 
> nit: the line break at ":" would make it easier to read than breaking at `arg`.

Adding all three params would make it > 80 char lines.

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

PR: https://git.openjdk.java.net/jdk/pull/4150



More information about the security-dev mailing list