JDK-6287599 : NPE thrown when opening PrintDialog with HP LaserJet 8000N
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2005-06-17
  • Updated: 2008-02-06
  • Resolved: 2005-07-26
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.
Other
1.4.2_10 b01Fixed
Description
The bug is specific to 1.4.2 update release.

While trying to backport the fix for 6174596 on 1.4.2_10, I figured out that the same  testcase as attached in 6174596 throws a NPE with HP LaserJet 8000N printer.
The bug is not reproduceable on 5.0 update release and on mustang.

Steps to reproduce:
- Run the attached testcase
- Following exception is thrown:

Exception in thread "main" java.lang.NullPointerException
        at sun.print.Win32PrintService.initMedia(Win32PrintService.java:362)
        at sun.print.Win32PrintService.getSupportedAttributeValues(Win32PrintSer
vice.java:1068)
        at sun.print.ServiceDialog$MediaPanel.updateInfo(ServiceDialog.java:1736
)
        at sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:
1104)
        at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:385)
        at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:180)
        at sun.print.ServiceDialog.<init>(ServiceDialog.java:133)
        at javax.print.ServiceUI.printDialog(ServiceUI.java:177)
        at PrintTest.print(PrintTest.java:40)
        at PrintTest.<init>(PrintTest.java:27)
        at PrintTest.main(PrintTest.java:56)



###@###.### 2005-06-17 22:27:12 GMT

Comments
EVALUATION In 1.4.2 ws, the return value from getMediaPrintableArea (line# 359 in Win32PrintService.java) is not checked for null condition. This has been fixed in 5.0 and above. May need to backport to 1.4.2_ur. ###@###.### 2005-06-17 22:33:15 GMT
17-06-2005