From: Julien Lancelot Date: Thu, 6 Feb 2014 08:12:46 +0000 (+0100) Subject: Revert getTargetDate() in public visibility because it's used by the Dev Cockpit... X-Git-Tag: 4.2~236 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=13c085c767e2ce7bc0455e65172636360eeffec7;p=sonarqube.git Revert getTargetDate() in public visibility because it's used by the Dev Cockpit plugin --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java index d411127ed52..5bc1cac80c5 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java +++ b/sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java @@ -103,7 +103,11 @@ public class PastSnapshot { return projectSnapshot != null ? projectSnapshot.getQualifier() : null; } - private Date getTargetDate() { + /** + * @deprecated in 4.2. Target date should only be used in labels. + */ + @Deprecated + public Date getTargetDate() { return targetDate; } @@ -118,13 +122,13 @@ public class PastSnapshot { public String toString() { if (StringUtils.equals(mode, CoreProperties.TIMEMACHINE_MODE_VERSION)) { String label = String.format("Compare to version %s", modeParameter); - if (getTargetDate() != null) { + if (targetDate != null) { label += String.format(" (%s)", DateUtils.formatDate(getDate())); } return label; } if (StringUtils.equals(mode, CoreProperties.TIMEMACHINE_MODE_DAYS)) { - String label = String.format("Compare over %s days (%s", modeParameter, DateUtils.formatDate(getTargetDate())); + String label = String.format("Compare over %s days (%s", modeParameter, DateUtils.formatDate(targetDate)); if (isRelatedToSnapshot()) { label += ", analysis of " + getDate(); } @@ -146,7 +150,7 @@ public class PastSnapshot { return label; } if (StringUtils.equals(mode, CoreProperties.TIMEMACHINE_MODE_DATE)) { - String label = "Compare to date " + DateUtils.formatDate(getTargetDate()); + String label = "Compare to date " + DateUtils.formatDate(targetDate); if (isRelatedToSnapshot()) { label += String.format(" (analysis of %s)", DateUtils.formatDate(getDate())); }