From 15b408bb59546a65a9a4f3f47067b4fa174702be Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 15 Oct 2018 19:03:39 +0300 Subject: Fix sinceKotlin updating & default setting --- core/src/main/kotlin/Kotlin/DocumentationBuilder.kt | 4 +++- core/src/main/kotlin/Model/DocumentationNode.kt | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'core/src') diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt index 3fb22589..205b44bd 100644 --- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt +++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt @@ -290,7 +290,9 @@ class DocumentationBuilder } fun DocumentationNode.appendDefaultSinceKotlin() { - sinceKotlin = passConfiguration.sinceKotlin + if (sinceKotlin == null) { + sinceKotlin = passConfiguration.sinceKotlin + } } fun DocumentationNode.appendModifiers(descriptor: DeclarationDescriptor) { diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 84f9a453..617816b3 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -122,8 +122,10 @@ open class DocumentationNode(val name: String, var sinceKotlin: String? get() = references(RefKind.SinceKotlin).singleOrNull()?.to?.name set(value) { - if(value == null) return dropReferences { it.kind == RefKind.SinceKotlin } - append(DocumentationNode(value, Content.Empty, NodeKind.Value), RefKind.SinceKotlin) + dropReferences { it.kind == RefKind.SinceKotlin } + if (value != null) { + append(DocumentationNode(value, Content.Empty, NodeKind.Value), RefKind.SinceKotlin) + } } val supertypes: List -- cgit