I have a method that starts like this:
class Sidecar {
def static String getVersions(String render_server) {
def rest = new RESTClient('http://' + render_server)
try {
def vpath = *'*/r/api/versions'
log.debug "Hitting http://${render_server}${vpath}"
def resp = rest.get(path:vpath)
and when I call it as Sidecar.getVersions('server-name') it works as
expected. When I "accidentally" call it without a parameter, though,
Groovy does not complain until it attempts the REST call:
groovy:000> r = Sidecar.getVersions()
15:49:41.209 [main] DEBUG com.jcrew.jenkins.helpers.Sidecar - Hitting
http://*null*/r/api/versions
Is Groovy defaulting the parameter to null when it's not supplied?