From ba8bcb2e9a6f741424c7d29471ad4488ecefcb7f Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Tue, 22 Oct 2013 13:58:27 +0400 Subject: [PATCH] Better diagnostics + basic recursion detection in memoized functions --- .../org/jetbrains/jet/storage/LockBasedStorageManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/util.runtime/src/org/jetbrains/jet/storage/LockBasedStorageManager.java b/core/util.runtime/src/org/jetbrains/jet/storage/LockBasedStorageManager.java index fd63db91d0f..a4db2d0f0ff 100644 --- a/core/util.runtime/src/org/jetbrains/jet/storage/LockBasedStorageManager.java +++ b/core/util.runtime/src/org/jetbrains/jet/storage/LockBasedStorageManager.java @@ -277,13 +277,13 @@ public class LockBasedStorageManager implements StorageManager { try { V typedValue = compute.invoke(input); Object oldValue = cache.put(input, WrappedValues.escapeNull(typedValue)); - assert oldValue == null : "Race condition detected"; + assert oldValue == null : "Race condition or recursion detected. Old value is " + oldValue; return typedValue; } catch (Throwable throwable) { Object oldValue = cache.put(input, WrappedValues.escapeThrowable(throwable)); - assert oldValue == null : "Race condition detected"; + assert oldValue == null : "Race condition or recursion detected. Old value is " + oldValue; throw ExceptionUtils.rethrow(throwable); }