diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-09 22:44:08 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-06-09 22:44:08 +0200 |
commit | 72fbbf025107c5bad6739313c29e05e72bb528a5 (patch) | |
tree | 655dcae1b6c0a6f7cfa93c6645082254fd3c2c93 /sonar-core/src/main/java | |
parent | 3f9ed2570796ab50e6684198721c6e43f5fc5be2 (diff) | |
download | sonarqube-72fbbf025107c5bad6739313c29e05e72bb528a5.tar.gz sonarqube-72fbbf025107c5bad6739313c29e05e72bb528a5.zip |
Fix quality flaw
Diffstat (limited to 'sonar-core/src/main/java')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java b/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java index 3d2013e6a41..28fbe6b268c 100644 --- a/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java +++ b/sonar-core/src/main/java/org/sonar/core/issue/IssueNotifications.java @@ -87,7 +87,8 @@ public class IssueNotifications implements BatchComponent, ServerComponent { @CheckForNull private Notification createChangeNotification(DefaultIssue issue, IssueChangeContext context, Rule rule, Component project, @Nullable Component component, @Nullable String comment) { - if (comment == null && (issue.currentChange() == null || issue.currentChange().diffs().isEmpty())) { + FieldDiffs currentChange = issue.currentChange(); + if (comment == null && (currentChange == null || currentChange.diffs().isEmpty())) { return null; } Notification notification = newNotification(project, "issue-changes"); @@ -105,9 +106,8 @@ public class IssueNotifications implements BatchComponent, ServerComponent { notification.setFieldValue("comment", comment); } - FieldDiffs diffs = issue.currentChange(); - if (diffs != null) { - for (Map.Entry<String, FieldDiffs.Diff> entry : diffs.diffs().entrySet()) { + if (currentChange != null) { + for (Map.Entry<String, FieldDiffs.Diff> entry : currentChange.diffs().entrySet()) { String type = entry.getKey(); FieldDiffs.Diff diff = entry.getValue(); notification.setFieldValue("old." + type, diff.oldValue() != null ? diff.oldValue().toString() : null); |