]> source.dussan.org Git - sonarqube.git/commitdiff
Add a find method without root qualifier for retro compatibility for dev cockpit
authorJulien Lancelot <julien.lancelot@gmail.com>
Tue, 2 Apr 2013 07:49:36 +0000 (09:49 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Tue, 2 Apr 2013 07:49:36 +0000 (09:49 +0200)
sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinder.java

index f48d5847836e0733033bceebd84deb6d50939da4..f416365c5e30c864698e3a5636610f6ca268087f 100644 (file)
@@ -60,12 +60,20 @@ public class PastSnapshotFinder implements BatchExtension {
     return pastSnapshot;
   }
 
+  /**
+   * For retro compatibility for dev cockpit. It will used deprecated periods property sonar.timemachine.periods4 and sonar.timemachine.periods5
+   */
+  public PastSnapshot find(Snapshot projectSnapshot, Settings settings, int index) {
+    return find(projectSnapshot, null, settings, index);
+  }
+
   static String getPropertyValue(String rootQualifier, Settings settings, int index) {
     return settings.getString(getProperty(rootQualifier, index));
   }
 
   static private String getProperty(String rootQualifier, int index) {
-    if (index <= 3) {
+    // The check on rootQualifier is for retro compatibility
+    if (index <= 3 || rootQualifier == null) {
       return CoreProperties.TIMEMACHINE_PERIOD_PREFIX + index;
     } else {
       return CoreProperties.TIMEMACHINE_PREFIX + "." + rootQualifier + "." + CoreProperties.TIMEMACHINE_PERIOD_SUFFIX + index;