diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt index 0608c4b8f82..221809489dc 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/CollectionStubMethodGenerator.kt @@ -38,6 +38,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.getAllSuperclassesWithoutAny import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeUniqueAsSequence import org.jetbrains.kotlin.resolve.jvm.diagnostics.CollectionStub import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodGenericSignature +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.checker.KotlinTypeChecker import org.jetbrains.kotlin.types.checker.KotlinTypeCheckerImpl @@ -309,8 +310,16 @@ class CollectionStubMethodGenerator( } private fun createSyntheticSubclass(): Pair> { - val child = MutableClassDescriptor(descriptor.containingDeclaration, ClassKind.CLASS, /* isInner = */ false, - /* isExternal */ false, Name.special(""), descriptor.source) + val child = MutableClassDescriptor( + descriptor.containingDeclaration, + ClassKind.CLASS, + /* isInner = */ false, + /* isExternal */ false, + Name.special(""), + descriptor.source, + LockBasedStorageManager.NO_LOCKS + ) + child.modality = Modality.FINAL child.visibility = Visibilities.PUBLIC val typeParameters = descriptor.typeConstructor.parameters diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/InnerClassConsumer.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/InnerClassConsumer.kt index 7b37fd96c99..84a70911af0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/InnerClassConsumer.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/InnerClassConsumer.kt @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.load.java.JvmAbi import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.scopes.MemberScope +import org.jetbrains.kotlin.storage.LockBasedStorageManager import java.util.* interface InnerClassConsumer { @@ -38,7 +39,7 @@ interface InnerClassConsumer { val classDescriptorImpl = ClassDescriptorImpl( descriptor, Name.identifier(JvmAbi.DEFAULT_IMPLS_CLASS_NAME), Modality.FINAL, ClassKind.CLASS, Collections.emptyList(), SourceElement.NO_SOURCE, - /* isExternal = */ false) + /* isExternal = */ false, LockBasedStorageManager.NO_LOCKS) classDescriptorImpl.initialize(MemberScope.Empty, emptySet(), null) return classDescriptorImpl diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt index 90ca64536b0..c9dc12ab7aa 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.descriptors.impl.MutablePackageFragmentDescriptor import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.KotlinType class JvmRuntimeTypes(module: ModuleDescriptor, private val languageVersionSettings: LanguageVersionSettings) { @@ -49,7 +50,7 @@ class JvmRuntimeTypes(module: ModuleDescriptor, private val languageVersionSetti classKind: ClassKind = ClassKind.CLASS ): ClassDescriptor = MutableClassDescriptor(packageFragment, classKind, /* isInner = */ false, /* isExternal = */ false, - Name.identifier(name), SourceElement.NO_SOURCE).apply { + Name.identifier(name), SourceElement.NO_SOURCE, LockBasedStorageManager.NO_LOCKS).apply { modality = Modality.FINAL visibility = Visibilities.PUBLIC setTypeParameterDescriptors(emptyList()) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java index ac68eb4b943..a0a1ddace1b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/SamWrapperCodegen.java @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt; +import org.jetbrains.kotlin.storage.LockBasedStorageManager; import org.jetbrains.kotlin.types.KotlinType; import org.jetbrains.kotlin.util.OperatorNameConventions; import org.jetbrains.org.objectweb.asm.MethodVisitor; @@ -90,7 +91,8 @@ public class SamWrapperCodegen { ClassKind.CLASS, Collections.singleton(samType.getType()), SourceElement.NO_SOURCE, - /* isExternal = */ false + /* isExternal = */ false, + LockBasedStorageManager.NO_LOCKS ); // e.g. compare(T, T) SimpleFunctionDescriptor erasedInterfaceFunction = samType.getOriginalAbstractMethod().copy( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticClassDescriptorForLambda.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticClassDescriptorForLambda.kt index fe4fb2b05c4..3ca07f75e92 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticClassDescriptorForLambda.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/SyntheticClassDescriptorForLambda.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.resolve.source.toSourceElement +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.KotlinType class SyntheticClassDescriptorForLambda( @@ -32,7 +33,7 @@ class SyntheticClassDescriptorForLambda( supertypes: Collection, element: KtElement ) : ClassDescriptorImpl(containingDeclaration, name, Modality.FINAL, ClassKind.CLASS, supertypes, element.toSourceElement(), - /* isExternal = */ false) { + /* isExternal = */ false, LockBasedStorageManager.NO_LOCKS) { init { initialize(MemberScope.Empty, emptySet(), null) } diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt index a68b89daecb..780f3ebca72 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt @@ -24,21 +24,23 @@ import org.jetbrains.kotlin.storage.LockBasedStorageManager import java.util.* object JvmPlatform : TargetPlatform("JVM") { - private val defaultImports = LockBasedStorageManager().createMemoizedFunction> { includeKotlinComparisons -> - ArrayList().apply { - addAll(Common.getDefaultImports(includeKotlinComparisons)) + private val defaultImports = LockBasedStorageManager().let { storageManager -> + storageManager.createMemoizedFunction> { includeKotlinComparisons -> + ArrayList().apply { + addAll(Common.getDefaultImports(includeKotlinComparisons)) - add(ImportPath.fromString("java.lang.*")) - add(ImportPath.fromString("kotlin.jvm.*")) + add(ImportPath.fromString("java.lang.*")) + add(ImportPath.fromString("kotlin.jvm.*")) - fun addAllClassifiersFromScope(scope: MemberScope) { - for (descriptor in scope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.ALL_NAME_FILTER)) { - add(ImportPath(DescriptorUtils.getFqNameSafe(descriptor), false)) + fun addAllClassifiersFromScope(scope: MemberScope) { + for (descriptor in scope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.ALL_NAME_FILTER)) { + add(ImportPath(DescriptorUtils.getFqNameSafe(descriptor), false)) + } } - } - for (builtinPackageFragment in JvmBuiltIns(LockBasedStorageManager.NO_LOCKS).builtInsPackageFragmentsImportedByDefault) { - addAllClassifiersFromScope(builtinPackageFragment.getMemberScope()) + for (builtinPackageFragment in JvmBuiltIns(storageManager).builtInsPackageFragmentsImportedByDefault) { + addAllClassifiersFromScope(builtinPackageFragment.getMemberScope()) + } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt index 4de43dda51d..0b2ab2044e6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/KnownDescriptors.kt @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe import org.jetbrains.kotlin.resolve.scopes.MemberScope +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.* open class KnownPackageFragmentDescriptor(moduleDescriptor: ModuleDescriptor, fqName: FqName) : @@ -44,7 +45,7 @@ open class KnownClassDescriptor( fun initialize(declaredTypeParameters: List, supertypes: List) { this.declaredTypeParameters = declaredTypeParameters this.supertypes = supertypes - this.typeConstructor = ClassTypeConstructorImpl(this, declaredTypeParameters, supertypes) + this.typeConstructor = ClassTypeConstructorImpl(this, declaredTypeParameters, supertypes, LockBasedStorageManager.NO_LOCKS) this.defaultType = TypeUtils.makeUnsubstitutedType(this, unsubstitutedMemberScope) } diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/builtins/JvmBuiltInClassDescriptorFactory.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/builtins/JvmBuiltInClassDescriptorFactory.kt index 7de707aab9c..e3eb7461ca3 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/builtins/JvmBuiltInClassDescriptorFactory.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/builtins/JvmBuiltInClassDescriptorFactory.kt @@ -36,7 +36,7 @@ class JvmBuiltInClassDescriptorFactory( ClassDescriptorImpl( computeContainingDeclaration(moduleDescriptor), CLONEABLE_NAME, Modality.ABSTRACT, ClassKind.INTERFACE, listOf(moduleDescriptor.builtIns.anyType), - SourceElement.NO_SOURCE, /* isExternal = */ false + SourceElement.NO_SOURCE, /* isExternal = */ false, storageManager ).apply { initialize(CloneableClassScope(storageManager, this), emptySet(), null) } diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/kotlin/JvmBuiltInsSettings.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/kotlin/JvmBuiltInsSettings.kt index b0185d6e0f0..5bc85d85fd0 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/kotlin/JvmBuiltInsSettings.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/kotlin/JvmBuiltInsSettings.kt @@ -91,7 +91,7 @@ open class JvmBuiltInsSettings( val mockSerializableClass = ClassDescriptorImpl( mockJavaIoPackageFragment, Name.identifier("Serializable"), Modality.ABSTRACT, ClassKind.INTERFACE, superTypes, - SourceElement.NO_SOURCE, /* isExternal = */ false + SourceElement.NO_SOURCE, /* isExternal = */ false, this ) mockSerializableClass.initialize(MemberScope.Empty, emptySet(), null) diff --git a/core/descriptors/src/org/jetbrains/kotlin/builtins/suspendFunctionTypes.kt b/core/descriptors/src/org/jetbrains/kotlin/builtins/suspendFunctionTypes.kt index 7a4f9f46eb7..dbab6a8ed71 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/builtins/suspendFunctionTypes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/builtins/suspendFunctionTypes.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.asTypeProjection import org.jetbrains.kotlin.types.typeUtil.builtIns @@ -25,7 +26,7 @@ val FAKE_CONTINUATION_CLASS_DESCRIPTOR_EXPERIMENTAL = MutableClassDescriptor( EmptyPackageFragmentDescriptor(ErrorUtils.getErrorModule(), DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL), ClassKind.INTERFACE, /* isInner = */ false, /* isExternal = */ false, - DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_EXPERIMENTAL.shortName(), SourceElement.NO_SOURCE + DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_EXPERIMENTAL.shortName(), SourceElement.NO_SOURCE, LockBasedStorageManager.NO_LOCKS ).apply { modality = Modality.ABSTRACT visibility = Visibilities.PUBLIC @@ -41,7 +42,7 @@ val FAKE_CONTINUATION_CLASS_DESCRIPTOR_RELEASE = MutableClassDescriptor( EmptyPackageFragmentDescriptor(ErrorUtils.getErrorModule(), DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME_RELEASE), ClassKind.INTERFACE, /* isInner = */ false, /* isExternal = */ false, - DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_RELEASE.shortName(), SourceElement.NO_SOURCE + DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME_RELEASE.shortName(), SourceElement.NO_SOURCE, LockBasedStorageManager.NO_LOCKS ).apply { modality = Modality.ABSTRACT visibility = Visibilities.PUBLIC diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt index 2287ac66bc5..23bbef19011 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/NotFoundClasses.kt @@ -56,7 +56,7 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo ) } - private val typeConstructor = ClassTypeConstructorImpl(this, typeParameters, setOf(module.builtIns.anyType)) + private val typeConstructor = ClassTypeConstructorImpl(this, typeParameters, setOf(module.builtIns.anyType), storageManager) override fun getKind() = ClassKind.CLASS override fun getModality() = Modality.FINAL diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java index 2982cd4615d..72cb71f3217 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/ClassDescriptorImpl.java @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.storage.LockBasedStorageManager; +import org.jetbrains.kotlin.storage.StorageManager; import org.jetbrains.kotlin.types.ClassTypeConstructorImpl; import org.jetbrains.kotlin.types.KotlinType; import org.jetbrains.kotlin.types.TypeConstructor; @@ -37,14 +38,15 @@ public class ClassDescriptorImpl extends ClassDescriptorBase { @NotNull ClassKind kind, @NotNull Collection supertypes, @NotNull SourceElement source, - boolean isExternal + boolean isExternal, + @NotNull StorageManager storageManager ) { - super(LockBasedStorageManager.NO_LOCKS, containingDeclaration, name, source, isExternal); + super(storageManager, containingDeclaration, name, source, isExternal); assert modality != Modality.SEALED : "Implement getSealedSubclasses() for this class: " + getClass(); this.modality = modality; this.kind = kind; - this.typeConstructor = new ClassTypeConstructorImpl(this, Collections.emptyList(), supertypes); + this.typeConstructor = new ClassTypeConstructorImpl(this, Collections.emptyList(), supertypes, storageManager); } public final void initialize( diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java index 21a02dd43ca..cd0df44073c 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/EnumEntrySyntheticClassDescriptor.java @@ -69,7 +69,7 @@ public class EnumEntrySyntheticClassDescriptor extends ClassDescriptorBase { this.annotations = annotations; this.typeConstructor = new ClassTypeConstructorImpl( - this, Collections.emptyList(), Collections.singleton(supertype) + this, Collections.emptyList(), Collections.singleton(supertype), storageManager ); this.scope = new EnumEntryScope(storageManager); diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java index c89b833e7ad..0b0d886a9b6 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/LazySubstitutingClassDescriptor.java @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.resolve.scopes.MemberScope; import org.jetbrains.kotlin.resolve.scopes.SubstitutingScope; +import org.jetbrains.kotlin.storage.LockBasedStorageManager; import org.jetbrains.kotlin.types.*; import java.util.ArrayList; @@ -73,7 +74,7 @@ public class LazySubstitutingClassDescriptor implements ClassDescriptor { supertypes.add(substitutor.substitute(supertype, Variance.INVARIANT)); } - typeConstructor = new ClassTypeConstructorImpl(this, typeConstructorParameters, supertypes); + typeConstructor = new ClassTypeConstructorImpl(this, typeConstructorParameters, supertypes, LockBasedStorageManager.NO_LOCKS); } return typeConstructor; diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java index 3270545b7d9..10ea5790aa9 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/impl/MutableClassDescriptor.java @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.annotations.Annotations; import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.resolve.scopes.MemberScope; -import org.jetbrains.kotlin.storage.LockBasedStorageManager; +import org.jetbrains.kotlin.storage.StorageManager; import org.jetbrains.kotlin.types.*; import java.util.*; @@ -25,6 +25,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase { private TypeConstructor typeConstructor; private List typeParameters; private final Collection supertypes = new ArrayList(); + private final StorageManager storageManager; public MutableClassDescriptor( @NotNull DeclarationDescriptor containingDeclaration, @@ -32,9 +33,11 @@ public class MutableClassDescriptor extends ClassDescriptorBase { boolean isInner, boolean isExternal, @NotNull Name name, - @NotNull SourceElement source + @NotNull SourceElement source, + @NotNull StorageManager storageManager ) { - super(LockBasedStorageManager.NO_LOCKS, containingDeclaration, name, source, isExternal); + super(storageManager, containingDeclaration, name, source, isExternal); + this.storageManager = storageManager; assert kind != ClassKind.OBJECT : "Fix isCompanionObject()"; this.kind = kind; @@ -151,7 +154,7 @@ public class MutableClassDescriptor extends ClassDescriptorBase { public void createTypeConstructor() { assert typeConstructor == null : typeConstructor; - this.typeConstructor = new ClassTypeConstructorImpl(this, typeParameters, supertypes); + this.typeConstructor = new ClassTypeConstructorImpl(this, typeParameters, supertypes, storageManager); for (FunctionDescriptor functionDescriptor : getConstructors()) { ((ClassConstructorDescriptorImpl) functionDescriptor).setReturnType(getDefaultType()); } diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java b/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java index 2bc7d47fda0..3f78aff0885 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/ClassTypeConstructorImpl.java @@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.SupertypeLoopChecker; import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.storage.LockBasedStorageManager; +import org.jetbrains.kotlin.storage.StorageManager; import java.util.ArrayList; import java.util.Collection; @@ -36,9 +37,10 @@ public class ClassTypeConstructorImpl extends AbstractClassTypeConstructor imple public ClassTypeConstructorImpl( @NotNull ClassDescriptor classDescriptor, @NotNull List parameters, - @NotNull Collection supertypes + @NotNull Collection supertypes, + @NotNull StorageManager storageManager ) { - super(LockBasedStorageManager.NO_LOCKS); + super(storageManager); this.classDescriptor = classDescriptor; this.parameters = Collections.unmodifiableList(new ArrayList(parameters)); this.supertypes = Collections.unmodifiableCollection(supertypes); diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java b/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java index 469d0792cf4..6a784198812 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java +++ b/core/descriptors/src/org/jetbrains/kotlin/types/ErrorUtils.java @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.name.Name; import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter; import org.jetbrains.kotlin.resolve.scopes.MemberScope; +import org.jetbrains.kotlin.storage.LockBasedStorageManager; import org.jetbrains.kotlin.types.error.ErrorSimpleFunctionDescriptorImpl; import org.jetbrains.kotlin.utils.Printer; @@ -343,7 +344,7 @@ public class ErrorUtils { public ErrorClassDescriptor(@NotNull Name name) { super(getErrorModule(), name, Modality.OPEN, ClassKind.CLASS, Collections.emptyList(), SourceElement.NO_SOURCE, - /* isExternal = */ false + /* isExternal = */ false, LockBasedStorageManager.NO_LOCKS ); ClassConstructorDescriptorImpl diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/crossLanguage/KotlinElementActionsFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/crossLanguage/KotlinElementActionsFactory.kt index 0da00d93665..de1b67fa2f3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/crossLanguage/KotlinElementActionsFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/crossLanguage/KotlinElementActionsFactory.kt @@ -58,6 +58,7 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.annotations.JVM_FIELD_ANNOTATION_FQ_NAME import org.jetbrains.kotlin.resolve.annotations.JVM_STATIC_ANNOTATION_FQ_NAME +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.types.typeUtil.supertypes @@ -206,7 +207,8 @@ class KotlinElementActionsFactory : JvmElementActionsFactory() { ClassKind.CLASS, emptyList(), SourceElement.NO_SOURCE, - false + false, + LockBasedStorageManager.NO_LOCKS ) val typeParameterResolver = object : TypeParameterResolver { override fun resolveTypeParameter(javaTypeParameter: JavaTypeParameter): TypeParameterDescriptor? { diff --git a/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableCodegenExtension.kt b/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableCodegenExtension.kt index 862d5e0d273..680aaaeba76 100644 --- a/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableCodegenExtension.kt +++ b/plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/parcel/ParcelableCodegenExtension.kt @@ -48,6 +48,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.resolve.descriptorUtil.module import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKind import org.jetbrains.kotlin.resolve.scopes.MemberScope +import org.jetbrains.kotlin.storage.LockBasedStorageManager import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeUtils import org.jetbrains.kotlin.types.Variance @@ -288,7 +289,7 @@ open class ParcelableCodegenExtension : ExpressionCodegenExtension { val creatorClass = ClassDescriptorImpl( parcelableClass, Name.identifier("Creator"), Modality.FINAL, ClassKind.CLASS, emptyList(), - parcelableClass.source, false) + parcelableClass.source, false, LockBasedStorageManager.NO_LOCKS) creatorClass.initialize( MemberScope.Empty, emptySet(),