From 5f8b0193c9d2df27ef555e70a7d5527944fd5bae Mon Sep 17 00:00:00 2001 From: Radek Felcman Date: Mon, 24 Jul 2023 15:46:24 +0200 Subject: [PATCH] Date to Instant parameter change --- .../eclipse/persistence/sdo/helper/SDOHelperContext.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOHelperContext.java b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOHelperContext.java index 299e6c8ef35..f2f2fa47546 100644 --- a/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOHelperContext.java +++ b/sdo/org.eclipse.persistence.sdo/src/main/java/org/eclipse/persistence/sdo/helper/SDOHelperContext.java @@ -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; @@ -1509,14 +1509,14 @@ public static Map putWrapperTypes(Map 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++; } @@ -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);