From 5c8253965ec61f94ba0d8db80ad8478d7af2700b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 4 Feb 2014 17:59:40 +0100 Subject: [PATCH] SONAR-926 drop support in multi-lang projects of methods shouldExecuteOnProject() that check project language --- .../sonar/batch/phases/SensorsExecutor.java | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/phases/SensorsExecutor.java b/sonar-batch/src/main/java/org/sonar/batch/phases/SensorsExecutor.java index 987a63f5146..d9ecbb18b17 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/phases/SensorsExecutor.java +++ b/sonar-batch/src/main/java/org/sonar/batch/phases/SensorsExecutor.java @@ -50,10 +50,9 @@ public class SensorsExecutor implements BatchComponent { private BatchExtensionDictionnary selector; private final DatabaseSession session; private final SensorMatcher sensorMatcher; - private final DefaultModuleLanguages moduleLanguages; public SensorsExecutor(BatchExtensionDictionnary selector, Project project, DefaultModuleFileSystem fs, MavenPluginExecutor mavenExecutor, EventBus eventBus, - DatabaseSession session, SensorMatcher sensorMatcher, DefaultModuleLanguages moduleLanguages) { + DatabaseSession session, SensorMatcher sensorMatcher) { this.selector = selector; this.mavenExecutor = mavenExecutor; this.eventBus = eventBus; @@ -61,7 +60,6 @@ public class SensorsExecutor implements BatchComponent { this.fs = fs; this.session = session; this.sensorMatcher = sensorMatcher; - this.moduleLanguages = moduleLanguages; } public void execute(SensorContext context) { @@ -74,22 +72,6 @@ public class SensorsExecutor implements BatchComponent { if (sensor.shouldExecuteOnProject(module)) { executeSensor(context, sensor); - } else { - // For backward compatibility try to execute Sensor for each language until it is executed once (or never) - String oldLanguageKey = module.getLanguageKey(); - Language oldLanguage = module.getLanguage(); - for (Language language : moduleLanguages.languages()) { - module.setLanguage(language); - module.getConfiguration().setProperty(CoreProperties.PROJECT_LANGUAGE_PROPERTY, language.getKey()); - if (sensor.shouldExecuteOnProject(module)) { - LOG.warn("Sensor {} should be updated to not depends on deprecated Project::getLanguage or Project::getLanguageKey", sensor); - executeSensor(context, sensor); - break; - } - } - // Restore module language - module.setLanguage(oldLanguage); - module.getConfiguration().setProperty(CoreProperties.PROJECT_LANGUAGE_PROPERTY, oldLanguageKey); } } -- 2.39.5