when accessing index data handle IOExceptions wrapped with RuntimeException

This commit is contained in:
Eugene Zhuravlev
2011-05-25 15:58:49 +02:00
parent f2f00ced61
commit 4ee4e273ab
@@ -365,14 +365,23 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi
indexStorage = memIndexStorage.getBackendStorage();
}
}
final ValueContainer<SerializedStubTree> valueContainer = indexStorage.read(key);
if (valueContainer.size() != 1) {
LOG.assertTrue(valueContainer.size() == 0);
try {
final ValueContainer<SerializedStubTree> 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 {