aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor
diff options
context:
space:
mode:
authorMichal Duda <michalno1@gmail.com>2018-11-13 11:00:42 +0100
committersonartech <sonartech@sonarsource.com>2019-01-16 09:43:00 +0100
commit6dd294b1f5af7c74191db30101e3721d00102204 (patch)
tree372dbc219371a610c32fb8b723869291a7148c5f /sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor
parentb44c75c2b93ca2d91d6ce559a08a0d994c73bd85 (diff)
downloadsonarqube-6dd294b1f5af7c74191db30101e3721d00102204.tar.gz
sonarqube-6dd294b1f5af7c74191db30101e3721d00102204.zip
SONAR-11459 move dir and module issues to root
Diffstat (limited to 'sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor')
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
index 1df2834b0eb..ed8640d7732 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorContext.java
@@ -27,6 +27,7 @@ import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
import org.sonar.api.batch.fs.InputModule;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
+import org.sonar.api.batch.fs.internal.InputModuleHierarchy;
import org.sonar.api.batch.rule.ActiveRules;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.code.NewSignificantCode;
@@ -79,9 +80,10 @@ public class DefaultSensorContext implements SensorContext {
private final InputModule module;
private final SonarRuntime sonarRuntime;
private final Configuration config;
+ private final InputModuleHierarchy hierarchy;
public DefaultSensorContext(InputModule module, Configuration config, Settings mutableSettings, FileSystem fs, ActiveRules activeRules,
- AnalysisMode analysisMode, SensorStorage sensorStorage, SonarRuntime sonarRuntime) {
+ AnalysisMode analysisMode, SensorStorage sensorStorage, SonarRuntime sonarRuntime, InputModuleHierarchy hierarchy) {
this.module = module;
this.config = config;
this.mutableSettings = mutableSettings;
@@ -90,6 +92,7 @@ public class DefaultSensorContext implements SensorContext {
this.analysisMode = analysisMode;
this.sensorStorage = sensorStorage;
this.sonarRuntime = sonarRuntime;
+ this.hierarchy = hierarchy;
}
@Override
@@ -134,7 +137,7 @@ public class DefaultSensorContext implements SensorContext {
@Override
public NewIssue newIssue() {
- return new DefaultIssue(sensorStorage);
+ return new DefaultIssue(hierarchy.root(), sensorStorage);
}
@Override
@@ -142,7 +145,7 @@ public class DefaultSensorContext implements SensorContext {
if (analysisMode.isIssues()) {
return NO_OP_NEW_EXTERNAL_ISSUE;
}
- return new DefaultExternalIssue(sensorStorage);
+ return new DefaultExternalIssue(hierarchy.root(), sensorStorage);
}
@Override