aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/base-test-utils/src/main/kotlin/utils
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-26 16:56:39 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commit732d181e4908ed0ddc513e305addc71560c0e109 (patch)
tree740c3ebe3fa05c3702b30faf07c4f6f87c97e432 /plugins/base/base-test-utils/src/main/kotlin/utils
parentf0524ce475695be163683cd1fdda2fab58ac0161 (diff)
downloaddokka-732d181e4908ed0ddc513e305addc71560c0e109.tar.gz
dokka-732d181e4908ed0ddc513e305addc71560c0e109.tar.bz2
dokka-732d181e4908ed0ddc513e305addc71560c0e109.zip
Let root package be represented as [root] to the user
Diffstat (limited to 'plugins/base/base-test-utils/src/main/kotlin/utils')
-rw-r--r--plugins/base/base-test-utils/src/main/kotlin/utils/TestOutputWriter.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/base/base-test-utils/src/main/kotlin/utils/TestOutputWriter.kt b/plugins/base/base-test-utils/src/main/kotlin/utils/TestOutputWriter.kt
index 00b865b4..67e62c36 100644
--- a/plugins/base/base-test-utils/src/main/kotlin/utils/TestOutputWriter.kt
+++ b/plugins/base/base-test-utils/src/main/kotlin/utils/TestOutputWriter.kt
@@ -3,6 +3,7 @@ package utils
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.renderers.OutputWriter
import org.jetbrains.dokka.plugability.DokkaPlugin
+import java.util.*
class TestOutputWriterPlugin(failOnOverwrite: Boolean = true) : DokkaPlugin() {
val writer = TestOutputWriter(failOnOverwrite)
@@ -19,7 +20,7 @@ class TestOutputWriterPlugin(failOnOverwrite: Boolean = true) : DokkaPlugin() {
class TestOutputWriter(private val failOnOverwrite: Boolean = true) : OutputWriter {
val contents: Map<String, String> get() = _contents
- private val _contents = mutableMapOf<String, String>()
+ private val _contents = Collections.synchronizedMap(mutableMapOf<String, String>())
override suspend fun write(path: String, text: String, ext: String) {
val fullPath = "$path$ext"
_contents.putIfAbsent(fullPath, text)?.also {