aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2016-03-31 15:38:07 +0200
committerDmitry Jemerov <yole@jetbrains.com>2016-03-31 15:38:20 +0200
commit6051ab5051be76d6c830a9996901bfbb9e1f901e (patch)
tree458869901d1157960995e67f910093de06f494bf /core/src/main
parent8e5aaee1c45753bc9a16bf4bff2387ef0fd70661 (diff)
downloaddokka-6051ab5051be76d6c830a9996901bfbb9e1f901e.tar.gz
dokka-6051ab5051be76d6c830a9996901bfbb9e1f901e.tar.bz2
dokka-6051ab5051be76d6c830a9996901bfbb9e1f901e.zip
Fix the implementation of containingClass() in javadoc adapters. Resolves #57
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/javadoc/docbase.kt12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/src/main/kotlin/javadoc/docbase.kt b/core/src/main/kotlin/javadoc/docbase.kt
index db5f201e..4298316f 100644
--- a/core/src/main/kotlin/javadoc/docbase.kt
+++ b/core/src/main/kotlin/javadoc/docbase.kt
@@ -156,12 +156,10 @@ class ProgramElementAdapter(module: ModuleNodeAdapter, node: DocumentationNode)
var owner = node.owner
while (owner != null) {
- when (owner.kind) {
- NodeKind.Class,
- NodeKind.Interface,
- NodeKind.Enum -> return ClassDocumentationNodeAdapter(module, owner)
- else -> owner = owner.owner
+ if (owner.kind in NodeKind.classLike) {
+ return ClassDocumentationNodeAdapter(module, owner)
}
+ owner = owner.owner
}
return null
@@ -346,6 +344,10 @@ open class ExecutableMemberAdapter(module: ModuleNodeAdapter, node: Documentatio
class ConstructorAdapter(module: ModuleNodeAdapter, node: DocumentationNode) : ExecutableMemberAdapter(module, node), ConstructorDoc {
override fun name(): String = node.owner?.name ?: throw IllegalStateException("No owner for $node")
+
+ override fun containingClass(): ClassDoc? {
+ return super.containingClass()
+ }
}
class MethodAdapter(module: ModuleNodeAdapter, node: DocumentationNode) : DocumentationNodeAdapter(module, node), ExecutableMemberDoc by ExecutableMemberAdapter(module, node), MethodDoc {