private static String getActionId(AnAction action) {
    return action instanceof ActionStub ? ((ActionStub)action).getId() : ActionManager.getInstance().getId(action);
  }
private static String getActionId(AnAction action)