public ProjectViewAttributes getProjectViewAttributes() {
throw new IllegalStateException("Only component of type PROJECT_VIEW have a FileAttributes object");
}
+
+ @Override
+ public String toString() {
+ return "ComponentImpl{" +
+ "key='" + key + '\'' +
+ ", type=" + type +
+ ", uuid='" + uuid + '\'' +
+ ", fileAttributes=" + fileAttributes +
+ ", name='" + name + '\'' +
+ ", reportAttributes=" + reportAttributes +
+ '}';
+ }
}
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import static com.google.common.collect.FluentIterable.from;
import static com.google.common.collect.Iterables.concat;
*/
public class VisitorsCrawler implements ComponentCrawler {
+ private static final Logger LOGGER = Loggers.get(VisitorsCrawler.class);
+
private final List<VisitorWrapper> preOrderVisitorWrappers;
private final List<VisitorWrapper> postOrderVisitorWrappers;
}
private void visitNode(Component component, VisitorWrapper visitor) {
+ LOGGER.trace("Visitor '{}' is currently visiting component {}", visitor, component);
visitor.visitAny(component);
switch (component.getType()) {
case PROJECT:
package org.sonar.server.computation.measure;
import org.sonar.api.ce.measure.MeasureComputer;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import org.sonar.server.computation.component.CrawlerDepthLimit;
import org.sonar.server.computation.component.SettingsRepository;
import org.sonar.server.computation.component.TypeAwareVisitorAdapter;
import org.sonar.server.computation.measure.api.MeasureComputerImplementationContext;
import org.sonar.server.computation.metric.MetricRepository;
-import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
public class MeasureComputersVisitor extends TypeAwareVisitorAdapter {
+ private static final Logger LOGGER = Loggers.get(MeasureComputersVisitor.class);
+
private final MetricRepository metricRepository;
private final MeasureRepository measureRepository;
private final SettingsRepository settings;
public MeasureComputersVisitor(MetricRepository metricRepository, MeasureRepository measureRepository, SettingsRepository settings,
MeasureComputersHolder measureComputersHolder, ComponentIssuesRepository componentIssuesRepository) {
- super(CrawlerDepthLimit.FILE, PRE_ORDER);
+ super(CrawlerDepthLimit.FILE, POST_ORDER);
this.metricRepository = metricRepository;
this.measureRepository = measureRepository;
this.settings = settings;
@Override
public void visitAny(org.sonar.server.computation.component.Component component) {
for (MeasureComputer computer : measureComputersHolder.getMeasureComputers()) {
+ LOGGER.trace("Measure computer '{}' is computing component {}", computer.getImplementation(), component);
MeasureComputerImplementationContext measureComputerContext = new MeasureComputerImplementationContext(component, computer,
settings, measureRepository, metricRepository, componentIssuesRepository);
computer.getImplementation().compute(measureComputerContext);