From 9f0b69df913dc4fb7e739a196f9b000bafce3319 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 15 Aug 2016 11:46:37 +0300 Subject: [PATCH 1/5] EA-85482 - assert: DataManagerImpl$MyDataContext.getData --- .../impl/src/com/intellij/debugger/actions/ViewTextAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java index 22573df059af..922c96a88b3e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/ViewTextAction.java @@ -50,6 +50,7 @@ public class ViewTextAction extends XFetchValueActionBase { @NotNull @Override protected ValueCollector createCollector(@NotNull AnActionEvent e) { + XValueNodeImpl node = getStringNode(e); return new ValueCollector(XDebuggerTree.getTree(e.getDataContext())) { MyDialog dialog = null; @@ -57,7 +58,6 @@ public class ViewTextAction extends XFetchValueActionBase { public void handleInCollector(Project project, String value, XDebuggerTree tree) { String text = StringUtil.unquoteString(value); if (dialog == null) { - XValueNodeImpl node = getStringNode(e); dialog = new MyDialog(project, text, node); dialog.setTitle(ActionsBundle.message(node != null ? "action.Debugger.ViewEditText.text" : "action.Debugger.ViewText.text")); dialog.show(); From b70295a0ae8fa426f38caee2d15d31cdd55b8a24 Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Mon, 15 Aug 2016 11:48:20 +0300 Subject: [PATCH 2/5] EA-86856 - NPE: ReloadClassesWorker.reloadClasses --- .../intellij/debugger/impl/ReloadClassesWorker.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java index 319d1e781988..04088e5947ff 100644 --- a/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java +++ b/java/debugger/impl/src/com/intellij/debugger/impl/ReloadClassesWorker.java @@ -17,10 +17,7 @@ package com.intellij.debugger.impl; import com.intellij.debugger.DebuggerBundle; import com.intellij.debugger.DebuggerManagerEx; -import com.intellij.debugger.engine.DebugProcessImpl; -import com.intellij.debugger.engine.DebuggerManagerThreadImpl; -import com.intellij.debugger.engine.JavaExecutionStack; -import com.intellij.debugger.engine.SuspendContextImpl; +import com.intellij.debugger.engine.*; import com.intellij.debugger.jdi.VirtualMachineProxyImpl; import com.intellij.debugger.ui.breakpoints.BreakpointManager; import com.intellij.openapi.diagnostic.Logger; @@ -168,7 +165,10 @@ class ReloadClassesWorker { processException(e); } - debugProcess.getPositionManager().clearCache(); + CompoundPositionManager positionManager = debugProcess.getPositionManager(); + if (positionManager != null) { + positionManager.clearCache(); + } DebuggerContextImpl context = myDebuggerSession.getContextManager().getContext(); SuspendContextImpl suspendContext = context.getSuspendContext(); From 3e22083c35f7b17ab3c28ddfb6b649d1f954b7a6 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Mon, 15 Aug 2016 11:32:51 +0300 Subject: [PATCH 3/5] When retrieving language indent options use LanguageUtil.getLanguageForPsi instead of FileType.getLanguage, since for scratches it is always plain text (fixes IDEA-156091) --- .../intellij/psi/codeStyle/CodeStyleSettings.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java index 783e30efd9b3..240339068111 100644 --- a/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java +++ b/platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java @@ -18,6 +18,7 @@ package com.intellij.psi.codeStyle; import com.intellij.configurationStore.UnknownElementCollector; import com.intellij.configurationStore.UnknownElementWriter; import com.intellij.lang.Language; +import com.intellij.lang.LanguageUtil; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.editor.Document; import com.intellij.openapi.extensions.ExtensionException; @@ -672,6 +673,14 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea } } } + + Language language = LanguageUtil.getLanguageForPsi(file.getProject(), file.getVirtualFile()); + if (language != null) { + IndentOptions options = getIndentOptions(language); + if (options != null) { + return options; + } + } return getIndentOptions(file.getFileType()); } @@ -699,6 +708,11 @@ public class CodeStyleSettings extends CommonCodeStyleSettings implements Clonea private IndentOptions getLanguageIndentOptions(@Nullable FileType fileType) { if (fileType == null || !(fileType instanceof LanguageFileType)) return null; Language lang = ((LanguageFileType)fileType).getLanguage(); + return getIndentOptions(lang); + } + + @Nullable + private IndentOptions getIndentOptions(Language lang) { CommonCodeStyleSettings langSettings = getCommonSettings(lang); return langSettings == this ? null : langSettings.getIndentOptions(); } From 8d2898299b240b956af45d649a73757cedda5625 Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Mon, 15 Aug 2016 11:43:47 +0300 Subject: [PATCH 4/5] [FreezeLogger] do not report in tests --- .../intellij/openapi/editor/actionSystem/FreezeLogger.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java b/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java index 9a520f616df6..31567aade6b0 100644 --- a/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java +++ b/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/FreezeLogger.java @@ -32,6 +32,11 @@ public class FreezeLogger { private static final int MAX_ALLOWED_TIME = 500; public static void runUnderPerformanceMonitor(@Nullable Project project, @NotNull Runnable action) { + if (ApplicationManager.getApplication().isUnitTestMode()) { + action.run(); + return; + } + final ModalityState initial = ModalityState.current(); ALARM.cancelAllRequests(); ALARM.addRequest(() -> dumpThreads(project, initial), MAX_ALLOWED_TIME); From 6e7123f923a7e3ce5940ca9fd4c7f968cd485f11 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Mon, 15 Aug 2016 12:55:26 +0300 Subject: [PATCH 5/5] [hg]: cleanUp prompthooks: use isinstance instead of direct import --- plugins/hg4idea/resources/python/prompthooks.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/plugins/hg4idea/resources/python/prompthooks.py b/plugins/hg4idea/resources/python/prompthooks.py index 5c5251cc2426..49de5e811273 100644 --- a/plugins/hg4idea/resources/python/prompthooks.py +++ b/plugins/hg4idea/resources/python/prompthooks.py @@ -204,7 +204,9 @@ def find_user_password(self, realm, authuri): else: return None - newMerc = isNewer3_8_3() + # After mercurial 3.8.3 urllib2.HTTPPasswordmgrwithdefaultrealm.find_user_password etc were changed to appropriate methods + # in util.urlreq module with slightly different semantics + newMerc = False if isinstance(self, urllib2.HTTPPasswordMgrWithDefaultRealm) else True if newMerc: user, password = util.urlreq.httppasswordmgrwithdefaultrealm().find_user_password(realm, authuri) else: @@ -221,15 +223,4 @@ def find_user_password(self, realm, authuri): raise util.Abort(_('http authorization required')) user, passwd = retrievedPass pmWithRealm.add_password(realm, authuri, user, passwd) - return retrievedPass - - -def isNewer3_8_3(): - # After mercurial 3.8.3 urllib2.HTTPPasswordmgrwithdefaultrealm.find_user_password etc were changed to appropriate methods - # in util.urlreq module with slightly different semantics - try: - from mercurial.url import urlreq - return True - except ImportError: - pass - return False \ No newline at end of file + return retrievedPass \ No newline at end of file