From b34fdb86dd904c0f60bdd05e63caae4a45d4c9e3 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Tue, 25 Aug 2009 18:39:33 +0400 Subject: [PATCH] do not hide exceptions in finally block --- lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java b/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java index da11e75224..5642fdfaf4 100644 --- a/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java +++ b/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java @@ -304,13 +304,18 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi for (StubIndexKey key : affectedIndices) { stubIndex.getWriteLock(key).lock(); } - getWriteLock().lock(); - super.updateWithMap(inputId, oldData, newData); - updateStubIndices(affectedIndices, inputId, oldStubTree, newStubTree); + try { + getWriteLock().lock(); + super.updateWithMap(inputId, oldData, newData); + updateStubIndices(affectedIndices, inputId, oldStubTree, newStubTree); + } + finally { + getWriteLock().unlock(); + } + } finally { - getWriteLock().unlock(); for (StubIndexKey key : affectedIndices) { stubIndex.getWriteLock(key).unlock(); } -- 2.11.4.GIT