Skip to content

Commit 38e09dd

Browse files
Fix compilation errors due to explicit api mode (#3162)
#3143 wasn't based on latest master, so the checks were green, but then the compilation failed due to explicit API mode
1 parent 2090723 commit 38e09dd

File tree

2 files changed

+9
-33
lines changed

2 files changed

+9
-33
lines changed

subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/JvmDependenciesIndexImpl.kt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
/*
2-
* Copyright 2010-2016 JetBrains s.r.o.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
153
*/
164

175
/**
@@ -40,7 +28,7 @@ import kotlin.concurrent.withLock
4028
// speeds up finding files/classes in classpath/java source roots
4129
// TODO: KT-58327 needs to be adapted/removed if we want compiler to be multithreaded
4230
// the main idea of this class is for each package to store roots which contains it to avoid excessive file system traversal
43-
class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex {
31+
public class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex {
4432
private val lock = ReentrantLock()
4533

4634
//these fields are computed based on _roots passed to constructor which are filled in later
@@ -76,7 +64,7 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex {
7664
// helps improve several scenarios, LazyJavaResolverContext.findClassInJava being the most important
7765
private var lastClassSearch: Pair<FindClassRequest, SearchResult>? = null
7866

79-
override val indexedRoots by lazy { roots.asSequence() }
67+
override val indexedRoots: Sequence<JavaRoot> by lazy { roots.asSequence() }
8068

8169
private val packageCache: Array<out MutableMap<String, VirtualFile?>> by lazy {
8270
Array(roots.size) { THashMap<String, VirtualFile?>() }
@@ -266,4 +254,4 @@ class JvmDependenciesIndexImpl(_roots: List<JavaRoot>) : JvmDependenciesIndex {
266254

267255
object NotFound : SearchResult()
268256
}
269-
}
257+
}

subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/KotlinCliJavaFileManagerImpl.kt

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
/*
2-
* Copyright 2010-2015 JetBrains s.r.o.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
2+
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
153
*/
164

175
/**
@@ -53,7 +41,7 @@ import org.jetbrains.kotlin.util.PerformanceCounter
5341
// TODO: do not inherit from CoreJavaFileManager to avoid accidental usage of its methods which do not use caches/indices
5442
// Currently, the only relevant usage of this class as CoreJavaFileManager is at CoreJavaDirectoryService.getPackage,
5543
// which is indirectly invoked from PsiPackage.getSubPackages
56-
class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJavaFileManager(myPsiManager), KotlinCliJavaFileManager {
44+
public class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJavaFileManager(myPsiManager), KotlinCliJavaFileManager {
5745
private val perfCounter = PerformanceCounter.create("Find Java class")
5846
private lateinit var index: JvmDependenciesIndex
5947
private lateinit var singleJavaFileRootsIndex: SingleJavaFileRootsIndex
@@ -62,7 +50,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ
6250
private val allScope = GlobalSearchScope.allScope(myPsiManager.project)
6351
private var usePsiClassFilesReading = false
6452

65-
fun initialize(
53+
public fun initialize(
6654
index: JvmDependenciesIndex,
6755
packagePartProviders: List<JvmPackagePartProvider>,
6856
singleJavaFileRootsIndex: SingleJavaFileRootsIndex,
@@ -92,7 +80,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ
9280
private val binaryCache: MutableMap<ClassId, JavaClass?> = THashMap()
9381
private val signatureParsingComponent = BinaryClassSignatureParser()
9482

95-
fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? = findClass(JavaClassFinder.Request(classId), searchScope)
83+
public fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? = findClass(JavaClassFinder.Request(classId), searchScope)
9684

9785
override fun findClass(request: JavaClassFinder.Request, searchScope: GlobalSearchScope): JavaClass? {
9886
val (classId, classFileContentFromRequest, outerClassFromRequest) = request
@@ -266,7 +254,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ
266254

267255
override fun getNonTrivialPackagePrefixes(): Collection<String> = emptyList()
268256

269-
companion object {
257+
public companion object {
270258
private val LOG = Logger.getInstance(KotlinCliJavaFileManagerImpl::class.java)
271259

272260
private fun findClassInPsiFile(classNameWithInnerClassesDotSeparated: String, file: PsiClassOwner): PsiClass? {

0 commit comments

Comments
 (0)