aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-04-30 15:59:38 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-04-30 15:59:38 +0200
commit4e6ce48288c10f14af1969cef727bb32d31c5942 (patch)
treeec23bdbc08d25a3184f5337fd635a62c6db9b8e6 /sonar-batch
parent3c37551b26940cce769b1de4139bfd131d9d5f97 (diff)
downloadsonarqube-4e6ce48288c10f14af1969cef727bb32d31c5942.tar.gz
sonarqube-4e6ce48288c10f14af1969cef727bb32d31c5942.zip
Fix quality flaws
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java7
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java1
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java6
3 files changed, 4 insertions, 10 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
index 437fd62ff55..99f5f028978 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/JdbcDriverHolder.java
@@ -26,8 +26,6 @@ import org.slf4j.LoggerFactory;
import org.sonar.api.utils.SonarException;
import org.sonar.home.cache.FileCache;
-import javax.annotation.CheckForNull;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -61,7 +59,7 @@ public class JdbcDriverHolder {
try {
LOG.info("Install JDBC driver");
String[] nameAndHash = downloadJdbcDriverIndex();
- if (nameAndHash != null) {
+ if (nameAndHash.length > 0) {
String filename = nameAndHash[0];
String hash = nameAndHash[1];
@@ -138,7 +136,6 @@ public class JdbcDriverHolder {
}
}
- @CheckForNull
private String[] downloadJdbcDriverIndex() {
String url = "/deploy/jdbc-driver.txt";
try {
@@ -146,7 +143,7 @@ public class JdbcDriverHolder {
String indexContent = serverClient.request(url);
// File is empty when H2 is used
if (Strings.isNullOrEmpty(indexContent)) {
- return null;
+ return new String[]{};
}
return indexContent.split("\\|");
} catch (Exception e) {
diff --git a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
index d823a0650cf..b328680a990 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java
@@ -26,7 +26,6 @@ import org.sonar.api.resources.ResourceTypes;
import org.sonar.api.task.Task;
import org.sonar.api.task.TaskComponent;
import org.sonar.api.task.TaskDefinition;
-import org.sonar.api.task.TaskExtension;
import org.sonar.api.utils.SonarException;
import org.sonar.batch.scan.ScanTask;
import org.sonar.batch.tasks.ListTask;
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
index 5180a498752..f4769d38316 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
@@ -19,12 +19,9 @@
*/
package org.sonar.batch.scan;
-import org.sonar.api.BatchComponent;
-import org.sonar.batch.qualitygate.GenerateQualityGateEvents;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.sonar.api.BatchExtension;
+import org.sonar.api.BatchComponent;
import org.sonar.api.batch.InstantiationStrategy;
import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.rule.CheckFactory;
@@ -51,6 +48,7 @@ import org.sonar.batch.issue.ignore.scanner.IssueExclusionsLoader;
import org.sonar.batch.issue.ignore.scanner.IssueExclusionsRegexpScanner;
import org.sonar.batch.phases.PhaseExecutor;
import org.sonar.batch.phases.PhasesTimeProfiler;
+import org.sonar.batch.qualitygate.GenerateQualityGateEvents;
import org.sonar.batch.qualitygate.QualityGateProvider;
import org.sonar.batch.qualitygate.QualityGateVerifier;
import org.sonar.batch.rule.*;