From 04b4c725364e33617a7607493e39308b0ba79d58 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 10 Jun 2020 12:42:40 +0200 Subject: Fix tests on javadoc --- plugins/javadoc/src/main/kotlin/javadoc/pages/JavadocPageNodes.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/javadoc/src') 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 = 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>> = 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() { -- cgit