Skip to content

Commit f4314ae

Browse files
committed
Bug 36409014 - SafeNamedCache.async() should ensure running cache
(merge main -> ce/main 107843) [git-p4: depot-paths = "//dev/coherence-ce/main/": change = 107845]
1 parent e3ccf4b commit f4314ae

File tree

1 file changed

+5
-2
lines changed
  • prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util

1 file changed

+5
-2
lines changed

prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/SafeNamedCache.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
3+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
44
*
55
* Licensed under the Universal Permissive License v 1.0 as shown at
66
* https://oss.oracle.com/licenses/upl.
@@ -713,6 +713,8 @@ else if (listener != null)
713713
}
714714

715715
// From interface: com.tangosol.net.NamedCache
716+
@Override
717+
@SuppressWarnings("resource")
716718
public com.tangosol.net.AsyncNamedCache async(com.tangosol.net.AsyncNamedMap.Option[] options)
717719
{
718720
SafeAsyncNamedCache cacheAsync = getSafeAsyncNamedCache();
@@ -721,13 +723,14 @@ public com.tangosol.net.AsyncNamedCache async(com.tangosol.net.AsyncNamedMap.Opt
721723
ensureLocked();
722724
try
723725
{
726+
NamedCache cache = getRunningNamedCache();
724727
SafeAsyncNamedCache cacheSafe = new SafeAsyncNamedCache();
725728
cacheSafe.setCacheName(getCacheName());
726729
cacheSafe.setSafeNamedCache(this);
727730
cacheSafe.setSafeCacheService(getSafeCacheService());
728731
cacheSafe.setClassLoader(getClassLoader());
729732
cacheSafe.setOptions(options);
730-
cacheSafe.setInternalNamedCache(getInternalNamedCache().async(options));
733+
cacheSafe.setInternalNamedCache(cache.async(options));
731734
cacheSafe.setStarted(true);
732735
setSafeAsyncNamedCache(cacheAsync = cacheSafe);
733736
}

0 commit comments

Comments
 (0)