import org.sonarqube.ws.Rules.SearchResponse;
import org.sonarqube.ws.Rules.ShowResponse;
+import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.collect.Sets.newHashSet;
/**
}
}
- private Collection<String> writeActiveRules(RuleKey ruleKey, Collection<ActiveRule> activeRules, Rules.Actives.Builder activesBuilder) {
+ private static Collection<String> writeActiveRules(RuleKey ruleKey, Collection<ActiveRule> activeRules, Rules.Actives.Builder activesBuilder) {
Collection<String> qProfileKeys = newHashSet();
Rules.ActiveList.Builder activeRulesListResponse = Rules.ActiveList.newBuilder();
for (ActiveRule activeRule : activeRules) {
return qProfileKeys;
}
- private Rules.Active buildActiveRuleResponse(ActiveRule activeRule) {
+ private static Rules.Active buildActiveRuleResponse(ActiveRule activeRule) {
Rules.Active.Builder activeRuleResponse = Rules.Active.newBuilder();
activeRuleResponse.setQProfile(activeRule.key().qProfile());
activeRuleResponse.setInherit(activeRule.inheritance().toString());
for (Map.Entry<String, String> param : activeRule.params().entrySet()) {
activeRuleResponse.addParams(paramBuilder.clear()
.setKey(param.getKey())
- .setValue(param.getValue()));
+ .setValue(nullToEmpty(param.getValue())));
}
return activeRuleResponse.build();