Fix deadlock: synchronized lazy in KtLightModifierListWithExplicitModifiers

This commit is contained in:
Pavel V. Talanov
2016-05-24 18:24:09 +03:00
parent 7fd2a016e7
commit 65e55f045f
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ abstract class KtLightModifierListWithExplicitModifiers(
) : LightModifierList(owner.manager, KotlinLanguage.INSTANCE, *modifiers) {
abstract val delegate: PsiAnnotationOwner
private val _annotations by lazy { computeAnnotations(this, delegate) }
private val _annotations by lazy(LazyThreadSafetyMode.PUBLICATION) { computeAnnotations(this, delegate) }
override fun getParent() = owner
@@ -57,7 +57,7 @@ class KtLightModifierList(
private val delegate: PsiModifierList,
private val owner: PsiModifierListOwner
) : PsiModifierList by delegate {
private val _annotations by lazy { computeAnnotations(this, delegate) }
private val _annotations by lazy(LazyThreadSafetyMode.PUBLICATION) { computeAnnotations(this, delegate) }
override fun getAnnotations(): Array<out PsiAnnotation> = _annotations.value