JDK-6829326 : Getting java.lang.NullPointerException: null pData while opening a File,Print,Page Dialog in Win
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: windows,windows_xp
  • CPU: x86
  • Submitted: 2009-04-13
  • Updated: 2011-03-07
  • Resolved: 2011-03-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b55Fixed
Related Reports
Duplicate :  
Relates :  
Description
Getting "java.lang.NullPointerException: null pData" while opening a FileDialog/PrintDialog/PageDialog in Windows.
This is reproducible in Windows XP, Vista with the Jdk7 b55 pit build.

Steps to Reproduce:
1. Run the attached testcase(ModalityTest.java)
2. Click on "Open File Dialog", "Open Page Dialog" and "Open Print Dialog"
3.Observe that Exception is thrown on console. If you see the same, then the bug is reproduced. 

The stack trace is:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException: null pData
        at sun.awt.windows.WComponentPeer.setZOrder(Native Method)
        at sun.awt.windows.WComponentPeer.setZOrder(WComponentPeer.java:1032)
        at java.awt.Component.addNotify(Component.java:6669)
        at java.awt.Container.addNotify(Container.java:2611)
        at java.awt.Window.addNotify(Window.java:720)
        at java.awt.Dialog.addNotify(Dialog.java:763)
        at java.awt.FileDialog.addNotify(FileDialog.java:283)
        at java.awt.Dialog.conditionalShow(Dialog.java:912)
        at java.awt.Dialog.show(Dialog.java:1061)
        at java.awt.Component.show(Component.java:1525)
        at java.awt.Component.setVisible(Component.java:1477)
        at java.awt.Window.setVisible(Window.java:925)
        at java.awt.Dialog.setVisible(Dialog.java:1011)
        at ModalityTest.actionPerformed(ModalityTest.java:79)
        at java.awt.Button.processActionEvent(Button.java:409)
        at java.awt.Button.processEvent(Button.java:377)
        at java.awt.Component.dispatchEventImpl(Component.java:4620)
        at java.awt.Component.dispatchEvent(Component.java:4446)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:605)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThre
ad.java:286)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.
java:201)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:191)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:186)

        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:178)

        at java.awt.EventDispatchThread.run(EventDispatchThread.java:139)

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/awt_data/7/6829326/
13-04-2009

EVALUATION Regression introduced by 6809227. The new method setZOrder isn't supposed to be invoked on the instances of the FileDialog|PrintDialog classes.
13-04-2009

SUGGESTED FIX $hg diff src/windows/classes/sun/awt/windows/WFileDialogPeer.java diff -r 1cb2e3e0631f src/windows/classes/sun/awt/windows/WFileDialogPeer.java --- a/src/windows/classes/sun/awt/windows/WFileDialogPeer.java Wed Apr 01 19:05:47 2009 +0400 +++ b/src/windows/classes/sun/awt/windows/WFileDialogPeer.java Mon Apr 13 14:56:32 2009 +0400 @@ -225,6 +225,7 @@ public class WFileDialogPeer extends WWi public void addDropTarget(DropTarget dt) {} public void removeDropTarget(DropTarget dt) {} public void updateFocusableWindowState() {} + public void setZOrder(ComponentPeer above) {} /** * Initialize JNI field and method ids $hg diff src/windows/classes/sun/awt/windows/WPrintDialogPeer.java diff -r 1cb2e3e0631f src/windows/classes/sun/awt/windows/WPrintDialogPeer.java --- a/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java Wed Apr 01 19:05:47 2009 +0400 +++ b/src/windows/classes/sun/awt/windows/WPrintDialogPeer.java Mon Apr 13 14:56:55 2009 +0400 @@ -27,6 +27,7 @@ package sun.awt.windows; import java.awt.*; import java.awt.peer.DialogPeer; +import java.awt.peer.ComponentPeer; import java.awt.dnd.DropTarget; import java.util.Vector; import sun.awt.AppContext; @@ -137,6 +138,7 @@ public class WPrintDialogPeer extends WW void invalidate(int x, int y, int width, int height) {} public void addDropTarget(DropTarget dt) {} public void removeDropTarget(DropTarget dt) {} + public void setZOrder(ComponentPeer above) {} /** * Initialize JNI field and method ids heffalump:/net/jse-st01/export3/awt/users/dc158259/repo/jdk-repo$
13-04-2009

EVALUATION Need to be fixed.
13-04-2009