use of org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.ProxyWhitelist in project workflow-cps-plugin by jenkinsci.
the class CpsWhitelist method get.
static synchronized Whitelist get() {
Jenkins j = Jenkins.getInstanceOrNull();
if (j == null) {
LOGGER.warning("Jenkins is not running");
return new ProxyWhitelist();
}
Whitelist wrapped = wrappedByJenkins.get(j);
if (wrapped == null) {
wrapped = new ProxyWhitelist(new CpsWhitelist(), Whitelist.all());
try {
if (!wrapped.permitsStaticMethod(Safepoint.class.getMethod("safepoint"), new Object[0])) {
throw new IllegalStateException("Broken whitelists: " + wrapped);
}
} catch (NoSuchMethodException x) {
assert false : x;
}
wrappedByJenkins.put(j, wrapped);
}
return wrapped;
}
Aggregations