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

NullPointerException in Frame.dispose() when not calling show()

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: joT67522 Date: 12/16/97


      The following code triggers a NullPointerException:

      import java.awt.Frame;
      import java.awt.event.WindowAdapter;

      public class Bug_DSB_19971216 {
      public static void main(String [] argv)
      {
                 Frame f = new Frame();
                 f.addWindowListener(new WindowAdapter() { });
                 f.dispose();
      }
      }


      If Windows didn't suck, I'd cut and paste the
      the stack trace. However, it does, so here is a
      paraphrase, transcribed by hand:

      NullPointerException
         at Toolkit.getEventQueue(line 670)
         at Window.postWindowEvent(line 165)
         at Window.dispose(line 182)
         at Frame.dispose(line 37)
         at <my class>

      Apparently, dispose() was never tested without
      calling show(). (Calling show() causes the null
      pointer exception to disappear.)
      (Review ID: 22037)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              prssunw Prs Prs (Inactive)
              Reporter:
              johsunw Joon Oh (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: