From 4ee4e273ab740e60d2d2e84eeafd05ad13e41143 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Wed, 25 May 2011 15:56:10 +0200 Subject: [PATCH] when accessing index data handle IOExceptions wrapped with RuntimeException --- .../intellij/psi/stubs/StubUpdatingIndex.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java index f76ed531cdf4..66820d9ebe49 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java @@ -365,14 +365,23 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi indexStorage = memIndexStorage.getBackendStorage(); } } - final ValueContainer valueContainer = indexStorage.read(key); - if (valueContainer.size() != 1) { - LOG.assertTrue(valueContainer.size() == 0); + try { + final ValueContainer valueContainer = indexStorage.read(key); + if (valueContainer.size() != 1) { + LOG.assertTrue(valueContainer.size() == 0); + return result; + } + + result.put(key, valueContainer.getValueIterator().next()); return result; } - - result.put(key, valueContainer.getValueIterator().next()); - return result; + catch (RuntimeException e) { + final Throwable cause = e.getCause(); + if (cause instanceof IOException) { + throw new StorageException(cause); + } + throw e; + } } public void clear() throws StorageException {