diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-10-20 10:41:46 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2015-10-20 10:59:38 +0200 |
commit | 7c0b24b200bc7e64e92902b5e0078b3600c5b85a (patch) | |
tree | 3443260c38ff39994cb9e3288293a8fa44b70c01 /server/sonar-server/src | |
parent | f08e45093397769d9f15fb000acd54b8a6d03863 (diff) | |
download | sonarqube-7c0b24b200bc7e64e92902b5e0078b3600c5b85a.tar.gz sonarqube-7c0b24b200bc7e64e92902b5e0078b3600c5b85a.zip |
Fix some quality flaw
Diffstat (limited to 'server/sonar-server/src')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java index b4933b6871e..449c52b7758 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java +++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/RuleMapping.java @@ -140,6 +140,7 @@ public class RuleMapping extends BaseMapping<RuleDoc, RuleMappingContext> { setParams(ruleResponse, ruleDoc, fieldsToReturn); setCreatedAt(ruleResponse, ruleDoc, fieldsToReturn); setDescriptionFields(ruleResponse, ruleDoc, fieldsToReturn); + setNotesFields(ruleResponse, ruleDoc, fieldsToReturn); setSeverity(ruleResponse, ruleDoc, fieldsToReturn); setInternalKey(ruleResponse, ruleDoc, fieldsToReturn); setLanguage(ruleResponse, ruleDoc, fieldsToReturn); @@ -291,15 +292,18 @@ public class RuleMapping extends BaseMapping<RuleDoc, RuleMappingContext> { ruleResponse.setHtmlDesc(macroInterpreter.interpret(ruleDoc.htmlDescription())); } } + if (shouldReturnField(fieldsToReturn, RuleNormalizer.RuleField.MARKDOWN_DESCRIPTION) && ruleDoc.markdownDescription() != null) { + ruleResponse.setMdDesc(ruleDoc.markdownDescription()); + } + } + + private void setNotesFields(Rules.Rule.Builder ruleResponse, Rule ruleDoc, Set<String> fieldsToReturn) { if (shouldReturnField(fieldsToReturn, "htmlNote") && ruleDoc.markdownNote() != null) { ruleResponse.setHtmlNote(macroInterpreter.interpret(Markdown.convertToHtml(ruleDoc.markdownNote()))); } if (shouldReturnField(fieldsToReturn, "mdNote") && ruleDoc.markdownNote() != null) { ruleResponse.setMdNote(ruleDoc.markdownNote()); } - if (shouldReturnField(fieldsToReturn, RuleNormalizer.RuleField.MARKDOWN_DESCRIPTION) && ruleDoc.markdownDescription() != null) { - ruleResponse.setMdDesc(ruleDoc.markdownDescription()); - } if (shouldReturnField(fieldsToReturn, RuleNormalizer.RuleField.NOTE_LOGIN) && ruleDoc.noteLogin() != null) { ruleResponse.setNoteLogin(ruleDoc.noteLogin()); } |