aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin/src
diff options
context:
space:
mode:
authorJulien HENRY <henryju@yahoo.fr>2016-07-04 11:58:10 +0200
committerJulien HENRY <henryju@yahoo.fr>2016-07-05 14:00:16 +0200
commit103f9ca40fe6c4864aa489119c1590e0449f1b9f (patch)
treea990c8be0e88b324307c2e3163559a42b1cfa0ac /plugins/sonar-xoo-plugin/src
parentb7fcb4dd974df546cc13faa6be6529ca6bc26688 (diff)
downloadsonarqube-103f9ca40fe6c4864aa489119c1590e0449f1b9f.tar.gz
sonarqube-103f9ca40fe6c4864aa489119c1590e0449f1b9f.zip
SONAR-7727 Remove deprecated stuff from Resources API
Diffstat (limited to 'plugins/sonar-xoo-plugin/src')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
index bd7cee61f44..3e51d046716 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/DeprecatedResourceApiSensor.java
@@ -53,12 +53,9 @@ public class DeprecatedResourceApiSensor implements Sensor {
@Override
public void analyse(Project module, org.sonar.api.batch.SensorContext context) {
- createIssueOnDir(new Directory(""));
- File src = fileSystem.sourceDirs().get(0);
-
for (File f : fileSystem.files(FileQuery.onMain().onLanguage(Xoo.KEY))) {
- String relativePathFromSourceDir = new PathResolver().relativePath(src, f);
- org.sonar.api.resources.File sonarFile = new org.sonar.api.resources.File(relativePathFromSourceDir);
+ String relativePathFromSourceDir = new PathResolver().relativePath(fileSystem.baseDir(), f);
+ org.sonar.api.resources.File sonarFile = org.sonar.api.resources.File.create(relativePathFromSourceDir);
Issuable issuable = perspectives.as(Issuable.class, sonarFile);
issuable.addIssue(issuable.newIssueBuilder()
.ruleKey(RuleKey.of(XooRulesDefinition.XOO_REPOSITORY, RULE_KEY))