aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-05-30 18:25:31 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-05-30 18:25:31 +0200
commitc35a38ea003ecfabccd079a0060d4b4b0e221b3c (patch)
treed68aaf52e81be5443e6c5c587aa7de7f65cd7594 /sonar-batch
parent2fa5e60abcad9866fd38deea8b11bbc9e049ce33 (diff)
downloadsonarqube-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.java12
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);
}