aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-10-07 10:27:39 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-10-07 12:23:48 +0200
commit32986b9e625c58ca8e5cf774d32c19eb061bcbe5 (patch)
treeb73ae35455d6ebbd8c90fbef936d103455730766
parent2165aab926de048fd908412ab5c6500529ee802f (diff)
downloadsonarqube-32986b9e625c58ca8e5cf774d32c19eb061bcbe5.tar.gz
sonarqube-32986b9e625c58ca8e5cf774d32c19eb061bcbe5.zip
SONAR-6913 Stop support of issue attributes on batch side
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java7
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java15
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java3
5 files changed, 4 insertions, 30 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java b/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java
index acc5d3343b4..bf8df8a64d5 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java
@@ -114,8 +114,7 @@ public class DeprecatedIssueBuilderWrapper implements Issuable.IssueBuilder {
@Override
public IssueBuilder attribute(String key, String value) {
- newIssue.addAttribute(key, value);
- return this;
+ throw new UnsupportedOperationException("Not supported during sensor phase");
}
@Override
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java
index 98a5eb32fd8..8ac79f4a924 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java
@@ -21,7 +21,6 @@ package org.sonar.api.batch.sensor.issue;
import com.google.common.annotations.Beta;
import java.util.List;
-import java.util.Map;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.batch.sensor.Sensor;
@@ -71,10 +70,4 @@ public interface Issue {
*/
List<Flow> flows();
- /**
- * Key/value pair of attributes that are attached to the issue.
- * @since 5.2
- */
- Map<String, String> attributes();
-
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java
index b6b2e068835..8fc8156d3ca 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java
@@ -75,12 +75,6 @@ public interface NewIssue {
NewIssueLocation newLocation();
/**
- * Attach a new attribute to the issue. Not used by SQ but can be reused later for integration needs (for example it is returned by WS).
- * @since 5.2
- */
- NewIssue addAttribute(String key, String value);
-
- /**
* Save the issue. If rule key is unknown or rule not enabled in the current quality profile then a warning is logged but no exception
* is thrown.
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
index 10f3e83706c..7fc35eabe3a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
@@ -22,13 +22,10 @@ package org.sonar.api.batch.sensor.issue.internal;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.LinkedHashMap;
import java.util.List;
-import java.util.Map;
import javax.annotation.Nullable;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.batch.sensor.internal.DefaultStorable;
@@ -60,7 +57,6 @@ public class DefaultIssue extends DefaultStorable implements Issue, NewIssue {
private Severity overriddenSeverity;
private IssueLocation primaryLocation;
private List<List<IssueLocation>> flows = new ArrayList<>();
- private final Map<String, String> attributes = new LinkedHashMap<>();
public DefaultIssue() {
super(null);
@@ -119,17 +115,6 @@ public class DefaultIssue extends DefaultStorable implements Issue, NewIssue {
}
@Override
- public DefaultIssue addAttribute(String key, String value) {
- attributes.put(key, value);
- return this;
- }
-
- @Override
- public Map<String, String> attributes() {
- return ImmutableMap.copyOf(attributes);
- }
-
- @Override
public RuleKey ruleKey() {
return this.ruleKey;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java
index de822ecb824..007ba81a117 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java
@@ -119,6 +119,9 @@ public interface Issuable extends Perspective {
IssueBuilder effortToFix(@Nullable Double d);
+ /**
+ * No more supported from batch side since 5.2
+ */
IssueBuilder attribute(String key, @Nullable String value);
Issue build();