From f5b7797255576e5f1c230e2ca3fcb5f4e602387c Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 21 Feb 2022 22:01:06 +0800 Subject: Code cleanups (#2165) --- .../src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt | 2 +- .../kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt | 2 +- .../main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt | 2 +- .../kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/javadoc/src') diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt index 4dbd5ca7..96bcec70 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt @@ -39,7 +39,7 @@ open class JavadocPageCreator(context: DokkaContext) { fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? = c.highestJvmSourceSet?.let { jvm -> - var children = c.classlikes.mapNotNull { pageForClasslike(it) } + val children = c.classlikes.mapNotNull { pageForClasslike(it) } JavadocClasslikePageNode( name = c.dri.classNames.orEmpty(), content = contentForClasslike(c), diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt index 6115cbff..2f5caa1c 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt @@ -85,7 +85,7 @@ data class TitleNode( val kind: Kind, override val sourceSets: Set ) : JavadocContentNode(dri, kind, sourceSets) { - override fun hasAnyContent(): Boolean = !title.isBlank() || !version.isNullOrBlank() || subtitle.isNotEmpty() + override fun hasAnyContent(): Boolean = title.isNotBlank() || !version.isNullOrBlank() || subtitle.isNotEmpty() override fun withNewExtras(newExtras: PropertyContainer): TitleNode = this diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt index 6bc0d9fd..c04c7538 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt @@ -51,7 +51,7 @@ object TreeViewInstaller : PageTransformer { private fun installPackageTreeNode(node: JavadocPackagePageNode, root: RootPageNode): JavadocPackagePageNode { val packageTree = TreeViewPage( - name = "${node.name}", + name = node.name, packages = null, classes = node.children.filterIsInstance(), dri = node.dri, diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt index 7abbeca8..94af07af 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt @@ -128,7 +128,7 @@ class JavadocLocationTest : BaseAbstractTest() { locationTestInline { rootPageNode, dokkaContext -> val locationProvider = dokkaContext.plugin().querySingle { locationProviderFactory } .getLocationProvider(rootPageNode) - val packageNode = rootPageNode.firstChildOfType() { it.name == "javadoc.test" } + val packageNode = rootPageNode.firstChildOfType { it.name == "javadoc.test" } val packagePath = locationProvider.resolve(packageNode) assertEquals("javadoc/test/package-summary", packagePath) -- cgit