Use plain epoch millis instead of DateTime
JodaTime is not strictly needed for comparing epoch times and
is not included anymore on Gerrit master (2.16/3.0).
Using a pure long timestamp comparison resolves compile problems
with master and makes it compatible with more versions of Gerrit.
Change-Id: Ia78ebd352b47ed48205bbd4533e6dfde1cc09d5b
diff --git a/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java b/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java
index 50acdf0..a240aee 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/websession/flatfile/FlatFileWebSessionCache.java
@@ -23,7 +23,6 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
-import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -83,8 +82,8 @@
public void cleanUp() {
for (Path path : listFiles()) {
Val val = readFile(path);
- DateTime expires = new DateTime(val.getExpiresAt());
- if (expires.isBefore(new DateTime())) {
+ long expires = val.getExpiresAt();
+ if (expires < System.currentTimeMillis()) {
deleteFile(path);
}
}