aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2014-10-10 11:17:24 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2014-10-14 11:59:06 +0200
commit0d2a019b933e3a90de9c8365bfa4037b9d44d943 (patch)
tree7b2843c149f3a5c83537004e7038a6f78174708d /sonar-batch
parent4e3edd5a810a59bf307e548ecbc14fd7de7eb690 (diff)
downloadsonarqube-0d2a019b933e3a90de9c8365bfa4037b9d44d943.tar.gz
sonarqube-0d2a019b933e3a90de9c8365bfa4037b9d44d943.zip
SONAR-5256 Fix NPE and add warning when sonar.importSources=false
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
index 1e185487a05..65a7585555e 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/filesystem/ComponentIndexer.java
@@ -22,6 +22,8 @@ package org.sonar.batch.scan.filesystem;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.CharMatcher;
import com.google.common.io.Files;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.api.BatchComponent;
import org.sonar.api.CoreProperties;
import org.sonar.api.batch.SonarIndex;
@@ -44,6 +46,8 @@ import org.sonar.batch.util.DeprecatedKeyUtils;
*/
public class ComponentIndexer implements BatchComponent {
+ private static final Logger LOG = LoggerFactory.getLogger(ComponentIndexer.class);
+
private final Languages languages;
private final Settings settings;
private final SonarIndex sonarIndex;
@@ -62,6 +66,9 @@ public class ComponentIndexer implements BatchComponent {
migration.migrateIfNeeded(module, fs);
boolean shouldImportSource = settings.getBoolean(CoreProperties.CORE_IMPORT_SOURCES_PROPERTY);
+ if (!shouldImportSource) {
+ LOG.warn("Not importing source will prevent issues to be properly tracked between consecutive analyses");
+ }
for (InputFile inputFile : fs.inputFiles(fs.predicates().all())) {
String languageKey = inputFile.language();
boolean unitTest = InputFile.Type.TEST == inputFile.type();