RFR: 8154067: Avoid early use of limited privilege escalation in InnerClassLambdaMetafactory
Alan Bateman
Alan.Bateman at oracle.com
Tue Apr 12 13:42:33 UTC 2016
On 12/04/2016 13:38, Claes Redestad wrote:
> Hi,
>
> the first usage of limited doPrivileged appears to have a small
> startup penalty (loads 8 permission-related classes and does some
> reflection), and is arguably excessive for this particular instance.
> Unrestricted doPrivileged allows for a small reduction of lambda init
> cost.
>
> Webrev: http://cr.openjdk.java.net/~redestad/8154067/webrev.01/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8154067
In general then we've been encouraging the use of limited doPrivileged
where it make sense although for cases like this then it doesn't have
much advantage. An alternative would be to just use System.getProperty
then System.getSecurityManager() == null.
-Alan
More information about the core-libs-dev
mailing list