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

Warning Message when Calling removeAll() on an Empty List

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 1.2.2_05
    • Fix Version/s: 1.3.0
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.3
    • CPU:
      sparc
    • OS:
      solaris_7

      Description

      When List.removeAll() is called on an empty java.awt.List, the following message
      is generated:

      Warning:
          Name: slist
          Class: XmList
          Item(s) to be deleted are not present in the list.

      The problem does not occur on the win32 JDK.

      Below is a test case. Click on the "remove all" button once to remove the list.
      Clicking a second time will then produce the warning message.

      --------------------------------------------------------------------------------

      import java.awt.*;
      import java.awt.event.*;

      class Main extends Frame implements ActionListener {
          List l = new List(10,
              false);
          Button b;

          Main() {
              super("removeAll Example");

              for (int i = 0; i < 10; i++) {
                  l.addItem("item "+i);
              }

          b = new Button("Remove All " + l.getRows() + " Rows");
              add(l, BorderLayout.CENTER);
              add(b, BorderLayout.SOUTH);
              b.addActionListener(this);
              pack();
              show();
          }

          static public void main(String[] args) {
              new Main();
          }

          public void actionPerformed(ActionEvent evt) {
              l.removeAll();
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                herrick Andy Herrick
                Reporter:
                nrodinsunw Nick Rodin (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: