RFR (12): 8191053: Provide a mechanism to make system's security manager immutable

Sean Mullan sean.mullan at oracle.com
Fri Sep 14 16:44:22 UTC 2018


On 9/13/18 11:01 PM, Weijun Wang wrote:
> 
> 
>> On Sep 14, 2018, at 4:02 AM, Sean Mullan <sean.mullan at oracle.com> wrote:
>>
>> webrev: http://cr.openjdk.java.net/~mullan/webrevs/8191053/webrev.00/
> 
>       public static SecurityManager getSecurityManager() {
> +        if (allowSecurityManager()) {
>           return security;
> +        } else {
> +            return null;
> +        }
>       }
> 
> Is this change really necessary? You have to call a method here.

I'll defer to a compiler expert, but I believe this is necessary to 
cause the constant-folding of this method since the allowSecurityManager 
field has an @Stable annotation.

>> CSR: https://bugs.openjdk.java.net/browse/JDK-8203316
> 
> Still having @Deprecated(since="11").

Fixed. Good catch.

--Sean



More information about the security-dev mailing list