From fd89d8fd49fd9b2511a340f110944696184be85f Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 12 Apr 2016 16:46:11 +0200 Subject: [PATCH] erase types to avoid red code caused by kotlin --- .../src/org/jetbrains/debugger/VariablesHost.java | 2 +- .../xdebugger/impl/breakpoints/XBreakpointUtil.java | 10 +++++----- .../impl/breakpoints/XLineBreakpointManager.java | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/platform/script-debugger/backend/src/org/jetbrains/debugger/VariablesHost.java b/platform/script-debugger/backend/src/org/jetbrains/debugger/VariablesHost.java index a0f189409166..746016d690cf 100644 --- a/platform/script-debugger/backend/src/org/jetbrains/debugger/VariablesHost.java +++ b/platform/script-debugger/backend/src/org/jetbrains/debugger/VariablesHost.java @@ -34,7 +34,7 @@ public abstract class VariablesHost { @NotNull @Override - public Promise> load(@NotNull VariablesHost host) { + public Promise load(@NotNull VariablesHost host) { return host.valueManager.isObsolete() ? ValueManager.Companion.reject() : host.load(); } }; diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointUtil.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointUtil.java index f1c6d7a35144..9e70f0f94202 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointUtil.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XBreakpointUtil.java @@ -133,11 +133,11 @@ public class XBreakpointUtil { * - if folded, checks if line breakpoints could be toggled inside folded text */ @NotNull - public static Promise toggleLineBreakpoint(@NotNull Project project, - @NotNull XSourcePosition position, - @Nullable Editor editor, - boolean temporary, - boolean moveCarret) { + public static Promise toggleLineBreakpoint(@NotNull Project project, + @NotNull XSourcePosition position, + @Nullable Editor editor, + boolean temporary, + boolean moveCarret) { int lineStart = position.getLine(); VirtualFile file = position.getFile(); // for folded text check each line and find out type with the biggest priority diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java index dcbaf0d6b44a..e889d6c4ad71 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java @@ -52,10 +52,12 @@ import com.intellij.util.ui.update.Update; import com.intellij.xdebugger.XDebuggerManager; import com.intellij.xdebugger.breakpoints.SuspendPolicy; import com.intellij.xdebugger.breakpoints.XBreakpoint; +import com.intellij.xdebugger.breakpoints.XLineBreakpoint; import com.intellij.xdebugger.impl.XSourcePositionImpl; import com.intellij.xdebugger.impl.ui.DebuggerUIUtil; import gnu.trove.TIntHashSet; import org.jetbrains.annotations.NotNull; +import org.jetbrains.concurrency.Promise; import java.awt.event.MouseEvent; import java.util.Collection; @@ -280,8 +282,8 @@ public class XLineBreakpointManager { if (line >= 0 && line < document.getLineCount() && file != null) { ActionManagerEx.getInstanceEx().fireBeforeActionPerformed(IdeActions.ACTION_TOGGLE_LINE_BREAKPOINT, e.getMouseEvent()); - XBreakpointUtil - .toggleLineBreakpoint(myProject, XSourcePositionImpl.create(file, line), editor, mouseEvent.isAltDown(), false) + final Promise lineBreakpoint = XBreakpointUtil.toggleLineBreakpoint(myProject, XSourcePositionImpl.create(file, line), editor, mouseEvent.isAltDown(), false); + lineBreakpoint .done(breakpoint -> { if (!mouseEvent.isAltDown() && mouseEvent.isShiftDown() && breakpoint != null) { breakpoint.setSuspendPolicy(SuspendPolicy.NONE);