I am wondering why the value of the key resolves to null when it is constructed from a string and a variable
def workingDir1 = "my/path"
def command1 = "command1"
Map<String,List> map1 = new HashMap<String,String>();
def value = map1.get(theKey)
println "$theKey $value"
value = map1.get(command1)
println "$command1 $value"
The problem here is different classes.
def theKey="command$i" creates a
map1.put("command1", workingDir1); uses a
String for the key.
To get your value out using
theKey you have to do: