From 8f66ebdb0cf8429e989b0ccb9c2b3fc75c4c1a4c Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Mon, 30 Oct 2023 22:03:14 +0100 Subject: [PATCH] [MPMD-382] Regression in report rendering --- .../maven/plugins/pmd/PmdReportRenderer.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) 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();