]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3895 fix loading of deprecated commons-conf in root module
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 8 Nov 2012 10:59:17 +0000 (11:59 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 8 Nov 2012 10:59:17 +0000 (11:59 +0100)
sonar-batch/src/main/java/org/sonar/batch/bootstrap/BatchSettings.java
sonar-batch/src/main/java/org/sonar/batch/bootstrap/ProjectSettings.java
sonar-plugin-api/src/main/java/org/sonar/api/config/Settings.java

index a637b45659c37aa991586a28dbdfe95d4fc0e6ac..ba1b76484dedc193257fc0db3b72877f6ecd505a 100644 (file)
@@ -74,7 +74,8 @@ public class BatchSettings extends Settings {
       String moduleKey = jsonProperty.get("p");
       if (moduleKey == null || projectKey.equals(moduleKey)) {
         setProperty(key, value);
-      } else {
+      }
+      if (moduleKey != null) {
         Map<String, String> map = moduleProperties.get(moduleKey);
         if (map == null) {
           map = Maps.newHashMap();
index 871a3a5fde141b4530f6c6498938e5e55401227a..eb5da0ff65f2a051c08ee40b8060fc6e7852d496 100644 (file)
@@ -44,16 +44,7 @@ public class ProjectSettings extends Settings {
 
     LoggerFactory.getLogger(ProjectSettings.class).info("Load module settings");
     this.deprecatedCommonsConf = deprecatedCommonsConf;
-    if (project.getParent() == null) {
-      // root project -> no need to reload settings
-      copy(batchSettings);
-    } else {
-      init(project, batchSettings);
-    }
-  }
-
-  private void copy(BatchSettings batchSettings) {
-    setProperties(batchSettings);
+    init(project, batchSettings);
   }
 
   private ProjectSettings init(ProjectDefinition project, BatchSettings batchSettings) {
index a3a087b417518d5669be1fd3f54511fc123a0382..c3c6f46fc9ee9b524d17169194d09dbbc79e4ee2 100644 (file)
@@ -356,13 +356,6 @@ public class Settings implements BatchComponent, ServerComponent {
     return addProperties(props);
   }
 
-  public final Settings setProperties(Settings s) {
-    if (s.properties == null) {
-      return clear();
-    }
-    return setProperties(Maps.newHashMap(s.properties));
-  }
-
   public final Settings setProperty(String key, @Nullable Date date, boolean includeTime) {
     return setProperty(key, includeTime ? DateUtils.formatDateTime(date) : DateUtils.formatDate(date));
   }