mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Don't use Date, instead use Calendar. I still want to sneak in LocalDate somehow...
This commit is contained in:
parent
13b62f7269
commit
ee778953e8
@ -35,10 +35,9 @@ public final class UUIDTranslator {
|
|||||||
// Cache the entry for three days.
|
// Cache the entry for three days.
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.add(Calendar.DAY_OF_MONTH, 3);
|
calendar.add(Calendar.DAY_OF_MONTH, 3);
|
||||||
Date date = calendar.getTime();
|
|
||||||
|
|
||||||
// Create the entry and populate the local maps
|
// Create the entry and populate the local maps
|
||||||
CachedUUIDEntry entry = new CachedUUIDEntry(name, uuid, date);
|
CachedUUIDEntry entry = new CachedUUIDEntry(name, uuid, calendar);
|
||||||
nameToUuidMap.put(name.toLowerCase(), entry);
|
nameToUuidMap.put(name.toLowerCase(), entry);
|
||||||
uuidToNameMap.put(uuid, entry);
|
uuidToNameMap.put(uuid, entry);
|
||||||
}
|
}
|
||||||
@ -199,10 +198,10 @@ public final class UUIDTranslator {
|
|||||||
private class CachedUUIDEntry {
|
private class CachedUUIDEntry {
|
||||||
private final String name;
|
private final String name;
|
||||||
private final UUID uuid;
|
private final UUID uuid;
|
||||||
private final Date expiry;
|
private final Calendar expiry;
|
||||||
|
|
||||||
public boolean expired() {
|
public boolean expired() {
|
||||||
return new Date().after(expiry);
|
return Calendar.getInstance().after(expiry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user