From bc9f6e80d1fae6a3b2d97dd8e17318ef012062bd Mon Sep 17 00:00:00 2001 From: Elizaveta Shashkova Date: Thu, 30 Mar 2017 15:04:19 +0300 Subject: [PATCH 01/12] Matplotlib interactive mode doesn't work (PY-23345) Check gui availability with environment variable on Linux --- python/helpers/pydev/_pydevd_bundle/pydevd_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py b/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py index a57783612595..cc6fa53ca178 100644 --- a/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py +++ b/python/helpers/pydev/_pydevd_bundle/pydevd_constants.py @@ -103,7 +103,7 @@ USE_LIB_COPY = SUPPORT_GEVENT and \ (IS_PY3K and sys.version_info[1] >= 3)) -INTERACTIVE_MODE_AVAILABLE = os.getenv('DISPLAY') is not None +INTERACTIVE_MODE_AVAILABLE = sys.platform in ('darwin', 'win32') or os.getenv('DISPLAY') is not None def protect_libraries_from_patching(): From 704bbf3a1a1715ee5ce0df2704df17c3ca8e584a Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Thu, 30 Mar 2017 15:18:01 +0300 Subject: [PATCH 02/12] IDEA-170602 Gradle plugin may store enormous amount of data in workspace.xml --- .../manage/ExternalProjectsManager.java | 59 ++++++++++--------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java index 87b9c3ac01ca..e6472e0f49a3 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java @@ -118,35 +118,35 @@ public class ExternalProjectsManager implements PersistentStateComponent systemManager : ExternalSystemApiUtil.getAllManagers()) { - final Collection externalProjects = - ExternalProjectsDataStorage.getInstance(myProject).list(systemManager.getSystemId()); - for (ExternalProjectInfo externalProject : externalProjects) { - if (externalProject.getExternalProjectStructure() == null) continue; - Collection> taskData = - ExternalSystemApiUtil.findAllRecursively(externalProject.getExternalProjectStructure(), TASK); - myShortcutsManager.scheduleKeymapUpdate(taskData); - } - - if (!externalProjects.isEmpty()) { - myShortcutsManager.scheduleRunConfigurationKeymapUpdate(systemManager.getSystemId()); - } + // init shortcuts manager + myShortcutsManager.init(); + for (ExternalSystemManager systemManager : ExternalSystemApiUtil.getAllManagers()) { + final Collection externalProjects = + ExternalProjectsDataStorage.getInstance(myProject).list(systemManager.getSystemId()); + for (ExternalProjectInfo externalProject : externalProjects) { + if (externalProject.getExternalProjectStructure() == null) continue; + Collection> taskData = + ExternalSystemApiUtil.findAllRecursively(externalProject.getExternalProjectStructure(), TASK); + myShortcutsManager.scheduleKeymapUpdate(taskData); } - // init task activation info - myTaskActivator.init(); + if (!externalProjects.isEmpty()) { + myShortcutsManager.scheduleRunConfigurationKeymapUpdate(systemManager.getSystemId()); + } + } + // init task activation info + myTaskActivator.init(); + + synchronized (isInitializationFinished) { isInitializationFinished.set(true); ApplicationManager.getApplication().executeOnPooledThread(() -> { myPostInitializationActivities.run(); @@ -156,10 +156,13 @@ public class ExternalProjectsManager implements PersistentStateComponent Date: Thu, 30 Mar 2017 15:26:17 +0300 Subject: [PATCH 03/12] do not expose all List api --- .../externalSystem/util/CompositeRunnable.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/CompositeRunnable.java b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/CompositeRunnable.java index 132c96662832..e1ee97e986a3 100644 --- a/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/CompositeRunnable.java +++ b/platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/CompositeRunnable.java @@ -17,10 +17,22 @@ package com.intellij.openapi.externalSystem.util; import com.intellij.util.SmartList; -public class CompositeRunnable extends SmartList implements Runnable { +import java.util.List; + +public class CompositeRunnable implements Runnable { + private List list = new SmartList<>(); + + public boolean add(Runnable runnable) { + return list.add(runnable); + } + + public void clear() { + list = new SmartList<>(); + } + @Override public void run() { - for (Runnable runnable : this) { + for (Runnable runnable : list) { runnable.run(); } } From b70405fb48a5e07096b26c8bc6c6929a4f05a287 Mon Sep 17 00:00:00 2001 From: "Vladislav.Soroka" Date: Thu, 30 Mar 2017 15:27:32 +0300 Subject: [PATCH 04/12] do not return real modifiable value for the cleanup (IDEA-170602) --- .../plugins/gradle/settings/GradleExtensionsSettings.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExtensionsSettings.java b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExtensionsSettings.java index 038c9e73e670..e09c0997b274 100644 --- a/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExtensionsSettings.java +++ b/plugins/gradle/src/org/jetbrains/plugins/gradle/settings/GradleExtensionsSettings.java @@ -69,7 +69,7 @@ public class GradleExtensionsSettings implements PersistentStateComponent Date: Thu, 30 Mar 2017 14:47:14 +0300 Subject: [PATCH 05/12] merge: reuse single MergeTool instance --- .../openapi/diff/impl/external/DiffManagerImpl.java | 6 +++--- .../com/intellij/openapi/diff/impl/mergeTool/MergeTool.java | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/DiffManagerImpl.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/DiffManagerImpl.java index 214dd4109c0d..4afd78e10e46 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/DiffManagerImpl.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/external/DiffManagerImpl.java @@ -129,7 +129,7 @@ public class DiffManagerImpl extends DiffManager implements PersistentStateCompo if (!ENABLE_FILES.value(myProperties) || !ENABLE_FOLDERS.value(myProperties) || !ENABLE_MERGE.value(myProperties)) { DiffTool[] embeddableTools = { INTERNAL_DIFF, - new MergeTool(), + MergeTool.INSTANCE, BinaryDiffTool.INSTANCE }; standardTools = new DiffTool[]{ @@ -138,7 +138,7 @@ public class DiffManagerImpl extends DiffManager implements PersistentStateCompo ExtMergeFiles.INSTANCE, new MultiLevelDiffTool(Arrays.asList(embeddableTools)), INTERNAL_DIFF, - new MergeTool(), + MergeTool.INSTANCE, BinaryDiffTool.INSTANCE }; } @@ -148,7 +148,7 @@ public class DiffManagerImpl extends DiffManager implements PersistentStateCompo ExtCompareFiles.INSTANCE, ExtMergeFiles.INSTANCE, INTERNAL_DIFF, - new MergeTool(), + MergeTool.INSTANCE, BinaryDiffTool.INSTANCE }; } diff --git a/platform/platform-impl/src/com/intellij/openapi/diff/impl/mergeTool/MergeTool.java b/platform/platform-impl/src/com/intellij/openapi/diff/impl/mergeTool/MergeTool.java index 489361e9067d..a3b0a6887a80 100644 --- a/platform/platform-impl/src/com/intellij/openapi/diff/impl/mergeTool/MergeTool.java +++ b/platform/platform-impl/src/com/intellij/openapi/diff/impl/mergeTool/MergeTool.java @@ -32,6 +32,8 @@ import java.awt.*; public class MergeTool implements DiffTool { public static final Logger LOG = Logger.getInstance(MergeTool.class); + public static final MergeTool INSTANCE = new MergeTool(); + public void show(DiffRequest data) { if (data instanceof MergeRequestImpl) { showDialog((MergeRequestImpl)data); From 7a667f03484a2b2e610c898ab117436db40d4ef4 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 30 Mar 2017 14:48:07 +0300 Subject: [PATCH 06/12] merge: remove unused method --- .../vcs/changes/actions/migrate/MigrateDiffTool.java | 5 ++--- .../changes/actions/migrate/MigrateToNewDiffUtil.java | 11 ----------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java index 9d8914d03ff1..39f91e212daf 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java @@ -17,7 +17,6 @@ package com.intellij.openapi.vcs.changes.actions.migrate; import com.intellij.diff.DiffDialogHints; import com.intellij.diff.DiffManager; -import com.intellij.diff.chains.DiffRequestChain; import com.intellij.openapi.Disposable; import com.intellij.openapi.diff.DiffRequest; import com.intellij.openapi.diff.DiffTool; @@ -39,9 +38,9 @@ public class MigrateDiffTool implements DiffTool { @Override public void show(DiffRequest request) { - DiffRequestChain newChain = MigrateToNewDiffUtil.convertRequestChain(request); + com.intellij.diff.requests.DiffRequest newRequest = MigrateToNewDiffUtil.convertRequest(request); WindowWrapper.Mode mode = FrameDiffTool.shouldOpenDialog(request.getHints()) ? WindowWrapper.Mode.MODAL : WindowWrapper.Mode.FRAME; - DiffManager.getInstance().showDiff(request.getProject(), newChain, new DiffDialogHints(mode)); + DiffManager.getInstance().showDiff(request.getProject(), newRequest, new DiffDialogHints(mode)); } @Override diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java index 74f6e961f0dc..b1c9e1e63f30 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java @@ -1,9 +1,7 @@ package com.intellij.openapi.vcs.changes.actions.migrate; -import com.intellij.diff.chains.DiffRequestChain; import com.intellij.diff.chains.DiffRequestProducer; import com.intellij.diff.chains.DiffRequestProducerException; -import com.intellij.diff.chains.SimpleDiffRequestChain; import com.intellij.diff.contents.DiffContent; import com.intellij.diff.contents.DocumentContentImpl; import com.intellij.diff.contents.EmptyContent; @@ -13,7 +11,6 @@ import com.intellij.diff.requests.ErrorDiffRequest; import com.intellij.diff.requests.SimpleDiffRequest; import com.intellij.diff.util.DiffUserDataKeysEx; import com.intellij.diff.util.LineCol; -import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.diff.DiffNavigationContext; import com.intellij.openapi.diff.DiffTool; import com.intellij.openapi.editor.Document; @@ -34,16 +31,8 @@ import java.util.List; import static com.intellij.openapi.util.text.StringUtil.notNullize; public class MigrateToNewDiffUtil { - private static final Logger LOG = Logger.getInstance(MigrateToNewDiffUtil.class); - @NonNls public static final Object DO_NOT_TRY_MIGRATE = "doNotTryMigrate"; - @NotNull - public static DiffRequestChain convertRequestChain(@NotNull com.intellij.openapi.diff.DiffRequest oldRequest) { - DiffRequest request = convertRequest(oldRequest); - return new SimpleDiffRequestChain(request); - } - @NotNull public static DiffRequest convertRequest(@NotNull com.intellij.openapi.diff.DiffRequest oldRequest) { DiffRequest request = convertRequestFair(oldRequest); From c6ecd41f5aa7437d1681c5e0991fe35f47473c86 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 30 Mar 2017 14:50:46 +0300 Subject: [PATCH 07/12] diff: remove dead code --- .../testframework/AbstractTestProxy.java | 8 -------- .../stacktrace/DiffHyperlink.java | 18 ------------------ 2 files changed, 26 deletions(-) diff --git a/platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java b/platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java index 5f7e846d60b6..67f174b5d38e 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java @@ -162,12 +162,4 @@ public abstract class AbstractTestProxy extends CompositePrintable { public String getLocationUrl() { return null; } - - @Deprecated - public interface AssertEqualsDiffChain { - DiffHyperlink getPrevious(); - DiffHyperlink getCurrent(); - DiffHyperlink getNext(); - void setCurrent(DiffHyperlink provider); - } } diff --git a/platform/testRunner/src/com/intellij/execution/testframework/stacktrace/DiffHyperlink.java b/platform/testRunner/src/com/intellij/execution/testframework/stacktrace/DiffHyperlink.java index 51d4caf9a464..37318b8b21af 100644 --- a/platform/testRunner/src/com/intellij/execution/testframework/stacktrace/DiffHyperlink.java +++ b/platform/testRunner/src/com/intellij/execution/testframework/stacktrace/DiffHyperlink.java @@ -23,7 +23,6 @@ package com.intellij.execution.testframework.stacktrace; import com.intellij.execution.ExecutionBundle; import com.intellij.execution.filters.HyperlinkInfo; import com.intellij.execution.filters.HyperlinkInfoBase; -import com.intellij.execution.testframework.AbstractTestProxy; import com.intellij.execution.testframework.Printable; import com.intellij.execution.testframework.Printer; import com.intellij.execution.testframework.actions.ViewAssertEqualsDiffAction; @@ -77,23 +76,6 @@ public class DiffHyperlink implements Printable { return filePath == null ? null : filePath.replace(File.separatorChar, '/'); } - /** - * Use {@link ViewAssertEqualsDiffAction#openDiff(DataContext, DiffHyperlink)} - */ - @Deprecated - public void openDiff(Project project) { - ViewAssertEqualsDiffAction.openDiff(DataManager.getInstance().getDataContext(), this); - } - - /** - * Use {@link ViewAssertEqualsDiffAction#openDiff(DataContext, DiffHyperlink)} - */ - @Deprecated - public void openMultiDiff(final Project project, - final AbstractTestProxy.AssertEqualsDiffChain chain) { - ViewAssertEqualsDiffAction.openDiff(DataManager.getInstance().getDataContext(), this); - } - protected String getTitle() { return ExecutionBundle.message("strings.equal.failed.dialog.title"); } From 7eaf6f422ec4b41196a5d196b17bf524fd424c1e Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Thu, 30 Mar 2017 15:00:37 +0300 Subject: [PATCH 08/12] diff: remove unused flag --- .../openapi/vcs/changes/actions/migrate/MigrateDiffTool.java | 1 - .../vcs/changes/actions/migrate/MigrateToNewDiffUtil.java | 2 -- 2 files changed, 3 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java index 39f91e212daf..282220c7d69f 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateDiffTool.java @@ -47,7 +47,6 @@ public class MigrateDiffTool implements DiffTool { public boolean canShow(DiffRequest request) { if (request instanceof MergeRequest) return false; if (request.getContents().length != 2) return false; - if (request.getHints().contains(MigrateToNewDiffUtil.DO_NOT_TRY_MIGRATE)) return false; if (request.getOnOkRunnable() != null) return false; if (!DiffManagerImpl.INTERNAL_DIFF.canShow(request) && !BinaryDiffTool.INSTANCE.canShow(request)) return false; for (DiffTool tool : DiffManagerImpl.getInstanceEx().getAdditionTools()) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java index b1c9e1e63f30..0bc200c1450e 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/migrate/MigrateToNewDiffUtil.java @@ -31,8 +31,6 @@ import java.util.List; import static com.intellij.openapi.util.text.StringUtil.notNullize; public class MigrateToNewDiffUtil { - @NonNls public static final Object DO_NOT_TRY_MIGRATE = "doNotTryMigrate"; - @NotNull public static DiffRequest convertRequest(@NotNull com.intellij.openapi.diff.DiffRequest oldRequest) { DiffRequest request = convertRequestFair(oldRequest); From eacb373ed8a198dd4344ddd9a93fcca61cc202e6 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Thu, 30 Mar 2017 15:34:45 +0300 Subject: [PATCH 09/12] fix HtmlFormatterTest --- .../src/com/intellij/psi/formatter/HtmlFormatterTest.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/xml/tests/src/com/intellij/psi/formatter/HtmlFormatterTest.java b/xml/tests/src/com/intellij/psi/formatter/HtmlFormatterTest.java index 86df13403101..23fa64bc1b30 100644 --- a/xml/tests/src/com/intellij/psi/formatter/HtmlFormatterTest.java +++ b/xml/tests/src/com/intellij/psi/formatter/HtmlFormatterTest.java @@ -17,7 +17,6 @@ package com.intellij.psi.formatter; import com.intellij.lang.html.HTMLLanguage; import com.intellij.lang.injection.InjectedLanguageManager; -import com.intellij.openapi.application.PathManager; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.fileEditor.FileEditorManager; import com.intellij.openapi.vfs.VirtualFile; @@ -37,7 +36,7 @@ import org.jetbrains.annotations.NotNull; import java.util.Arrays; -public class HtmlFormatterTest extends FormatterTestCase { +public class HtmlFormatterTest extends XmlFormatterTestBase { @Override protected String getBasePath() { return "psi/formatter/html"; @@ -263,11 +262,6 @@ public class HtmlFormatterTest extends FormatterTestCase { doTestPerformance("html reformat with range", 5000, null); } - @Override - protected String getTestDataPath() { - return PathManager.getHomePath() + "/community/xml/tests/testData"; - } - public void doTestPerformance(@NotNull String message, int expectedTime, OptionsSetup optionsSetup) throws Exception { CodeStyleSettings settings = new CodeStyleSettings(); if (optionsSetup != null) optionsSetup.setupOptions(settings); From 928206ac5ba7d44a3665ad2f39c36b248ddc98ca Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Thu, 30 Mar 2017 15:36:42 +0300 Subject: [PATCH 10/12] IDEA-170621 'Smart Step Into' doesn't work in certain cases with interface methods --- .../engine/BasicStepMethodFilter.java | 19 +++++++++++++++++-- .../debugger/engine/MethodFilter.java | 11 ++++++++++- .../intellij/debugger/engine/RequestHint.java | 4 ++-- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java index cfd345758fcc..1d8570aa03c9 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/BasicStepMethodFilter.java @@ -15,6 +15,7 @@ */ package com.intellij.debugger.engine; +import com.intellij.debugger.EvaluatingComputable; import com.intellij.debugger.SourcePosition; import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.debugger.impl.DebuggerUtilsEx; @@ -25,6 +26,7 @@ import com.intellij.psi.util.InheritanceUtil; import com.intellij.util.Range; import com.sun.jdi.Location; import com.sun.jdi.Method; +import com.sun.jdi.ObjectReference; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -65,7 +67,12 @@ public class BasicStepMethodFilter implements NamedMethodFilter { return myTargetMethodName; } - public boolean locationMatches(final DebugProcessImpl process, final Location location) throws EvaluateException { + public boolean locationMatches(DebugProcessImpl process, Location location) throws EvaluateException { + return locationMatches(process, location, () -> null); + } + + public boolean locationMatches(DebugProcessImpl process, Location location, @NotNull EvaluatingComputable thisProvider) + throws EvaluateException { Method method = location.method(); String name = method.name(); if (!myTargetMethodName.equals(name)) { @@ -96,7 +103,15 @@ public class BasicStepMethodFilter implements NamedMethodFilter { if (method.isBridge()) { // skip bridge methods return false; } - return DebuggerUtilsEx.isAssignableFrom(myDeclaringClassName.getName(process), location.declaringType()); + String declaringClassNameName = myDeclaringClassName.getName(process); + boolean res = DebuggerUtilsEx.isAssignableFrom(declaringClassNameName, location.declaringType()); + if (!res && !method.isStatic()) { + ObjectReference thisObject = thisProvider.compute(); + if (thisObject != null) { + res = DebuggerUtilsEx.isAssignableFrom(declaringClassNameName, thisObject.referenceType()); + } + } + return res; } private static boolean signatureMatches(Method method, final String expectedSignature) throws EvaluateException { diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java b/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java index 757272c8b777..b90829d82b3f 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/MethodFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,13 +15,22 @@ */ package com.intellij.debugger.engine; +import com.intellij.debugger.EvaluatingComputable; import com.intellij.debugger.engine.evaluation.EvaluateException; import com.intellij.util.Range; import com.sun.jdi.Location; +import com.sun.jdi.ObjectReference; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public interface MethodFilter { boolean locationMatches(DebugProcessImpl process, Location location) throws EvaluateException; + + default boolean locationMatches(DebugProcessImpl process, Location location, @NotNull EvaluatingComputable thisProvider) + throws EvaluateException { + return locationMatches(process, location); + } + @Nullable Range getCallingExpressionLines(); default int onReached(SuspendContextImpl context, RequestHint hint) { diff --git a/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java b/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java index d6d00f5207e5..f5adb418da5a 100644 --- a/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java +++ b/java/debugger/impl/src/com/intellij/debugger/engine/RequestHint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 JetBrains s.r.o. + * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -192,7 +192,7 @@ public class RequestHint { if (myMethodFilter != null && frameProxy != null && !(myMethodFilter instanceof BreakpointStepMethodFilter) && - myMethodFilter.locationMatches(context.getDebugProcess(), frameProxy.location()) && + myMethodFilter.locationMatches(context.getDebugProcess(), frameProxy.location(), frameProxy::thisObject) && !isTheSameFrame(context) ) { myTargetMethodMatched = true; From 51b9297a0e1a1409513f52d93d1cb248cb8ee3af Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 30 Mar 2017 15:26:17 +0300 Subject: [PATCH 11/12] [vcs]: RemoveChangeList action title/description changed to plural --- .../src/messages/ActionsBundle.properties | 4 ++-- .../openapi/vcs/changes/actions/RemoveChangeListAction.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index 7fb339d34ab5..a756aa3b39f0 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -1232,8 +1232,8 @@ action.ChangesView.NewChangeList.text=New Changelist action.ChangesView.NewChangeList.description=Create new changelist action.ChangesView.Revert.text=_Revert action.ChangesView.Revert.description=Revert selected changes -action.ChangesView.RemoveChangeList.text=Delete Changelist -action.ChangesView.RemoveChangeList.description=Remove changelist and move all changes to {0} +action.ChangesView.RemoveChangeList.text=Delete Changelists +action.ChangesView.RemoveChangeList.description=Remove changelists and move all changes to {0} action.ChangesView.SetDefault.text=Set Active Changelist action.ChangesView.SetDefault.description=Set changelist to which new changes are placed by default action.ChangesView.Move.text=Move to Another Changelist... diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/RemoveChangeListAction.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/RemoveChangeListAction.java index 61d8f5eeaf15..7a1b627afdb3 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/RemoveChangeListAction.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/RemoveChangeListAction.java @@ -54,6 +54,7 @@ public class RemoveChangeListAction extends AnAction implements DumbAware { presentation.setDescription(ArrayUtil.isEmpty(e.getData(VcsDataKeys.CHANGES)) ? presentation.getText() : getDescription(changeLists)); } + @NotNull private static String getDescription(@Nullable ChangeList[] changeLists) { return ActionsBundle.message("action.ChangesView.RemoveChangeList.description", containsActiveChangelist(changeLists) ? "another changelist" : "active one"); From dee2f63b7fc6fee798afb0c8576bdcada50a8787 Mon Sep 17 00:00:00 2001 From: Nadya Zabrodina Date: Thu, 30 Mar 2017 15:27:05 +0300 Subject: [PATCH 12/12] [vcs]: cosmetic - rename and unify method usages --- .../changes/patch/ApplyPatchDifferentiatedDialog.java | 2 +- .../git4idea/src/git4idea/push/GitPushTargetPanel.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java index 933573d18dd2..4386f8d23f9f 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java @@ -431,7 +431,7 @@ public class ApplyPatchDifferentiatedDialog extends DialogWrapper { private void addNotificationAndWarn(@NotNull String errorMessage) { LOG.warn(errorMessage); - myErrorNotificationPanel.text(errorMessage); + myErrorNotificationPanel.setText(errorMessage); myErrorNotificationPanel.setVisible(true); } diff --git a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java index 310ff88234ed..c4fcd92b02ba 100644 --- a/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java +++ b/plugins/git4idea/src/git4idea/push/GitPushTargetPanel.java @@ -68,10 +68,10 @@ public class GitPushTargetPanel extends PushTargetPanel { private static final Comparator REMOTE_BRANCH_COMPARATOR = new MyRemoteBranchComparator(); private static final String SEPARATOR = " : "; private static final Color NEW_BRANCH_LABEL_FG = new JBColor(0x00b53d, 0x6ba65d); - private static final Color NEW_BRANCH_SELECTION_LABEL_FG = UIUtil.getTreeSelectionForeground(); + private static final Color NEW_BRANCH_LABEL_SELECTION_FG = UIUtil.getTreeSelectionForeground(); private static final Color NEW_BRANCH_LABEL_BG = new JBColor(0xebfcf1, 0x313b32); - private static final Color NEW_BRANCH_SELECTION_LABEL__BG = - new JBColor(ColorUtil.toAlpha(NEW_BRANCH_SELECTION_LABEL_FG, 20), ColorUtil.toAlpha(NEW_BRANCH_SELECTION_LABEL_FG, 30)); + private static final Color NEW_BRANCH_LABEL_SELECTION_BG = + new JBColor(ColorUtil.toAlpha(NEW_BRANCH_LABEL_SELECTION_FG, 20), ColorUtil.toAlpha(NEW_BRANCH_LABEL_SELECTION_FG, 30)); private static final RelativeFont NEW_BRANCH_LABEL_FONT = RelativeFont.TINY.small(); private static final TextIcon NEW_BRANCH_LABEL = new TextIcon("New", NEW_BRANCH_LABEL_FG, NEW_BRANCH_LABEL_BG, 0); @@ -282,8 +282,8 @@ public class GitPushTargetPanel extends PushTargetPanel { NEW_BRANCH_LABEL.setInsets(JBUI.insets(2)); NEW_BRANCH_LABEL.setRound(JBUI.scale(4)); NEW_BRANCH_LABEL.setFont(NEW_BRANCH_LABEL_FONT.derive(renderer.getFont())); - NEW_BRANCH_LABEL.setForeground(isSelected ? NEW_BRANCH_SELECTION_LABEL_FG : NEW_BRANCH_LABEL_FG); - NEW_BRANCH_LABEL.setBackground(isSelected ? NEW_BRANCH_SELECTION_LABEL__BG : NEW_BRANCH_LABEL_BG); + NEW_BRANCH_LABEL.setForeground(isSelected ? NEW_BRANCH_LABEL_SELECTION_FG : NEW_BRANCH_LABEL_FG); + NEW_BRANCH_LABEL.setBackground(isSelected ? NEW_BRANCH_LABEL_SELECTION_BG : NEW_BRANCH_LABEL_BG); renderer.setIcon(NEW_BRANCH_LABEL); } }