RFR: 8223717: javafx printing: Support Specifying Print to File in the API [v3]

Phil Race prr at openjdk.java.net
Mon Jun 28 19:47:46 UTC 2021


On Fri, 25 Jun 2021 21:20:53 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/com/sun/prism/j2d/print/J2DPrinterJob.java line 839:
>> 
>>> 837:             security.checkPrintJobAccess();
>>> 838:             String file = settings.getOutputFile();
>>> 839:             if (!file.isEmpty()) {
>> 
>> Don't we need to check for file!= null?
>
> The default value for the property is the empty string. But it does bring up a good point that we should either check and throw NPE if `setOutputFile` is called with `null` or we should map null to the empty string.

we do remap null to the empty string .. the code in JobSettings.outputFileProperty() does it.
So this will never be null

-------------

PR: https://git.openjdk.java.net/jfx/pull/543


More information about the openjfx-dev mailing list