Review 8035808: Eliminate dependency to GetPropertyAction and other sun.security.action convenient classes

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Fri Mar 7 15:03:45 UTC 2014


On 3/7/14 3:31 PM, Alan Bateman wrote:
> On 06/03/2014 21:10, Mandy Chung wrote:
>> Webrev:
>> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8035808/webrev.00/
>>
>> This patch converts the use of sun.security.action.GetPropertyAction 
>> tolambda
>>        (PrivilegedAction<String>) () -> System.getProperty(key)
>>
>> Similarly for GetIntegerAction and GetLongAction.
>>
>> The sun.security.action.* classes are just convenient classes that 
>> are used not only by the security library but also used by RMI, 
>> management, a couple other components that cause cross-module 
>> dependency that are not absolutely necessary.  They can simply be 
>> replaced to call System.getProperty, Integer.getInteger, or 
>> Long.getLong at the callsite.
> This looks good to me as it reduces the number of inner classes, 
How it reduce the number of inner classes? Since it replaces a usage of 
one particular class to the new lambdas each time they are used.
Is this absolutely necessary? Does it mean that Get**Actions are 
deprecated now?
> removes a lot of dependencies on sun.* APIs, and updates the code to 
> use new language features. The only downside appears to the cast but 
> you can't really get away from that here (at least not without 
> declaring a PrivilegedAction for each usage).
>
> -Alan.


-- 
Best regards, Sergey.




More information about the core-libs-dev mailing list