aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-01-12 18:53:34 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-01-13 11:47:44 +0100
commitb009b7b057a9dc02f55371854458ed1f688a8823 (patch)
tree8d7bfb3e41682868f81020ac7f963d4a26ecc62a /sonar-plugin-api/src/main/java/org/sonar/api/utils/DateUtils.java
parent952ed409d9b2a6822e87f3fa49a32769b91e4d84 (diff)
downloadsonarqube-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.java5
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