diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-30 18:25:31 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-30 18:25:31 +0200 |
commit | c35a38ea003ecfabccd079a0060d4b4b0e221b3c (patch) | |
tree | d68aaf52e81be5443e6c5c587aa7de7f65cd7594 /sonar-batch | |
parent | 2fa5e60abcad9866fd38deea8b11bbc9e049ce33 (diff) | |
download | sonarqube-c35a38ea003ecfabccd079a0060d4b4b0e221b3c.tar.gz sonarqube-c35a38ea003ecfabccd079a0060d4b4b0e221b3c.zip |
Dates of past analysis must not contain milliseconds
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/components/PastSnapshot.java | 12 |
1 files changed, 8 insertions, 4 deletions
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 666aab37d81..e252433c3ff 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 @@ -25,6 +25,8 @@ import org.sonar.api.CoreProperties; import org.sonar.api.database.model.Snapshot; import org.sonar.api.utils.DateUtils; +import javax.annotation.Nullable; +import java.util.Calendar; import java.util.Date; public class PastSnapshot { @@ -32,15 +34,17 @@ public class PastSnapshot { private int index; private String mode, modeParameter; private Snapshot projectSnapshot; - private Date targetDate; + private Date targetDate = null; - public PastSnapshot(String mode, Date targetDate, Snapshot projectSnapshot) { + public PastSnapshot(String mode, @Nullable Date targetDate, @Nullable Snapshot projectSnapshot) { this.mode = mode; - this.targetDate = targetDate; + if (targetDate != null) { + this.targetDate = org.apache.commons.lang.time.DateUtils.truncate(targetDate, Calendar.SECOND); + } this.projectSnapshot = projectSnapshot; } - public PastSnapshot(String mode, Date targetDate) { + public PastSnapshot(String mode, @Nullable Date targetDate) { this(mode, targetDate, null); } |