{
Map<String, ReviewExtendedDepth> reviewByNames = new HashMap<String, ReviewExtendedDepth>(relativePaths.size());
for (String relativePath : relativePaths)
{
File file = RevuVfsUtils.findFileFromRelativePath(project, relativePath);
Review review = reviewsByFiles.get(file);
if (review == null)
{
review = new Review();
review.setFile(file);
}
if (load(review, true))
{
ReviewExtendedDepth reviewExtendedDepth = new ReviewExtendedDepth(review, 0);
reviewByNames.put(review.getName(), reviewExtendedDepth);
}
}
List<ReviewExtendedDepth> reviewExtendedDepths = new ArrayList<ReviewExtendedDepth>(reviewByNames.values());
for (ReviewExtendedDepth reviewExtendedDepth : reviewExtendedDepths)
{
Review review = reviewExtendedDepth.review;
if (review.getExtendedReview() != null)
{
try
{
checkCyclicLink(review, review.getExtendedReview());
}
catch (RevuException e)
{
LOGGER.warn("Cyclic link: " + review.getFile(), e);
fireReviewLoadFailed(e, review.getFile());
}
while ((review != null) && (review.getExtendedReview() != null))
{
reviewExtendedDepth.depth++;
review = reviewsByNames.get(review.getExtendedReview().getName());
}
}
}
Collections.sort(reviewExtendedDepths, new Comparator<ReviewExtendedDepth>()