private static int getFlags(@NotNull AnAction action) {
    if (action.myMetaFlags != 0) return action.myMetaFlags;
    int flags = INIT;
    boolean isGroup = action instanceof ActionGroup;
    {
      Class<?> c = ReflectionUtil.getMethodDeclaringClass(action.getClass(), "update", AnActionEvent.class);
      if (AnAction.class.equals(c)) flags = BitUtil.set(flags, UPDATE, true);
      else if (isActionWrapper(c)) flags = BitUtil.set(flags, WRAPPER_UPDATE, true);
    }

    if (isGroup) {
      Class<?> c = ReflectionUtil.getMethodDeclaringClass(action.getClass(), "getChildren", AnActionEvent.class);
      if (isDefaultActionGroup(c)) flags = BitUtil.set(flags, CHILDREN, true);
      else if (isActionWrapper(c)) flags = BitUtil.set(flags, WRAPPER_CHILDREN, true);
    }

    if (isGroup) {
      Class<?> c1 = ReflectionUtil.getMethodDeclaringClass(action.getClass(), "postProcessVisibleChildren",
                                                          List.class, UpdateSession.class);
      Class<?> c2 = ReflectionUtil.getMethodDeclaringClass(action.getClass(), "postProcessVisibleChildren",
                                                          AnActionEvent.class, List.class);

      if (ActionGroup.class.equals(c1) && ActionGroup.class.equals(c2)) flags = BitUtil.set(flags, POSTPROCESS, true);
      else if (isActionWrapper(c1) && isActionWrapper(c2)) flags = BitUtil.set(flags, WRAPPER_POSTPROCESS, true);
    }

    action.myMetaFlags = flags;
    return flags;
  }
private static int getFlags(@NotNull AnAction action)