summaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2016-03-24 18:27:47 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-03-25 15:02:45 +0100
commita14e9357d2acc4a320ca279f6e5e6aab4f6dbeb2 (patch)
tree14873861cfb92dbdb21d9dec4273daf8436e3adc /sonar-core
parentd4f696ab1e013f3d305b7cb978d65a3ee0937149 (diff)
downloadsonarqube-a14e9357d2acc4a320ca279f6e5e6aab4f6dbeb2.tar.gz
sonarqube-a14e9357d2acc4a320ca279f6e5e6aab4f6dbeb2.zip
SONAR-7467 Drop/deprecate action plan API
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultActionPlan.java145
-rw-r--r--sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java9
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java2
3 files changed, 2 insertions, 154 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultActionPlan.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultActionPlan.java
deleted file mode 100644
index 3b60ec123b5..00000000000
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultActionPlan.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2016 SonarSource SA
- * mailto:contact AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.core.issue;
-
-import java.util.Date;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-import org.sonar.api.issue.ActionPlan;
-import org.sonar.core.util.Uuids;
-
-public class DefaultActionPlan implements ActionPlan {
-
- private String key;
- private String name;
- private String projectKey;
- private String description;
- private String userLogin;
- private String status;
- private Date deadLine;
- private Date createdAt;
- private Date updatedAt;
-
- public DefaultActionPlan() {
-
- }
-
- public static DefaultActionPlan create(String name) {
- DefaultActionPlan actionPlan = new DefaultActionPlan();
- actionPlan.setKey(Uuids.create());
- Date now = new Date();
- actionPlan.setName(name);
- actionPlan.setStatus(ActionPlan.STATUS_OPEN);
- actionPlan.setCreatedAt(now).setUpdatedAt(now);
- return actionPlan;
- }
-
- @Override
- public String key() {
- return key;
- }
-
- public DefaultActionPlan setKey(String key) {
- this.key = key;
- return this;
- }
-
- @Override
- public String name() {
- return name;
- }
-
- public DefaultActionPlan setName(String name) {
- this.name = name;
- return this;
- }
-
- @Override
- public String projectKey() {
- return projectKey;
- }
-
- public DefaultActionPlan setProjectKey(String projectKey) {
- this.projectKey = projectKey;
- return this;
- }
-
- @Override
- @CheckForNull
- public String description() {
- return description;
- }
-
- public DefaultActionPlan setDescription(@Nullable String description) {
- this.description = description;
- return this;
- }
-
- @Override
- public String userLogin() {
- return userLogin;
- }
-
- public DefaultActionPlan setUserLogin(String userLogin) {
- this.userLogin = userLogin;
- return this;
- }
-
- @Override
- public String status() {
- return status;
- }
-
- public DefaultActionPlan setStatus(String status) {
- this.status = status;
- return this;
- }
-
- @Override
- @CheckForNull
- public Date deadLine() {
- return deadLine != null ? new Date(deadLine.getTime()) : null;
- }
-
- public DefaultActionPlan setDeadLine(@Nullable Date deadLine) {
- this.deadLine = deadLine != null ? new Date(deadLine.getTime()) : null;
- return this;
- }
-
- @Override
- public Date createdAt() {
- return createdAt;
- }
-
- public DefaultActionPlan setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- @Override
- public Date updatedAt() {
- return updatedAt;
- }
-
- public DefaultActionPlan setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-}
diff --git a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
index 37eebd3f91b..aa56371cb11 100644
--- a/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
+++ b/sonar-core/src/main/java/org/sonar/core/issue/DefaultIssue.java
@@ -80,7 +80,6 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.
private String checksum;
private Map<String, String> attributes = null;
private String authorLogin = null;
- private String actionPlanKey;
private List<IssueComment> comments = null;
private Set<String> tags = null;
// temporarily an Object as long as DefaultIssue is used by sonar-batch
@@ -507,12 +506,8 @@ public class DefaultIssue implements Issue, Trackable, org.sonar.api.ce.measure.
@Override
@CheckForNull
public String actionPlanKey() {
- return actionPlanKey;
- }
-
- public DefaultIssue setActionPlanKey(@Nullable String actionPlanKey) {
- this.actionPlanKey = actionPlanKey;
- return this;
+ // In 5.5, action plan is dropped.
+ return null;
}
public DefaultIssue setFieldChange(IssueChangeContext context, String field, @Nullable Serializable oldValue, @Nullable Serializable newValue) {
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
index 2dc8be7b155..a98373af68c 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/DefaultIssueTest.java
@@ -51,7 +51,6 @@ public class DefaultIssueTest {
.setLine(7)
.setGap(1.2d)
.setEffort(Duration.create(28800L))
- .setActionPlanKey("BCDE")
.setStatus(Issue.STATUS_CLOSED)
.setResolution(Issue.RESOLUTION_FIXED)
.setReporter("simon")
@@ -79,7 +78,6 @@ public class DefaultIssueTest {
assertThat(issue.line()).isEqualTo(7);
assertThat(issue.effortToFix()).isEqualTo(1.2d);
assertThat(issue.debt()).isEqualTo(Duration.create(28800L));
- assertThat(issue.actionPlanKey()).isEqualTo("BCDE");
assertThat(issue.status()).isEqualTo(Issue.STATUS_CLOSED);
assertThat(issue.resolution()).isEqualTo(Issue.RESOLUTION_FIXED);
assertThat(issue.reporter()).isEqualTo("simon");