Skip to content

Commit

Permalink
PMD bug - return all file violations not one per file
Browse files Browse the repository at this point in the history
  • Loading branch information
SpOOnman committed Apr 8, 2014
1 parent 433a5ea commit 7adad64
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/pl/touk/sputnik/pmd/CollectorRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import pl.touk.sputnik.review.Violation;

import java.io.IOException;
import java.util.Iterator;

public class CollectorRenderer extends AbstractRenderer {
private static final Logger LOG = LoggerFactory.getLogger(CollectorRenderer.class);
Expand All @@ -38,9 +37,7 @@ public void startFileAnalysis(DataSource dataSource) {

@Override
public void renderFileReport(Report report) throws IOException {
Iterator<RuleViolation> violations = report.iterator();
if (violations.hasNext()) {
RuleViolation ruleViolation = violations.next();
for (RuleViolation ruleViolation : report) {
reviewResult.add(new Violation(ruleViolation.getFilename(), ruleViolation.getBeginLine(), ruleViolation.getDescription(), convert(ruleViolation.getRule().getPriority())));
}
}
Expand Down

0 comments on commit 7adad64

Please sign in to comment.