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

Method Window.show() throws unexpected NullPointerException

    Details

    • Subcomponent:
    • Resolved In Build:
      1.2.2
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: dsC58869 Date: 09/29/98



      The java.awt.Window.show() method throws NullPointerException when
      this window's owner has its own owner.

      ==== Here is the test demonstrating the bug ====
      import java.awt.*;

      public class WindowTest01 {

          public static void main (String args[]) {
      Frame parent = new Frame("Frame");
      Window owner = new Window(parent);
      Window window = new Window(owner);
      try {
      window.show();
      System.out.println("OKAY");
      } catch (NullPointerException npe) {
      npe.printStackTrace();
      System.out.println("failed");
      }
      System.exit(0);
          }
      }

      === OUTPUT ===
      %java WindowTest01
      java.lang.NullPointerException: NullPointerException
              at sun.awt.motif.MWindowPeer.create(Native Method)
              at sun.awt.motif.MComponentPeer.init(Compiled Code)
              at sun.awt.motif.MWindowPeer.<init>(Compiled Code)
              at sun.awt.motif.MToolkit.createWindow(Compiled Code)
              at java.awt.Window.addNotify(Compiled Code)
              at java.awt.Window.show(Compiled Code)
              at WindowTest01.main(Compiled Code)
      failed
      %

      ======================================================================
       Justification:
      Unexpected behavior.

      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              xdengsunw Xianfa Deng (Inactive)
              Reporter:
              dsilaev Dmitri Silaev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: