Class CpsClosure2
- java.lang.Object
-
- groovy.lang.GroovyObjectSupport
-
- groovy.lang.Closure
-
- com.cloudbees.groovy.cps.impl.CpsClosure
-
- org.jenkinsci.plugins.workflow.cps.CpsClosure2
-
- All Implemented Interfaces:
groovy.lang.GroovyCallable
,groovy.lang.GroovyObject
,Serializable
,Cloneable
,Runnable
,Callable
public class CpsClosure2 extends CpsClosure
CpsClosure
that intercepts thesleep
call so that it gets handled via SleepStep, instead ofDefaultGroovyStaticMethods.sleep(Object, long)
that Groovy adds toObject
.We have to do this because the
sleep
step (intentionally) picks the same name as a method defined onObject
, whichCpsScript.sleep(long)
delegates. Granted, it is a method added by Groovy, not by JDK, but the end result is still the same, and the consequence is as severe as trying to overridehashCode()
method and use it for something completely different. (At the time a bug masked the severity of the problem.)- Author:
- Kohsuke Kawaguchi
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
print(Object arg)
void
printf(String format, Object value)
void
println()
void
println(Object arg)
Object
sleep(long arg)
-
Methods inherited from class com.cloudbees.groovy.cps.impl.CpsClosure
call, call, call, doCall
-
Methods inherited from class groovy.lang.Closure
asWritable, clone, curry, curry, dehydrate, getDelegate, getDirective, getMaximumNumberOfParameters, getOwner, getParameterTypes, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline
-
-