Request for review: [NEW BUG] Printer spoolers ignore result from spool process

Phil Race philip.race at
Thu Oct 20 18:40:34 UTC 2011


Can you please redirect this over to 2d-dev.
Printing has nothing to do with core-libs. Its Java2D.


On 10/20/2011 11:15 AM, Neil Richards wrote:
> Hi all,
> Whilst trying to debug a printing problem, I noticed that the (Unix and
> PostScript) printer spoolers in Java do not check what the result is of
> trying to launch the OS print spooler command (often 'lpr' or 'lp').
> As a result, if that exec'd command fails for any reason, that result
> (and that reason) is lost, and the user left without any clue that
> something is amiss.
> To address this, I've created a suggested fix [1], which checks the exit
> code for the exec'd command and, if it's bad, throws an exception which
> captures any text from the command's error stream.
> It does this in both sun.print.PSPrinterJob and sun.print.UnixPrinterJob
> (they are very similar in composition and function).
> Please review this suggested change.
> Thanks, Neil
> [1]

More information about the core-libs-dev mailing list