diff --git a/src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java b/src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java index e72c1392..1665f2c9 100644 --- a/src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java +++ b/src/main/java/org/apache/maven/plugins/pmd/PmdReportRenderer.java @@ -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( @@ -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();