Avoid throwing arbitrary exceptions (AssertionError / AIOBE due to corrupted code), translate them to IOExceptions (EA-74073, EA-69880)

This commit is contained in:
Maxim.Mossienko
2015-10-07 15:27:49 +02:00
parent 9c92e04d82
commit e6cf8c52eb
@@ -22,7 +22,6 @@ import com.intellij.util.CompressionUtil;
import com.intellij.util.SystemProperties;
import com.intellij.util.containers.SLRUMap;
import gnu.trove.TLongArrayList;
import org.iq80.snappy.CorruptionException;
import org.jetbrains.annotations.NotNull;
import java.io.*;
@@ -201,11 +200,13 @@ public class CompressedAppendableFile {
} catch (IOException ignore) {}
}
assert false;
assert false:"data corruption detected:"+chunkNumber + "," + myChunkTableLength;
return ArrayUtil.EMPTY_BYTE_ARRAY;
}
catch (CorruptionException e) {
catch (RuntimeException e) { // CorruptedException, ArrayIndexOutofBounds, etc
throw new IOException(e);
} catch(AssertionError ae) {
throw new IOException(ae);
}
}