diff options
9 files changed, 15 insertions, 14 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/SendIssueNotificationsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/SendIssueNotificationsStep.java index 9bda954d6ec..977d31e6aa6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/SendIssueNotificationsStep.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/SendIssueNotificationsStep.java @@ -43,7 +43,7 @@ public class SendIssueNotificationsStep implements ComputationStep { /** * Types of the notifications sent by this step */ - static final Set<String> NOTIF_TYPES = ImmutableSet.of(IssueChangeNotification.TYPE, NewIssuesNotification.TYPE, MyNewIssuesNotification.TYPE); + static final Set<String> NOTIF_TYPES = ImmutableSet.of(IssueChangeNotification.TYPE, NewIssuesNotification.TYPE, MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); private final IssueCache issueCache; private final RuleCache rules; diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplate.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplate.java index fb500e48949..5621913e768 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplate.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplate.java @@ -39,7 +39,7 @@ public class MyNewIssuesEmailTemplate extends AbstractNewIssuesEmailTemplate { @Override protected boolean shouldNotFormat(Notification notification) { - return !MyNewIssuesNotification.TYPE.equals(notification.getType()); + return !MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE.equals(notification.getType()); } @Override diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotification.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotification.java index ce4343f3de3..6a2f9c476ba 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotification.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotification.java @@ -29,10 +29,10 @@ import static org.sonar.server.issue.notification.AbstractNewIssuesEmailTemplate public class MyNewIssuesNotification extends NewIssuesNotification { - public static final String TYPE = "my-new-issues"; + public static final String MY_NEW_ISSUES_NOTIF_TYPE = "my-new-issues"; MyNewIssuesNotification(UserIndex userIndex, RuleIndex ruleIndex, DbClient dbClient, Durations durations) { - super(TYPE, userIndex, ruleIndex, dbClient, durations); + super(MY_NEW_ISSUES_NOTIF_TYPE, userIndex, ruleIndex, dbClient, durations); } public MyNewIssuesNotification setAssignee(String assignee) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java index 2a247346878..b5d3237ded5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java @@ -34,7 +34,7 @@ public class MyNewIssuesNotificationDispatcher extends NotificationDispatcher { private final NotificationManager manager; public MyNewIssuesNotificationDispatcher(NotificationManager manager) { - super(MyNewIssuesNotification.TYPE); + super(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); this.manager = manager; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java index 584234f1e3a..7f64ef28d06 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java @@ -27,6 +27,7 @@ class MeasureFilterSort { private Metric metric = null; private Integer period = null; private boolean asc = true; + MeasureFilterSort() { } @@ -129,7 +130,7 @@ class MeasureFilterSort { } } - public static enum Field { + public enum Field { KEY, NAME, VERSION, METRIC, SHORT_NAME, DESCRIPTION, // Sort by last analysis date DATE, diff --git a/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettings.java b/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettings.java index 6d7b1a9854e..9eb94f93b4b 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettings.java +++ b/server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettings.java @@ -27,11 +27,11 @@ import java.util.Map; public class ProjectSettings extends Settings { private final Settings settings; - private final Map<String, String> properties; + private final Map<String, String> projectProperties; - public ProjectSettings(Settings settings, Map<String, String> properties) { + public ProjectSettings(Settings settings, Map<String, String> projectProperties) { this.settings = settings; - this.properties = properties; + this.projectProperties = projectProperties; } @Override @@ -67,6 +67,6 @@ public class ProjectSettings extends Settings { } private String get(String key) { - return properties.get(key); + return projectProperties.get(key); } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java index 8f5bcd612f0..e30e67d1f37 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java @@ -130,7 +130,7 @@ public class MyNewIssuesEmailTemplateTest { @Test public void do_not_add_footer_when_properties_missing() { - Notification notification = new Notification(MyNewIssuesNotification.TYPE) + Notification notification = new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) .setFieldValue(SEVERITY + ".count", "32") .setFieldValue("projectName", "Struts"); @@ -139,7 +139,7 @@ public class MyNewIssuesEmailTemplateTest { } private Notification newNotification() { - return new Notification(MyNewIssuesNotification.TYPE) + return new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) .setFieldValue("projectName", "Struts") .setFieldValue("projectKey", "org.apache:struts") .setFieldValue("projectUuid", "ABCDE") diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java index c7e00ba71a0..5bf25f7e65f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java @@ -61,7 +61,7 @@ public class MyNewIssuesNotificationDispatcherTest { recipients.put("user2", twitterChannel); when(notificationManager.findNotificationSubscribers(sut, "struts")).thenReturn(recipients); - Notification notification = new Notification(MyNewIssuesNotification.TYPE) + Notification notification = new Notification(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE) .setFieldValue("projectKey", "struts") .setFieldValue("assignee", "user1"); sut.performDispatch(notification, context); diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java index 8d31716e692..78f34ca26cf 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java @@ -43,7 +43,7 @@ public class MyNewIssuesNotificationTest { @Test public void set_with_a_specific_type() { - assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.TYPE); + assertThat(sut.getType()).isEqualTo(MyNewIssuesNotification.MY_NEW_ISSUES_NOTIF_TYPE); } } |