From 0ab82a37008d214692390bba72e3ce9e3ee53ee1 Mon Sep 17 00:00:00 2001 From: "Maxim.Mossienko" Date: Thu, 13 Mar 2014 18:27:56 +0100 Subject: [PATCH 1/4] trunk is IntelliJ Idea 14.0 --- community-resources/src/idea/IdeaApplicationInfo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/community-resources/src/idea/IdeaApplicationInfo.xml b/community-resources/src/idea/IdeaApplicationInfo.xml index 3901a1791f13..7617517167e7 100644 --- a/community-resources/src/idea/IdeaApplicationInfo.xml +++ b/community-resources/src/idea/IdeaApplicationInfo.xml @@ -1,5 +1,5 @@ - + From 4482c9d5edb23ef29927c8f70bea78a8c63502a4 Mon Sep 17 00:00:00 2001 From: Michael Golubev Date: Thu, 13 Mar 2014 18:33:23 +0100 Subject: [PATCH 2/4] CR-IU-624 - make JavaDebugServerModeHandler the abstract class --- .../deployment/debug/JavaDebugServerModeHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/debug/JavaDebugServerModeHandler.java b/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/debug/JavaDebugServerModeHandler.java index 68399461e77c..89323b7a0258 100644 --- a/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/debug/JavaDebugServerModeHandler.java +++ b/platform/remote-servers/api/src/com/intellij/remoteServer/runtime/deployment/debug/JavaDebugServerModeHandler.java @@ -20,9 +20,9 @@ import com.intellij.execution.ExecutionException; /** * @author michael.golubev */ -public interface JavaDebugServerModeHandler { +public abstract class JavaDebugServerModeHandler { - void attachRemote() throws ExecutionException; + public abstract void attachRemote() throws ExecutionException; - void detachRemote() throws ExecutionException; + public abstract void detachRemote() throws ExecutionException; } From f37e655b862109642cd518d2fa61c4ab645671dc Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 13 Mar 2014 21:34:05 +0400 Subject: [PATCH 3/4] fixed NPE when toggling a breakpoint on a line with comment --- .../impl/breakpoints/XBreakpointUtil.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 f3779e43df05..47062d1834dc 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 @@ -28,6 +28,7 @@ import com.intellij.xdebugger.XDebuggerManager; import com.intellij.xdebugger.XDebuggerUtil; import com.intellij.xdebugger.breakpoints.*; import com.intellij.xdebugger.impl.DebuggerSupport; +import com.intellij.xdebugger.impl.XDebuggerUtilImpl; import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointItem; import com.intellij.xdebugger.impl.breakpoints.ui.BreakpointPanelProvider; import org.jetbrains.annotations.NonNls; @@ -167,20 +168,19 @@ public class XBreakpointUtil { } } - - XLineBreakpoint res = null; if (typeWinner != null) { - res = XDebuggerUtil.getInstance().toggleLineBreakpoint(project, typeWinner, file, lineWinner, temporary); - } + XLineBreakpoint res = XDebuggerUtilImpl.toggleAndReturnLineBreakpoint(project, typeWinner, file, lineWinner, temporary); - if (editor != null && lineStart != lineWinner) { - int offset = editor.getDocument().getLineStartOffset(lineWinner); - ExpandRegionAction.expandRegionAtOffset(project, editor, offset); - if (moveCarret) { - editor.getCaretModel().moveToOffset(offset); + if (editor != null && lineStart != lineWinner) { + int offset = editor.getDocument().getLineStartOffset(lineWinner); + ExpandRegionAction.expandRegionAtOffset(project, editor, offset); + if (moveCarret) { + editor.getCaretModel().moveToOffset(offset); + } } + return res; } - return res; + return null; } } From 222b27be3e8986a0e9e1edc45290790dbf4f7ba7 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 13 Mar 2014 21:35:11 +0400 Subject: [PATCH 4/4] IDEA-121738 Shift-click in gutter doesn't create 'no suspend' breakpoint anymore (after review) --- .../com/intellij/xdebugger/XDebuggerUtil.java | 4 +-- .../xdebugger/impl/XDebuggerUtilImpl.java | 26 +++++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerUtil.java b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerUtil.java index 8bfae66e04be..e33bcaf75b10 100644 --- a/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerUtil.java +++ b/platform/xdebugger-api/src/com/intellij/xdebugger/XDebuggerUtil.java @@ -47,7 +47,7 @@ public abstract class XDebuggerUtil { toggleLineBreakpoint(project, file, line, false); } - public abstract XLineBreakpoint toggleLineBreakpoint(@NotNull Project project, + public abstract void toggleLineBreakpoint(@NotNull Project project, @NotNull VirtualFile file, int line, boolean temporary); @@ -59,7 +59,7 @@ public abstract class XDebuggerUtil { toggleLineBreakpoint(project, type, file, line, false); } - public abstract

XLineBreakpoint toggleLineBreakpoint(@NotNull Project project, + public abstract

void toggleLineBreakpoint(@NotNull Project project, @NotNull XLineBreakpointType

type, @NotNull VirtualFile file, int line, diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java index ef1e8c519c69..9d15d5b53500 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java @@ -25,7 +25,6 @@ import com.intellij.openapi.fileEditor.FileDocumentManager; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.fileTypes.StdFileTypes; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Ref; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil; @@ -75,7 +74,7 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { } @Override - public XLineBreakpoint toggleLineBreakpoint(@NotNull final Project project, @NotNull final VirtualFile file, final int line, boolean temporary) { + public void toggleLineBreakpoint(@NotNull final Project project, @NotNull final VirtualFile file, final int line, boolean temporary) { XLineBreakpointType typeWinner = null; for (XLineBreakpointType type : getLineBreakpointTypes()) { if (type.canPutAt(file, line, project) && (typeWinner == null || type.getPriority() > typeWinner.getPriority())) { @@ -83,9 +82,8 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { } } if (typeWinner != null) { - return toggleLineBreakpoint(project, typeWinner, file, line, temporary); + toggleLineBreakpoint(project, typeWinner, file, line, temporary); } - return null; } @Override @@ -99,15 +97,22 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { } @Override - public

XLineBreakpoint toggleLineBreakpoint(@NotNull final Project project, + public

void toggleLineBreakpoint(@NotNull final Project project, @NotNull final XLineBreakpointType

type, @NotNull final VirtualFile file, final int line, final boolean temporary) { - final Ref res = new Ref(); - new WriteAction() { + toggleAndReturnLineBreakpoint(project, type, file, line, temporary); + } + + public static

XLineBreakpoint toggleAndReturnLineBreakpoint(@NotNull final Project project, + @NotNull final XLineBreakpointType

type, + @NotNull final VirtualFile file, + final int line, + final boolean temporary) { + return new WriteAction() { @Override - protected void run(@NotNull final Result result) { + protected void run(@NotNull final Result result) { XBreakpointManager breakpointManager = XDebuggerManager.getInstance(project).getBreakpointManager(); XLineBreakpoint

breakpoint = breakpointManager.findBreakpointAtLine(type, file, line); if (breakpoint != null) { @@ -115,11 +120,10 @@ public class XDebuggerUtilImpl extends XDebuggerUtil { } else { P properties = type.createBreakpointProperties(file, line); - res.set(breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary)); + result.setResult(breakpointManager.addLineBreakpoint(type, file.getUrl(), line, properties, temporary)); } } - }.execute(); - return res.get(); + }.execute().getResultObject(); } @Override