Skip to content

Commit

Permalink
Date to Instant parameter change
Browse files Browse the repository at this point in the history
  • Loading branch information
rfelcman committed Jul 24, 2023
1 parent fec8f7f commit 5f8b019
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.util.Date;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -1509,14 +1509,14 @@ public static Map<SDOWrapperTypeId,SDOWrapperType> putWrapperTypes(Map<SDOWrappe
* @param expirationTime defines age of helper context records. Older one will be removed. It's compared against creation time.
* @return number of removed helper context records
*/
public static int removeExpiredHelperContexts(Object key, Date expirationTime) {
public static int removeExpiredHelperContexts(Object key, Instant expirationTime) {
int removedCounter = 0;
CacheIdentityMap contextMap = helperContexts.get(key);
if (contextMap != null) {
Map<Object, CacheKey> cacheKeys = contextMap.getCacheKeys();
for (Object key0: cacheKeys.keySet()) {
CacheKey cacheKey = cacheKeys.get(key0);
if (cacheKey.getConcurrencyManagerCreationDate().compareTo(expirationTime) < 0) {
if (cacheKey.getConcurrencyManagerCreationDate().getTime() < expirationTime.getEpochSecond() * 1000) {
cacheKeys.remove(key0);
removedCounter++;
}
Expand All @@ -1534,7 +1534,7 @@ public static int removeExpiredHelperContexts(Object key, Date expirationTime) {
* @param expirationTime defines age of helper context records. Older one will be removed. It's compared against creation time.
* @return number of removed helper context records
*/
public static int removeAllExpiredHelperContexts(Date expirationTime) {
public static int removeAllExpiredHelperContexts(Instant expirationTime) {
int removedCounter = 0;
for (Object key: helperContexts.keySet()) {
removedCounter += removeExpiredHelperContexts(key, expirationTime);
Expand Down

0 comments on commit 5f8b019

Please sign in to comment.