public void addItem(MenuItem item){
  XMenuItemPeer mp=(XMenuItemPeer)item.getPeer();
  if (mp != null) {
    mp.setContainer(this);
synchronized (getMenuTreeLock()) {
      items.add(mp);
    }
  }
 else {
    if (log.isLoggable(PlatformLogger.Level.FINE)) {
      log.fine("WARNING: Attempt to add menu item without a peer");
    }
  }
  updateSize();
}

public void addItem ( MenuItem item ) { XMenuItemPeer mp = ( XMenuItemPeer ) item . getPeer ( ) ; if ( mp != null ) { mp . setContainer ( this ) ; synchronized ( getMenuTreeLock ( ) ) { items . add ( mp ) ; } } else { if ( log . isLoggable ( PlatformLogger . Level . FINE ) ) { log . fine ( "WARNING: Attempt to add menu item without a peer" ) ; } } updateSize ( ) ; }
adds item to end of items vector . note that this function does not perform check for adding duplicate items
