diff options
author | Eugene Petrenko <eugene.petrenko@jetbrains.com> | 2018-09-23 15:49:11 +0200 |
---|---|---|
committer | Eugene Petrenko <eugene.petrenko@jetbrains.com> | 2018-09-23 15:49:11 +0200 |
commit | 835c3b1b6f76fff29290949cc14cad2a2b26b265 (patch) | |
tree | 17325885590ff87d7955c1407506e30246029c9f /core/src | |
parent | d7fdbb7b4ab13d05bbc8ea796518e75ecab97fb7 (diff) | |
download | dokka-835c3b1b6f76fff29290949cc14cad2a2b26b265.tar.gz dokka-835c3b1b6f76fff29290949cc14cad2a2b26b265.tar.bz2 dokka-835c3b1b6f76fff29290949cc14cad2a2b26b265.zip |
less noise from an attempt to write file several times
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Generation/FileGenerator.kt | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/core/src/main/kotlin/Generation/FileGenerator.kt b/core/src/main/kotlin/Generation/FileGenerator.kt index 8a282ef1..c90d0735 100644 --- a/core/src/main/kotlin/Generation/FileGenerator.kt +++ b/core/src/main/kotlin/Generation/FileGenerator.kt @@ -25,27 +25,11 @@ class FileGenerator @Inject constructor(@Named("outputDir") override val root: F //TODO: it opens the way to safely track all files created //TODO: to make sure no files were overwritten by mistake //TODO: also, the NodeLocationAwareGenerator should be removed - val stack = "$context\n" + try { - throw Error() - } catch (t: Throwable) { - StringWriter().use { ww -> - PrintWriter(ww).use { - t.printStackTrace(it) - } - ww.toString().split("[\r\n]+").asSequence().drop(1).take(3).joinToString("\n") {" $it"} - } - } - val writes = createdFiles.getOrDefault(this, listOf()) + stack + val writes = createdFiles.getOrDefault(this, listOf()) + context createdFiles[this] = writes if (writes.size > 1) { println("ERROR. An attempt to write ${this.relativeTo(root)} several times!") - - createdFiles[this] = writes + stack - for (call in writes + stack) { - println(call) - } - println() return } |