From 6b2e9382a298045c1d3c39bdb3c33cdc0eebf38d Mon Sep 17 00:00:00 2001 From: Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> Date: Tue, 6 Apr 2021 15:34:39 +0200 Subject: Fix some compiler warnings (#1812) --- core/src/main/kotlin/DokkaBootstrapImpl.kt | 10 +++++----- core/src/main/kotlin/pages/PageNodes.kt | 2 +- core/src/main/kotlin/plugability/DokkaJavaPlugin.kt | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'core/src/main/kotlin') diff --git a/core/src/main/kotlin/DokkaBootstrapImpl.kt b/core/src/main/kotlin/DokkaBootstrapImpl.kt index 6d6d8698..67dee9ae 100644 --- a/core/src/main/kotlin/DokkaBootstrapImpl.kt +++ b/core/src/main/kotlin/DokkaBootstrapImpl.kt @@ -9,18 +9,18 @@ import java.util.function.BiConsumer fun parsePerPackageOptions(args: List): List = args.map { it.split(",") }.map { val matchingRegex = it.first() - val args = it.subList(1, it.size) + val options = it.subList(1, it.size) - val deprecated = args.find { it.endsWith("skipDeprecated") }?.startsWith("+") + val deprecated = options.find { it.endsWith("skipDeprecated") }?.startsWith("+") ?: DokkaDefaults.skipDeprecated - val reportUndocumented = args.find { it.endsWith("reportUndocumented") }?.startsWith("+") + val reportUndocumented = options.find { it.endsWith("reportUndocumented") }?.startsWith("+") ?: DokkaDefaults.reportUndocumented - val privateApi = args.find { it.endsWith("includeNonPublic") }?.startsWith("+") + val privateApi = options.find { it.endsWith("includeNonPublic") }?.startsWith("+") ?: DokkaDefaults.includeNonPublic - val suppress = args.find { it.endsWith("suppress") }?.startsWith("+") + val suppress = options.find { it.endsWith("suppress") }?.startsWith("+") ?: DokkaDefaults.suppress PackageOptionsImpl( diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 83468671..9fc4d6e8 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -142,7 +142,7 @@ class MemberPageNode( override val embeddedResources: List = listOf() ) : MemberPage { override fun modified(name: String, children: List): MemberPageNode = - modified(name = name, content = this.content, children = children) as MemberPageNode + modified(name = name, content = this.content, children = children) override fun modified( name: String, diff --git a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt index 1d8ea8aa..4c621703 100644 --- a/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt +++ b/core/src/main/kotlin/plugability/DokkaJavaPlugin.kt @@ -28,8 +28,8 @@ data class ExtensionBuilder internal constructor( private val name: String, private val ext: ExtensionPoint, private val action: LazyEvaluated, - private val before: List>, - private val after: List>, + private val before: List>, + private val after: List>, private val override: OverrideKind = OverrideKind.None, private val conditions: List<(DokkaConfiguration) -> Boolean> ){ @@ -62,11 +62,11 @@ data class ExtensionBuilder internal constructor( abstract class DokkaJavaPlugin: DokkaPlugin() { - fun plugin(clazz: Class): T? = + fun plugin(clazz: Class): T = context?.plugin(clazz.kotlin) ?: throwIllegalQuery() fun extend(func: (ExtensionBuilderStart) -> ExtensionBuilder): Lazy> = lazy { func(ExtensionBuilderStart()).build() }.also { unsafeInstall(it) } -} \ No newline at end of file +} -- cgit