]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5931 Cleanup new issue API
authorJulien HENRY <julien.henry@sonarsource.com>
Thu, 19 Feb 2015 21:34:14 +0000 (22:34 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Thu, 19 Feb 2015 21:34:14 +0000 (22:34 +0100)
20 files changed:
plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/DependencySensorTest.java
plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/lang/MeasureSensorTest.java
plugins/sonar-xoo-plugin/src/test/java/org/sonar/xoo/rule/OneIssuePerLineSensorTest.java
sonar-batch/src/main/java/org/sonar/batch/deprecated/DeprecatedSensorContext.java
sonar-batch/src/main/java/org/sonar/batch/sensor/DefaultSensorContext.java
sonar-batch/src/main/java/org/sonar/batch/sensor/DefaultSensorStorage.java
sonar-batch/src/test/java/org/sonar/batch/cpd/JavaCpdEngineTest.java
sonar-batch/src/test/java/org/sonar/batch/sensor/DefaultSensorContextTest.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorStorage.java [deleted file]
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/dependency/internal/DefaultDependency.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/duplication/internal/DefaultDuplication.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultStorable.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java [new file with mode: 0644]
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 [new file with mode: 0644]
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssue.java
sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasure.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/issue/internal/DefaultIssueTest.java
sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/measure/internal/DefaultMeasureTest.java

index e586263feda0f15e334ddc5675edaad223ff3ef4..73b63909ebc2d337126e4ea8ca51405e555d0e11 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.xoo.lang;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Rule;
@@ -30,7 +32,6 @@ import org.sonar.api.batch.fs.InputFile.Type;
 import org.sonar.api.batch.fs.internal.DefaultFileSystem;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.dependency.Dependency;
 import org.sonar.api.batch.sensor.dependency.internal.DefaultDependency;
 import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;
index 6626a5e95456b111470908c940846cd9874fc5d1..92169bdf42b3f80c563b2b8fe80e236d91e1e2f9 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.xoo.lang;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.apache.commons.io.FileUtils;
 import org.junit.Before;
 import org.junit.Rule;
@@ -31,7 +33,6 @@ import org.sonar.api.batch.fs.internal.DefaultFileSystem;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.measure.MetricFinder;
 import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;
 import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
 import org.sonar.api.measures.CoreMetrics;
index 9f1a4436a0e1441299075f26584813cf98cb4183..ab8ea247d35f201ff9592b20ebdbbc9ab77d3cb2 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.xoo.rule;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -28,7 +30,6 @@ import org.mockito.stubbing.Answer;
 import org.sonar.api.batch.fs.internal.DefaultFileSystem;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.internal.DefaultSensorDescriptor;
 import org.sonar.api.batch.sensor.issue.Issue;
 import org.sonar.api.batch.sensor.issue.Issue.Severity;
index a8d96036863aabf5a2d29495d04a207393bf2ee0..c216e7ab29f6e0f1ed976ad716c08b08f0019f0e 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.batch.deprecated;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -31,7 +33,6 @@ import org.sonar.api.batch.fs.InputDir;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputPath;
 import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.config.Settings;
 import org.sonar.api.design.Dependency;
 import org.sonar.api.measures.Measure;
index 667552ae8405050e1f50719406122d0685b7d2cd..e010b83fca20851d0bae6615f7a3bde5acabaafd 100644 (file)
@@ -25,13 +25,13 @@ import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
 import org.sonar.api.batch.rule.ActiveRules;
 import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.dependency.NewDependency;
 import org.sonar.api.batch.sensor.dependency.internal.DefaultDependency;
 import org.sonar.api.batch.sensor.duplication.NewDuplication;
 import org.sonar.api.batch.sensor.duplication.internal.DefaultDuplication;
 import org.sonar.api.batch.sensor.highlighting.HighlightingBuilder;
-import org.sonar.api.batch.sensor.issue.Issue;
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+import org.sonar.api.batch.sensor.issue.NewIssue;
 import org.sonar.api.batch.sensor.issue.internal.DefaultIssue;
 import org.sonar.api.batch.sensor.measure.NewMeasure;
 import org.sonar.api.batch.sensor.measure.internal.DefaultMeasure;
@@ -88,7 +88,7 @@ public class DefaultSensorContext implements SensorContext {
   }
 
   @Override
-  public Issue newIssue() {
+  public NewIssue newIssue() {
     return new DefaultIssue(sensorStorage);
   }
 
index 1624e10d7b229c8083ff2bfd18e773061e1f8ad4..170fd671daf71cded28f4202c6a1807d9461e65b 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.batch.sensor;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import com.google.common.base.Preconditions;
 import org.sonar.api.batch.fs.FileSystem;
 import org.sonar.api.batch.fs.InputDir;
@@ -26,7 +28,6 @@ import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputPath;
 import org.sonar.api.batch.measure.MetricFinder;
 import org.sonar.api.batch.rule.ActiveRules;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.duplication.Duplication;
 import org.sonar.api.batch.sensor.duplication.internal.DefaultDuplication;
 import org.sonar.api.batch.sensor.issue.Issue;
index 2de7d5952cff53408b105dbad3371f61344f3ea4..e4e4d3e0366b2b8084ed4a6f5e4110ecb00086fe 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.batch.cpd;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -27,7 +29,6 @@ import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.sonar.api.batch.fs.internal.DeprecatedDefaultInputFile;
 import org.sonar.api.batch.sensor.SensorContext;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.duplication.NewDuplication;
 import org.sonar.api.batch.sensor.duplication.internal.DefaultDuplication;
 import org.sonar.api.batch.sensor.measure.Measure;
index 19b12f7b972130d7728a51ca7b8a97f2a44575b6..b5d443aa3033e476a45f9bdb8fe2fffc1bd3f81d 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.batch.sensor;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
@@ -29,11 +31,9 @@ import org.sonar.api.batch.fs.internal.DefaultFileSystem;
 import org.sonar.api.batch.measure.MetricFinder;
 import org.sonar.api.batch.rule.ActiveRules;
 import org.sonar.api.batch.rule.internal.ActiveRulesBuilder;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.config.Settings;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.batch.index.ComponentDataCache;
-
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
index 336a7eef61ab494478d0083cf434a10d4f44a7fe..bd15a900398ad7fd031b42bf10b0ae1c3d9db044 100644 (file)
@@ -28,6 +28,7 @@ import org.sonar.api.batch.sensor.dependency.NewDependency;
 import org.sonar.api.batch.sensor.duplication.NewDuplication;
 import org.sonar.api.batch.sensor.highlighting.HighlightingBuilder;
 import org.sonar.api.batch.sensor.issue.Issue;
+import org.sonar.api.batch.sensor.issue.NewIssue;
 import org.sonar.api.batch.sensor.measure.Measure;
 import org.sonar.api.batch.sensor.measure.NewMeasure;
 import org.sonar.api.batch.sensor.symbol.SymbolTableBuilder;
@@ -71,9 +72,9 @@ public interface SensorContext {
   // ----------- ISSUES --------------
 
   /**
-   * Fluent builder to create a new {@link Issue}. Don't forget to call {@link Issue#save()} once all parameters are provided.
+   * Fluent builder to create a new {@link Issue}. Don't forget to call {@link NewIssue#save()} once all parameters are provided.
    */
-  Issue newIssue();
+  NewIssue newIssue();
 
   // ------------ HIGHLIGHTING ------------
 
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorStorage.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorStorage.java
deleted file mode 100644 (file)
index 7ee6b30..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2014 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube 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.
- *
- * SonarQube 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.api.batch.sensor;
-
-import org.sonar.api.batch.sensor.dependency.Dependency;
-import org.sonar.api.batch.sensor.duplication.Duplication;
-import org.sonar.api.batch.sensor.issue.Issue;
-import org.sonar.api.batch.sensor.measure.Measure;
-
-/**
- * Interface for storing data computed by sensors.
- * @since 5.1
- */
-public interface SensorStorage {
-
-  void store(Measure measure);
-
-  void store(Issue issue);
-
-  void store(Duplication duplication);
-
-  void store(Dependency dependency);
-
-}
index 9dcb3d34ece175104479d201d70bc20eff56d712..56161c2964634577896cd7f5ee3ba031aee3ebc0 100644 (file)
  */
 package org.sonar.api.batch.sensor.dependency.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import com.google.common.base.Preconditions;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.dependency.Dependency;
 import org.sonar.api.batch.sensor.dependency.NewDependency;
 import org.sonar.api.batch.sensor.internal.DefaultStorable;
index 496f3cd93320e3bf125fbda2f3d0f1d317cb02a2..d9836036646565a48bfab56d876db333ef983b40 100644 (file)
@@ -19,6 +19,8 @@
  */
 package org.sonar.api.batch.sensor.duplication.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import com.google.common.base.Preconditions;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -26,7 +28,6 @@ import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.duplication.Duplication;
 import org.sonar.api.batch.sensor.duplication.NewDuplication;
 import org.sonar.api.batch.sensor.internal.DefaultStorable;
index e3b7f919f2c9a63c0e2d34c2517158710c61b6a9..31f16142b57a3f36a513d55a04b222e8d7c2e6ad 100644 (file)
@@ -23,7 +23,6 @@ import com.google.common.base.Preconditions;
 import org.apache.commons.lang.builder.ToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.sonar.api.batch.fs.InputFile;
-import org.sonar.api.batch.sensor.SensorStorage;
 
 import javax.annotation.Nullable;
 
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/SensorStorage.java
new file mode 100644 (file)
index 0000000..69b79f7
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube 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.
+ *
+ * SonarQube 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.api.batch.sensor.internal;
+
+import org.sonar.api.batch.sensor.dependency.Dependency;
+import org.sonar.api.batch.sensor.duplication.Duplication;
+import org.sonar.api.batch.sensor.issue.Issue;
+import org.sonar.api.batch.sensor.measure.Measure;
+
+/**
+ * Interface for storing data computed by sensors.
+ * @since 5.1
+ */
+public interface SensorStorage {
+
+  void store(Measure measure);
+
+  void store(Issue issue);
+
+  void store(Duplication duplication);
+
+  void store(Dependency dependency);
+
+}
index e126ddef95b669249a7f73eeda9f143222a3e0f6..d320bd2c11f6293025ce3dc1ede7fc325e48832b 100644 (file)
  */
 package org.sonar.api.batch.sensor.issue;
 
-import com.google.common.annotations.Beta;
-import org.sonar.api.batch.fs.InputDir;
-import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputPath;
 import org.sonar.api.batch.sensor.Sensor;
 import org.sonar.api.rule.RuleKey;
 
 import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
 
 /**
  * Represents an issue detected by a {@link Sensor}.
  *
- * @since 5.0
+ * @since 5.1
  */
-@Beta
 public interface Issue {
 
   public enum Severity {
@@ -45,43 +40,17 @@ public interface Issue {
     BLOCKER;
   }
 
-  /**
-   * The {@link RuleKey} of the issue.
-   */
-  Issue ruleKey(RuleKey ruleKey);
-
   /**
    * The {@link RuleKey} of this issue.
    */
   RuleKey ruleKey();
 
-  /**
-   * The {@link InputFile} the issue belongs to. For global issues call {@link #onProject()}.
-   */
-  Issue onFile(InputFile file);
-
-  /**
-   * The {@link InputDir} the issue belongs to. For global issues call {@link #onProject()}.
-   */
-  Issue onDir(InputDir inputDir);
-
-  /**
-   * Tell that the issue is global to the project.
-   */
-  Issue onProject();
-
   /**
    * The {@link InputPath} this issue belongs to. Returns null if issue is global to the project.
    */
   @CheckForNull
   InputPath inputPath();
 
-  /**
-   * Line of the issue. Only available for {@link #onFile(InputFile)} issues. 
-   * If no line is specified it means that issue is global to the file.
-   */
-  Issue atLine(int line);
-
   /**
    * Line of the issue. Null for global issues and issues on directories. Can also be null
    * for files (issue global to the file).
@@ -89,44 +58,22 @@ public interface Issue {
   @CheckForNull
   Integer line();
 
-  /**
-   * Effort to fix the issue.
-   */
-  Issue effortToFix(@Nullable Double effortToFix);
-
   /**
    * Effort to fix the issue. Used by technical debt model.
    */
   @CheckForNull
   Double effortToFix();
 
-  /**
-   * Message of the issue.
-   */
-  Issue message(String message);
-
   /**
    * Message of the issue.
    */
   @CheckForNull
   String message();
 
-  /**
-   * Override severity of the issue.
-   * Setting a null value or not calling this method means to use severity configured in quality profile.
-   */
-  Issue overrideSeverity(@Nullable Severity severity);
-
   /**
    * Overriden severity.
    */
   @CheckForNull
   Severity overridenSeverity();
 
-  /**
-   * Save the issue. If rule key is unknow or rule not enabled in the current quality profile then a warning is logged but no exception
-   * is thrown.
-   */
-  void save();
-
 }
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
new file mode 100644 (file)
index 0000000..8819fc2
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube 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.
+ *
+ * SonarQube 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.api.batch.sensor.issue;
+
+import org.sonar.api.batch.fs.InputDir;
+import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.sensor.Sensor;
+import org.sonar.api.batch.sensor.issue.Issue.Severity;
+import org.sonar.api.rule.RuleKey;
+
+import javax.annotation.Nullable;
+
+/**
+ * Represents an issue detected by a {@link Sensor}.
+ *
+ * @since 5.1
+ */
+public interface NewIssue {
+
+  /**
+   * The {@link RuleKey} of the issue.
+   */
+  NewIssue ruleKey(RuleKey ruleKey);
+
+  /**
+   * The {@link InputFile} the issue belongs to. For global issues call {@link #onProject()}.
+   */
+  NewIssue onFile(InputFile file);
+
+  /**
+   * The {@link InputDir} the issue belongs to. For global issues call {@link #onProject()}.
+   */
+  NewIssue onDir(InputDir inputDir);
+
+  /**
+   * Tell that the issue is global to the project.
+   */
+  NewIssue onProject();
+
+  /**
+   * Line of the issue. Only available for {@link #onFile(InputFile)} issues. 
+   * If no line is specified it means that issue is global to the file.
+   */
+  NewIssue atLine(int line);
+
+  /**
+   * Effort to fix the issue.
+   */
+  NewIssue effortToFix(@Nullable Double effortToFix);
+
+  /**
+   * Message of the issue.
+   */
+  NewIssue message(String message);
+
+  /**
+   * Override severity of the issue.
+   * Setting a null value or not calling this method means to use severity configured in quality profile.
+   */
+  NewIssue overrideSeverity(@Nullable Severity severity);
+
+  /**
+   * 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.
+   */
+  void save();
+
+}
index df4779a489481e8bf6c39121faf65c00f9980abe..c029722eb9d4d9c08ff6100dfa9c7b58011c5c3c 100644 (file)
  */
 package org.sonar.api.batch.sensor.issue.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import org.sonar.api.batch.fs.InputDir;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.fs.InputPath;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.internal.DefaultStorable;
 import org.sonar.api.batch.sensor.issue.Issue;
+import org.sonar.api.batch.sensor.issue.NewIssue;
 import org.sonar.api.rule.RuleKey;
 import org.sonar.api.utils.internal.Uuids;
 
 import javax.annotation.CheckForNull;
 import javax.annotation.Nullable;
 
-public class DefaultIssue extends DefaultStorable implements Issue {
+public class DefaultIssue extends DefaultStorable implements Issue, NewIssue {
 
   private static final String INPUT_DIR_SHOULD_BE_NON_NULL = "InputDir should be non null";
   private static final String INPUT_FILE_SHOULD_BE_NON_NULL = "InputFile should be non null";
@@ -110,7 +112,7 @@ public class DefaultIssue extends DefaultStorable implements Issue {
   }
 
   @Override
-  public Issue overrideSeverity(@Nullable Severity severity) {
+  public DefaultIssue overrideSeverity(@Nullable Severity severity) {
     this.overridenSeverity = severity;
     return this;
   }
index a6e4a0021fa01b46e001f43359e0278819670f74..e798ce64fdeb29fec74c67901706260c7d643652 100644 (file)
  */
 package org.sonar.api.batch.sensor.measure.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import com.google.common.base.Preconditions;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.sonar.api.batch.fs.InputFile;
 import org.sonar.api.batch.measure.Metric;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.batch.sensor.internal.DefaultStorable;
 import org.sonar.api.batch.sensor.measure.Measure;
 import org.sonar.api.batch.sensor.measure.NewMeasure;
index 5580f881f1ac0d751650dbd1db799a4f434ceac7..8973939afe35f0d97be822becd617babd9a3d028 100644 (file)
  */
 package org.sonar.api.batch.sensor.issue.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.rule.RuleKey;
-
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;
index a4e5c4afb8e977132d79a9745ffc78d1aff44f9b..6dae7fc2dbf36ce039439f97cb10ebaef56d9d40 100644 (file)
  */
 package org.sonar.api.batch.sensor.measure.internal;
 
+import org.sonar.api.batch.sensor.internal.SensorStorage;
+
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.api.batch.fs.internal.DefaultInputFile;
-import org.sonar.api.batch.sensor.SensorStorage;
 import org.sonar.api.measures.CoreMetrics;
-
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verify;