Skip to content

Commit 8f66ebd

Browse files
committed
[MPMD-382] Regression in report rendering
1 parent a7fcb38 commit 8f66ebd

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ private void renderSingleRuleViolation(Violation ruleViolation, PmdFileInfo file
177177
sink.tableCell();
178178
addRuleName(ruleViolation);
179179
sink.tableCell_();
180-
tableCell(ruleViolation.getText());
180+
// May contain content not legit for #tableCell()
181+
sink.tableCell();
182+
sink.text(ruleViolation.getText());
183+
sink.tableCell_();
181184

182185
if (this.renderRuleViolationPriority) {
183186
tableCell(String.valueOf(
@@ -338,12 +341,17 @@ public int compare(SuppressedViolation o1, SuppressedViolation o2) {
338341
PmdFileInfo fileInfo = determineFileInfo(filename);
339342
filename = shortenFilename(filename, fileInfo);
340343

341-
tableRow(new String[] {
342-
filename,
343-
suppressedViolation.getRuleMessage(),
344-
suppressedViolation.getSuppressionType(),
345-
suppressedViolation.getUserMessage()
346-
});
344+
// May contain content not legit for #tableCell()
345+
sink.tableRow();
346+
tableCell(filename);
347+
sink.tableCell();
348+
sink.text(suppressedViolation.getRuleMessage());
349+
sink.tableCell_();
350+
tableCell(suppressedViolation.getSuppressionType());
351+
sink.tableCell();
352+
sink.text(suppressedViolation.getUserMessage());
353+
sink.tableCell_();
354+
sink.tableRow_();
347355
}
348356

349357
endTable();

0 commit comments

Comments
 (0)