replace assert with exception
* assert hides errors when code is executed without -ea * it is easier to set up breakpoint
This commit is contained in:
@@ -32,11 +32,12 @@ public class Slices {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <K, V> boolean processRewrite(WritableSlice<K, V> slice, K key, V oldValue, V newValue) {
|
public <K, V> boolean processRewrite(WritableSlice<K, V> slice, K key, V oldValue, V newValue) {
|
||||||
assert (oldValue == null && newValue == null) || (oldValue != null && oldValue.equals(newValue))
|
if (!((oldValue == null && newValue == null) || (oldValue != null && oldValue.equals(newValue)))) {
|
||||||
: "Rewrite at slice " + slice +
|
throw new IllegalStateException("Rewrite at slice " + slice +
|
||||||
" key: " + key +
|
" key: " + key +
|
||||||
" old value: " + oldValue + '@' + System.identityHashCode(oldValue) +
|
" old value: " + oldValue + '@' + System.identityHashCode(oldValue) +
|
||||||
" new value: " + newValue + '@' + System.identityHashCode(newValue);
|
" new value: " + newValue + '@' + System.identityHashCode(newValue));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user