aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-09-16 15:50:13 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-09-17 09:48:22 +0200
commit734546728357140404d3403f310621c79deade29 (patch)
tree0552a60a0fb2974b8d3a050304d8613087c2c757 /sonar-plugin-api
parent9ca6bac286879ab0e323fb32b12e40a5d4454d7c (diff)
downloadsonarqube-734546728357140404d3403f310621c79deade29.tar.gz
sonarqube-734546728357140404d3403f310621c79deade29.zip
Fix some quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/SensorDescriptor.java5
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptor.java19
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptorTest.java8
3 files changed, 6 insertions, 26 deletions
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 73541d507c2..8c887ae0dca 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
@@ -82,11 +82,6 @@ public interface SensorDescriptor {
SensorDescriptor requireProperties(String... propertyKeys);
/**
- * Should this sensor be disabled in preview mode. Default is to run all sensors in preview mode.
- */
- SensorDescriptor disabledInPreview();
-
- /**
* Should this sensor be disabled in issues mode. Default is to run all sensors in issues mode.
*/
SensorDescriptor disabledInIssues();
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptor.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptor.java
index 98f88752252..e3324f87882 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptor.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptor.java
@@ -19,13 +19,11 @@
*/
package org.sonar.api.batch.sensor.internal;
-import org.sonar.api.batch.fs.InputFile;
-import org.sonar.api.batch.sensor.SensorDescriptor;
-
-import javax.annotation.Nullable;
-
import java.util.Arrays;
import java.util.Collection;
+import javax.annotation.Nullable;
+import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.sensor.SensorDescriptor;
public class DefaultSensorDescriptor implements SensorDescriptor {
@@ -34,7 +32,6 @@ public class DefaultSensorDescriptor implements SensorDescriptor {
private InputFile.Type type = null;
private String[] ruleRepositories = new String[0];
private String[] properties = new String[0];
- private boolean disabledInPreview = false;
private boolean disabledInIssues = false;
public String name() {
@@ -58,10 +55,6 @@ public class DefaultSensorDescriptor implements SensorDescriptor {
return Arrays.asList(properties);
}
- public boolean isDisabledInPreview() {
- return disabledInPreview;
- }
-
public boolean isDisabledInIssues() {
return disabledInIssues;
}
@@ -112,12 +105,6 @@ public class DefaultSensorDescriptor implements SensorDescriptor {
}
@Override
- public DefaultSensorDescriptor disabledInPreview() {
- this.disabledInPreview = true;
- return this;
- }
-
- @Override
public DefaultSensorDescriptor disabledInIssues() {
this.disabledInIssues = true;
return this;
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptorTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptorTest.java
index 2b50c5f1696..abd505ae7ed 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptorTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/sensor/internal/DefaultSensorDescriptorTest.java
@@ -42,16 +42,14 @@ public class DefaultSensorDescriptorTest {
assertThat(descriptor.properties()).containsOnly("sonar.foo.reportPath");
assertThat(descriptor.ruleRepositories()).containsOnly("squid-java");
}
-
+
@Test
public void disabledAnalysisModes() {
DefaultSensorDescriptor descriptor = new DefaultSensorDescriptor();
descriptor
- .disabledInIssues()
- .disabledInPreview();
-
+ .disabledInIssues();
+
assertThat(descriptor.isDisabledInIssues()).isTrue();
- assertThat(descriptor.isDisabledInPreview()).isTrue();
}
}