8019622: (sl) ServiceLoadet.next incorrect when creation and usages are in different contexts

Mandy Chung mandy.chung at oracle.com
Wed Jul 3 17:29:53 UTC 2013

On 7/3/13 9:15 AM, Alan Bateman wrote:
> When running with a security manager, ServiceLoader isn't currently 
> very predictable when created and used in different contexts. For the 
> ServiceLoader usages in the JDK then isn't a problem because all (bar 
> one or two uninteresting cases) involve creating the ServiceLoader and 
> immediately iterating over the providers. However for other usages 
> then it may be an issue as the iteration over the providers may or may 
> not have the expected permissions. The webrev with the proposed 
> changes is here:
> http://cr.openjdk.java.net/~alanb/8019622/webrev/
> Mandy - this is one that we've chatted about a few times so you are 
> probably the best to review it (if you have time of course).

We've talked about this a few times and it's good to see this fixed.  
The fix is reasonable to capture the ACC at creation time and use that 
for iteration.

Looks good.


More information about the core-libs-dev mailing list