From d0984314aad605e8a73e87579241b662b7ddfe0d Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Tue, 2 Apr 2013 09:49:36 +0200 Subject: [PATCH] Add a find method without root qualifier for retro compatibility for dev cockpit --- .../org/sonar/batch/components/PastSnapshotFinder.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinder.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinder.java index f48d5847836..f416365c5e3 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshotFinder.java @@ -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; -- 2.39.5