diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-08-11 21:47:26 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-19 13:34:10 +0200 |
commit | 852a6ce6c0f43c9b2044320dcceb4c6cc0a3b302 (patch) | |
tree | fb95be79e816769ca5305cf3a601348549000c6d /plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt | |
parent | 822653f017fa58352148e1c586690debb6773965 (diff) | |
download | dokka-852a6ce6c0f43c9b2044320dcceb4c6cc0a3b302.tar.gz dokka-852a6ce6c0f43c9b2044320dcceb4c6cc0a3b302.tar.bz2 dokka-852a6ce6c0f43c9b2044320dcceb4c6cc0a3b302.zip |
Refactor location providers
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt deleted file mode 100644 index 442d2e6d..00000000 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProviderFactory.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.jetbrains.dokka.base.resolvers.local - -import org.jetbrains.dokka.pages.MultimoduleRootPageNode -import org.jetbrains.dokka.pages.RootPageNode -import org.jetbrains.dokka.plugability.DokkaContext -import java.util.* -import java.util.concurrent.ConcurrentHashMap - -class DefaultLocationProviderFactory(private val context: DokkaContext) : LocationProviderFactory { - - private val cache = ConcurrentHashMap<CacheWrapper, LocationProvider>() - - override fun getLocationProvider(pageNode: RootPageNode) = cache.computeIfAbsent(CacheWrapper(pageNode)) { - if (pageNode.children.first() is MultimoduleRootPageNode) MultimoduleLocationProvider(pageNode, context) - else DefaultLocationProvider(pageNode, context) - } -} - -private class CacheWrapper(val pageNode: RootPageNode) { - override fun equals(other: Any?) = other is CacheWrapper && other.pageNode == this.pageNode - - override fun hashCode() = System.identityHashCode(pageNode) -}
\ No newline at end of file |