aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2016-05-10 18:12:35 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2016-05-12 08:49:09 +0200
commitf785c62ff8259184c889eacea78c5dc25cb9e1a3 (patch)
tree7041dfa84407c19f3287d1a9e4b4d50e8f9dad96 /sonar-plugin-api
parent73f40c17f4b9cdd03636d7198ac5ae1b563de7d1 (diff)
downloadsonarqube-f785c62ff8259184c889eacea78c5dc25cb9e1a3.tar.gz
sonarqube-f785c62ff8259184c889eacea78c5dc25cb9e1a3.zip
SONAR-7612 Move new Sensor API out of @Beta
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/AbstractCpdMapping.java5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/BuildBreaker.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/CheckProject.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/CpdMapping.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/PostJob.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/Sensor.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/SensorContext.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java1
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJob.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java16
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobDescriptor.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/internal/DefaultPostJobDescriptor.java14
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/PostJobIssue.java (renamed from sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/Issue.java)16
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/Sensor.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/cpd/NewCpdTokens.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/Issue.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/IssueLocation.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssue.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssueLocation.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/Measure.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/NewMeasure.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/component/Module.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java33
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/component/RubyComponentService.java5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/component/SourceFile.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/source/Highlightable.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java3
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/StaxParser.java6
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/XmlParserException.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java2
43 files changed, 70 insertions, 130 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AbstractCpdMapping.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/AbstractCpdMapping.java
index 248aeee5479..d644d00d5e3 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AbstractCpdMapping.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/AbstractCpdMapping.java
@@ -19,15 +19,16 @@
*/
package org.sonar.api.batch;
-import org.sonar.api.resources.Resource;
-
import java.util.List;
+import org.sonar.api.resources.Resource;
/**
* A pre-implementation of the CpdMapping extension point
*
* @since 1.10
+ * @deprecated since 5.6
*/
+@Deprecated
public abstract class AbstractCpdMapping implements CpdMapping {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/BuildBreaker.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/BuildBreaker.java
index bc989e83ce4..c8296c7f3b7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/BuildBreaker.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/BuildBreaker.java
@@ -23,7 +23,9 @@ import org.sonar.api.utils.SonarException;
/**
* @since 1.10
+ * @deprecated since 5.6
*/
+@Deprecated
@Phase(name = Phase.Name.POST)
public abstract class BuildBreaker implements PostJob {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/CheckProject.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/CheckProject.java
index 37e39a0555c..b3d12907e47 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/CheckProject.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/CheckProject.java
@@ -23,7 +23,9 @@ import org.sonar.api.resources.Project;
/**
* @since 1.10
+ * @deprecated since 5.6
*/
+@Deprecated
public interface CheckProject {
boolean shouldExecuteOnProject(Project project);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/CpdMapping.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/CpdMapping.java
index 33fca518ee9..a39c405dcec 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/CpdMapping.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/CpdMapping.java
@@ -29,7 +29,7 @@ import org.sonar.api.resources.Resource;
/**
* Implement this extension to get Copy/Paste detection for your language.
* @since 1.10
- * @deprecated since 5.5
+ * @deprecated since 5.5 use {@link SensorContext#newCpdTokens()}
*/
@BatchSide
@ExtensionPoint
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
index d6f3f10f26e..e05bbb2a9db 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorBarriers.java
@@ -28,7 +28,9 @@ package org.sonar.api.batch;
* </ul>
*
* @since 2.3
+ * @deprecated since 5.6 no more used since Decorators are deprecated
*/
+@Deprecated
public interface DecoratorBarriers {
/**
@@ -47,7 +49,6 @@ public interface DecoratorBarriers {
*/
String ISSUES_TRACKED = "END_OF_VIOLATION_TRACKING";
-
/**
* @deprecated in 3.6. Not required anymore.
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java
index 351f217a329..2da3f35e3ba 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/DecoratorContext.java
@@ -30,7 +30,9 @@ import org.sonar.api.resources.Resource;
/**
* @since 1.10
+ * @deprecated since 5.6 no more used since Decorator is deprecated
*/
+@Deprecated
public interface DecoratorContext {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java
index a9bfa828390..66e2f9f27db 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Initializer.java
@@ -26,12 +26,8 @@ import org.sonar.api.resources.Project;
* <p>
* Initializer can execute external tool (like a Maven plugin), change project configuration. For example CoberturaMavenInitializer invokes
* the Codehaus Cobertura Mojo and sets path to Cobertura report according to Maven POM.
- *
- *
* <p>
* Initializers are executed first and once during project analysis.
- *
- *
* @since 2.6
*/
@BatchSide
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/PostJob.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/PostJob.java
index 6ba8298c70e..5605a34c305 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/PostJob.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/PostJob.java
@@ -29,7 +29,9 @@ import org.sonar.api.resources.Project;
* it is an asynchronous processing on server side.
*
* @since 1.10
+ * @deprecated since 5.6 use {@link org.sonar.api.batch.postjob.PostJob}
*/
+@Deprecated
@BatchSide
@ExtensionPoint
public interface PostJob {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Sensor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Sensor.java
index 72cb369f3d3..ebe26fdb6d9 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/Sensor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/Sensor.java
@@ -40,7 +40,9 @@ import org.sonar.api.resources.Project;
*
*
* @since 1.10
+ * @deprecated since 5.6 use {@link org.sonar.api.batch.sensor.Sensor}
*/
+@Deprecated
@BatchSide
@ExtensionPoint
public interface Sensor extends CheckProject {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SensorContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SensorContext.java
index d9573c82deb..b9775f0fcd8 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SensorContext.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SensorContext.java
@@ -32,7 +32,9 @@ import org.sonar.api.resources.Resource;
/**
* @since 1.10
+ * @deprecated since 5.6 use {@link org.sonar.api.batch.sensor.Sensor}
*/
+@Deprecated
public interface SensorContext extends org.sonar.api.batch.sensor.SensorContext {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
index cd3a9947013..404bc29ca1e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java
@@ -22,6 +22,7 @@ package org.sonar.api.batch;
import java.util.Collection;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.design.Dependency;
import org.sonar.api.measures.Measure;
import org.sonar.api.measures.MeasuresFilter;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJob.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJob.java
index 25a060733b1..58510ad3ea1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJob.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJob.java
@@ -19,19 +19,17 @@
*/
package org.sonar.api.batch.postjob;
-import com.google.common.annotations.Beta;
-import org.sonar.api.batch.BatchSide;
import org.sonar.api.ExtensionPoint;
+import org.sonar.api.batch.BatchSide;
/**
- * PostJobs are executed at the very end of batch analysis. A PostJob can't do any modification
+ * PostJobs are executed at the very end of scanner analysis. A PostJob can't do any modification
* since everything is already computed (issues, measures,...). <br>
- * WANRING: Do not rely on the fact that analysis results are available on server side using WS since this is an
+ * WARNING: Do not rely on the fact that analysis results are available on server side when using WS since this is an
* asynchronous process to compute data on server side in 5.x series.
*
* @since 5.2
*/
-@Beta
@BatchSide
@ExtensionPoint
public interface PostJob {
@@ -42,7 +40,7 @@ public interface PostJob {
void describe(PostJobDescriptor descriptor);
/**
- * The actual sensor code.
+ * Called at the end of the analysis.
*/
void execute(PostJobContext context);
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java
index 43d0c7c9713..ed9706309bb 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobContext.java
@@ -19,16 +19,13 @@
*/
package org.sonar.api.batch.postjob;
-import com.google.common.annotations.Beta;
-import org.sonar.api.batch.AnalysisMode;
-import org.sonar.api.batch.postjob.issue.Issue;
+import org.sonar.api.batch.postjob.issue.PostJobIssue;
import org.sonar.api.config.Settings;
/**
* See {@link PostJob#execute(PostJobContext)}
* @since 5.2
*/
-@Beta
public interface PostJobContext {
/**
@@ -36,21 +33,16 @@ public interface PostJobContext {
*/
Settings settings();
- /**
- * Get analysis mode.
- */
- AnalysisMode analysisMode();
-
- // ----------- ISSUES --------------
+ // ----------- Only available in preview mode --------------
/**
* All the unresolved issues of the project, including the issues reported by end-users.
*/
- Iterable<Issue> issues();
+ Iterable<PostJobIssue> issues();
/**
* All the issues of this project that have been marked as resolved during this scan
*/
- Iterable<Issue> resolvedIssues();
+ Iterable<PostJobIssue> resolvedIssues();
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobDescriptor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobDescriptor.java
index 081b0d2779f..7e7a1693da5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobDescriptor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/PostJobDescriptor.java
@@ -19,15 +19,12 @@
*/
package org.sonar.api.batch.postjob;
-import com.google.common.annotations.Beta;
-
/**
* Describe what a {@link PostJob} is doing. Information may be used by the platform
* to log interesting information or perform some optimization.
* See {@link PostJob#describe(PostJobDescriptor)}
* @since 5.2
*/
-@Beta
public interface PostJobDescriptor {
/**
@@ -47,9 +44,4 @@ public interface PostJobDescriptor {
*/
PostJobDescriptor requireProperties(String... propertyKeys);
- /**
- * Should this PostJob be disabled in issues mode. Default is to run all PostJobs in preview mode.
- */
- PostJobDescriptor disabledInIssues();
-
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/internal/DefaultPostJobDescriptor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/internal/DefaultPostJobDescriptor.java
index 8cf5a578deb..ce277761e99 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/internal/DefaultPostJobDescriptor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/internal/DefaultPostJobDescriptor.java
@@ -19,16 +19,14 @@
*/
package org.sonar.api.batch.postjob.internal;
-import org.sonar.api.batch.postjob.PostJobDescriptor;
-
import java.util.Arrays;
import java.util.Collection;
+import org.sonar.api.batch.postjob.PostJobDescriptor;
public class DefaultPostJobDescriptor implements PostJobDescriptor {
private String name;
private String[] properties = new String[0];
- private boolean disabledInIssues = false;
public String name() {
return name;
@@ -38,10 +36,6 @@ public class DefaultPostJobDescriptor implements PostJobDescriptor {
return Arrays.asList(properties);
}
- public boolean isDisabledInIssues() {
- return disabledInIssues;
- }
-
@Override
public DefaultPostJobDescriptor name(String name) {
this.name = name;
@@ -59,10 +53,4 @@ public class DefaultPostJobDescriptor implements PostJobDescriptor {
return this;
}
- @Override
- public DefaultPostJobDescriptor disabledInIssues() {
- this.disabledInIssues = true;
- return this;
- }
-
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/Issue.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/PostJobIssue.java
index ec514a5936b..553e12826a9 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/Issue.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/postjob/issue/PostJobIssue.java
@@ -19,19 +19,17 @@
*/
package org.sonar.api.batch.postjob.issue;
-import com.google.common.annotations.Beta;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.rule.RuleKey;
/**
- * Represents an issue state at the end of the batch analysis. Only available after local issue tracking in preview mode.
+ * Represents an issue state at the end of the batch analysis. Some attributes are only available in preview/issues mode.
*
* @since 5.2
*/
-@Beta
-public interface Issue {
+public interface PostJobIssue {
/**
* Key of the issue.
@@ -62,24 +60,18 @@ public interface Issue {
Integer line();
/**
- * Effort to fix the issue. Used by technical debt model.
- */
- @CheckForNull
- Double effortToFix();
-
- /**
* Message of the issue.
*/
@CheckForNull
String message();
/**
- * Severity.
+ * Severity. Only accurate in preview/issues mode.
*/
Severity severity();
/**
- * If the issue a new one.
+ * If the issue a new one. Only available in preview/issues mode.
*/
boolean isNew();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/Sensor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/Sensor.java
index 1509e58fc5c..e4cc8e61744 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/Sensor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/Sensor.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor;
-import com.google.common.annotations.Beta;
import org.sonar.api.ExtensionPoint;
import org.sonar.api.batch.BatchSide;
@@ -27,15 +26,10 @@ import org.sonar.api.batch.BatchSide;
* <p>
* A sensor is invoked once for each module of a project, starting from leaf modules. The sensor can parse a flat file, connect to a web server... Sensors are
* used to add measure and issues at file level.
- *
- *
* <p>
* For example the Cobertura Sensor parses Cobertura report and saves the first-level of measures on files.
- *
- *
* @since 5.1
*/
-@Beta
@BatchSide
@ExtensionPoint
public interface Sensor {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java
index 044f5f36c16..bb1aa0fd922 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorContext.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor;
-import com.google.common.annotations.Beta;
import java.io.Serializable;
import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputModule;
@@ -41,7 +40,6 @@ import org.sonar.api.utils.Version;
* In order to write unit tests you can use {@link SensorContextTester}
* @since 5.1
*/
-@Beta
public interface SensorContext {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java
index 9000a81432b..4f36c763964 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
/**
@@ -28,7 +27,6 @@ import org.sonar.api.batch.fs.InputFile;
* See {@link Sensor#describe(SensorDescriptor)}
* @since 5.1
*/
-@Beta
public interface SensorDescriptor {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java
index cdab75f44c4..cdde991667d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/CoverageType.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.coverage;
-import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableSet;
import java.util.Set;
import org.sonar.api.measures.Metric;
@@ -50,7 +49,6 @@ import static org.sonar.api.measures.CoreMetrics.UNCOVERED_LINES;
* Different coverage categories.
* @since 5.2
*/
-@Beta
public enum CoverageType {
UNIT(LINES_TO_COVER, UNCOVERED_LINES, COVERAGE_LINE_HITS_DATA, CONDITIONS_TO_COVER, UNCOVERED_CONDITIONS, COVERED_CONDITIONS_BY_LINE, CONDITIONS_BY_LINE),
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java
index 2ef1be16a2a..c9e9024072a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/coverage/NewCoverage.java
@@ -19,14 +19,12 @@
*/
package org.sonar.api.batch.sensor.coverage;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
/**
* This builder is used to define code coverage by tests of a given type (UT/IT/Overall) on files.
* @since 5.2
*/
-@Beta
public interface NewCoverage {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/cpd/NewCpdTokens.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/cpd/NewCpdTokens.java
index e2a48d1a724..1a2785ac8fb 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/cpd/NewCpdTokens.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/cpd/NewCpdTokens.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.cpd;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.TextRange;
@@ -27,7 +26,6 @@ import org.sonar.api.batch.fs.TextRange;
* This builder is used to define tokens used by CPD algorithm on files.
* @since 5.5
*/
-@Beta
public interface NewCpdTokens {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java
index 6f59fad4bad..577aefd911e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/NewHighlighting.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.highlighting;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.TextRange;
@@ -27,7 +26,6 @@ import org.sonar.api.batch.fs.TextRange;
* This builder is used to define syntax highlighting (aka code coloration) on files.
* @since 5.1
*/
-@Beta
public interface NewHighlighting {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
index 4065eff5789..559e44e61a6 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/highlighting/TypeOfText.java
@@ -19,15 +19,12 @@
*/
package org.sonar.api.batch.sensor.highlighting;
-import com.google.common.annotations.Beta;
-
/**
* Experimental, do not use.
* <br>
* Possible types for highlighting code. See sonar-colorizer.css
* @since 5.1
*/
-@Beta
public enum TypeOfText {
ANNOTATION("a"),
CONSTANT("c"),
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 1f275390788..fb7cfc87b40 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
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.issue;
-import com.google.common.annotations.Beta;
import java.util.List;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.rule.Severity;
@@ -31,7 +30,6 @@ import org.sonar.api.rule.RuleKey;
*
* @since 5.1
*/
-@Beta
public interface Issue {
interface Flow {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/IssueLocation.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/IssueLocation.java
index 37d32cbebf8..2dade89c658 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/IssueLocation.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/IssueLocation.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.issue;
-import com.google.common.annotations.Beta;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.TextRange;
@@ -29,7 +28,6 @@ import org.sonar.api.batch.fs.TextRange;
*
* @since 5.2
*/
-@Beta
public interface IssueLocation {
/**
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 2dbf02b31d1..f428d8c6aa1 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
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.issue;
-import com.google.common.annotations.Beta;
import javax.annotation.Nullable;
import org.sonar.api.batch.rule.Severity;
import org.sonar.api.batch.sensor.Sensor;
@@ -30,7 +29,6 @@ import org.sonar.api.rule.RuleKey;
*
* @since 5.1
*/
-@Beta
public interface NewIssue {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssueLocation.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssueLocation.java
index f4fe17f13ac..ea62885fbc0 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssueLocation.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/issue/NewIssueLocation.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.issue;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.TextRange;
@@ -29,7 +28,6 @@ import org.sonar.api.batch.fs.TextRange;
*
* @since 5.2
*/
-@Beta
public interface NewIssueLocation {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/Measure.java
index 40b479f4485..87b37b15e08 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/Measure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/Measure.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.measure;
-import com.google.common.annotations.Beta;
import java.io.Serializable;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.measure.Metric;
@@ -29,7 +28,6 @@ import org.sonar.api.batch.measure.Metric;
* Should not be implemented by client.
* @since 5.1
*/
-@Beta
public interface Measure<G extends Serializable> {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/NewMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/NewMeasure.java
index fc3dc68201e..00b3a17a1be 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/NewMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/measure/NewMeasure.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.measure;
-import com.google.common.annotations.Beta;
import java.io.Serializable;
import org.sonar.api.batch.fs.InputComponent;
import org.sonar.api.batch.measure.Metric;
@@ -29,7 +28,6 @@ import org.sonar.api.batch.measure.Metric;
* Should not be implemented by client.
* @since 5.2
*/
-@Beta
public interface NewMeasure<G extends Serializable> {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java
index 46368ed5ee1..06c2ba8529d 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbol.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.symbol;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.TextRange;
@@ -27,7 +26,6 @@ import org.sonar.api.batch.fs.TextRange;
* This builder is used to define symbol references on files.
* @since 5.6
*/
-@Beta
public interface NewSymbol {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java
index 1e8487c557d..874261a6c6f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/symbol/NewSymbolTable.java
@@ -19,7 +19,6 @@
*/
package org.sonar.api.batch.sensor.symbol;
-import com.google.common.annotations.Beta;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.TextRange;
@@ -27,7 +26,6 @@ import org.sonar.api.batch.fs.TextRange;
* This builder is used to define symbol references on files.
* @since 5.6
*/
-@Beta
public interface NewSymbolTable {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/Module.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/Module.java
index c2aeab148b1..3ab3f6d1776 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/component/Module.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/Module.java
@@ -19,6 +19,10 @@
*/
package org.sonar.api.component;
+/**
+ * @deprecated since 5.6
+ */
+@Deprecated
public interface Module extends Component {
String getDescription();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java
index 76cb7cd3d04..858f5b9e7fd 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/ResourcePerspectives.java
@@ -22,41 +22,14 @@ package org.sonar.api.component;
import javax.annotation.CheckForNull;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.InputPath;
-import org.sonar.api.issue.Issuable;
+import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.resources.Resource;
-import org.sonar.api.source.Highlightable;
-import org.sonar.api.source.Symbolizable;
-import org.sonar.api.test.TestPlan;
-import org.sonar.api.test.Testable;
/**
- * Use this component to create perspective from resources or {@link InputPath}
- * Only on batch-side.
- *
- * <pre>
- * public class MySensor implements Sensor {
- * private final ResourcePerspectives perspectives;
- *
- * public MySensor(ResourcePerspectives perspectives) {
- * this.perspectives = perspectives;
- * }
- *
- * public void analyse(Project module, SensorContext context) {
- * // Get some Resource or InputFile/InputPath
- * Highlightable highlightable = perspectives.as(Highlightable.class, inputPath);
- * if (highlightable != null) {
- * ...
- * }
- * }
- * }
- * </pre>
- * @see Issuable
- * @see Highlightable
- * @see Symbolizable
- * @see Testable
- * @see TestPlan
* @since 3.5
+ * @deprecated since 5.6 all features are available on {@link SensorContext}
*/
+@Deprecated
public interface ResourcePerspectives {
@CheckForNull
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/RubyComponentService.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/RubyComponentService.java
index 901290d57b4..0f4f3e2ca5b 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/component/RubyComponentService.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/RubyComponentService.java
@@ -19,13 +19,14 @@
*/
package org.sonar.api.component;
-import org.sonar.api.server.ServerSide;
-
import javax.annotation.CheckForNull;
+import org.sonar.api.server.ServerSide;
/**
* @since 3.6
+ * @deprecated since 5.6
*/
+@Deprecated
@ServerSide
public interface RubyComponentService {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/SourceFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/SourceFile.java
index bfc25f1d786..76cb7f0883a 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/component/SourceFile.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/SourceFile.java
@@ -19,5 +19,9 @@
*/
package org.sonar.api.component;
+/**
+ * @deprecated since 5.6
+ */
+@Deprecated
public interface SourceFile extends Component {
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java
index 8ee9b16a5d9..e169ddc6524 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/component/mock/MockSourceFile.java
@@ -21,6 +21,10 @@ package org.sonar.api.component.mock;
import org.sonar.api.component.SourceFile;
+/**
+ * @deprecated since 5.6
+ */
+@Deprecated
public class MockSourceFile implements SourceFile {
private String key;
private String path;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/source/Highlightable.java b/sonar-plugin-api/src/main/java/org/sonar/api/source/Highlightable.java
index 267fd082a8b..4230b2ccdee 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/source/Highlightable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/source/Highlightable.java
@@ -19,6 +19,7 @@
*/
package org.sonar.api.source;
+import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.component.Perspective;
import org.sonar.api.component.ResourcePerspectives;
@@ -26,7 +27,9 @@ import org.sonar.api.component.ResourcePerspectives;
* Use this perspective to save syntax highlighting on files.
* See {@link ResourcePerspectives}.
* @since 3.6
+ * @deprecated since 5.6 use {@link SensorContext#newHighlighting()}
*/
+@Deprecated
public interface Highlightable extends Perspective {
interface HighlightingBuilder {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java
index c639e022e0e..fac2b3e76f9 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbol.java
@@ -19,6 +19,12 @@
*/
package org.sonar.api.source;
+import org.sonar.api.batch.sensor.SensorContext;
+
+/**
+ * @deprecated since 5.6 use {@link SensorContext#newSymbolTable()}
+ */
+@Deprecated
public interface Symbol {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
index 1e40f26a23c..98177598ef1 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
@@ -20,6 +20,7 @@
package org.sonar.api.source;
import java.util.List;
+import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.component.Perspective;
import org.sonar.api.component.ResourcePerspectives;
@@ -27,7 +28,9 @@ import org.sonar.api.component.ResourcePerspectives;
* Use this perspective to save symbol references on files.
* See {@link ResourcePerspectives}.
* @since 3.6
+ * @deprecated since 5.6 use {@link SensorContext#newSymbolTable()}
*/
+@Deprecated
public interface Symbolizable extends Perspective {
interface SymbolTableBuilder {
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/StaxParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/StaxParser.java
index 2a75d72bb4c..0b7eb907b85 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/StaxParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/StaxParser.java
@@ -37,7 +37,9 @@ import org.codehaus.staxmate.in.SMHierarchicCursor;
/**
* @since 1.10
+ * @deprecated since 5.6 plugins should use their own dependencies
*/
+@Deprecated
public class StaxParser {
private SMInputFactory inf;
@@ -77,7 +79,7 @@ public class StaxParser {
}
public void parse(File xmlFile) throws XMLStreamException {
- FileInputStream input=null;
+ FileInputStream input = null;
try {
input = new FileInputStream(xmlFile);
parse(input);
@@ -123,7 +125,7 @@ public class StaxParser {
if (StringUtils.startsWithIgnoreCase(undeclaredEntity, "u") && undeclaredEntity.length() == 5) {
int unicodeCharHexValue = Integer.parseInt(undeclaredEntity.substring(1), 16);
if (Character.isDefined(unicodeCharHexValue)) {
- undeclaredEntity = new String(new char[]{(char) unicodeCharHexValue});
+ undeclaredEntity = new String(new char[] {(char) unicodeCharHexValue});
}
}
return undeclaredEntity;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/XmlParserException.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/XmlParserException.java
index 4737039a0df..cd88d5bf6de 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/XmlParserException.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/XmlParserException.java
@@ -21,7 +21,9 @@ package org.sonar.api.utils;
/**
* @since 1.10
+ * @deprecated since 5.6
*/
+@Deprecated
public class XmlParserException extends SonarException {
public XmlParserException() {
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java
index df350a4893b..e21fcefaf38 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/XpathParser.java
@@ -56,7 +56,9 @@ import org.xml.sax.SAXException;
* XML Parsing tool using XPATH. It's recommended to use StaxParser when parsing big XML files.
*
* @since 1.10
+ * @deprecated since 5.6 plugins should use their own dependencies
*/
+@Deprecated
public class XpathParser {
private static final String CAN_NOT_PARSE_XML = "can not parse xml : ";