]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8421 fix ConcurrentModificationException 1421/head
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 30 Nov 2016 15:26:22 +0000 (16:26 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Wed, 30 Nov 2016 15:26:22 +0000 (16:26 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/IssueChangelog.java

index d4beab689ad8fc8f6c2a0ea38f884b140097cb23..cdb8db9bf46b38b763b3d2335c1770b6da2bad31 100644 (file)
@@ -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);
       }
     }
   }