From: Sébastien Lesaint Date: Wed, 30 Nov 2016 15:26:22 +0000 (+0100) Subject: SONAR-8421 fix ConcurrentModificationException X-Git-Tag: 6.2-RC2~13^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1421%2Fhead;p=sonarqube.git SONAR-8421 fix ConcurrentModificationException --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java index d4beab689ad..cdb8db9bf46 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java @@ -51,12 +51,10 @@ public class IssueChangelog { private static void replacedTechnicalDebtByEffort(List changes) { for (FieldDiffs fieldDiffs : changes) { Map diffs = fieldDiffs.diffs(); - for (Map.Entry entry : diffs.entrySet()) { - // As "technicalDebt" couldn't been updated to "effort" in db, we need to convert it here to correctly display "effort" in WS/UI - if (entry.getKey().equals(IssueUpdater.TECHNICAL_DEBT)) { - diffs.put("effort", entry.getValue()); - diffs.remove(entry.getKey()); - } + if (diffs.containsKey(IssueUpdater.TECHNICAL_DEBT)) { + FieldDiffs.Diff value = diffs.get(IssueUpdater.TECHNICAL_DEBT); + diffs.remove(IssueUpdater.TECHNICAL_DEBT); + diffs.put("effort", value); } } }