IDEA-379840 Make ExternalSystemNode comparable over ? instead of T

This gets rid of the raw type in the compareTo method.
Additionally, it's more correct anyway as the whole implementation
indicates that ExternalSystemNode is comparable regardless of the
held data.

GitOrigin-RevId: 4ecf8032e7e7d1cd6449cce7da03b69a0c641b9c
This commit is contained in:
Tobias Kahlert
2025-09-24 21:22:45 +00:00
committed by intellij-monorepo-bot
parent 9e35795ae2
commit a2da3d416c
4 changed files with 5 additions and 5 deletions
@@ -35,7 +35,7 @@ import java.util.function.Function;
/**
* @author Vladislav.Soroka
*/
public abstract class ExternalSystemNode<T> extends SimpleNode implements Comparable<ExternalSystemNode<T>> {
public abstract class ExternalSystemNode<T> extends SimpleNode implements Comparable<ExternalSystemNode<?>> {
static final int BUILTIN_TASKS_DATA_NODE_ORDER = 10;
static final int BUILTIN_DEPENDENCIES_DATA_NODE_ORDER = BUILTIN_TASKS_DATA_NODE_ORDER + 10;
@@ -407,7 +407,7 @@ public abstract class ExternalSystemNode<T> extends SimpleNode implements Compar
}
@Override
public int compareTo(@NotNull ExternalSystemNode node) {
public int compareTo(@NotNull ExternalSystemNode<?> node) {
return StringUtil.compare(this.getName(), node.getName(), true);
}
@@ -422,7 +422,7 @@ final class ExternalSystemViewDefaultContributor extends ExternalSystemViewContr
}
@Override
public int compareTo(@NotNull ExternalSystemNode node) {
public int compareTo(@NotNull ExternalSystemNode<?> node) {
final T myData = getData();
final Object thatData = node.getData();
if (myData instanceof OrderAware && thatData instanceof OrderAware) {
@@ -80,7 +80,7 @@ public class ModuleNode extends ExternalSystemNode<ModuleData> {
}
@Override
public int compareTo(@NotNull ExternalSystemNode node) {
public int compareTo(@NotNull ExternalSystemNode<?> node) {
return myIsRoot ? -1 : (node instanceof ModuleNode && ((ModuleNode)node).myIsRoot) ? 1 : super.compareTo(node);
}
@@ -80,7 +80,7 @@ public class TasksNode extends ExternalSystemNode<Object> {
}
@Override
public int compareTo(@NotNull ExternalSystemNode node) {
public int compareTo(@NotNull ExternalSystemNode<?> node) {
return "other".equals(group) ? 1 : super.compareTo(node);
}
};