I did away with the doPrivileged and it seems fine ...
http://cr.openjdk.java.net/~prr/8038875.1/

-phil.

On 05/07/2014 01:26 PM, Phil Race wrote:
On 5/7/14 12:40 PM, Mandy Chung wrote:


You may consider to use the 3-arg version of Class.forName and not to initialize the class. This is called within a doPrivileged block and it's generally a good convention to invoke the class initialization of the specified class (from the system property) outside the doPrivileged block. Static analysis tool may consider catching the 1-arg version of Class.forName and flag it as a warning.

The class will need to be initialized in the newInstance() call. The above comment might not apply. Is the doPrivileged block needed for the RenderingEngine instantiation? I was wondering if it was needed for the service loader only or not.


Good question. A privilege is obviously needed for the getProperty but
the rest may not need it .. I can try removing it and see if anything breaks.

-phil.


Reply via email to