Closed
Description
MapKeyDotReplacer throws an ConcurrentModificationException when tries to replace dots in the document Map. I would suggest to rewrite the method replaceInMapKeys in the MapKeyDotReplacer class as follows:
private Document replaceInMapKeys(Document map, String regexFrom, String from, String to) {
Document result = new Document();
for (String key : map.keySet()) {
Object val = map.get(key);
if (key.contains(from)) {
String escaped = key.replaceAll(regexFrom, to);
result.put(escaped, val);
} else {
result.put(key, val);
}
}
return result;
}