From 76986f850f04fe48b7a96ac51bcd50f0a7c1fada Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 5 Sep 2014 15:30:52 +0400 Subject: [PATCH] Drop outdated code in JDR related to static class members --- .../lazy/descriptors/LazyJavaStaticScope.kt | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/descriptors/LazyJavaStaticScope.kt b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/descriptors/LazyJavaStaticScope.kt index ca7c8773368..bb103ac974d 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/descriptors/LazyJavaStaticScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/jet/lang/resolve/java/lazy/descriptors/LazyJavaStaticScope.kt @@ -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.structure.JavaPackage 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.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.PackageClassUtils import org.jetbrains.jet.lang.resolve.scopes.JetScope @@ -138,16 +136,12 @@ public class LazyPackageFragmentScopeForJavaPackage( } private val _subPackages = c.storageManager.createRecursionTolerantLazyValue( - { - listOf( - // 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 - jPackage.getClasses().map { c -> c.getFqName().sure("Toplevel class has no fqName: $c") }, - jPackage.getSubPackages().map { sp -> sp.getFqName() } - ).flatten() - }, - // This breaks infinite recursion between loading Java descriptors and building light classes - onRecursiveCall = listOf()) + { + jPackage.getSubPackages().map { sp -> sp.getFqName() } + }, + // This breaks infinite recursion between loading Java descriptors and building light classes + onRecursiveCall = listOf() + ) override fun computeNonDeclaredFunctions(result: MutableCollection, name: Name) { val samConstructor = getClassifier(name)?.createSamConstructor() @@ -172,11 +166,7 @@ public class LazyJavaStaticClassScope( override fun getAllClassNames(): Collection = listOf() override fun getClassifier(name: Name): ClassifierDescriptor? = null - // 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 - override fun getSubPackages(): Collection = jClass.getInnerClasses().stream() - .filter { c -> c.isStatic() } - .map { c -> c.getFqName().sure("Nested class has no fqName: $c") }.toList() + override fun getSubPackages(): Collection = listOf() override fun computeNonDeclaredFunctions(result: MutableCollection, name: Name) { //NOTE: assuming that all sam constructors are created for interfaces which are static and should be placed in this scope