forked from phoedos/pmd
Fix flaky SummaryHTMLRenderer
This commit is contained in:
@ -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;
|
||||
|
||||
@ -74,7 +74,7 @@ public class SummaryHTMLRenderer extends AbstractAccumulatingRenderer {
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -69,8 +69,8 @@ class SummaryHTMLRendererTest extends AbstractRendererTest {
|
||||
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>"
|
||||
|
Reference in New Issue
Block a user