I have code like below, in which the inner loop modifies the Hashmap, but only in a way that no new keys are added or deleted, but only the values are updated. Does this qualifies as modification of a Hashmap, for Concurrent Modification Exception to be thrown ? In current tests that I have done, I haven't found any exception to be thrown though.
for(String variable:variableMap.descendingKeySet()) {
for (String innerVariable : variableMap.keySet()) {
variableMap.put(innerVariable, variableMap.get(innerVariable).replace("$" + variable, variableMap.get(variable)));
}
}
variableMap.replaceAll((k, v) -> v.replace("$" + variable, variableMap.get(variable))).