Drop outdated code in JDR related to static class members
This commit is contained in:
+7
-17
@@ -24,10 +24,8 @@ import org.jetbrains.jet.lang.resolve.java.lazy.LazyJavaResolverContext
|
|||||||
import org.jetbrains.jet.lang.resolve.java.lazy.withTypes
|
import org.jetbrains.jet.lang.resolve.java.lazy.withTypes
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaPackage
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaPackage
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName
|
import org.jetbrains.jet.lang.resolve.name.FqName
|
||||||
import org.jetbrains.jet.utils.flatten
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaClass
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaClass
|
||||||
import org.jetbrains.kotlin.util.inn
|
import org.jetbrains.kotlin.util.inn
|
||||||
import org.jetbrains.kotlin.util.sure
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.lazy.findClassInJava
|
import org.jetbrains.jet.lang.resolve.java.lazy.findClassInJava
|
||||||
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils
|
import org.jetbrains.jet.lang.resolve.java.PackageClassUtils
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope
|
||||||
@@ -138,16 +136,12 @@ public class LazyPackageFragmentScopeForJavaPackage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val _subPackages = c.storageManager.createRecursionTolerantLazyValue(
|
private val _subPackages = c.storageManager.createRecursionTolerantLazyValue(
|
||||||
{
|
{
|
||||||
listOf(
|
jPackage.getSubPackages().map { sp -> sp.getFqName() }
|
||||||
// We do not filter by hasStaticMembers() because it's slow (e.g. it triggers light class generation),
|
},
|
||||||
// and there's no harm in having some names in the result that can not be resolved
|
// This breaks infinite recursion between loading Java descriptors and building light classes
|
||||||
jPackage.getClasses().map { c -> c.getFqName().sure("Toplevel class has no fqName: $c") },
|
onRecursiveCall = listOf()
|
||||||
jPackage.getSubPackages().map { sp -> sp.getFqName() }
|
)
|
||||||
).flatten()
|
|
||||||
},
|
|
||||||
// This breaks infinite recursion between loading Java descriptors and building light classes
|
|
||||||
onRecursiveCall = listOf())
|
|
||||||
|
|
||||||
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
|
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
|
||||||
val samConstructor = getClassifier(name)?.createSamConstructor()
|
val samConstructor = getClassifier(name)?.createSamConstructor()
|
||||||
@@ -172,11 +166,7 @@ public class LazyJavaStaticClassScope(
|
|||||||
override fun getAllClassNames(): Collection<Name> = listOf()
|
override fun getAllClassNames(): Collection<Name> = listOf()
|
||||||
override fun getClassifier(name: Name): ClassifierDescriptor? = null
|
override fun getClassifier(name: Name): ClassifierDescriptor? = null
|
||||||
|
|
||||||
// We do not filter by hasStaticMembers() because it's slow (e.g. it triggers light class generation),
|
override fun getSubPackages(): Collection<FqName> = listOf()
|
||||||
// and there's no harm in having some names in the result that can not be resolved
|
|
||||||
override fun getSubPackages(): Collection<FqName> = jClass.getInnerClasses().stream()
|
|
||||||
.filter { c -> c.isStatic() }
|
|
||||||
.map { c -> c.getFqName().sure("Nested class has no fqName: $c") }.toList()
|
|
||||||
|
|
||||||
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
|
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
|
||||||
//NOTE: assuming that all sam constructors are created for interfaces which are static and should be placed in this scope
|
//NOTE: assuming that all sam constructors are created for interfaces which are static and should be placed in this scope
|
||||||
|
|||||||
Reference in New Issue
Block a user