public synchronized boolean replaceAction(@NotNull AnAction oldAction, @NotNull AnAction newAction) {
    int index = mySortedChildren.indexOf(oldAction);
    if (index >= 0) {
      mySortedChildren.set(index, newAction);
      replaceConstraint(oldAction, newAction);
      incrementModificationStamp();
      return true;
    }
    else {
      int indexOld = myPendingActions.indexOf(oldAction);
      if (indexOld >= 0) {
        myPendingActions.set(indexOld, newAction);
        replaceConstraint(oldAction, newAction);
        incrementModificationStamp();
        return true;
      }
    }
    return false;
  }
public synchronized boolean replaceAction(@NotNull AnAction oldAction, @NotNull AnAction newAction)