Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Fix flaky SummaryHTMLRenderer #4750

Merged
merged 1 commit into from Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -5,7 +5,7 @@
package net.sourceforge.pmd.renderers;

import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;

Expand Down Expand Up @@ -74,7 +74,7 @@ private void renderSummary(Report report) throws IOException {
}

private static Map<String, MutableInt> getSummary(Report report) {
Map<String, MutableInt> summary = new HashMap<>();
Map<String, MutableInt> summary = new LinkedHashMap<>();
for (RuleViolation rv : report.getViolations()) {
String name = rv.getRule().getName();
MutableInt count = summary.get(name);
Expand Down
Expand Up @@ -69,8 +69,8 @@ String getExpectedMultiple() {
return "<html><head><title>PMD</title></head><body>" + EOL + "<center><h2>Summary</h2></center>" + EOL
+ "<table align=\"center\" cellspacing=\"0\" cellpadding=\"3\">" + EOL
+ "<tr><th>Rule name</th><th>Number of violations</th></tr>" + EOL
+ "<tr><td>Boo</td><td align=center>1</td></tr>" + EOL
+ "<tr><td>Foo</td><td align=center>1</td></tr>" + EOL + "</table>" + EOL
+ "<tr><td>Foo</td><td align=center>1</td></tr>" + EOL
+ "<tr><td>Boo</td><td align=center>1</td></tr>" + EOL + "</table>" + EOL
+ "<center><h2>Detail</h2></center><table align=\"center\" cellspacing=\"0\" cellpadding=\"3\"><tr>"
+ EOL
+ "<center><h3>PMD report</h3></center><center><h3>Problems found</h3></center><table align=\"center\" cellspacing=\"0\" cellpadding=\"3\"><tr>"
Expand Down