org.kohsuke.groovy.sandbox.impl.ClosureSupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of groovy-sandbox Show documentation
Show all versions of groovy-sandbox Show documentation
Executes untrusted Groovy script safely
package org.kohsuke.groovy.sandbox.impl;
import groovy.lang.Closure;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Helps with sanbox intercepting Closures, which has unique dispatching rules we need to understand.
*
* @author Kohsuke Kawaguchi
*/
final class ClosureSupport {
/**
* {@link Closure} forwards methods/properties to other objects, depending on the resolution strategy.
*
* This method returns the list of non-null objects that should be considered, in that order.
*/
public static List