From a0062f6aca571bcc72f5ffe02811254e5740706d Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Fri, 1 Feb 2013 09:28:33 +0100 Subject: [PATCH] Fix violations. --- .../templates/reviews/ReviewEmailTemplate.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/templates/reviews/ReviewEmailTemplate.java b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/templates/reviews/ReviewEmailTemplate.java index 2a2e4df3bc1..da82ccf69b7 100644 --- a/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/templates/reviews/ReviewEmailTemplate.java +++ b/plugins/sonar-email-notifications-plugin/src/main/java/org/sonar/plugins/emailnotifications/templates/reviews/ReviewEmailTemplate.java @@ -91,12 +91,15 @@ public class ReviewEmailTemplate extends EmailTemplate { String newComment = notification.getFieldValue("new.comment"); String oldComment = notification.getFieldValue("old.comment"); - if (newComment != null) { // comment was added or modified + if (newComment != null) { + // comment was added or modified sb.append("Comment:\n ").append(newComment).append('\n'); - if (oldComment != null) { // comment was modified + if (oldComment != null) { + // comment was modified sb.append("Was:\n ").append(oldComment).append('\n'); } - } else if (oldComment != null) { // comment was deleted + } else if (oldComment != null) { + // comment was deleted sb.append("Comment deleted, was:\n ").append(oldComment).append('\n'); } } @@ -115,7 +118,8 @@ public class ReviewEmailTemplate extends EmailTemplate { return null; } User user = userFinder.findByLogin(login); - if (user == null) { // most probably user was deleted + if (user == null) { + // most probably user was deleted return login; } return StringUtils.defaultIfBlank(user.getName(), login); -- 2.39.5