public static List<CloneGroup> detect(CloneIndex cloneIndex, Collection<Block> fileBlocks) { if (fileBlocks.isEmpty()) { return Collections.emptyList(); } TextSet text = createTextSet(cloneIndex, fileBlocks); if (text == null) { return Collections.emptyList(); } DuplicationsCollector reporter = new DuplicationsCollector(text); Search.perform(text, reporter); return reporter.getResult(); }
public static List<CloneGroup> detect(CloneIndex cloneIndex, Collection<Block> fileBlocks) { if (fileBlocks.isEmpty()) { return Collections.EMPTY_LIST; } TextSet text = createTextSet(cloneIndex, fileBlocks); if (text == null) { return Collections.EMPTY_LIST; } DuplicationsCollector reporter = new DuplicationsCollector(text); Search.perform(text, reporter); return reporter.getResult(); }