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

Reply via email to