[OpenJDK 2D-Dev] [9] RFR JDK-5049012: PrintToFile option is not disabled for flavors that do not support destination
Philip Race
philip.race at oracle.com
Wed Jun 29 18:29:18 UTC 2016
---
https://docs.oracle.com/javase/8/docs/api/javax/print/PrintService.html#isAttributeValueSupported-javax.print.attribute.Attribute-javax.print.DocFlavor-javax.print.attribute.AttributeSet-
Throws:
NullPointerException - (unchecked exception) if attrval is null.
--
So why did you remove the check for null ?
-phil.
On 6/28/16, 3:04 AM, Prasanta Sadhukhan wrote:
> Hi All,
>
> Please review a fix for an issue where it is seen that "Print-To-File"
> option is enabled even for flavors that do not support Destination
> attribute
> even though isAttributeValueSupported for that flavor returns false.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-5049012
> webrev: http://cr.openjdk.java.net/~psadhukhan/5049012/webrev.00/
>
> The reason for this behaviour is in Print Dialog code, the validation
> is done against isAttributeCategorySupported() which still returns
> true because Pageable and Printable supports it
> and therefore the "Print-to-File" option gets enabled.
>
> But print dialog is shown specific to a doc flavor and a print service
> (selected one) and hence must validate the attribute against the
> chosen doc flavor.
> So, the proposed fix checks the attributevalue is supported or not for
> that flavor to determine if we need to enable "Print-to-File" option
> in print dialog.
>
> Regards
> Prasanta
More information about the 2d-dev
mailing list