On Fri, 9 Apr 2021 13:51:30 GMT, Conor Cleary <ccle...@openjdk.org> wrote:

>> An alternative here would be to use 
>> sun.security.action.privilegedGetProperty(prop, default).
>> The package is already exported from java.base to java.desktop, etc.
>
> That is a very neat alternative yes. Approaching the problem like that 
> especially improves the readability 
> [JdkLDAP.java](https://github.com/openjdk/jdk/pull/3416/files#diff-bf4c67da93cf2b9196508db2d57f7e01bc884f2268f5bfd43a9f01dfd55e4955)
>  in my opinion. 
> I don't think casting has any major performance hits for these fixes, so is 
> your suggestion mostly for readability's sake?

Right, not a performance problem.  Just simpler to use an existing method to 
read a privileged property.
And there will be one less doPriv.

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

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

Reply via email to