public synchronized void endFill(boolean onAppKit) {
    disposeChildren(0);

    if (myBuffer.isEmpty()) {
      return;
    }

    myCachedPeers = new long[myBuffer.size()];
    //System.err.println("refill with " + newItemsPeers.length + " items");
    for (int c = 0; c < myBuffer.size(); ++c) {
      MenuItem menuItem = myBuffer.get(c);
      if (menuItem != null) {
        menuItem.ensureNativePeer();
        myCachedPeers[c] = menuItem.nativePeer;
        //System.err.printf("\t0x%X\n", newItemsPeers[c]);
        myItems.add(menuItem);
        menuItem.isInHierarchy = true;
      }
      else {
        myCachedPeers[c] = 0;
      }
    }
    myBuffer.clear();

    refillImpl(onAppKit);
  }
public synchronized void endFill(boolean onAppKit)