import org.sonar.plugins.cpd.index.IndexFactory;
import org.sonar.plugins.cpd.index.SonarDuplicationsIndex;
+import javax.annotation.Nullable;
+
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStreamReader;
return JavaFile.fromRelativePath(inputFile.getRelativePath(), false);
}
- static void save(SensorContext context, Resource resource, Iterable<CloneGroup> duplications) {
- if (Iterables.isEmpty(duplications)) {
+ static void save(SensorContext context, Resource resource, @Nullable Iterable<CloneGroup> duplications) {
+ if (duplications == null || Iterables.isEmpty(duplications)) {
return;
}
// Calculate number of lines and blocks