HCOLL-167 simplified the exception throwing code

This commit is contained in:
Rob Austin
2014-10-22 13:06:13 +01:00
parent 0795300304
commit ac6f3dd778
2 changed files with 3 additions and 19 deletions
@@ -503,9 +503,6 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
in.clear();
in.buffer().clear();
/* in.buffer().limit(in.buffer().capacity());
in.limit(in.buffer().position());
*/
// read size
while (in.buffer().position() < 2) {
clientChannel.read(in.buffer());
@@ -527,20 +524,12 @@ class StatelessChronicleMap<K, V> implements ChronicleMap<K, V>, Closeable {
long inTransactionId = in.readLong();
if (inTransactionId != transactionId) {
if (inTransactionId != transactionId)
throw new IllegalStateException("the received transaction-id=" + inTransactionId +
", does not match the expected transaction-id=" + transactionId);
}
if (isException) {
int len = in.readUnsignedShort();
in.limit(in.position() + len);
Object o = in.readObject();
RuntimeException runtimeException = (RuntimeException) o;
throw runtimeException;
}
if (isException)
throw (RuntimeException) in.readObject();
return in;
}