]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6913 Stop support of issue attributes on batch side 574/head
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 7 Oct 2015 08:27:39 +0000 (10:27 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 7 Oct 2015 10:23:48 +0000 (12:23 +0200)
sonar-batch/src/main/java/org/sonar/batch/issue/DeprecatedIssueBuilderWrapper.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
sonar-plugin-api/src/main/java/org/sonar/api/issue/Issuable.java

index acc5d3343b498b6872e74db11c706e1c5917a1c1..bf8df8a64d53a03e2e0c054639b8b48cd9a1b6a4 100644 (file)
@@ -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
index 98a5eb32fd80ac99a3ba42937f6efae36b519e73..8ac79f4a9241085ff5085b2465d47b6bd7db973f 100644 (file)
@@ -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();
-
 }
index b6b2e068835dfdb747c2a4548f7e3e9cbc9ba7a3..8fc8156d3cae1e20af831e2f259f3d8a6a6fdc46 100644 (file)
@@ -74,12 +74,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.
index 10f3e83706cf25139a48cea5d08b132f3001516e..7fc35eabe3a4b763cf04b90db54ac249cf55040a 100644 (file)
@@ -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);
@@ -118,17 +114,6 @@ public class DefaultIssue extends DefaultStorable implements Issue, NewIssue {
     return this;
   }
 
-  @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;
index de822ecb824f75eb0f095be865977990f1eb2434..007ba81a117f4195544e0813f91cffc278307d42 100644 (file)
@@ -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();