-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Good job for this library! I like it.
In VariableGroupMap you always set the same value to all variables so I had to override the method in a child class.
public class VariableGroupMap extends BaseAbstractMethod {
private final Map<String, ConfigurationVariableValue> map = new HashMap<>();
**private final ConfigurationVariableValue variableValue = new ConfigurationVariableValue();**
public VariableGroupMap() {
}
public void put(String name, String value) {
**variableValue.setValue(value);**
map.put(name, variableValue); --> same reference used for all variables in the library
}
You always use the same object so all variables have the same reference. ConfigurationVariableValue should be created each time so have different value per key.
I made it work with this hack:
public static class VariableGroupMapInternal extends VariableGroupMap {
@Override
public void put(String name, String value) {
ConfigurationVariableValue variableValue = new ConfigurationVariableValue();
variableValue.setValue(value);
this.get().put(name, variableValue);
}
}
hkarthik7
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working