summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-08-07 17:32:06 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2015-08-10 14:18:19 +0200
commitdf1e852ed659f62455cbbb5a2a8bf69190ff42a9 (patch)
tree001536e2c46da7f145c00784cc1b3d2dc3120238 /server
parent72e02c82b33ecdc6350ca11bcdd31633c2e09036 (diff)
downloadsonarqube-df1e852ed659f62455cbbb5a2a8bf69190ff42a9.tar.gz
sonarqube-df1e852ed659f62455cbbb5a2a8bf69190ff42a9.zip
Rename Visitor to ComponentVisitor
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/ComponentVisitor.java (renamed from server/sonar-server/src/main/java/org/sonar/server/computation/component/Visitor.java)2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java8
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java6
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitor.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/TreeRootHolderImpl.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitor.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitorWrapper.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java18
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainer.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainerImpl.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/formula/FormulaExecutorComponentCrawler.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureComputersVisitor.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitor.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/ComponentVisitors.java20
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/CustomMeasuresCopyStep.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/ExecuteVisitorsStep.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/IntegrateIssuesStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistDuplicationsStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistEventsStep.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistMeasuresStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistProjectLinksStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestsStep.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateEventsStep.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateLoadingStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateMeasuresStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/SizeMeasuresStep.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/step/ValidateProjectStep.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/batch/TreeRootHolderRule.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/PathAwareCrawlerTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/PostOrderDepthTraversalTypeAwareCrawlerTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/PreOrderDepthTraversalTypeAwareCrawlerTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPathAwareVisitorTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPostOrderTypeAwareVisitorTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPreOrderTypeAwareVisitorTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureComputersVisitorTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryRule.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitorTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/ExecuteVisitorsStepTest.java10
45 files changed, 103 insertions, 103 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/Visitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/ComponentVisitor.java
index 017d59764d8..e24d7ef9fdd 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/Visitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/ComponentVisitor.java
@@ -20,7 +20,7 @@
package org.sonar.server.computation.component;
-public interface Visitor {
+public interface ComponentVisitor {
Order getOrder();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java
index 5557e22c38d..e629528dcdb 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/DepthTraversalTypeAwareCrawler.java
@@ -29,9 +29,9 @@ import static java.util.Objects.requireNonNull;
*/
public abstract class DepthTraversalTypeAwareCrawler implements TypeAwareCrawler {
private final Component.Type maxDepth;
- private final Visitor.Order order;
+ private final ComponentVisitor.Order order;
- protected DepthTraversalTypeAwareCrawler(Component.Type maxDepth, Visitor.Order order) {
+ protected DepthTraversalTypeAwareCrawler(Component.Type maxDepth, ComponentVisitor.Order order) {
this.maxDepth = requireNonNull(maxDepth);
this.order = requireNonNull(order);
}
@@ -42,13 +42,13 @@ public abstract class DepthTraversalTypeAwareCrawler implements TypeAwareCrawler
return;
}
- if (order == Visitor.Order.PRE_ORDER) {
+ if (order == ComponentVisitor.Order.PRE_ORDER) {
visitNode(component);
}
visitChildren(component);
- if (order == Visitor.Order.POST_ORDER) {
+ if (order == ComponentVisitor.Order.POST_ORDER) {
visitNode(component);
}
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java
index c73e78c355d..d0a0d7e27f0 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareCrawler.java
@@ -19,8 +19,8 @@
*/
package org.sonar.server.computation.component;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* A {@link ComponentCrawler} which provide access to a representation of the path from the root to the currently visited
@@ -32,7 +32,7 @@ public abstract class PathAwareCrawler<T> extends PathAwareVisitorAdapter<T> imp
private final DequeBasedPath<T> stack = new DequeBasedPath<>();
- public PathAwareCrawler(Component.Type maxDepth, Visitor.Order order, StackElementFactory<T> factory) {
+ public PathAwareCrawler(Component.Type maxDepth, ComponentVisitor.Order order, StackElementFactory<T> factory) {
super(maxDepth, order, factory);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitor.java
index 3c4473fe21b..1dd23d7b6ac 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitor.java
@@ -23,11 +23,11 @@ package org.sonar.server.computation.component;
import java.util.NoSuchElementException;
/**
- * A {@link Visitor} which provide access to a representation of the path from the root to the currently visited
+ * A {@link ComponentVisitor} which provide access to a representation of the path from the root to the currently visited
* Component. It also provides a way to have an object associated to each Component and access it and all of its
* parent's.
*/
-public interface PathAwareVisitor<T> extends Visitor {
+public interface PathAwareVisitor<T> extends ComponentVisitor {
StackElementFactory<T> getFactory();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java
index ba36b285aeb..101932dbae4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/PathAwareVisitorWrapper.java
@@ -66,7 +66,7 @@ public class PathAwareVisitorWrapper<T> implements VisitorWrapper {
}
@Override
- public Visitor.Order getOrder() {
+ public ComponentVisitor.Order getOrder() {
return delegate.getOrder();
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TreeRootHolderImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TreeRootHolderImpl.java
index 11337d9ee3e..edd7124819e 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TreeRootHolderImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TreeRootHolderImpl.java
@@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
/**
* Holds the reference to the root of the {@link Component} tree for the current CE run.
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitor.java
index 180ad426ff1..d49db4b8f89 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitor.java
@@ -21,9 +21,9 @@
package org.sonar.server.computation.component;
/**
- * A {@link Visitor} which can exposes methods which ensure the type of the visited Component.
+ * A {@link ComponentVisitor} which can exposes methods which ensure the type of the visited Component.
*/
-public interface TypeAwareVisitor extends Visitor {
+public interface TypeAwareVisitor extends ComponentVisitor {
/**
* Called when encountering a Component of type {@link Component.Type#PROJECT}
*/
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitorWrapper.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitorWrapper.java
index fb28c9b972a..814cb8a0370 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitorWrapper.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/TypeAwareVisitorWrapper.java
@@ -64,7 +64,7 @@ public class TypeAwareVisitorWrapper implements VisitorWrapper {
}
@Override
- public Visitor.Order getOrder() {
+ public ComponentVisitor.Order getOrder() {
return delegate.getOrder();
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java
index 134ff9f8b48..c3b4f4b9ac3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/component/VisitorsCrawler.java
@@ -36,7 +36,7 @@ public class VisitorsCrawler implements ComponentCrawler {
private final List<VisitorWrapper> preOrderVisitorWrappers;
private final List<VisitorWrapper> postOrderVisitorWrappers;
- public VisitorsCrawler(Iterable<Visitor> visitors) {
+ public VisitorsCrawler(Iterable<ComponentVisitor> visitors) {
List<VisitorWrapper> visitorWrappers = from(visitors).transform(ToVisitorWrapper.INSTANCE).toList();
this.preOrderVisitorWrappers = from(visitorWrappers).filter(MathPreOrderVisitor.INSTANCE).toList();
this.postOrderVisitorWrappers = from(visitorWrappers).filter(MatchPostOrderVisitor.INSTANCE).toList();
@@ -95,15 +95,15 @@ public class VisitorsCrawler implements ComponentCrawler {
}
}
- private enum ToVisitorWrapper implements Function<Visitor, VisitorWrapper> {
+ private enum ToVisitorWrapper implements Function<ComponentVisitor, VisitorWrapper> {
INSTANCE;
@Override
- public VisitorWrapper apply(@Nonnull Visitor visitor) {
- if (visitor instanceof TypeAwareVisitor) {
- return new TypeAwareVisitorWrapper((TypeAwareVisitor) visitor);
- } else if (visitor instanceof PathAwareVisitor) {
- return new PathAwareVisitorWrapper((PathAwareVisitor) visitor);
+ public VisitorWrapper apply(@Nonnull ComponentVisitor componentVisitor) {
+ if (componentVisitor instanceof TypeAwareVisitor) {
+ return new TypeAwareVisitorWrapper((TypeAwareVisitor) componentVisitor);
+ } else if (componentVisitor instanceof PathAwareVisitor) {
+ return new PathAwareVisitorWrapper((PathAwareVisitor) componentVisitor);
} else {
throw new IllegalArgumentException("Only TypeAwareVisitor and PathAwareVisitor can be used");
}
@@ -128,7 +128,7 @@ public class VisitorsCrawler implements ComponentCrawler {
@Override
public boolean apply(@Nonnull VisitorWrapper visitorWrapper) {
- return visitorWrapper.getOrder() == Visitor.Order.PRE_ORDER;
+ return visitorWrapper.getOrder() == ComponentVisitor.Order.PRE_ORDER;
}
}
@@ -137,7 +137,7 @@ public class VisitorsCrawler implements ComponentCrawler {
@Override
public boolean apply(@Nonnull VisitorWrapper visitorWrapper) {
- return visitorWrapper.getOrder() == Visitor.Order.POST_ORDER;
+ return visitorWrapper.getOrder() == ComponentVisitor.Order.POST_ORDER;
}
}
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainer.java b/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainer.java
index 742d898059d..f931517d94e 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainer.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainer.java
@@ -21,7 +21,7 @@ package org.sonar.server.computation.container;
import org.sonar.core.platform.ComponentContainer;
import org.sonar.server.computation.ReportQueue.Item;
-import org.sonar.server.computation.component.Visitor;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.step.ComputationStep;
/**
@@ -46,7 +46,7 @@ public interface ComputeEngineContainer {
*/
<T extends ComputationStep> T getStep(Class<T> type);
- <T extends Visitor> T getComponentVisitor(Class<T> type);
+ <T extends ComponentVisitor> T getComponentVisitor(Class<T> type);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainerImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainerImpl.java
index add42ca7f71..2d2ca9fef80 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainerImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/container/ComputeEngineContainerImpl.java
@@ -43,10 +43,10 @@ import org.sonar.server.computation.ReportQueue;
import org.sonar.server.computation.activity.ActivityManager;
import org.sonar.server.computation.batch.BatchReportDirectoryHolderImpl;
import org.sonar.server.computation.batch.BatchReportReaderImpl;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DbIdsRepository;
import org.sonar.server.computation.component.ProjectSettingsRepository;
import org.sonar.server.computation.component.TreeRootHolderImpl;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.debt.DebtModelHolderImpl;
import org.sonar.server.computation.event.EventRepositoryImpl;
import org.sonar.server.computation.issue.BaseIssuesLoader;
@@ -274,7 +274,7 @@ public class ComputeEngineContainerImpl extends ComponentContainer implements Co
}
@Override
- public <T extends Visitor> T getComponentVisitor(Class<T> type) {
+ public <T extends ComponentVisitor> T getComponentVisitor(Class<T> type) {
return getComponentByType(type);
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/formula/FormulaExecutorComponentCrawler.java b/server/sonar-server/src/main/java/org/sonar/server/computation/formula/FormulaExecutorComponentCrawler.java
index 9b86cec3a30..ceb69053879 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/formula/FormulaExecutorComponentCrawler.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/formula/FormulaExecutorComponentCrawler.java
@@ -26,8 +26,8 @@ import java.util.List;
import java.util.Map;
import javax.annotation.CheckForNull;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.PathAwareCrawler;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.measure.Measure;
import org.sonar.server.computation.measure.MeasureRepository;
import org.sonar.server.computation.metric.Metric;
@@ -59,7 +59,7 @@ public class FormulaExecutorComponentCrawler extends PathAwareCrawler<FormulaExe
private final List<Formula> formulas;
private FormulaExecutorComponentCrawler(Builder builder, List<Formula> formulas) {
- super(Component.Type.FILE, Visitor.Order.POST_ORDER, COUNTERS_FACTORY);
+ super(Component.Type.FILE, ComponentVisitor.Order.POST_ORDER, COUNTERS_FACTORY);
this.periodsHolder = builder.periodsHolder;
this.measureRepository = builder.measureRepository;
this.metricRepository = builder.metricRepository;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureComputersVisitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureComputersVisitor.java
index e0e105a547f..488b09d5c63 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureComputersVisitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureComputersVisitor.java
@@ -27,7 +27,7 @@ import org.sonar.server.computation.measure.api.MeasureComputerImplementationCon
import org.sonar.server.computation.metric.MetricRepository;
import static org.sonar.server.computation.component.Component.Type.FILE;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class MeasureComputersVisitor extends TypeAwareVisitorAdapter {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitor.java b/server/sonar-server/src/main/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitor.java
index 8a9170a2476..cd12577cd2b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitor.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitor.java
@@ -23,8 +23,8 @@ package org.sonar.server.computation.sqale;
import com.google.common.base.Optional;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.PathAwareVisitorAdapter;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.measure.Measure;
import org.sonar.server.computation.measure.MeasureRepository;
import org.sonar.server.computation.metric.Metric;
@@ -44,7 +44,7 @@ public class SqaleMeasuresVisitor extends PathAwareVisitorAdapter<SqaleMeasuresV
private final Metric sqaleRatingMetric;
public SqaleMeasuresVisitor(MetricRepository metricRepository, MeasureRepository measureRepository, SqaleRatingSettings sqaleRatingSettings) {
- super(Component.Type.FILE, Visitor.Order.POST_ORDER, new SimpleStackElementFactory<DevelopmentCost>() {
+ super(Component.Type.FILE, ComponentVisitor.Order.POST_ORDER, new SimpleStackElementFactory<DevelopmentCost>() {
@Override
public DevelopmentCost createForAny(Component component) {
return new DevelopmentCost();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComponentVisitors.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComponentVisitors.java
index 34257d49906..64b9b64bea1 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComponentVisitors.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComponentVisitors.java
@@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import java.util.List;
import javax.annotation.Nonnull;
-import org.sonar.server.computation.component.Visitor;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.container.ComputeEngineContainer;
import org.sonar.server.computation.measure.MeasureComputersVisitor;
import org.sonar.server.computation.sqale.SqaleMeasuresVisitor;
@@ -36,7 +36,7 @@ import org.sonar.server.computation.sqale.SqaleMeasuresVisitor;
*/
public class ComponentVisitors {
- private static final List<Class<? extends Visitor>> ORDERED_VISITOR_CLASSES = ImmutableList.of(
+ private static final List<Class<? extends ComponentVisitor>> ORDERED_VISITOR_CLASSES = ImmutableList.of(
SqaleMeasuresVisitor.class,
// Must be after all other visitors as it requires measures computed by previous visitors
@@ -44,9 +44,9 @@ public class ComponentVisitors {
);
/**
- * List of all {@link Visitor}, ordered by execution sequence.
+ * List of all {@link ComponentVisitor}, ordered by execution sequence.
*/
- public List<Class<? extends Visitor>> orderedClasses() {
+ public List<Class<? extends ComponentVisitor>> orderedClasses() {
return ORDERED_VISITOR_CLASSES;
}
@@ -56,13 +56,13 @@ public class ComponentVisitors {
this.computeEngineContainer = computeEngineContainer;
}
- public Iterable<Visitor> instances() {
- return Iterables.transform(orderedClasses(), new Function<Class<? extends Visitor>, Visitor>() {
+ public Iterable<ComponentVisitor> instances() {
+ return Iterables.transform(orderedClasses(), new Function<Class<? extends ComponentVisitor>, ComponentVisitor>() {
@Override
- public Visitor apply(@Nonnull Class<? extends Visitor> input) {
- Visitor visitor = computeEngineContainer.getComponentVisitor(input);
- Preconditions.checkState(visitor != null, String.format("Visitor not found: %s", input));
- return visitor;
+ public ComponentVisitor apply(@Nonnull Class<? extends ComponentVisitor> input) {
+ ComponentVisitor componentVisitor = computeEngineContainer.getComponentVisitor(input);
+ Preconditions.checkState(componentVisitor != null, String.format("Visitor not found: %s", input));
+ return componentVisitor;
}
});
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java
index 1ba19ba8ec9..6ba2faed8ff 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ComputeQProfileMeasureStep.java
@@ -36,7 +36,7 @@ import org.sonar.server.computation.qualityprofile.QPMeasureData;
import org.sonar.server.computation.qualityprofile.QualityProfile;
import static org.sonar.server.computation.component.Component.Type.MODULE;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
/**
* Aggregates quality profile on lower-level module nodes on their parent modules and project
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/CustomMeasuresCopyStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/CustomMeasuresCopyStep.java
index bc5e02d52e9..ab5788e4848 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/CustomMeasuresCopyStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/CustomMeasuresCopyStep.java
@@ -27,9 +27,9 @@ import org.sonar.db.DbSession;
import org.sonar.db.MyBatis;
import org.sonar.db.measure.custom.CustomMeasureDto;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.measure.Measure;
import org.sonar.server.computation.measure.MeasureRepository;
import org.sonar.server.computation.metric.Metric;
@@ -52,7 +52,7 @@ public class CustomMeasuresCopyStep implements ComputationStep {
@Override
public void execute() {
- new DepthTraversalTypeAwareCrawler(Component.Type.FILE, Visitor.Order.PRE_ORDER) {
+ new DepthTraversalTypeAwareCrawler(Component.Type.FILE, ComponentVisitor.Order.PRE_ORDER) {
@Override
public void visitAny(Component component) {
copy(component);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ExecuteVisitorsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ExecuteVisitorsStep.java
index 7d93a3e7829..31137c5f607 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ExecuteVisitorsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ExecuteVisitorsStep.java
@@ -20,13 +20,13 @@
package org.sonar.server.computation.step;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.component.VisitorsCrawler;
public class ExecuteVisitorsStep implements ComputationStep {
private final TreeRootHolder treeRootHolder;
- private final Iterable<Visitor> visitors;
+ private final Iterable<ComponentVisitor> visitors;
public ExecuteVisitorsStep(TreeRootHolder treeRootHolder, ComponentVisitors visitors) {
this.treeRootHolder = treeRootHolder;
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStep.java
index b2a87eb2a6c..cdd4a48173e 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStep.java
@@ -46,7 +46,7 @@ import org.sonar.server.computation.metric.MetricRepository;
import org.sonar.server.computation.period.Period;
import org.sonar.server.computation.period.PeriodsHolder;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* Set variations on all numeric measures found in the repository.
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/IntegrateIssuesStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/IntegrateIssuesStep.java
index 1e357c6b624..56184e7df99 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/IntegrateIssuesStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/IntegrateIssuesStep.java
@@ -36,7 +36,7 @@ import org.sonar.server.computation.issue.IssueVisitors;
import org.sonar.server.computation.issue.TrackerExecution;
import org.sonar.server.util.cache.DiskCache;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
public class IntegrateIssuesStep implements ComputationStep {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistDuplicationsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistDuplicationsStep.java
index 920dcbf1330..0f114952347 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistDuplicationsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistDuplicationsStep.java
@@ -36,7 +36,7 @@ import org.sonar.server.computation.component.DbIdsRepository;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* Persist duplications into
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistEventsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistEventsStep.java
index 152dd24c662..2fa50e97872 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistEventsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistEventsStep.java
@@ -29,10 +29,10 @@ import org.sonar.db.MyBatis;
import org.sonar.db.event.EventDto;
import org.sonar.server.computation.batch.BatchReportReader;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DbIdsRepository;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.event.Event;
import org.sonar.server.computation.event.EventRepository;
@@ -139,7 +139,7 @@ public class PersistEventsStep implements ComputationStep {
private final long analysisDate;
public PersistEventComponentCrawler(DbSession session, long analysisDate) {
- super(Component.Type.FILE, Visitor.Order.PRE_ORDER);
+ super(Component.Type.FILE, ComponentVisitor.Order.PRE_ORDER);
this.session = session;
this.analysisDate = analysisDate;
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java
index 0a188c1a4cd..f1b058ee6e6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistFileSourcesStep.java
@@ -49,7 +49,7 @@ import org.sonar.server.computation.source.LineReader;
import org.sonar.server.computation.source.ScmLineReader;
import org.sonar.server.computation.source.SymbolsLineReader;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class PersistFileSourcesStep implements ComputationStep {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistMeasuresStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistMeasuresStep.java
index 6cd01463a9b..7985bacda40 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistMeasuresStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistMeasuresStep.java
@@ -46,7 +46,7 @@ import static com.google.common.collect.FluentIterable.from;
import static org.sonar.api.measures.CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.FILE_COMPLEXITY_DISTRIBUTION_KEY;
import static org.sonar.api.measures.CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION_KEY;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class PersistMeasuresStep implements ComputationStep {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java
index e40475f2ef1..2f2f59459d8 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStep.java
@@ -39,7 +39,7 @@ import org.sonar.server.computation.metric.MetricRepository;
import org.sonar.server.source.index.SourceLineIndex;
import static com.google.common.base.Objects.firstNonNull;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class PersistNumberOfDaysSinceLastCommitStep implements ComputationStep {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistProjectLinksStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistProjectLinksStep.java
index d6c04562054..3c5c8e3bce3 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistProjectLinksStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistProjectLinksStep.java
@@ -41,7 +41,7 @@ import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
import static com.google.common.collect.Sets.newHashSet;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* Persist project and module links
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestsStep.java
index d3f27f950b8..373717e58ec 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistTestsStep.java
@@ -49,9 +49,9 @@ import org.sonar.db.source.FileSourceDto;
import org.sonar.db.source.FileSourceDto.Type;
import org.sonar.server.computation.batch.BatchReportReader;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
public class PersistTestsStep implements ComputationStep {
@@ -97,7 +97,7 @@ public class PersistTestsStep implements ComputationStep {
boolean hasUnprocessedCoverageDetails = false;
public TestDepthTraversalTypeAwareCrawler(DbSession session) {
- super(Component.Type.FILE, Visitor.Order.PRE_ORDER);
+ super(Component.Type.FILE, ComponentVisitor.Order.PRE_ORDER);
this.session = session;
this.existingFileSourcesByUuid = new HashMap<>();
this.projectUuid = treeRootHolder.getRoot().getUuid();
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateEventsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateEventsStep.java
index 450e4abe150..7d68599b278 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateEventsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateEventsStep.java
@@ -26,9 +26,9 @@ import org.sonar.api.notifications.Notification;
import org.sonar.api.utils.log.Logger;
import org.sonar.api.utils.log.Loggers;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.event.Event;
import org.sonar.server.computation.event.EventRepository;
import org.sonar.server.computation.measure.Measure;
@@ -62,7 +62,7 @@ public class QualityGateEventsStep implements ComputationStep {
@Override
public void execute() {
- new DepthTraversalTypeAwareCrawler(Component.Type.PROJECT, Visitor.Order.PRE_ORDER) {
+ new DepthTraversalTypeAwareCrawler(Component.Type.PROJECT, ComponentVisitor.Order.PRE_ORDER) {
@Override
public void visitProject(Component project) {
executeForProject(project);
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateLoadingStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateLoadingStep.java
index 818416f671a..6ebeccd2b1c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateLoadingStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateLoadingStep.java
@@ -34,7 +34,7 @@ import org.sonar.server.computation.qualitygate.QualityGate;
import org.sonar.server.computation.qualitygate.QualityGateService;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* This step retrieves the QualityGate for the current {@link ReportQueue.Item} and stores it in
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateMeasuresStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateMeasuresStep.java
index 12f512483dc..5ee4d43ff0c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateMeasuresStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityGateMeasuresStep.java
@@ -44,7 +44,7 @@ import org.sonar.server.computation.qualitygate.QualityGate;
import org.sonar.server.computation.qualitygate.QualityGateHolder;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
/**
* This step:
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java
index f84a1dec15f..5b5e8593eba 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/QualityProfileEventsStep.java
@@ -42,7 +42,7 @@ import org.sonar.server.computation.metric.MetricRepository;
import org.sonar.server.computation.qualityprofile.QPMeasureData;
import org.sonar.server.computation.qualityprofile.QualityProfile;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
/**
* Computation of quality profile events
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/SizeMeasuresStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/SizeMeasuresStep.java
index 2c2f6700f22..8dea286a6e4 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/SizeMeasuresStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/SizeMeasuresStep.java
@@ -40,7 +40,7 @@ import static org.sonar.api.measures.CoreMetrics.LINES_KEY;
import static org.sonar.api.measures.CoreMetrics.NCLOC_KEY;
import static org.sonar.api.measures.CoreMetrics.STATEMENTS_KEY;
import static org.sonar.server.computation.component.Component.Type.FILE;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
import static org.sonar.server.computation.measure.Measure.newMeasureBuilder;
/**
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ValidateProjectStep.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ValidateProjectStep.java
index f28b30abb12..41efe8506c7 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/step/ValidateProjectStep.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/step/ValidateProjectStep.java
@@ -42,9 +42,9 @@ import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.SnapshotDto;
import org.sonar.server.computation.batch.BatchReportReader;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import static org.sonar.api.utils.DateUtils.formatDateTime;
@@ -108,7 +108,7 @@ public class ValidateProjectStep implements ComputationStep {
private Component rawProject;
public ValidateProjectsCrawler(DbSession session, ComponentDao componentDao, boolean preventAutomaticProjectCreation, Map<String, ComponentDto> baseModulesByKey) {
- super(Component.Type.MODULE, Visitor.Order.PRE_ORDER);
+ super(Component.Type.MODULE, ComponentVisitor.Order.PRE_ORDER);
this.session = session;
this.componentDao = componentDao;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/batch/TreeRootHolderRule.java b/server/sonar-server/src/test/java/org/sonar/server/computation/batch/TreeRootHolderRule.java
index bbf7aeb57fd..e77c132b607 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/batch/TreeRootHolderRule.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/batch/TreeRootHolderRule.java
@@ -30,7 +30,7 @@ import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.MutableTreeRootHolder;
import org.sonar.server.computation.component.TreeRootHolder;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
public class TreeRootHolderRule implements TestRule, MutableTreeRootHolder {
private Component root;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PathAwareCrawlerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PathAwareCrawlerTest.java
index 5bf623620d8..615c413fc67 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PathAwareCrawlerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PathAwareCrawlerTest.java
@@ -38,8 +38,8 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class PathAwareCrawlerTest {
@@ -258,7 +258,7 @@ public class PathAwareCrawlerTest {
private static class TestPathAwareCrawler extends PathAwareCrawler<Integer> {
private final List<CallRecord> callsRecords = new ArrayList<>();
- public TestPathAwareCrawler(Component.Type maxDepth, Visitor.Order order) {
+ public TestPathAwareCrawler(Component.Type maxDepth, ComponentVisitor.Order order) {
super(maxDepth, order, new SimpleStackElementFactory<Integer>() {
@Override
public Integer createForAny(Component component) {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PostOrderDepthTraversalTypeAwareCrawlerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PostOrderDepthTraversalTypeAwareCrawlerTest.java
index 9ba230af816..a6e8cb98f22 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PostOrderDepthTraversalTypeAwareCrawlerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PostOrderDepthTraversalTypeAwareCrawlerTest.java
@@ -29,7 +29,7 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
public class PostOrderDepthTraversalTypeAwareCrawlerTest {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PreOrderDepthTraversalTypeAwareCrawlerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PreOrderDepthTraversalTypeAwareCrawlerTest.java
index aeb2c28c823..d3d858c7734 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/PreOrderDepthTraversalTypeAwareCrawlerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/PreOrderDepthTraversalTypeAwareCrawlerTest.java
@@ -29,7 +29,7 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class PreOrderDepthTraversalTypeAwareCrawlerTest {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerTest.java
index a381ed21007..da80d003f7d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerTest.java
@@ -34,8 +34,8 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class VisitorsCrawlerTest {
@@ -87,7 +87,7 @@ public class VisitorsCrawlerTest {
@Test
public void execute_pre_visitor_before_post_visitor() throws Exception {
InOrder inOrder = inOrder(spyPreOrderTypeAwareVisitor, spyPostOrderTypeAwareVisitor);
- VisitorsCrawler underTest = new VisitorsCrawler(Arrays.<Visitor>asList(spyPreOrderTypeAwareVisitor, spyPostOrderTypeAwareVisitor));
+ VisitorsCrawler underTest = new VisitorsCrawler(Arrays.<ComponentVisitor>asList(spyPreOrderTypeAwareVisitor, spyPostOrderTypeAwareVisitor));
underTest.visit(COMPONENT_TREE);
inOrder.verify(spyPreOrderTypeAwareVisitor).visitProject(COMPONENT_TREE);
@@ -108,7 +108,7 @@ public class VisitorsCrawlerTest {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Only TypeAwareVisitor and PathAwareVisitor can be used");
- Visitor visitor = new Visitor() {
+ ComponentVisitor componentVisitor = new ComponentVisitor() {
@Override
public Order getOrder() {
return PRE_ORDER;
@@ -119,7 +119,7 @@ public class VisitorsCrawlerTest {
return FILE;
}
};
- new VisitorsCrawler(Arrays.asList(visitor));
+ new VisitorsCrawler(Arrays.asList(componentVisitor));
}
private static Component component(final Component.Type type, final int ref, final Component... children) {
@@ -128,14 +128,14 @@ public class VisitorsCrawlerTest {
private static class TestTypeAwareVisitor extends TypeAwareVisitorAdapter {
- public TestTypeAwareVisitor(Component.Type maxDepth, Visitor.Order order) {
+ public TestTypeAwareVisitor(Component.Type maxDepth, ComponentVisitor.Order order) {
super(maxDepth, order);
}
}
private static class TestPathAwareVisitor extends PathAwareVisitorAdapter<Integer> {
- public TestPathAwareVisitor(Component.Type maxDepth, Visitor.Order order) {
+ public TestPathAwareVisitor(Component.Type maxDepth, ComponentVisitor.Order order) {
super(maxDepth, order, new SimpleStackElementFactory<Integer>() {
@Override
public Integer createForAny(Component component) {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPathAwareVisitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPathAwareVisitorTest.java
index fb7741eb68d..24b9162fd5e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPathAwareVisitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPathAwareVisitorTest.java
@@ -40,8 +40,8 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class VisitorsCrawlerWithPathAwareVisitorTest {
@@ -265,14 +265,14 @@ public class VisitorsCrawlerWithPathAwareVisitorTest {
return new CallRecord(method, currentRef, currentRef, parentRef, ROOT_REF, path);
}
- private static VisitorsCrawler newVisitorsCrawler(Visitor visitor) {
- return new VisitorsCrawler(Arrays.asList(visitor));
+ private static VisitorsCrawler newVisitorsCrawler(ComponentVisitor componentVisitor) {
+ return new VisitorsCrawler(Arrays.asList(componentVisitor));
}
private static class TestPathAwareVisitor extends PathAwareVisitorAdapter<Integer> {
private final List<CallRecord> callsRecords = new ArrayList<>();
- public TestPathAwareVisitor(Component.Type maxDepth, Visitor.Order order) {
+ public TestPathAwareVisitor(Component.Type maxDepth, ComponentVisitor.Order order) {
super(maxDepth, order, new SimpleStackElementFactory<Integer>() {
@Override
public Integer createForAny(Component component) {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPostOrderTypeAwareVisitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPostOrderTypeAwareVisitorTest.java
index ceddd9b92e6..1044f4754db 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPostOrderTypeAwareVisitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPostOrderTypeAwareVisitorTest.java
@@ -31,7 +31,7 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.POST_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.POST_ORDER;
public class VisitorsCrawlerWithPostOrderTypeAwareVisitorTest {
@@ -296,8 +296,8 @@ public class VisitorsCrawlerWithPostOrderTypeAwareVisitorTest {
return DumbComponent.builder(type, ref).addChildren(children).build();
}
- private static VisitorsCrawler newVisitorsCrawler(Visitor visitor) {
- return new VisitorsCrawler(Arrays.asList(visitor));
+ private static VisitorsCrawler newVisitorsCrawler(ComponentVisitor componentVisitor) {
+ return new VisitorsCrawler(Arrays.asList(componentVisitor));
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPreOrderTypeAwareVisitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPreOrderTypeAwareVisitorTest.java
index 5ceabfcdd5e..43b606ed194 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPreOrderTypeAwareVisitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/VisitorsCrawlerWithPreOrderTypeAwareVisitorTest.java
@@ -31,7 +31,7 @@ import static org.sonar.server.computation.component.Component.Type.DIRECTORY;
import static org.sonar.server.computation.component.Component.Type.FILE;
import static org.sonar.server.computation.component.Component.Type.MODULE;
import static org.sonar.server.computation.component.Component.Type.PROJECT;
-import static org.sonar.server.computation.component.Visitor.Order.PRE_ORDER;
+import static org.sonar.server.computation.component.ComponentVisitor.Order.PRE_ORDER;
public class VisitorsCrawlerWithPreOrderTypeAwareVisitorTest {
@@ -289,8 +289,8 @@ public class VisitorsCrawlerWithPreOrderTypeAwareVisitorTest {
return DumbComponent.builder(type, ref).addChildren(children).build();
}
- private static VisitorsCrawler newVisitorsCrawler(Visitor visitor) {
- return new VisitorsCrawler(Arrays.asList(visitor));
+ private static VisitorsCrawler newVisitorsCrawler(ComponentVisitor componentVisitor) {
+ return new VisitorsCrawler(Arrays.asList(componentVisitor));
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureComputersVisitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureComputersVisitorTest.java
index 1780a720025..cb4c8ea6f1d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureComputersVisitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureComputersVisitorTest.java
@@ -26,7 +26,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.ce.measure.MeasureComputer;
import org.sonar.server.computation.component.Component;
-import org.sonar.server.computation.component.Visitor;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.VisitorsCrawler;
import org.sonar.server.computation.measure.api.MeasureComputerImpl;
import org.sonar.server.computation.metric.MetricRepositoryRule;
@@ -116,7 +116,7 @@ public class MeasureComputersVisitorTest {
.build()
));
- VisitorsCrawler visitorsCrawler = new VisitorsCrawler(Arrays.<Visitor>asList(new MeasureComputersVisitor(metricRepository, measureRepository, null, measureComputersHolder)));
+ VisitorsCrawler visitorsCrawler = new VisitorsCrawler(Arrays.<ComponentVisitor>asList(new MeasureComputersVisitor(metricRepository, measureRepository, null, measureComputersHolder)));
visitorsCrawler.visit(ROOT);
assertThat(toEntries(measureRepository.getAddedRawMeasures(FILE_1_REF))).containsOnly(entryOf(NEW_METRIC_KEY, newMeasureBuilder().create(12)));
@@ -140,7 +140,7 @@ public class MeasureComputersVisitorTest {
measureRepository.addRawMeasure(ROOT_REF, COMMENT_LINES_KEY, newMeasureBuilder().create(7));
measureComputersHolder.setMeasureComputers(Collections.<MeasureComputer>emptyList());
- VisitorsCrawler visitorsCrawler = new VisitorsCrawler(Arrays.<Visitor>asList(new MeasureComputersVisitor(metricRepository, measureRepository, null, measureComputersHolder)));
+ VisitorsCrawler visitorsCrawler = new VisitorsCrawler(Arrays.<ComponentVisitor>asList(new MeasureComputersVisitor(metricRepository, measureRepository, null, measureComputersHolder)));
visitorsCrawler.visit(ROOT);
assertThat(toEntries(measureRepository.getAddedRawMeasures(FILE_1_REF))).isEmpty();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryRule.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryRule.java
index e2effb13ea3..80828720b7c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryRule.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryRule.java
@@ -33,9 +33,9 @@ import javax.annotation.Nullable;
import org.junit.rules.ExternalResource;
import org.sonar.db.rule.RuleDto;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DepthTraversalTypeAwareCrawler;
import org.sonar.server.computation.component.TreeRootHolder;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.debt.Characteristic;
import org.sonar.server.computation.metric.Metric;
import org.sonar.server.computation.metric.MetricRepositoryRule;
@@ -386,7 +386,7 @@ public class MeasureRepositoryRule extends ExternalResource implements MeasureRe
private final Map<Integer, Component> componentsByRef = new HashMap<>();
public TreeComponentProvider(Component root) {
- new DepthTraversalTypeAwareCrawler(Component.Type.FILE, Visitor.Order.PRE_ORDER) {
+ new DepthTraversalTypeAwareCrawler(Component.Type.FILE, ComponentVisitor.Order.PRE_ORDER) {
@Override
public void visitAny(Component component) {
checkState(!componentsByRef.containsKey(component.getRef()), "Tree contains more than one component with ref " + component.getRef());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitorTest.java
index e0f846fc5ab..4e4e7f9e3e7 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/sqale/SqaleMeasuresVisitorTest.java
@@ -26,9 +26,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.server.computation.batch.TreeRootHolderRule;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.DumbComponent;
import org.sonar.server.computation.component.FileAttributes;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.component.VisitorsCrawler;
import org.sonar.server.computation.measure.Measure;
import org.sonar.server.computation.measure.MeasureRepoEntry;
@@ -82,7 +82,7 @@ public class SqaleMeasuresVisitorTest {
private SqaleRatingSettings sqaleRatingSettings = mock(SqaleRatingSettings.class);
- private VisitorsCrawler underTest = new VisitorsCrawler(Arrays.<Visitor>asList(new SqaleMeasuresVisitor(metricRepository, measureRepository, sqaleRatingSettings)));
+ private VisitorsCrawler underTest = new VisitorsCrawler(Arrays.<ComponentVisitor>asList(new SqaleMeasuresVisitor(metricRepository, measureRepository, sqaleRatingSettings)));
@Before
public void setUp() {
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ExecuteVisitorsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ExecuteVisitorsStepTest.java
index 137fdd8a75f..f7bd96ada45 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ExecuteVisitorsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ExecuteVisitorsStepTest.java
@@ -26,9 +26,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.sonar.server.computation.batch.TreeRootHolderRule;
import org.sonar.server.computation.component.Component;
+import org.sonar.server.computation.component.ComponentVisitor;
import org.sonar.server.computation.component.PathAwareVisitorAdapter;
import org.sonar.server.computation.component.TypeAwareVisitorAdapter;
-import org.sonar.server.computation.component.Visitor;
import org.sonar.server.computation.measure.MeasureRepositoryRule;
import org.sonar.server.computation.metric.Metric;
import org.sonar.server.computation.metric.MetricImpl;
@@ -87,7 +87,7 @@ public class ExecuteVisitorsStepTest {
@Test
public void execute_with_type_aware_visitor() throws Exception {
- when(visitors.instances()).thenReturn(Arrays.<Visitor>asList(new TestTypeAwareVisitor()));
+ when(visitors.instances()).thenReturn(Arrays.<ComponentVisitor>asList(new TestTypeAwareVisitor()));
ExecuteVisitorsStep underStep = new ExecuteVisitorsStep(treeRootHolder, visitors);
measureRepository.addRawMeasure(FILE_1_REF, NCLOC_KEY, newMeasureBuilder().create(1));
@@ -107,7 +107,7 @@ public class ExecuteVisitorsStepTest {
@Test
public void execute_with_path_aware_visitor() throws Exception {
- when(visitors.instances()).thenReturn(Arrays.<Visitor>asList(new TestPathAwareVisitor()));
+ when(visitors.instances()).thenReturn(Arrays.<ComponentVisitor>asList(new TestPathAwareVisitor()));
ExecuteVisitorsStep underStep = new ExecuteVisitorsStep(treeRootHolder, visitors);
measureRepository.addRawMeasure(FILE_1_REF, NCLOC_KEY, newMeasureBuilder().create(1));
@@ -125,7 +125,7 @@ public class ExecuteVisitorsStepTest {
private class TestTypeAwareVisitor extends TypeAwareVisitorAdapter {
public TestTypeAwareVisitor() {
- super(Component.Type.FILE, Visitor.Order.POST_ORDER);
+ super(Component.Type.FILE, ComponentVisitor.Order.POST_ORDER);
}
@Override
@@ -138,7 +138,7 @@ public class ExecuteVisitorsStepTest {
private class TestPathAwareVisitor extends PathAwareVisitorAdapter<Counter> {
public TestPathAwareVisitor() {
- super(Component.Type.FILE, Visitor.Order.POST_ORDER, new SimpleStackElementFactory<Counter>() {
+ super(Component.Type.FILE, ComponentVisitor.Order.POST_ORDER, new SimpleStackElementFactory<Counter>() {
@Override
public Counter createForAny(Component component) {
return new Counter();