[OpenJDK 2D-Dev] RFR: 8038875: Remove use of ServiceLoader in finding class implementing sun.java2d.pipe. RenderingEngine

Jim Graham james.graham at oracle.com
Thu May 8 22:05:40 UTC 2014


What about loading native libraries from the 2 engines?  Or are those 
each individually protected by their own doPrivileged?

			...jim

On 5/7/14 2:57 PM, Phil Race wrote:
> 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.
>>
>



More information about the 2d-dev mailing list