diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-30 16:26:22 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2016-11-30 16:26:22 +0100 |
commit | 9eebecd84d86c76ea513afc0e50573516c6731b8 (patch) | |
tree | 9255ff32aa80ef90a9458af287ebc4ee4274795c /server/sonar-server | |
parent | 5eed3e27357aefe61dd989d058ebcb6127ae7cf7 (diff) | |
download | sonarqube-9eebecd84d86c76ea513afc0e50573516c6731b8.tar.gz sonarqube-9eebecd84d86c76ea513afc0e50573516c6731b8.zip |
SONAR-8421 fix ConcurrentModificationException
Diffstat (limited to 'server/sonar-server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java | 10 |
1 files changed, 4 insertions, 6 deletions
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<FieldDiffs> changes) { for (FieldDiffs fieldDiffs : changes) { Map<String, FieldDiffs.Diff> diffs = fieldDiffs.diffs(); - for (Map.Entry<String, FieldDiffs.Diff> 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); } } } |