Skip to content

Commit

Permalink
[MPMD-382] Regression in report rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-o committed Oct 30, 2023
1 parent a7fcb38 commit 8f66ebd
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ private void renderSingleRuleViolation(Violation ruleViolation, PmdFileInfo file
sink.tableCell();
addRuleName(ruleViolation);
sink.tableCell_();
tableCell(ruleViolation.getText());
// May contain content not legit for #tableCell()
sink.tableCell();
sink.text(ruleViolation.getText());
sink.tableCell_();

if (this.renderRuleViolationPriority) {
tableCell(String.valueOf(
Expand Down Expand Up @@ -338,12 +341,17 @@ public int compare(SuppressedViolation o1, SuppressedViolation o2) {
PmdFileInfo fileInfo = determineFileInfo(filename);
filename = shortenFilename(filename, fileInfo);

tableRow(new String[] {
filename,
suppressedViolation.getRuleMessage(),
suppressedViolation.getSuppressionType(),
suppressedViolation.getUserMessage()
});
// May contain content not legit for #tableCell()
sink.tableRow();
tableCell(filename);
sink.tableCell();
sink.text(suppressedViolation.getRuleMessage());
sink.tableCell_();
tableCell(suppressedViolation.getSuppressionType());
sink.tableCell();
sink.text(suppressedViolation.getUserMessage());
sink.tableCell_();
sink.tableRow_();
}

endTable();
Expand Down

0 comments on commit 8f66ebd

Please sign in to comment.