diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2016-03-24 11:07:49 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-03-29 19:10:52 +0200 |
commit | 5025760c586e0e24524794356afdb4ad48ed1296 (patch) | |
tree | 3eedaa15eb79dd2fa0f47d632642bc441754cf34 /sonar-scanner-engine | |
parent | 0fbea9bb63a3983724eac4ae24e64a4f930ef3c9 (diff) | |
download | sonarqube-5025760c586e0e24524794356afdb4ad48ed1296.tar.gz sonarqube-5025760c586e0e24524794356afdb4ad48ed1296.zip |
SONAR-7473 Drop 'reporter' from scanner
Diffstat (limited to 'sonar-scanner-engine')
6 files changed, 11 insertions, 27 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/TrackedIssueAdapter.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/TrackedIssueAdapter.java index 19027847d9d..5d9d8c3d0a7 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/TrackedIssueAdapter.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/TrackedIssueAdapter.java @@ -25,6 +25,7 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.annotation.CheckForNull; import org.sonar.api.issue.Issue; import org.sonar.api.issue.IssueComment; import org.sonar.api.rule.RuleKey; @@ -92,9 +93,14 @@ public class TrackedIssueAdapter implements Issue { return issue.resolution(); } + /** + * @deprecated since 5.5, manual issue feature has been dropped. + */ + @Deprecated + @CheckForNull @Override public String reporter() { - return issue.reporter(); + return null; } @Override diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/tracking/TrackedIssue.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/tracking/TrackedIssue.java index ea303bf6a4f..093db671f35 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/tracking/TrackedIssue.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/issue/tracking/TrackedIssue.java @@ -45,7 +45,6 @@ public class TrackedIssue implements Trackable, Serializable { private String resolution; private String status; private String assignee; - private String reporter; private String componentKey; private String message; @@ -150,15 +149,6 @@ public class TrackedIssue implements Trackable, Serializable { return this; } - public String reporter() { - return reporter; - } - - public TrackedIssue setReporter(String reporter) { - this.reporter = reporter; - return this; - } - public String resolution() { return resolution; } diff --git a/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/JSONReport.java b/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/JSONReport.java index 99954736613..84184a410a1 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/JSONReport.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/batch/scan/report/JSONReport.java @@ -150,9 +150,6 @@ public class JSONReport implements Reporter { .prop("assignee", issue.assignee()) .prop("effortToFix", issue.gap()) .propDateTime("creationDate", issue.creationDate()); - if (!StringUtils.isEmpty(issue.reporter())) { - logins.add(issue.reporter()); - } if (!StringUtils.isEmpty(issue.assignee())) { logins.add(issue.assignee()); } diff --git a/sonar-scanner-engine/src/test/java/org/sonar/batch/issue/TrackedIssueAdapterTest.java b/sonar-scanner-engine/src/test/java/org/sonar/batch/issue/TrackedIssueAdapterTest.java index d1a9a723897..f87035fa719 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/batch/issue/TrackedIssueAdapterTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/batch/issue/TrackedIssueAdapterTest.java @@ -42,7 +42,6 @@ public class TrackedIssueAdapterTest { .setGap(2.0) .setStatus("RESOLVED") .setResolution("FIXED") - .setReporter("toto") .setAssignee("tata") .setNew(true) .setCreationDate(creationDate); @@ -53,10 +52,9 @@ public class TrackedIssueAdapterTest { assertThat(issue.severity()).isEqualTo("MAJOR"); assertThat(issue.message()).isEqualTo("msg"); assertThat(issue.line()).isEqualTo(1); - assertThat(issue.effortToFix()).isEqualTo(2.0); + assertThat(issue.gap()).isEqualTo(2.0); assertThat(issue.status()).isEqualTo("RESOLVED"); assertThat(issue.resolution()).isEqualTo("FIXED"); - assertThat(issue.reporter()).isEqualTo("toto"); assertThat(issue.assignee()).isEqualTo("tata"); assertThat(issue.isNew()).isTrue(); assertThat(issue.attribute("foo")).isNull(); @@ -66,7 +64,7 @@ public class TrackedIssueAdapterTest { assertThat(issue.closeDate()).isNull(); assertThat(issue.authorLogin()).isNull(); assertThat(issue.comments()).isEmpty(); - assertThat(issue.debt()).isNull(); + assertThat(issue.effort()).isNull(); assertThat(issue.projectKey()).isNull(); assertThat(issue.projectUuid()).isNull(); assertThat(issue.componentUuid()).isNull(); diff --git a/sonar-scanner-engine/src/test/java/org/sonar/batch/scan/report/JSONReportTest.java b/sonar-scanner-engine/src/test/java/org/sonar/batch/scan/report/JSONReportTest.java index da798a2dbf1..03cc40cc3a2 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/batch/scan/report/JSONReportTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/batch/scan/report/JSONReportTest.java @@ -112,15 +112,12 @@ public class JSONReportTest { issue.setStartLineOffset(3); issue.setEndLineOffset(4); issue.setGap(3.14); - issue.setReporter("julien"); issue.setAssignee("simon"); issue.setCreationDate(SIMPLE_DATE_FORMAT.parse("2013-04-24")); issue.setNew(false); when(issueCache.all()).thenReturn(Lists.newArrayList(issue)); - ScannerInput.User user1 = ScannerInput.User.newBuilder().setLogin("julien").setName("Julien").build(); - ScannerInput.User user2 = ScannerInput.User.newBuilder().setLogin("simon").setName("Simon").build(); - when(userRepository.load("julien")).thenReturn(user1); - when(userRepository.load("simon")).thenReturn(user2); + ScannerInput.User user = ScannerInput.User.newBuilder().setLogin("simon").setName("Simon").build(); + when(userRepository.load("simon")).thenReturn(user); StringWriter writer = new StringWriter(); jsonReport.writeJson(writer); diff --git a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json index a33e06342fa..e024e17340d 100644 --- a/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json +++ b/sonar-scanner-engine/src/test/resources/org/sonar/batch/scan/report/JSONReportTest/report.json @@ -53,10 +53,6 @@ ], "users": [ { - "login": "julien", - "name": "Julien" - }, - { "login": "simon", "name": "Simon" } |