capture agent: cleanup

This commit is contained in:
Egor Ushakov
2018-01-25 19:28:12 +03:00
parent 94160c620e
commit e965acf756
@@ -40,8 +40,7 @@ public class CaptureStorage {
if (DEBUG) {
System.out.println("capture " + getCallerDescriptor(exception) + " - " + key);
}
Deque<InsertMatch> currentStacks = CURRENT_STACKS.get();
CapturedStack stack = createCapturedStack(exception, currentStacks.isEmpty() ? null : currentStacks.getLast());
CapturedStack stack = createCapturedStack(exception, CURRENT_STACKS.get().peekLast());
WeakKey keyRef = new WeakKey(key);
synchronized (HISTORY) {
CapturedStack old = STORAGE.put(keyRef, stack);