RFR: 8210469: Missing doPriviledged block and permission for jdk.zipfs module
Mandy Chung
mandy.chung at oracle.com
Thu Jan 24 23:20:08 UTC 2019
On 1/24/19 1:55 PM, Lance Andersen wrote:
>
>> Alternatively you can simply do:
>> PrivilegedExceptionAction<Path> pea = () ->
>> tempPath.toRealPath();
>> return AccessController.doPrivileged(pea);
>>
>> In this case, limited doPrivileged does not make whole lot of
>> difference jdk.zip explicitly grants for limited permissions and this
>> doPrivileged block is one single operation, toRealPath.
>
> Do you have a preference here either way? I had that originally but
> changed it to make it clearer why it was done.
For this simple case, I would avoid using limited doPrivileged.
Mandy
More information about the core-libs-dev
mailing list