public class CpsClosure2
extends com.cloudbees.groovy.cps.impl.CpsClosure
CpsClosure
that intercepts the sleep
call so that it gets handled via SleepStep,
instead of DefaultGroovyStaticMethods.sleep(Object, long)
that Groovy adds to Object
.
We have to do this because the sleep
step (intentionally) picks the same name
as a method defined on Object
, which CpsScript.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 override hashCode()
method and use it for something completely different.
(At the time a bug masked the severity of the problem.)
Constructor and Description |
---|
CpsClosure2(Object owner,
Object thisObject,
List<String> parameters,
com.cloudbees.groovy.cps.Block body,
com.cloudbees.groovy.cps.Env capture) |
Modifier and Type | Method and Description |
---|---|
void |
print(Object arg) |
void |
printf(String format,
Object value) |
void |
println() |
void |
println(Object arg) |
Object |
sleep(long arg) |
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
Copyright © 2016–2020. All rights reserved.