mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
provide equals/hashcode to work inside maps/sets correctly (IDEA-126131)
This commit is contained in:
@@ -651,7 +651,7 @@ public class GotoActionModel implements ChooseByNameModel, CustomMatcherModel, C
|
||||
private MatchMode myMode;
|
||||
private String myGroupName;
|
||||
|
||||
public ActionWrapper(AnAction action, String groupName, MatchMode mode) {
|
||||
public ActionWrapper(@NotNull AnAction action, String groupName, MatchMode mode) {
|
||||
myAction = action;
|
||||
myMode = mode;
|
||||
myGroupName = groupName;
|
||||
@@ -680,5 +680,15 @@ public class GotoActionModel implements ChooseByNameModel, CustomMatcherModel, C
|
||||
public void setGroupName(String groupName) {
|
||||
myGroupName = groupName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof ActionWrapper && compareTo((ActionWrapper)obj) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return myAction.getTemplatePresentation().getText().hashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user