Looks good to me Shanliang.
-- daniel
On 03/02/15 14:16, shanliang wrote:
Hi,
Hope this is last time :)
http://cr.openjdk.java.net/~sjiang/JDK-8065213/02/
1)
Mandy Chung wrote:
You may want to consider using limited doPrivileged (that can be done
in the second phase).
Done as in ManagementFactory:
878 // get all providers
879 List<PlatformMBeanProvider> providers
880 =
AccessController.doPrivileged((PrivilegedAction<List<PlatformMBeanProvider>>)
() -> {
881 List<PlatformMBeanProvider> all = new
ArrayList<>();
882 for (PlatformMBeanProvider provider :
ServiceLoader.loadInstalled(PlatformMBeanProvider.class)) {
883 all.add(provider);
884 }
885 all.add(new DefaultPlatformMBeanProvider());
886 return all;
887 },
888 null,
889 new FilePermission("<<ALL FILES>>", "read"),
890 new
RuntimePermission("sun.management.spi.PlatformMBeanProvider"));
2)
The modification to Flag is removed, we get another solution to know
whether commercial feature is enabled.
3) some mis minors modifications.
Thanks,
Shanliang