United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6287599 : NPE thrown when opening PrintDialog with HP LaserJet 8000N

Details
Type:
Bug
Submit Date:
2005-06-17
Status:
Resolved
Updated Date:
2008-02-06
Project Name:
JDK
Resolved Date:
2005-07-26
Component:
client-libs
OS:
windows
Sub-Component:
2d
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.2
Fixed Versions:
1.4.2_10 (b01)

Related Reports

Sub Tasks

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
                                     
2005-06-17



Hardware and Software, Engineered to Work Together