Details
-
Type:
Bug
-
Status: Resolved
-
Priority:
P3
-
Resolution: Fixed
-
Affects Version/s: 1.2.0
-
Fix Version/s: 1.2.2
-
Component/s: client-libs
-
Labels:
-
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.
======================================================================