moduleSecurityManager.getBasePermissionSet().addAPIClass(IOException.class);
moduleSecurityManager.getBasePermissionSet().addAPIClass(InvocationTargetException.class);
moduleSecurityManager.getBasePermissionSet().addAPIClass(LoggerFactory.class);
moduleSecurityManager.getBasePermissionSet().addAPIClass(Logger.class);
APIScanner apiScanner = new APIScanner(moduleSecurityManager);
for (Module module : registry) {
if (module.isOnClasspath()) {
apiScanner.scan(module);
}
}
moduleSecurityManager.getBasePermissionSet().grantPermission("com.google.gson", ReflectPermission.class);
moduleSecurityManager.getBasePermissionSet().grantPermission("com.google.gson.internal", ReflectPermission.class);