aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
index ce6fbba0..83de9911 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/ExternalLocationProviderFactory.kt
@@ -17,8 +17,10 @@ interface ExternalLocationProviderFactory {
class ExternalLocationProviderFactoryWithCache(val ext: ExternalLocationProviderFactory) : ExternalLocationProviderFactory {
- private val locationProviders = ConcurrentHashMap<String, ExternalLocationProvider>()
+ private val locationProviders = ConcurrentHashMap<String, CacheWrapper>()
override fun getExternalLocationProvider(param: String): ExternalLocationProvider? =
- locationProviders.getOrPut(param) { ext.getExternalLocationProvider(param) }
-} \ No newline at end of file
+ locationProviders.getOrPut(param) { CacheWrapper(ext.getExternalLocationProvider(param)) }.provider
+}
+
+private class CacheWrapper(val provider: ExternalLocationProvider?) \ No newline at end of file