public void save(@NotNull Review review) throws RevuException, IOException
{
assert (!review.isEmbedded()) : "Embedded review cannot be saved : " + review;
IReviewExternalizer reviewExternalizer = project.getComponent(IReviewExternalizer.class);
boolean newReview;
MetaReview metaReview = metaReviews.get(review);
if (metaReview == null)
{
reviewsByFiles.put(review.getFile(), review);
reviewsByNames.put(review.getName(), review);
metaReview = new MetaReview(review, -1, true);
metaReviews.put(review, metaReview);
newReview = true;
}
else
{
metaReview.isSaving = true;
metaReview.updateReviewHashcode();
newReview = false;
}
try
{
if (review.isExternalizable())
{
reviewExternalizer.save(review, review.getFile());
}
}
finally
{
metaReview.isSaving = false;