]> source.dussan.org Git - sonarqube.git/commitdiff
rename ambiguous field names
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 8 May 2015 08:30:54 +0000 (10:30 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 8 May 2015 08:30:54 +0000 (10:30 +0200)
server/sonar-server/src/main/java/org/sonar/server/computation/step/SendIssueNotificationsStep.java
server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplate.java
server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotification.java
server/sonar-server/src/main/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcher.java
server/sonar-server/src/main/java/org/sonar/server/measure/MeasureFilterSort.java
server/sonar-server/src/main/java/org/sonar/server/properties/ProjectSettings.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesEmailTemplateTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationDispatcherTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/notification/MyNewIssuesNotificationTest.java

index 9bda954d6ec2d84a9726579782de9612f727ed40..977d31e6aa620481236fac31c6fb47fe8a62b4cb 100644 (file)
@@ -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;
index fb500e4894938780299f880f8bec55bfe7c1e92b..5621913e768249922091eb83c078c6e212500860 100644 (file)
@@ -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
index ce4343f3de3805332135e851f3640be6ba08df66..6a2f9c476ba6acb7189799255fc5203f64efd78d 100644 (file)
@@ -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) {
index 2a247346878768ee9f7f9b6ec9bbabeb37fcabb4..b5d3237ded56647197812f7b446b9c61284a3e8b 100644 (file)
@@ -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;
   }
 
index 584234f1e3acc013bd49e10739dcbd76b7a13369..7f64ef28d06a8ad792b8127a406e28773b1790db 100644 (file)
@@ -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,
index 6d7b1a9854ea751713bf9e496f7e9958947280f4..9eb94f93b4bd5981fda5212ce63b588bf8a01521 100644 (file)
@@ -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);
   }
 }
index 8f5bcd612f062eed83ac0e1dad2ca73a8574fd78..e30e67d1f3736751d5156fac4ae3b718d6e47c3d 100644 (file)
@@ -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")
index c7e00ba71a051aedc0b6595c9cdc613ac42e66ef..5bf25f7e65fdb1f701a44df00c00988b85b4b0ee 100644 (file)
@@ -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);
index 8d31716e692d6e0920732364cb9791788a3b2581..78f34ca26cfd68247428b50d3bc2a9dd5d51960a 100644 (file)
@@ -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);
 
   }
 }