United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6574117 NPE in querying Win32PrintService that does not support SheetCollate when using null DocFlavor
JDK-6574117 : NPE in querying Win32PrintService that does not support SheetCollate when using null DocFlavor

Details
Type:
Bug
Submit Date:
2007-06-26
Status:
Closed
Updated Date:
2011-03-07
Project Name:
JDK
Resolved Date:
2011-03-07
Component:
client-libs
OS:
windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
1.5.0_11-b03

ADDITIONAL OS VERSION INFORMATION :
Windows

A DESCRIPTION OF THE PROBLEM :
it seems an improper implementation with sun.print.Win32PrintService.getSupportedAttributeValues(line 1203):
	    if ((isCollateSup && flavor == null) ||
		(flavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE) ||
		 flavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE))) {

The argument "flavor" can be null according the API document, but if "isCollateSup" is false(it is case for the virtual printer "Microsoft Office Document Image Writer"), a NullPointerException will be thrown out for a null DocFlavor.


REPRODUCIBILITY :
This bug can be reproduced always.

                                    

Comments
EVALUATION

yep.
                                     
2007-06-26



Hardware and Software, Engineered to Work Together