aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-xoo-plugin
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-01-21 11:22:44 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-01-23 09:59:47 +0100
commit1340ee7da7a1688ebb059812504e117d041e0124 (patch)
tree171deefeac6057e876106131ac333bd4914d9253 /plugins/sonar-xoo-plugin
parent97ca9e16fc27e19f021558502fdce23fe9a77460 (diff)
downloadsonarqube-1340ee7da7a1688ebb059812504e117d041e0124.tar.gz
sonarqube-1340ee7da7a1688ebb059812504e117d041e0124.zip
SONAR-6012 Local issue tracking
Diffstat (limited to 'plugins/sonar-xoo-plugin')
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java7
-rw-r--r--plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java7
2 files changed, 12 insertions, 2 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java
index 886104c14a0..01973adef97 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java
@@ -19,7 +19,10 @@
*/
package org.sonar.xoo.rule;
+import org.sonar.api.batch.fs.FilePredicates;
+import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.fs.InputFile.Type;
import org.sonar.api.batch.rule.ActiveRule;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
@@ -40,7 +43,9 @@ public class CreateIssueByInternalKeySensor implements Sensor {
@Override
public void execute(SensorContext context) {
- for (InputFile file : context.fileSystem().inputFiles(context.fileSystem().predicates().hasLanguages(Xoo.KEY))) {
+ FileSystem fs = context.fileSystem();
+ FilePredicates p = fs.predicates();
+ for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(Type.MAIN)))) {
createIssues(file, context);
}
}
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
index 3e0b9f48ee5..7e79e2857f6 100644
--- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
+++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java
@@ -19,7 +19,10 @@
*/
package org.sonar.xoo.rule;
+import org.sonar.api.batch.fs.FilePredicates;
+import org.sonar.api.batch.fs.FileSystem;
import org.sonar.api.batch.fs.InputFile;
+import org.sonar.api.batch.fs.InputFile.Type;
import org.sonar.api.batch.sensor.Sensor;
import org.sonar.api.batch.sensor.SensorContext;
import org.sonar.api.batch.sensor.SensorDescriptor;
@@ -43,7 +46,9 @@ public class OneIssuePerLineSensor implements Sensor {
@Override
public void execute(SensorContext context) {
- for (InputFile file : context.fileSystem().inputFiles(context.fileSystem().predicates().hasLanguages(Xoo.KEY))) {
+ FileSystem fs = context.fileSystem();
+ FilePredicates p = fs.predicates();
+ for (InputFile file : fs.inputFiles(p.and(p.hasLanguages(Xoo.KEY), p.hasType(Type.MAIN)))) {
createIssues(file, context);
}
}