diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-24 17:17:25 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-02-25 10:18:42 +0100 |
commit | 271d642877c769f52f7aa5fe792ee541e19cd68a (patch) | |
tree | d0633fe93bc7680c1ef73817a1f36819efd77542 | |
parent | 1ef5de2df1f03e4d0a381e619353267c13448b21 (diff) | |
download | sonarqube-271d642877c769f52f7aa5fe792ee541e19cd68a.tar.gz sonarqube-271d642877c769f52f7aa5fe792ee541e19cd68a.zip |
Remove dead code in IssueUpdater
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java | 16 | ||||
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java | 31 |
2 files changed, 0 insertions, 47 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java index 303a430134c..3f7d93d12ca 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueUpdater.java @@ -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>() { diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java index b536a6d1c7c..7e8544ce2ef 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/issue/IssueUpdaterTest.java @@ -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"); - } - } |