check state in WriteableScopeImpl

(nothing is written to allDescriptor after getAllDescriptors fetched)
This commit is contained in:
Stepan Koltsov
2012-06-16 02:24:11 +04:00
parent 5f1f854293
commit 4657567484
@@ -131,6 +131,10 @@ public class WritableScopeImpl extends WritableScopeWithImports {
if (!allDescriptorsDone) {
allDescriptorsDone = true;
// make sure no descriptors added to allDescriptors collection
changeLockLevel(LockLevel.READING);
allDescriptors.addAll(getWorkerScope().getAllDescriptors());
for (JetScope imported : getImports()) {
allDescriptors.addAll(imported.getAllDescriptors());