]> source.dussan.org Git - sonarqube.git/commitdiff
Remove dead code in IssueUpdater
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Wed, 24 Feb 2016 16:17:25 +0000 (17:17 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 25 Feb 2016 09:18:42 +0000 (10:18 +0100)
server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java
server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java

index 303a430134ccd43c9a0a4cf5c6586a99ea743901..3f7d93d12ca2978a07a952a314e9db45d8243b30 100644 (file)
@@ -307,22 +307,6 @@ public class IssueUpdater {
     return false;
   }
 
-  public boolean setProject(DefaultIssue issue, String projectKey, IssueChangeContext context) {
-    if (!Objects.equal(projectKey, issue.projectKey())) {
-      issue.setProjectKey(projectKey);
-      issue.setUpdateDate(context.date());
-      issue.setChanged(true);
-      return true;
-    }
-    return false;
-  }
-
-  public boolean setPastProject(DefaultIssue issue, String previousKey, IssueChangeContext context) {
-    String currentProjectKey = issue.projectKey();
-    issue.setProjectKey(previousKey);
-    return setProject(issue, currentProjectKey, context);
-  }
-
   public boolean setTags(DefaultIssue issue, Collection<String> tags, IssueChangeContext context) {
     Set<String> newTags = Sets.newHashSet(Collections2.transform(
       Collections2.filter(tags, new Predicate<String>() {
index b536a6d1c7cdc881198d3238ff300557a6e9d52d..7e8544ce2ef4d13895ec9c4ea56326470ca3a188 100644 (file)
@@ -544,35 +544,4 @@ public class IssueUpdaterTest {
     updater.setNewAuthor(issue, "julien", context);
   }
 
-  @Test
-  public void set_project() {
-    boolean updated = updater.setProject(issue, "sample", context);
-    assertThat(updated).isTrue();
-    assertThat(issue.projectKey()).isEqualTo("sample");
-
-    // do not save change
-    assertThat(issue.currentChange()).isNull();
-    assertThat(issue.mustSendNotifications()).isFalse();
-  }
-
-  @Test
-  public void set_past_project() {
-    issue.setProjectKey("new project key");
-    boolean updated = updater.setPastProject(issue, "past project key", context);
-    assertThat(updated).isTrue();
-    assertThat(issue.projectKey()).isEqualTo("new project key");
-
-    // do not save change
-    assertThat(issue.currentChange()).isNull();
-    assertThat(issue.mustSendNotifications()).isFalse();
-  }
-
-  @Test
-  public void not_set_past_project_if_no_change() {
-    issue.setProjectKey("key");
-    boolean updated = updater.setPastProject(issue, "key", context);
-    assertThat(updated).isFalse();
-    assertThat(issue.projectKey()).isEqualTo("key");
-  }
-
 }