From e965acf756aff84deb12316871236da90ffd41b1 Mon Sep 17 00:00:00 2001 From: Egor Ushakov Date: Thu, 25 Jan 2018 19:16:06 +0300 Subject: [PATCH] capture agent: cleanup --- .../src/com/intellij/rt/debugger/agent/CaptureStorage.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java b/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java index 34fd8e8e6b09..014247360396 100644 --- a/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java +++ b/java/debugger/debugger-agent-storage/src/com/intellij/rt/debugger/agent/CaptureStorage.java @@ -40,8 +40,7 @@ public class CaptureStorage { if (DEBUG) { System.out.println("capture " + getCallerDescriptor(exception) + " - " + key); } - Deque 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);