From 9eebecd84d86c76ea513afc0e50573516c6731b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 30 Nov 2016 16:26:22 +0100 Subject: [PATCH] SONAR-8421 fix ConcurrentModificationException --- .../java/org/sonar/server/issue/IssueChangelog.java | 10 ++++------ 1 file 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 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); } } } -- 2.39.5