RFR 8064924: Update java.net.URL to work with modules

Peter Levart peter.levart at gmail.com
Wed Feb 4 16:01:11 UTC 2015


On 02/04/2015 04:45 PM, Alan Bateman wrote:
> On 04/02/2015 15:10, Weijun Wang wrote:
>> It should be checked, otherwise a non-initialized parent object comes 
>> into being.
> In general then permission checks in constructors are a bad idea but 
> we have an established idiom that has the no-arg constructor invoking 
> a static method that does the permission check.
>
> -Alan

There is an alternative. The 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(Class<?>) 
checks the permission without running any code of the class. But if 
verify-er checks constructor flow then this is as good as proposed.


Peter



More information about the core-libs-dev mailing list