public void menuWillOpen() {
    // Called on AppKit when a menu opening
    if (!myIsOpened) {
      // When a user opens some menu at second time (without focus lost), apple doesn't call menuNeedsUpdate for
      // this menu (but always calls menuWillOpen) and for all submenus. It causes problems like IDEA-319117.
      // So detect this case and call menuNeedsUpdate() "manually".
      // NOTE: unfortunately modifying menu here can cause unstable behavior, see IDEA-315910.
      getLogger().debug("menuNeedsUpdate wasn't called for '" + myTitle + "', will do it now");
      menuNeedsUpdate();
    }
  }
public void menuWillOpen()