protected void consumeReport(Report r) { for (Entry<Integer, List<FaultExplanation>> entry : r.getReports().entrySet()) { if (!sortedReport.containsKey(entry.getKey())) { sortedReport.put(entry.getKey(), new HashMap<String, List<List<Integer>>>()); } Map<String, List<List<Integer>>> sortedLinesPerFile = sortedReport.get(entry.getKey()); for (FaultExplanation fe : entry.getValue()) { if (fe.locations.isEmpty()) { continue; } // get the sorted list of line numbers for this report. LinkedHashSet<Integer> lines = new LinkedHashSet<Integer>(); for (SourceLocation line : fe.locations) { lines.add(line.StartLine); } LinkedList<Integer> sortedLines = new LinkedList<Integer>(lines); Collections.sort(sortedLines); // get the file name for this report. String fname = fe.fileName; if (!sortedLinesPerFile.containsKey(fname)) { sortedLinesPerFile.put(fname, new LinkedList<List<Integer>>()); } sortedLinesPerFile.get(fname).add(sortedLines); } } }
/* (non-Javadoc) * @see bixie.checker.reportprinter.ReportPrinter#printReport(bixie.checker.report.Report) */ @Override public void printReport(Report r) { consumeReport(r); String s = r.toString(); if (s != null && !s.isEmpty()) Log.info(r.toString()); }