mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[IDEA-CR-52372] remove deprecated methods
GitOrigin-RevId: 07a67117cefcfc6f6692359c78b50b50382eee34
This commit is contained in:
committed by
intellij-monorepo-bot
parent
992fb746a9
commit
b2dbacf80e
@@ -23,10 +23,10 @@ import com.intellij.rt.execution.application.AppMainV2;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.execution.ParametersListUtil;
|
||||
import com.intellij.xdebugger.attach.XAttachProcessPresentationGroup;
|
||||
import com.intellij.xdebugger.attach.XDefaultLocalAttachGroup;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachDebugger;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachDebuggerProvider;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachGroup;
|
||||
import com.jetbrains.sa.SaJdwp;
|
||||
import com.sun.tools.attach.AttachNotSupportedException;
|
||||
import com.sun.tools.attach.VirtualMachine;
|
||||
@@ -71,7 +71,7 @@ public class JavaAttachDebuggerProvider implements XLocalAttachDebuggerProvider
|
||||
|
||||
private static final Key<Map<String, LocalAttachInfo>> ADDRESS_MAP_KEY = Key.create("ADDRESS_MAP");
|
||||
|
||||
private static final XLocalAttachGroup ourAttachGroup = new JavaDebuggerAttachGroup("Java", -20);
|
||||
private static final XAttachProcessPresentationGroup ourAttachGroup = new JavaDebuggerAttachGroup("Java", -20);
|
||||
|
||||
static class JavaDebuggerAttachGroup extends XDefaultLocalAttachGroup {
|
||||
private final String myName;
|
||||
@@ -95,7 +95,7 @@ public class JavaAttachDebuggerProvider implements XLocalAttachDebuggerProvider
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getProcessDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
public String getItemDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
LocalAttachInfo attachInfo = getAttachInfo(project, info.getPid(), info.getCommandLine(), dataHolder.getUserData(ADDRESS_MAP_KEY));
|
||||
assert attachInfo != null;
|
||||
String res;
|
||||
@@ -117,7 +117,7 @@ public class JavaAttachDebuggerProvider implements XLocalAttachDebuggerProvider
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public XLocalAttachGroup getAttachGroup() {
|
||||
public XAttachProcessPresentationGroup getPresentationGroup() {
|
||||
return ourAttachGroup;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.debugger.impl.attach;
|
||||
|
||||
import com.intellij.xdebugger.attach.XLocalAttachGroup;
|
||||
import com.intellij.xdebugger.attach.XAttachProcessPresentationGroup;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @author egor
|
||||
*/
|
||||
public class JavaSAAttachDebuggerProvider extends JavaAttachDebuggerProvider {
|
||||
private static final XLocalAttachGroup ourAttachGroup = new JavaDebuggerAttachGroup("Java Read Only", -19);
|
||||
private static final XAttachProcessPresentationGroup ourAttachGroup = new JavaDebuggerAttachGroup("Java Read Only", -19);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public XLocalAttachGroup getAttachGroup() {
|
||||
public XAttachProcessPresentationGroup getPresentationGroup() {
|
||||
return ourAttachGroup;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -18,11 +17,6 @@ import java.util.List;
|
||||
public interface XAttachDebuggerProvider {
|
||||
ExtensionPointName<XAttachDebuggerProvider> EP = ExtensionPointName.create("com.intellij.xdebugger.attachDebuggerProvider");
|
||||
|
||||
/**
|
||||
* will be removed in 2020.1, right after {@link XLocalAttachDebuggerProvider}
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
@NotNull
|
||||
static List<XAttachDebuggerProvider> getAttachDebuggerProviders() {
|
||||
return ContainerUtil.concat(new ArrayList<>(EP.getExtensionList()),
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.intellij.xdebugger.attach;
|
||||
import com.intellij.execution.process.ProcessInfo;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -27,8 +26,9 @@ import java.util.Comparator;
|
||||
|
||||
/**
|
||||
* This interface describes visualization of attach items
|
||||
*
|
||||
* @param <T> type of the child items (belonging to this group)
|
||||
* (applicable both for {@link XAttachHost} and {@link ProcessInfo} items)
|
||||
* (applicable both for {@link XAttachHost} and {@link ProcessInfo} items)
|
||||
*/
|
||||
public interface XAttachPresentationGroup<T> extends Comparator<T> {
|
||||
/**
|
||||
@@ -39,31 +39,13 @@ public interface XAttachPresentationGroup<T> extends Comparator<T> {
|
||||
@NotNull
|
||||
String getGroupName();
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getItemIcon(Project, Object, UserDataHolder)} (will be removed in 2020.1)
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
Icon getProcessIcon(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder);
|
||||
|
||||
/**
|
||||
* @param dataHolder you may put your specific data into the holder at previous step in {@link XAttachDebuggerProvider#getAvailableDebuggers}
|
||||
* and use it for presentation
|
||||
* @return an icon to be shown in popup menu for your item, described by info
|
||||
*/
|
||||
@NotNull
|
||||
default Icon getItemIcon(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder) {
|
||||
return getProcessIcon(project, info, dataHolder);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getItemDisplayText(Project, Object, UserDataHolder)} (will be removed in 2020.1)
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
String getProcessDisplayText(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder);
|
||||
Icon getItemIcon(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder);
|
||||
|
||||
/**
|
||||
* @param dataHolder you may put your specific data into the holder at previous step in {@link XAttachDebuggerProvider#getAvailableDebuggers}
|
||||
@@ -71,9 +53,7 @@ public interface XAttachPresentationGroup<T> extends Comparator<T> {
|
||||
* @return a text to be shown on your item, described by info
|
||||
*/
|
||||
@NotNull
|
||||
default String getItemDisplayText(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder) {
|
||||
return getProcessDisplayText(project, info, dataHolder);
|
||||
}
|
||||
String getItemDisplayText(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder);
|
||||
|
||||
/**
|
||||
* @param dataHolder you may put your specific data into the holder at previous step in {@link XAttachDebuggerProvider#getAvailableDebuggers}
|
||||
@@ -84,18 +64,4 @@ public interface XAttachPresentationGroup<T> extends Comparator<T> {
|
||||
default String getItemDescription(@NotNull Project project, @NotNull T info, @NotNull UserDataHolder dataHolder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #compare(Object, Object)} (will be removed in 2020.1)
|
||||
*
|
||||
* Specifies process order in your group
|
||||
*
|
||||
* @param dataHolder you may put your specific data into the holder at previous step in {@link XAttachDebuggerProvider#getAvailableDebuggers}
|
||||
* and use it for comparison
|
||||
*/
|
||||
@Deprecated
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
default int compare(@NotNull Project project, @NotNull T a, @NotNull T b, @NotNull UserDataHolder dataHolder) {
|
||||
return compare(a, b);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link XAttachPresentationGroup} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public class XDefaultLocalAttachGroup implements XLocalAttachGroup {
|
||||
public class XDefaultLocalAttachGroup implements XAttachProcessPresentationGroup {
|
||||
public static final XDefaultLocalAttachGroup INSTANCE = new XDefaultLocalAttachGroup();
|
||||
|
||||
@Override
|
||||
@@ -45,13 +41,13 @@ public class XDefaultLocalAttachGroup implements XLocalAttachGroup {
|
||||
@NotNull
|
||||
@Override
|
||||
public Icon getItemIcon(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return getProcessIcon(project, info, dataHolder);
|
||||
return AllIcons.RunConfigurations.Application;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getItemDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return getProcessDisplayText(project, info, dataHolder);
|
||||
return info.getExecutableDisplayName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -59,16 +55,4 @@ public class XDefaultLocalAttachGroup implements XLocalAttachGroup {
|
||||
public String getItemDescription(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Icon getProcessIcon(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return AllIcons.RunConfigurations.Application;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public String getProcessDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return info.getExecutableDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,34 +10,17 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link XAttachDebuggerProvider} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public interface XLocalAttachDebuggerProvider extends XAttachDebuggerProvider {
|
||||
ExtensionPointName<XAttachDebuggerProvider> EP = ExtensionPointName.create("com.intellij.xdebugger.localAttachDebuggerProvider");
|
||||
|
||||
/**
|
||||
* @deprecated use {@link XAttachDebuggerProvider#getAvailableDebuggers(Project, XAttachHost, ProcessInfo, UserDataHolder)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
List<XLocalAttachDebugger> getAvailableDebuggers(@NotNull Project project,
|
||||
@NotNull ProcessInfo process,
|
||||
@NotNull UserDataHolder contextHolder);
|
||||
|
||||
/**
|
||||
* @deprecated use {@link XAttachDebuggerProvider#getPresentationGroup()} instead
|
||||
*/
|
||||
@Deprecated
|
||||
@NotNull
|
||||
default XAttachPresentationGroup<ProcessInfo> getAttachGroup() {
|
||||
return XDefaultLocalAttachGroup.INSTANCE;
|
||||
}
|
||||
@NotNull ProcessInfo process,
|
||||
@NotNull UserDataHolder contextHolder);
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
default XAttachPresentationGroup<ProcessInfo> getPresentationGroup() {
|
||||
return getAttachGroup();
|
||||
return XDefaultLocalAttachGroup.INSTANCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,9 +31,9 @@ public interface XLocalAttachDebuggerProvider extends XAttachDebuggerProvider {
|
||||
@NotNull
|
||||
@Override
|
||||
default List<XAttachDebugger> getAvailableDebuggers(@NotNull Project project,
|
||||
@NotNull XAttachHost hostInfo,
|
||||
@NotNull ProcessInfo process,
|
||||
@NotNull UserDataHolder contextHolder) {
|
||||
@NotNull XAttachHost hostInfo,
|
||||
@NotNull ProcessInfo process,
|
||||
@NotNull UserDataHolder contextHolder) {
|
||||
assert hostInfo instanceof LocalAttachHost;
|
||||
|
||||
return new ArrayList<>(getAvailableDebuggers(project, process, contextHolder));
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2016 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.xdebugger.attach;
|
||||
|
||||
import com.intellij.execution.process.ProcessInfo;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link XAttachProcessPresentationGroup} (will be removed in 2020.1)
|
||||
*/
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
@Deprecated
|
||||
public interface XLocalAttachGroup extends XAttachProcessPresentationGroup {
|
||||
/**
|
||||
* @deprecated will be removed in 2020.1
|
||||
*/
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
@Deprecated @NotNull
|
||||
XLocalAttachGroup DEFAULT = new XDefaultLocalAttachGroup();
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #compare(ProcessInfo, ProcessInfo)} (will be removed in 2020.1)
|
||||
*/
|
||||
@ApiStatus.ScheduledForRemoval(inVersion = "2020.1")
|
||||
@Override
|
||||
@Deprecated
|
||||
default int compare(@NotNull Project project, @NotNull ProcessInfo a, @NotNull ProcessInfo b, @NotNull UserDataHolder dataHolder) {
|
||||
return compare(a, b);
|
||||
}
|
||||
}
|
||||
@@ -18,18 +18,10 @@ object LocalAttachHostPresentationGroup: XAttachPresentationGroup<XAttachHost> {
|
||||
return ""
|
||||
}
|
||||
|
||||
override fun getProcessIcon(project: Project, info: XAttachHost, dataHolder: UserDataHolder): Icon {
|
||||
TODO("deprecated method should not be invoked")
|
||||
}
|
||||
|
||||
override fun getItemIcon(project: Project, info: XAttachHost, dataHolder: UserDataHolder): Icon {
|
||||
return EmptyIcon.ICON_16
|
||||
}
|
||||
|
||||
override fun getProcessDisplayText(project: Project, info: XAttachHost, dataHolder: UserDataHolder): String {
|
||||
TODO("deprecated method should not be invoked")
|
||||
}
|
||||
|
||||
override fun getItemDisplayText(project: Project, info: XAttachHost, dataHolder: UserDataHolder): String {
|
||||
return "Local Host"
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public class AttachToProcessActionTest extends HeavyPlatformTestCase {
|
||||
new TestDebuggerProvider(new TestAttachGroup("group", 0) {
|
||||
@NotNull
|
||||
@Override
|
||||
public String getProcessDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
public String getItemDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return "custom";
|
||||
}
|
||||
}, "dbg1"));
|
||||
@@ -639,22 +639,22 @@ public class AttachToProcessActionTest extends HeavyPlatformTestCase {
|
||||
|
||||
private static class TestDebuggerProvider implements XLocalAttachDebuggerProvider {
|
||||
@Nullable private final Integer myFilterPID;
|
||||
@NotNull private final XLocalAttachGroup myGroup;
|
||||
@NotNull private final XAttachPresentationGroup myGroup;
|
||||
@NotNull private final List<XLocalAttachDebugger> myDebuggers;
|
||||
|
||||
TestDebuggerProvider(@Nullable Integer filterPID,
|
||||
@NotNull XLocalAttachGroup group,
|
||||
@NotNull XAttachPresentationGroup group,
|
||||
@NotNull List<XLocalAttachDebugger> debuggers) {
|
||||
myFilterPID = filterPID;
|
||||
myGroup = group;
|
||||
myDebuggers = debuggers;
|
||||
}
|
||||
|
||||
TestDebuggerProvider(@Nullable Integer filterPID, @NotNull XLocalAttachGroup group, String... names) {
|
||||
TestDebuggerProvider(@Nullable Integer filterPID, @NotNull XAttachPresentationGroup group, String... names) {
|
||||
this(filterPID, group, createDebuggers(names));
|
||||
}
|
||||
|
||||
TestDebuggerProvider(@NotNull XLocalAttachGroup group, String... names) {
|
||||
TestDebuggerProvider(@NotNull XAttachPresentationGroup group, String... names) {
|
||||
this(null, group, names);
|
||||
}
|
||||
|
||||
@@ -664,7 +664,7 @@ public class AttachToProcessActionTest extends HeavyPlatformTestCase {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public XLocalAttachGroup getAttachGroup() {
|
||||
public XAttachPresentationGroup getPresentationGroup() {
|
||||
return myGroup;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.xdebugger.attach.XAttachProcessPresentationGroup;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachDebugger;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachDebuggerProvider;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachGroup;
|
||||
import com.jetbrains.python.debugger.PyDebuggerOptionsProvider;
|
||||
import com.jetbrains.python.run.AbstractPythonRunConfiguration;
|
||||
import com.jetbrains.python.sdk.PreferredSdkComparator;
|
||||
@@ -46,7 +46,7 @@ public class PyLocalAttachDebuggerProvider implements XLocalAttachDebuggerProvid
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public XLocalAttachGroup getAttachGroup() {
|
||||
public XAttachProcessPresentationGroup getPresentationGroup() {
|
||||
return PyLocalAttachGroup.INSTANCE;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,13 @@ import com.intellij.execution.process.ProcessInfo;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.intellij.xdebugger.attach.XLocalAttachGroup;
|
||||
import com.intellij.xdebugger.attach.XAttachProcessPresentationGroup;
|
||||
import com.intellij.xdebugger.attach.XDefaultLocalAttachGroup;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
class PyLocalAttachGroup implements XLocalAttachGroup {
|
||||
class PyLocalAttachGroup implements XAttachProcessPresentationGroup {
|
||||
public static final PyLocalAttachGroup INSTANCE = new PyLocalAttachGroup();
|
||||
|
||||
private PyLocalAttachGroup() {
|
||||
@@ -32,7 +33,7 @@ class PyLocalAttachGroup implements XLocalAttachGroup {
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return XLocalAttachGroup.DEFAULT.getOrder() - 10;
|
||||
return XDefaultLocalAttachGroup.INSTANCE.getOrder() - 10;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -43,13 +44,13 @@ class PyLocalAttachGroup implements XLocalAttachGroup {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Icon getProcessIcon(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
public Icon getItemIcon(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return AllIcons.RunConfigurations.Application;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getProcessDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
public String getItemDisplayText(@NotNull Project project, @NotNull ProcessInfo info, @NotNull UserDataHolder dataHolder) {
|
||||
return info.getArgs();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user