]> source.dussan.org Git - sonarqube.git/commitdiff
Fix regression concerning SONAR-5878 (task property was released too early)
authorJulien HENRY <julien.henry@sonarsource.com>
Thu, 4 Dec 2014 10:46:43 +0000 (11:46 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Thu, 4 Dec 2014 10:47:22 +0000 (11:47 +0100)
sonar-batch/src/main/java/org/sonar/batch/bootstrap/TaskContainer.java

index 6edd826ab037e1c47d13818479ab64ec216ceea1..21fd5c214e17094d182aeeadf47578858847f740 100644 (file)
@@ -76,8 +76,6 @@ public class TaskContainer extends ComponentContainer {
 
   void installCoreTasks() {
     add(new TaskProperties(taskProperties, getParent().getComponentByType(BootstrapProperties.class).property(CoreProperties.ENCRYPTION_SECRET_KEY_PATH)));
-    // Release memory
-    taskProperties.clear();
     add(
       ScanTask.DEFINITION, ScanTask.class,
       ListTask.DEFINITION, ListTask.class,
@@ -118,6 +116,8 @@ public class TaskContainer extends ComponentContainer {
   public void doAfterStart() {
     // default value is declared in CorePlugin
     String taskKey = StringUtils.defaultIfEmpty(taskProperties.get(CoreProperties.TASK), CoreProperties.SCAN_TASK);
+    // Release memory
+    taskProperties.clear();
 
     TaskDefinition def = getComponentByType(Tasks.class).definition(taskKey);
     if (def == null) {