[OpenJDK 2D-Dev]  RFR JDK-8067059, , PrinterJob.pageDialog() with DialogSelectionType.NATIVE returns a PageFormat when cancelled.
jennifer.godinez at oracle.com
Mon Nov 16 18:00:23 UTC 2015
Looks good. Approved.
----- Original Message -----
From: prasanta.sadhukhan at oracle.com
To: philip.race at oracle.com
Cc: 2d-dev at openjdk.java.net, rajeev.chamyal at oracle.com
Sent: Friday, November 13, 2015 3:36:15 AM GMT -08:00 US/Canada Pacific
Subject: Re: [OpenJDK 2D-Dev]  RFR JDK-8067059, , PrinterJob.pageDialog() with DialogSelectionType.NATIVE returns a PageFormat when cancelled.
Thanks Phil. I was indeed relying on non-presence of equals method in PageFormat.
I have modified the webrev to use equality. Can you please review ?
On 11/13/2015 11:35 AM, Philip Race wrote:
On 11/12/15, 9:52 PM, prasanta sadhukhan wrote:
On 11/13/2015 12:05 AM, Philip Race wrote:
Shouldn't this use reference equality ?
It seems Object.java equals() method does == anyways and it seems it always better to call equals() than to explicitly check for ==
Is it not correct? If it is not, I will change it.
You are relying on PageFormat not over-riding equals.
It could do so and then the intent of your equals call would be broken
in the case that updates to the dialog resulted in a new PageFormat
but with the equal fieids.
Also the test does a number of wild card imports instead of
the specific classes it needs. And I am not sure why it
is importing java.awt.* anyway ..
And I find qualifying "java.lang.String" to be unnecessary.
will update the test.
On 11/3/15, 12:59 AM, prasanta sadhukhan wrote:
Please review a fix for jdk9.
The issue was if we "cancel" Printer Job setup dialog which has been created with DialogSelectionType.NATIVE
it should return "null" as per spec
[If the user cancels the dialog, the attributes will not reflect any changes made by the user, and the return value will be null.]
We were returning PageFormat instead. Fixed to return null in such case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the 2d-dev