From a37a451c2e118a06689e6eb581b891c9f729586e Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Tue, 29 Mar 2011 15:01:55 +0400 Subject: [PATCH] Fix execution of PhasesTimeProfiler --- .../src/main/java/org/sonar/batch/Batch.java | 26 ++++--------------- .../java/org/sonar/batch/ProjectBatch.java | 14 +++------- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/Batch.java b/sonar-batch/src/main/java/org/sonar/batch/Batch.java index d36128953ea..c2b15adda09 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/Batch.java +++ b/sonar-batch/src/main/java/org/sonar/batch/Batch.java @@ -19,9 +19,6 @@ */ package org.sonar.batch; -import java.net.URLClassLoader; -import java.util.Arrays; - import org.apache.commons.configuration.Configuration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,23 +30,8 @@ import org.sonar.batch.bootstrap.BatchPluginRepository; import org.sonar.batch.bootstrap.BootstrapClassLoader; import org.sonar.batch.bootstrap.ExtensionDownloader; import org.sonar.batch.bootstrap.TempDirectories; -import org.sonar.batch.components.PastMeasuresLoader; -import org.sonar.batch.components.PastSnapshotFinder; -import org.sonar.batch.components.PastSnapshotFinderByDate; -import org.sonar.batch.components.PastSnapshotFinderByDays; -import org.sonar.batch.components.PastSnapshotFinderByPreviousAnalysis; -import org.sonar.batch.components.PastSnapshotFinderByVersion; -import org.sonar.batch.events.EventBus; -import org.sonar.batch.index.DefaultIndex; -import org.sonar.batch.index.DefaultPersistenceManager; -import org.sonar.batch.index.DefaultResourcePersister; -import org.sonar.batch.index.DependencyPersister; -import org.sonar.batch.index.EventPersister; -import org.sonar.batch.index.LinkPersister; -import org.sonar.batch.index.MeasurePersister; -import org.sonar.batch.index.MemoryOptimizer; -import org.sonar.batch.index.SourcePersister; -import org.sonar.batch.index.ViolationPersister; +import org.sonar.batch.components.*; +import org.sonar.batch.index.*; import org.sonar.core.components.CacheMetricFinder; import org.sonar.core.components.CacheRuleFinder; import org.sonar.core.plugin.JpaPluginDao; @@ -58,6 +40,9 @@ import org.sonar.jpa.session.DatabaseSessionProvider; import org.sonar.jpa.session.DriverDatabaseConnector; import org.sonar.jpa.session.ThreadLocalDatabaseSessionFactory; +import java.net.URLClassLoader; +import java.util.Arrays; + public class Batch { private static final Logger LOG = LoggerFactory.getLogger(Batch.class); @@ -104,7 +89,6 @@ public class Batch { addComponent(EventPersister.class); addComponent(LinkPersister.class); addComponent(MeasurePersister.class); - addComponent(EventBus.class); addComponent(MemoryOptimizer.class); addComponent(DefaultResourcePersister.class); addComponent(SourcePersister.class); diff --git a/sonar-batch/src/main/java/org/sonar/batch/ProjectBatch.java b/sonar-batch/src/main/java/org/sonar/batch/ProjectBatch.java index 1ffbcb954ad..109b098debf 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/ProjectBatch.java +++ b/sonar-batch/src/main/java/org/sonar/batch/ProjectBatch.java @@ -25,26 +25,19 @@ import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Metric; import org.sonar.api.measures.Metrics; import org.sonar.api.profiles.RulesProfile; -import org.sonar.api.resources.DefaultProjectFileSystem; -import org.sonar.api.resources.Language; -import org.sonar.api.resources.Languages; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.ProjectFileSystem; +import org.sonar.api.resources.*; import org.sonar.api.rules.DefaultRulesManager; import org.sonar.api.utils.SonarException; import org.sonar.batch.bootstrap.BatchPluginRepository; import org.sonar.batch.components.PastViolationsLoader; import org.sonar.batch.components.TimeMachineConfiguration; +import org.sonar.batch.events.EventBus; import org.sonar.batch.index.DefaultIndex; import org.sonar.batch.index.DefaultResourcePersister; import org.sonar.batch.phases.Phases; import org.sonar.batch.phases.PhasesTimeProfiler; import org.sonar.core.components.DefaultModelFinder; -import org.sonar.jpa.dao.AsyncMeasuresDao; -import org.sonar.jpa.dao.AsyncMeasuresService; -import org.sonar.jpa.dao.DaoFacade; -import org.sonar.jpa.dao.ProfilesDao; -import org.sonar.jpa.dao.RulesDao; +import org.sonar.jpa.dao.*; public class ProjectBatch { @@ -146,6 +139,7 @@ public class ProjectBatch { private static class ProjectCoreComponents extends Module { @Override protected void configure() { + addComponent(EventBus.class); addComponent(Phases.class); addComponent(PhasesTimeProfiler.class); for (Class clazz : Phases.getPhaseClasses()) { -- 2.39.5