diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-01-12 18:53:34 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-01-13 11:47:44 +0100 |
commit | b009b7b057a9dc02f55371854458ed1f688a8823 (patch) | |
tree | 8d7bfb3e41682868f81020ac7f963d4a26ecc62a /sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java | |
parent | 952ed409d9b2a6822e87f3fa49a32769b91e4d84 (diff) | |
download | sonarqube-b009b7b057a9dc02f55371854458ed1f688a8823.tar.gz sonarqube-b009b7b057a9dc02f55371854458ed1f688a8823.zip |
change analysis_reports timestamp columns to bigint/long
Diffstat (limited to 'sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java index a36ce0a44ea..556db486621 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java @@ -20,7 +20,6 @@ package org.sonar.api.utils; import javax.annotation.Nullable; - import java.io.NotSerializableException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -64,6 +63,10 @@ public final class DateUtils { return THREAD_SAFE_DATETIME_FORMAT.format(date); } + public static Date timeToDate(@Nullable Long time) { + return time == null ? null : new Date(time); + } + /** * @param s string in format {@link #DATE_FORMAT} * @throws SonarException when string cannot be parsed |