Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4188847

JMenu.remove(JMenuItem item) throws exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs



      Name: rk38400 Date: 11/10/98


      the following function removes the object 'item' from the listenerRegistry twice. this cause an exception to be throw on
      the second remove() call

          public void remove(JMenuItem item) {
              popupMenu.remove(item);
          if (listenerRegistry != null) {
      #1---> ActionChangedListener p = (ActionChangedListener) listenerRegistry.remove(item);
      #2---> Action a = (Action)listenerRegistry.remove(p);
              item.removeActionListener(a);
              if (p!=null)
              p.setTarget(null);
              if (a!=null)
              a.removePropertyChangeListener(p);
          }
          }
      (Review ID: 42292)
      ======================================================================

            gsaab Georges Saab
            rkarsunw Ralph Kar (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: