diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/JvmDependenciesIndexImpl.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/JvmDependenciesIndexImpl.kt index 7cc41600bd..da18a95286 100644 --- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/JvmDependenciesIndexImpl.kt +++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/JvmDependenciesIndexImpl.kt @@ -1,17 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ /** @@ -40,7 +28,7 @@ import kotlin.concurrent.withLock // speeds up finding files/classes in classpath/java source roots // TODO: KT-58327 needs to be adapted/removed if we want compiler to be multithreaded // the main idea of this class is for each package to store roots which contains it to avoid excessive file system traversal -class JvmDependenciesIndexImpl(_roots: List) : JvmDependenciesIndex { +public class JvmDependenciesIndexImpl(_roots: List) : JvmDependenciesIndex { private val lock = ReentrantLock() //these fields are computed based on _roots passed to constructor which are filled in later @@ -76,7 +64,7 @@ class JvmDependenciesIndexImpl(_roots: List) : JvmDependenciesIndex { // helps improve several scenarios, LazyJavaResolverContext.findClassInJava being the most important private var lastClassSearch: Pair? = null - override val indexedRoots by lazy { roots.asSequence() } + override val indexedRoots: Sequence by lazy { roots.asSequence() } private val packageCache: Array> by lazy { Array(roots.size) { THashMap() } @@ -266,4 +254,4 @@ class JvmDependenciesIndexImpl(_roots: List) : JvmDependenciesIndex { object NotFound : SearchResult() } -} \ No newline at end of file +} diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinCliJavaFileManagerImpl.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinCliJavaFileManagerImpl.kt index deb092744e..3d3406727e 100644 --- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinCliJavaFileManagerImpl.kt +++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinCliJavaFileManagerImpl.kt @@ -1,17 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ /** @@ -53,7 +41,7 @@ import org.jetbrains.kotlin.util.PerformanceCounter // TODO: do not inherit from CoreJavaFileManager to avoid accidental usage of its methods which do not use caches/indices // Currently, the only relevant usage of this class as CoreJavaFileManager is at CoreJavaDirectoryService.getPackage, // which is indirectly invoked from PsiPackage.getSubPackages -class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJavaFileManager(myPsiManager), KotlinCliJavaFileManager { +public class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJavaFileManager(myPsiManager), KotlinCliJavaFileManager { private val perfCounter = PerformanceCounter.create("Find Java class") private lateinit var index: JvmDependenciesIndex private lateinit var singleJavaFileRootsIndex: SingleJavaFileRootsIndex @@ -62,7 +50,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ private val allScope = GlobalSearchScope.allScope(myPsiManager.project) private var usePsiClassFilesReading = false - fun initialize( + public fun initialize( index: JvmDependenciesIndex, packagePartProviders: List, singleJavaFileRootsIndex: SingleJavaFileRootsIndex, @@ -92,7 +80,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ private val binaryCache: MutableMap = THashMap() private val signatureParsingComponent = BinaryClassSignatureParser() - fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? = findClass(JavaClassFinder.Request(classId), searchScope) + public fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? = findClass(JavaClassFinder.Request(classId), searchScope) override fun findClass(request: JavaClassFinder.Request, searchScope: GlobalSearchScope): JavaClass? { val (classId, classFileContentFromRequest, outerClassFromRequest) = request @@ -266,7 +254,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ override fun getNonTrivialPackagePrefixes(): Collection = emptyList() - companion object { + public companion object { private val LOG = Logger.getInstance(KotlinCliJavaFileManagerImpl::class.java) private fun findClassInPsiFile(classNameWithInnerClassesDotSeparated: String, file: PsiClassOwner): PsiClass? {