JDK-6574117 : NPE in querying Win32PrintService that does not support SheetCollate when using null DocFlavor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-06-26
  • 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 6 JDK 7
6u10Fixed 7 b17Fixed
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.
26-06-2007