diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-08-20 18:05:27 +0200 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-08-21 13:55:09 +0200 |
commit | fc7e84440749ea77c2bd69128115e3848d2050f0 (patch) | |
tree | af30436b5defc5a6bf8ba98c36bdb14bc7a8ba80 | |
parent | 7370c19e9acfefb2b9ac1fb3aeea7fd73f5a5fc3 (diff) | |
download | sonarqube-fc7e84440749ea77c2bd69128115e3848d2050f0.tar.gz sonarqube-fc7e84440749ea77c2bd69128115e3848d2050f0.zip |
Improve quality
6 files changed, 9 insertions, 16 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/AbstractDeprecatedXooRuleSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/AbstractDeprecatedXooRuleSensor.java index 63290dd1254..31eeefdbcb3 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/AbstractDeprecatedXooRuleSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/AbstractDeprecatedXooRuleSensor.java @@ -19,8 +19,6 @@ */ package org.sonar.xoo.rule; -import org.sonar.api.batch.rule.ActiveRule; - import org.sonar.api.batch.Sensor; import org.sonar.api.batch.SensorContext; import org.sonar.api.batch.fs.FileSystem; diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/Xoo2BasicProfile.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/Xoo2BasicProfile.java index a735d0840c0..bdd68e9c506 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/Xoo2BasicProfile.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/Xoo2BasicProfile.java @@ -29,6 +29,7 @@ import org.sonar.api.utils.ValidationMessages; public class Xoo2BasicProfile extends ProfileDefinition { + @Override public RulesProfile createProfile(ValidationMessages messages) { RulesProfile profile = RulesProfile.create("Basic", Xoo2.KEY); diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AbstractAnalysisMode.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AbstractAnalysisMode.java index 61726ba4108..52d73c8bf41 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AbstractAnalysisMode.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/AbstractAnalysisMode.java @@ -27,20 +27,25 @@ import java.util.Arrays; import org.sonar.api.batch.AnalysisMode; public abstract class AbstractAnalysisMode implements AnalysisMode { + protected final static String[] VALID_MODES = {CoreProperties.ANALYSIS_MODE_PREVIEW, CoreProperties.ANALYSIS_MODE_PUBLISH, CoreProperties.ANALYSIS_MODE_ISSUES}; + protected boolean preview; protected boolean issues; protected AbstractAnalysisMode() { } + @Override public boolean isPreview() { return preview; } + @Override public boolean isIssues() { return issues; } + @Override public boolean isPublish() { return !preview && !issues; } diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java index 364a408b5ce..c97dd5fa912 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java +++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchPluginRepository.java @@ -68,8 +68,7 @@ public class BatchPluginRepository implements PluginRepository, Startable { private void logPlugins() { if (infosByKeys.isEmpty()) { LOG.debug("No plugins loaded"); - } - else { + } else { LOG.debug("Plugins:"); for (PluginInfo p : infosByKeys.values()) { LOG.debug(" {}-{}", p.getName(), p.getVersion()); diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cache/CacheSyncTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cache/CacheSyncTest.java index a0d2ef8b7f8..3c5d2749926 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cache/CacheSyncTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/cache/CacheSyncTest.java @@ -22,7 +22,6 @@ package org.sonar.batch.mediumtest.cache; import org.sonar.batch.protocol.input.FileData; import org.junit.Test; -import org.junit.Rule; import com.google.common.collect.ImmutableMap; import org.junit.After; import org.sonar.api.CoreProperties; @@ -33,13 +32,8 @@ import org.sonar.xoo.rule.XooRulesDefinition; import java.util.Date; -import org.junit.rules.TemporaryFolder; - public class CacheSyncTest { - @Rule - public TemporaryFolder temp = new TemporaryFolder(); - public BatchMediumTester tester; @After @@ -56,7 +50,7 @@ public class CacheSyncTest { String[] hashes = new String[] { "line1", "line2" }; - + tester = BatchMediumTester.builder() .bootstrapProperties(ImmutableMap.of(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_ISSUES)) .registerPlugin("xoo", new XooPlugin()) @@ -69,7 +63,7 @@ public class CacheSyncTest { tester.start(); tester.syncProject("test-project"); - + } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java index e0f82b7a71d..50019d5eadd 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/AnalysisMode.java @@ -19,16 +19,12 @@ */ package org.sonar.api.batch; -import org.sonar.api.CoreProperties; - /** * Use this component to find the current running mode. * @since 5.1 */ @BatchSide public interface AnalysisMode { - static final String[] VALID_MODES = {CoreProperties.ANALYSIS_MODE_PREVIEW, CoreProperties.ANALYSIS_MODE_PUBLISH, CoreProperties.ANALYSIS_MODE_ISSUES}; - boolean isPreview(); boolean isIssues(); |