Fix deadlock in StaticScopeForKotlinEnum

Also fix possible deadlock in ReflectionTypes

 #KT-11869 Fixed
This commit is contained in:
Alexander Udalov
2016-04-12 16:24:11 +03:00
parent a8629b3836
commit 11d875ca17
4 changed files with 13 additions and 9 deletions
@@ -124,9 +124,11 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
this.declarationProvider = c.getDeclarationProviderFactory().getClassMemberDeclarationProvider(classLikeInfo);
StorageManager storageManager = c.getStorageManager();
this.unsubstitutedMemberScope = createMemberScope(c, this.declarationProvider);
this.kind = classLikeInfo.getClassKind();
this.staticScope = kind == ClassKind.ENUM_CLASS ? new StaticScopeForKotlinEnum(this) : MemberScope.Empty.INSTANCE;
this.staticScope = kind == ClassKind.ENUM_CLASS ? new StaticScopeForKotlinEnum(storageManager, this) : MemberScope.Empty.INSTANCE;
this.typeConstructor = new LazyClassTypeConstructor();
@@ -154,8 +156,6 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
this.isInner = isInnerClass(modifierList) && !ModifiersChecker.isIllegalInner(this);
this.isData = modifierList != null && modifierList.hasModifier(KtTokens.DATA_KEYWORD);
StorageManager storageManager = c.getStorageManager();
// Annotation entries are taken from both own annotations (if any) and object literal annotations (if any)
List<KtAnnotationEntry> annotationEntries = new ArrayList<KtAnnotationEntry>();
if (classOrObject != null && classOrObject.getParent() instanceof KtObjectLiteralExpression) {