[grid] Fixing previous commit, always making a copy
@@ -168,8 +168,8 @@ public GridNodeConfiguration() {
public GridNodeConfiguration(NodeJsonConfiguration jsonConfig) {
super(jsonConfig);
role = ROLE;
- capabilities = ofNullable(jsonConfig.getCapabilities())
- .orElse(new ArrayList<>(DEFAULT_CONFIG_FROM_JSON.getCapabilities()));
+ capabilities = new ArrayList<>(ofNullable(jsonConfig.getCapabilities())
+ .orElse(DEFAULT_CONFIG_FROM_JSON.getCapabilities()));
maxSession = ofNullable(jsonConfig.getMaxSession())
.orElse(DEFAULT_CONFIG_FROM_JSON.getMaxSession());
register = ofNullable(jsonConfig.getRegister())
