public void analyse(Project project, SensorContext context) {
List<InputFile> inputFiles = project.getFileSystem().mainFiles(project.getLanguageKey());
if (inputFiles.isEmpty()) {
return;
}
<BUG>CloneIndex index = new PackedMemoryCloneIndex();
if (isCrossProject(project)) {
Logs.INFO.info("Enabled cross-project analysis");
Snapshot currentSnapshot = resourcePersister.getSnapshot(project);
Snapshot lastSnapshot = resourcePersister.getLastSnapshot(currentSnapshot, false);
DbCloneIndex db = new DbCloneIndex(dbSession, currentSnapshot.getId(), lastSnapshot == null ? null : lastSnapshot.getId());
index = new CombinedCloneIndex(index, db);
</BUG>
}

public void analyse(Project project, SensorContext context) {
List<InputFile> inputFiles = project.getFileSystem().mainFiles(project.getLanguageKey());
if (inputFiles.isEmpty()) {
return;
}
final SonarCloneIndex index;
if (isCrossProject(project)) {
Logs.INFO.info("Enabled cross-project analysis");
index = new SonarCloneIndex(new DbCloneIndex(dbSession, resourcePersister, project));
} else {
index = new SonarCloneIndex();
}
