Search in sources :

Example 1 with TypeAwareVisitorAdapter

use of org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorAdapter in project sonarqube by SonarSource.

the class FileMoveDetectionStep method getReportFilesByUuid.

private static Map<String, Component> getReportFilesByUuid(Component root) {
    final ImmutableMap.Builder<String, Component> builder = ImmutableMap.builder();
    new DepthTraversalTypeAwareCrawler(new TypeAwareVisitorAdapter(CrawlerDepthLimit.FILE, POST_ORDER) {

        @Override
        public void visitFile(Component file) {
            builder.put(file.getUuid(), file);
        }
    }).visit(root);
    return builder.build();
}
Also used : DepthTraversalTypeAwareCrawler(org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler) TypeAwareVisitorAdapter(org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorAdapter) Component(org.sonar.ce.task.projectanalysis.component.Component) ImmutableMap(com.google.common.collect.ImmutableMap)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 Component (org.sonar.ce.task.projectanalysis.component.Component)1 DepthTraversalTypeAwareCrawler (org.sonar.ce.task.projectanalysis.component.DepthTraversalTypeAwareCrawler)1 TypeAwareVisitorAdapter (org.sonar.ce.task.projectanalysis.component.TypeAwareVisitorAdapter)1