diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-06-10 12:42:40 +0200 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-06-23 02:19:14 +0200 |
commit | 04b4c725364e33617a7607493e39308b0ba79d58 (patch) | |
tree | 6522f9e2650287731a2fed98a03f95af76a010a3 /plugins/javadoc/src/main/kotlin | |
parent | 8f1bc3565e85281ee242a5620496aa3aedefa9c7 (diff) | |
download | dokka-04b4c725364e33617a7607493e39308b0ba79d58.tar.gz dokka-04b4c725364e33617a7607493e39308b0ba79d58.tar.bz2 dokka-04b4c725364e33617a7607493e39308b0ba79d58.zip |
Fix tests on javadoc
Diffstat (limited to 'plugins/javadoc/src/main/kotlin')
-rw-r--r-- | plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt b/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt index a1bffdc2..118bc4d3 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt @@ -239,7 +239,7 @@ class TreeViewPage( else { listOf(node.copy(children = node.children.flatMap (::classTreeRec))) } - fun classTree(node: InheritanceNode) = classTreeRec(node).single() + fun classTree(node: InheritanceNode) = classTreeRec(node).singleOrNull() fun interfaceTreeRec(node: InheritanceNode): List<InheritanceNode> = if (node.isInterface) { listOf(node.copy(children = node.children.filter { it.isInterface })) @@ -248,7 +248,7 @@ class TreeViewPage( node.children.flatMap(::interfaceTreeRec) } - fun interfaceTree(node: InheritanceNode) = interfaceTreeRec(node).first() // TODO.single() + fun interfaceTree(node: InheritanceNode) = interfaceTreeRec(node).firstOrNull() // TODO.single() fun gatherPsiClasses(psi: PsiClass): List<Pair<PsiClass, List<PsiClass>>> = psi.supers.toList().let { l -> listOf(psi to l) + l.flatMap { gatherPsiClasses(it) } @@ -303,7 +303,7 @@ class TreeViewPage( collect(it.value.dri) } - return rootNodes.let { Pair(it.map(::classTree), it.map(::interfaceTree)) } + return rootNodes.let { Pair(it.mapNotNull(::classTree), it.mapNotNull(::interfaceTree)) } } private fun generateInterfaceGraph() { |