diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2022-04-29 15:03:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 15:03:08 +0300 |
commit | 8c218ff4dd5f970233c43845c19299fc74256389 (patch) | |
tree | b6818183ce8faa2c58d6571ca1c86aa28d4f0431 /kotlin-analysis/src/main/kotlin/org/jetbrains/dokka | |
parent | 84aacad29982240ae367b21e9d283d38dab672ae (diff) | |
download | dokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.gz dokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.bz2 dokka-8c218ff4dd5f970233c43845c19299fc74256389.zip |
Enable warnings as errors and fix all warnings (#2451)
* Enable warnings as errors and fix all warnings
* Enable skip-metadata-version-check compiler setting
Diffstat (limited to 'kotlin-analysis/src/main/kotlin/org/jetbrains/dokka')
4 files changed, 22 insertions, 9 deletions
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt index 452b821c..46916705 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt @@ -114,8 +114,11 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl JavadocTagInfo.EP_NAME, JavadocTagInfo::class.java ) + @Suppress("DEPRECATION") + val extensionArea = Extensions.getRootArea() + CoreApplicationEnvironment.registerExtensionPoint( - Extensions.getRootArea(), + extensionArea, CustomJavadocTagProvider.EP_NAME, CustomJavadocTagProvider::class.java ) @@ -588,8 +591,12 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl instances: List<T>, disposable: Disposable ) { - if (Extensions.getRootArea().hasExtensionPoint(appExtension.extensionPointName)) + @Suppress("DEPRECATION") + val extensionArea = Extensions.getRootArea() + + if (extensionArea.hasExtensionPoint(appExtension.extensionPointName)) { return + } appExtension.registerExtensionPoint() instances.forEach { extension -> appExtension.registerExtension(extension, disposable) } diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt index c0fafc25..b278ef6e 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/DokkaResolutionFacade.kt @@ -75,6 +75,7 @@ class DokkaResolutionFacade( if (key != element) { throw UnsupportedOperationException() } + @Suppress("UNCHECKED_CAST") return when { slice == BindingContext.DECLARATION_TO_DESCRIPTOR -> descriptor as V slice == BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER && (element as KtParameter).hasValOrVar() -> descriptor as V diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/JvmDependenciesIndexImpl.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/JvmDependenciesIndexImpl.kt index 3632337a..c64f2fab 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/JvmDependenciesIndexImpl.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/JvmDependenciesIndexImpl.kt @@ -20,7 +20,7 @@ import com.intellij.ide.highlighter.JavaClassFileType import com.intellij.ide.highlighter.JavaFileType import com.intellij.openapi.vfs.VfsUtilCore import com.intellij.openapi.vfs.VirtualFile -import com.intellij.util.containers.IntArrayList +import it.unimi.dsi.fastutil.ints.IntArrayList import gnu.trove.THashMap import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName @@ -54,7 +54,7 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex { Cache().apply { roots.indices.forEach(rootIndices::add) rootIndices.add(maxIndex) - rootIndices.trimToSize() + rootIndices.trim() } } @@ -121,8 +121,8 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex { // NOTE: indices manipulation instead of using caches.reversed() is here for performance reasons for (cacheIndex in caches.lastIndex downTo 0) { val cacheRootIndices = caches[cacheIndex].rootIndices - for (i in 0 until cacheRootIndices.size()) { - val rootIndex = cacheRootIndices[i] + for (i in 0 until cacheRootIndices.size) { + val rootIndex = cacheRootIndices.getInt(i) if (rootIndex <= processedRootsUpTo) continue // roots with those indices have been processed by now val directoryInRoot = @@ -138,7 +138,12 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex { } } } - processedRootsUpTo = if (cacheRootIndices.isEmpty) processedRootsUpTo else cacheRootIndices.get(cacheRootIndices.size() - 1) + processedRootsUpTo = + if (cacheRootIndices.isEmpty) { + processedRootsUpTo + } else { + cacheRootIndices.getInt(cacheRootIndices.size - 1) + } } if (request is FindClassRequest) { @@ -160,7 +165,7 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex { for (i in (fillCachesAfter + 1) until cachesPath.size) { // we all know roots that contain this package by now cachesPath[i].rootIndices.add(maxIndex) - cachesPath[i].rootIndices.trimToSize() + cachesPath[i].rootIndices.trim() } return null } diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt index 336b7566..22660ecc 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/TypeReferenceFactory.kt @@ -23,7 +23,7 @@ fun TypeReference.Companion.from(d: ReceiverParameterDescriptor): TypeReference? fun TypeReference.Companion.from(d: ValueParameterDescriptor): TypeReference = fromPossiblyNullable(d.type, emptyList()) -fun TypeReference.Companion.from(p: PsiClass) = TypeReference +fun TypeReference.Companion.from(@Suppress("UNUSED_PARAMETER") p: PsiClass) = TypeReference private fun TypeReference.Companion.fromPossiblyNullable(t: KotlinType, paramTrace: List<KotlinType>): TypeReference = fromPossiblyRecursive(t, paramTrace).let { if (t.isMarkedNullable) Nullable(it) else it } |