Skip to content

Commit

Permalink
Replace "," with "_" in rule key.
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
steffen-wilke committed Jun 9, 2020
1 parent e7f46d1 commit 1f252e3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class InspectCodeIssueDefinitionModel {
* The unique identifier of this issue as defined by {@code InspectCode}.
*/
public InspectCodeIssueDefinitionModel(@NotNull String issueTypeId) {
this.issueTypeId = issueTypeId.trim();
this.issueTypeId = issueTypeId.replace(',', '_').trim();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public String getIssueTypeId() {
* The issue type identifier, which should correspond to {@link InspectCodeIssueDefinitionModel#getIssueTypeId()}.
*/
public void setIssueTypeId(String issueTypeId) {
this.issueTypeId = issueTypeId;
this.issueTypeId = issueTypeId.replace(',', '_').trim();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public final class SonarQubeRuleDefinitionModel {
* are removed from the supplied value. Must not be {@code null}.
*/
public SonarQubeRuleDefinitionModel(@NotNull String ruleDefinitionKey) {
this.ruleDefinitionKey = ruleDefinitionKey.trim();
this.ruleDefinitionKey = ruleDefinitionKey.replace(',', '_').trim();
}

public SonarQubeRuleDefinitionModel(@NotNull InspectCodeIssueDefinitionModel model){
this(model.getIssueTypeId());
this.inspectcodeModel = model;
this.ruleDefinitionKey = model.getIssueTypeId();
this.ruleName = model.getDescription();
this.activatedByDefault = false;
this.ruleStatus = RuleStatus.READY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ private InspectCodeIssueDefinitionModel parseXmlElementIssueType(@NotNull final

// Create a new issue definition model instance
final InspectCodeIssueDefinitionModel inspectCodeIssueDefinitionModel =
new InspectCodeIssueDefinitionModel(ruleDefinitionIdentifier.trim());
new InspectCodeIssueDefinitionModel(ruleDefinitionIdentifier);

// Parse all attributes of the XML element that just started
final int length = attributes.getLength();
Expand Down

0 comments on commit 1f252e3

Please # to comment.