[OpenJDK 2D-Dev] [9] RFR 4987884: PrinterJob carries over some values between calls to print.

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Tue Jul 5 05:22:02 UTC 2016


Hi All,

Please review a fix whereby it is seen that the PageRanges attribute 
passed to 1st print() call is inadvertently been carried forward to 2nd 
print
if some program tries calling in this sequence
----------
/PrinterJob pj = PrinterJob.getPrinterJob();//
//pj.setPageable(..)//
//pj.print(..)//
//pj.setPageable(..)//
//pj.print(..)
------------
/
Bug: https://bugs.openjdk.java.net/browse/JDK-4987884/
/webrev: http://cr.openjdk.java.net/~psadhukhan/4987884/webrev.00//

/This is because no-args print() uses an internal attribute set which is 
presumed to carry over information not supplied
by the client directly but created during a call to no-args 
printDialog() or during call to setPrintable() called via setAttributes().
but it apparently seems, we should not be remembering PageRange 
attribute between calls to print() as it will result in wrong page 
numbers being printed.

Proposed fix to remove the PageRanges attribute from no-args print() 
between print() calls.

Regards
Prasanta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20160705/12ec4128/attachment.html>


More information about the 2d-dev mailing list