]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-926 fix compatibility with views plugin
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Feb 2014 12:44:42 +0000 (13:44 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Feb 2014 12:44:42 +0000 (13:44 +0100)
sonar-batch/src/main/java/org/sonar/batch/DefaultSensorContext.java

index 26640dba5a3ef145c69df40274e33172124e8088..158e9e79982c9fc5f6c99cfeb350b7906dc0636e 100644 (file)
@@ -29,12 +29,7 @@ import org.sonar.api.design.Dependency;
 import org.sonar.api.measures.Measure;
 import org.sonar.api.measures.MeasuresFilter;
 import org.sonar.api.measures.Metric;
-import org.sonar.api.resources.File;
-import org.sonar.api.resources.Languages;
-import org.sonar.api.resources.Project;
-import org.sonar.api.resources.ProjectLink;
-import org.sonar.api.resources.Resource;
-import org.sonar.api.resources.Scopes;
+import org.sonar.api.resources.*;
 import org.sonar.api.rules.Violation;
 import org.sonar.api.scan.filesystem.InputFile;
 import org.sonar.api.utils.SonarException;
@@ -52,13 +47,11 @@ public class DefaultSensorContext implements SensorContext {
   private SonarIndex index;
   private Project project;
   private MeasurementFilters filters;
-  private Languages languages;
 
-  public DefaultSensorContext(SonarIndex index, Project project, MeasurementFilters filters, Languages languages) {
+  public DefaultSensorContext(SonarIndex index, Project project, MeasurementFilters filters) {
     this.index = index;
     this.project = project;
     this.filters = filters;
-    this.languages = languages;
   }
 
   public Project getProject() {
@@ -75,8 +68,8 @@ public class DefaultSensorContext implements SensorContext {
   }
 
   private boolean indexedByCore(Resource resource) {
-    return StringUtils.equals(Scopes.DIRECTORY, resource.getScope()) ||
-      StringUtils.equals(Scopes.FILE, resource.getScope());
+    return StringUtils.equals(Qualifiers.DIRECTORY, resource.getQualifier()) ||
+      StringUtils.equals(Qualifiers.FILE, resource.getQualifier());
   }
 
   @Override