HADOOP-15865. ConcurrentModificationException in Configuration.overlay() method. Contributed by Oleksandr Shevchenko.

This commit is contained in:
Wei-Chiu Chuang 2019-08-01 19:56:51 -07:00
parent c2d00c8450
commit e872ceb810

View File

@ -3436,8 +3436,10 @@ private void readTagFromConfig(String attributeValue, String confName, String
}
private void overlay(Properties to, Properties from) {
for (Entry<Object, Object> entry: from.entrySet()) {
to.put(entry.getKey(), entry.getValue());
synchronized (from) {
for (Entry<Object, Object> entry : from.entrySet()) {
to.put(entry.getKey(), entry.getValue());
}
}
}