From ae913f4c0e1ff6746ca669a42cd5b02e6a9a07c7 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Tue, 24 Apr 2012 22:14:00 +0400 Subject: [PATCH] replace assert with exception * assert hides errors when code is executed without -ea * it is easier to set up breakpoint --- .../src/org/jetbrains/jet/util/slicedmap/Slices.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/util/slicedmap/Slices.java b/compiler/frontend/src/org/jetbrains/jet/util/slicedmap/Slices.java index b1085c67c9d..e2b4b232146 100644 --- a/compiler/frontend/src/org/jetbrains/jet/util/slicedmap/Slices.java +++ b/compiler/frontend/src/org/jetbrains/jet/util/slicedmap/Slices.java @@ -32,11 +32,12 @@ public class Slices { @Override public boolean processRewrite(WritableSlice slice, K key, V oldValue, V newValue) { - assert (oldValue == null && newValue == null) || (oldValue != null && oldValue.equals(newValue)) - : "Rewrite at slice " + slice + - " key: " + key + - " old value: " + oldValue + '@' + System.identityHashCode(oldValue) + - " new value: " + newValue + '@' + System.identityHashCode(newValue); + if (!((oldValue == null && newValue == null) || (oldValue != null && oldValue.equals(newValue)))) { + throw new IllegalStateException("Rewrite at slice " + slice + + " key: " + key + + " old value: " + oldValue + '@' + System.identityHashCode(oldValue) + + " new value: " + newValue + '@' + System.identityHashCode(newValue)); + } return true; } };