diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-19 23:06:58 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-02-20 09:36:21 +0100 |
commit | 272fb51fc5f7dcbef163938c3230ef1e4f87640a (patch) | |
tree | 91cdc2d9847c9fb1fcacde60e0220e9aedf38578 /plugins/sonar-xoo-plugin | |
parent | 72d197c7c6b3a87668c4375d04b35e2d8339c427 (diff) | |
download | sonarqube-272fb51fc5f7dcbef163938c3230ef1e4f87640a.tar.gz sonarqube-272fb51fc5f7dcbef163938c3230ef1e4f87640a.zip |
SONAR-5931 Cleanup new issue API
Diffstat (limited to 'plugins/sonar-xoo-plugin')
5 files changed, 5 insertions, 5 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/TemplateRuleCheck.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/TemplateRuleCheck.java index 01fd6ad0c15..9e58a410526 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/TemplateRuleCheck.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/checks/TemplateRuleCheck.java @@ -38,7 +38,7 @@ public class TemplateRuleCheck implements Check { public void execute(SensorContext sensorContext, InputFile file, RuleKey ruleKey) { sensorContext.newIssue() .onFile(file) - .ruleKey(ruleKey) + .forRule(ruleKey) .atLine(line) .save(); } 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 01973adef97..5a1cefcab8e 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 @@ -55,7 +55,7 @@ public class CreateIssueByInternalKeySensor implements Sensor { context.settings().getString(INTERNAL_KEY_PROPERTY)); if (rule != null) { context.newIssue() - .ruleKey(rule.ruleKey()) + .forRule(rule.ruleKey()) .onFile(file) .message("This issue is generated on each file") .save(); diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java index 66a31686e03..6dbda2f741a 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java @@ -51,7 +51,7 @@ public class OneIssueOnDirPerFileSensor implements Sensor { InputDir inputDir = context.fileSystem().inputDir(file.file().getParentFile()); if (inputDir != null) { context.newIssue() - .ruleKey(ruleKey) + .forRule(ruleKey) .onDir(inputDir) .message("This issue is generated for file " + file.relativePath()) .save(); 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 7e79e2857f6..4aa4ea7e33f 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 @@ -58,7 +58,7 @@ public class OneIssuePerLineSensor implements Sensor { String severity = context.settings().getString(FORCE_SEVERITY_PROPERTY); for (int line = 1; line <= file.lines(); line++) { context.newIssue() - .ruleKey(ruleKey) + .forRule(ruleKey) .onFile(file) .atLine(line) .effortToFix(context.settings().getDouble(EFFORT_TO_FIX_PROPERTY)) diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/RandomAccessSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/RandomAccessSensor.java index 6d51bd8661a..0541d917552 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/RandomAccessSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/RandomAccessSensor.java @@ -64,7 +64,7 @@ public class RandomAccessSensor implements Sensor { private void createIssues(InputFile file, SensorContext context) { RuleKey ruleKey = RuleKey.of(XooRulesDefinition.XOO_REPOSITORY, RULE_KEY); context.newIssue() - .ruleKey(ruleKey) + .forRule(ruleKey) .onFile(file) .atLine(1) .message("This issue is generated on each file") |