aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-09-23 17:28:25 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-09-23 17:28:25 +0000
commit1dfd7034c4cb735683949cef50a8e3809bab6a35 (patch)
treebd5692842fa4e17eb557bfaadd86e70654824a54 /sonar-deprecated
parentab9fa99f65324e32caccc5f7016b9aa88c56aca2 (diff)
downloadsonarqube-1dfd7034c4cb735683949cef50a8e3809bab6a35.tar.gz
sonarqube-1dfd7034c4cb735683949cef50a8e3809bab6a35.zip
add AnnotationRuleRepository to load rules from sonar-check-api annotations
Diffstat (limited to 'sonar-deprecated')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java2
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java
index 9a7432f16b1..0bd135f6225 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/AbstractViolationsStaxParser.java
@@ -164,7 +164,7 @@ public abstract class AbstractViolationsStaxParser {
Rule rule = getRule(violationCursor);
Integer line = getLineIndex(violationCursor);
if (rule != null && resource != null) {
- Violation violation = new Violation(rule, resource)
+ Violation violation = Violation.create(rule, resource)
.setLineId(line)
.setMessage(messageFor(violationCursor));
context.saveViolation(violation);
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java
index 7f563920825..47c48f28a66 100644
--- a/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java
+++ b/sonar-deprecated/src/main/java/org/sonar/api/checks/checkers/MessageDispatcher.java
@@ -96,7 +96,7 @@ public class MessageDispatcher {
public void log(Resource resource, Message message) {
Object checker = message.getChecker();
Check check = getCheck(checker);
- Violation violation = new Violation(new Rule(check.getRepositoryKey(), check.getTemplateKey()), resource);
+ Violation violation = Violation.create(new Rule(check.getRepositoryKey(), check.getTemplateKey()), resource);
violation.setLineId(message.getLine());
violation.setMessage(message.getText(Locale.ENGLISH));
violation.setPriority(RulePriority.fromCheckPriority(check.getPriority()));