List of usage examples for com.google.common.collect SortedArraySet SortedArraySet
public SortedArraySet(SortedSet<E> set)
From source file:org.hardisonbrewing.clover.ReductMojo.java
private generated.File reduceFile(generated.File file) throws Exception { String filePath = file.getPath(); if (!new File(filePath).exists()) { throw new FileNotFoundException(filePath); }//from ww w . j a v a 2 s.c o m Properties properties = info(filePath); long revision = Long.parseLong(properties.getProperty("Revision")); if (revision < cutoffRevision) { return null; } generated.File fileReduced = null; Set<Line> sortedLines = null; List<Long> revisions = blame(file.getPath()); for (Line line : file.getLine()) { int lineNumber = line.getNum(); if (cutoffRevision >= revisions.get(lineNumber - 1)) { continue; } if (fileReduced == null) { fileReduced = new generated.File(); fileReduced.setMetrics(new FileMetrics()); fileReduced.setName(file.getName()); fileReduced.setPath(file.getPath()); sortedLines = new SortedArraySet<Line>(new LineComparator()); } addMetrics(fileReduced, line); sortedLines.add(line); } if (fileReduced != null) { List<Line> lines = fileReduced.getLine(); lines.addAll(sortedLines); } return fileReduced; }