[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: [OpenJDK 2D-Dev] [9] RFR JDK-8165947: One more page printed before the test page with OpenJDK.
From: Jayathirth D V <jayathirth.d.v () oracle ! com>
Date: 2016-09-26 9:18:11
Message-ID: 014b1f64-1e2c-4463-9f38-f1a95a46c3f4 () default
[Download RAW message or body]
Hi Prasanta,
Changes are working fine.
Thanks,
Jay
From: Prasanta Sadhukhan
Sent: Friday, September 23, 2016 10:54 PM
To: Philip Race
Cc: 2d-dev
Subject: Re: [OpenJDK 2D-Dev] [9] RFR JDK-8165947: One more page printed before the \
test page with OpenJDK.
Yes, sorry. Done
http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.03/
Regards
Prasanta
On 9/23/2016 10:44 PM, Philip Race wrote:
77 throw new RuntimeException("Banner page is \
printed");
that message needs to be conditionalized too.
-phil
On 9/23/16, 10:01 AM, Prasanta Sadhukhan wrote:
Updated the testcase:
HYPERLINK "http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.02/"http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.02/
Regards
Prasanta
On 9/23/2016 9:47 PM, Philip Race wrote:
The JDK changes are fine but I don't think the test is.
It assumes that the system default is no banner page.
You need to update the test to check what the system default is
(banner or no banner) and have the tester "expect" whatever that happens to be.
-phil
On 9/23/16, 8:30 AM, Prasanta Sadhukhan wrote:
Hi Phil,
Please find the modified webrev:
HYPERLINK "http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.01/"http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.01/
Regards
Prasanta
On 9/22/2016 11:10 PM, Prasanta Sadhukhan wrote:
On 9/22/2016 11:09 PM, Philip Race wrote:
OK I see now.
The comment should be updated to remove mention of the dialog
and explain that instead.
But in that case do you still need the "else" in setAttributes?
Yes, right. we do not need the else in setAttributes. will update that and comment \
and publish new webrev.
Regards
Prasanta
-phil.
On 9/22/16, 10:32 AM, Prasanta Sadhukhan wrote:
On 9/22/2016 10:59 PM, Philip Race wrote:
Your comment refers only (and explicitly) to the print dialog :-
1484 * printing Banner page through print dialog via \
setAttributes().
So if we get into that code afterwards why do we need this new code ?
The new code is needed because if we have null attributes, then setAttributes() will \
return
1177 if (attributes == null || service == null) {
1178 return;
1179 }
even before it reaches
1271 JobSheets jobSheets = \
(JobSheets)attributes.get(JobSheets.class); 1272 if (jobSheets != \
null) { 1273 noJobSheet = jobSheets == JobSheets.NONE;
1274 } else {
1275 JobSheets js = (JobSheets)getPrintService().
1276 getDefaultAttributeValue(JobSheets.class);
1277 if (js != null && js.equals(JobSheets.NONE)) {
1278 noJobSheet = true;
1279 }
1280 }
Regards
Prasanta
I do see that call to setAttributes() but I am assuming it does not
get in there, else why does it not work already for this case?
It looks identical to your new code.
Put another way I don't see how the bug even manifests if it works as you describe.
-phil.
On 9/22/16, 10:10 AM, Prasanta Sadhukhan wrote:
That's why I call the new code before setAttributes() so that user's selection is not \
overridden. I put a comment regarding that in the fix.
Regards
Prasanta
On 9/22/2016 10:38 PM, Philip Race wrote:
What happens if the application does not display a dialog but
instead the application code explicitly does this:
aset.add(JobSheets.STANDARD);
print(aset)
?
It appears to me you will over-ride that.
-phil.
On 9/22/16, 9:54 AM, Prasanta Sadhukhan wrote:
Hi Phil,
My new code takes care of the problem when attribute is not set by the user who \
directly calls PrinterJob.print(). If no print dialog is shown, then print(attr) \
seems to be called with Null attribute and since noJobSheet was false, it used to \
print the banner page. I now checked only the \
PrintService.getDefaultAttributeValue(JobSheets.class) and if IPP returns "none", I \
change the default noJobSheet to true so that no banner page is printed (to honor \
system default).
Regards
Prasanta
On 9/22/2016 10:16 PM, Philip Race wrote:
This looks wrong to me. Shouldn't the logic look like the one you have earlier in
the file ? ie this :
1271 JobSheets jobSheets = \
(JobSheets)attributes.get(JobSheets.class); 1272 if (jobSheets != \
null) { 1273 noJobSheet = jobSheets == JobSheets.NONE;
1274 } else {
1275 JobSheets js = (JobSheets)getPrintService().
1276 getDefaultAttributeValue(JobSheets.class);
1277 if (js != null && js.equals(JobSheets.NONE)) {
1278 noJobSheet = true;
1279 }
1280 }
As it is your new code seems to completely disregard any setting by
the application in the attribute set - which *does not* have anything to do with
whether a dialog was set.
Also I reject that this can be a TCK failure.
"I got a banner page" is something that can be a system configuration
parameter and is wholly outside anything JCK can (or should) care about.
You could fix this but it could then behave the same on a different system.
In fact my reading of the bug is simply that they noticed this when running
a TCK test. That does not make it a TCK failure.
I have removed the tck labels from the bug and JCK can argue with me if they want to \
..
-phil.
On 9/16/16, 3:21 AM, Prasanta Sadhukhan wrote:
Hi All,
Please review a fix for a tck failure in jdk9 whereby "banner page" (cover page) is \
printed by default when print() is called directly without any print dialog being \
shown.
Bug: https://bugs.openjdk.java.net/browse/JDK-8165947
webrev: HYPERLINK "http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.00/"http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.00/ \
Issue was in RasterPrinterJob, "noJobSheet" variable was set to false which when \
passed to PSPrinterJob#printExecCmd(), it results in adding "-o job-sheets=standard" \
to lpr command and therefore, Banner page was getting printed by default.
Proposed fix is to check for defaultAttributeValue for JobSheets attribute so that we \
can find what is the default value reported by underlying platform and set \
"noJobSheet" value to default jobsheet native value (like CUPS report job-sheet=none \
so that no banner page is to be printed by default even though it supports jobsheet)
I tested "6575247:Banner checkbox in PrinterJob print dialog doesn't work" testcase \
in windows, solaris, linux and it works as expected.
JCK test api/javax_swing/interactive/PrintTest.html#PrintTest via command
"/jdk-9/bin/java -showversion \
-Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel -cp \
/root/jck/JCK-runtime-9/classes: \
-Djava.security.policy=/root/jck/JCK-runtime-9/lib/jck.policy \
javasoft.sqe.tests.api.java.awt.interactive.PrintTest -platform.hasPrinter true \
-TestCaseID ALL" also works ie no banner page is printed by default.
Regards
Prasanta
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body bgcolor=white lang=EN-US link=blue \
vlink=purple><div class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Hi \
Prasanta,<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Changes are \
working fine.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks,<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Jay<o:p></o:p></span></p><p \
class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div><div \
style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'>From:</span></b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext'> Prasanta \
Sadhukhan <br><b>Sent:</b> Friday, September 23, 2016 10:54 PM<br><b>To:</b> Philip \
Race<br><b>Cc:</b> 2d-dev<br><b>Subject:</b> Re: [OpenJDK 2D-Dev] [9] RFR \
JDK-8165947: One more page printed before the test page with \
OpenJDK.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p \
class=MsoNormal>Yes, sorry. Done<br><a \
href="http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.03/">http://cr.openjdk.jav \
a.net/~psadhukhan/8165947/webrev.03/</a><br><br>Regards<br>Prasanta<o:p></o:p></p><div><p \
class=MsoNormal>On 9/23/2016 10:44 PM, Philip Race \
wrote:<o:p></o:p></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal> \
77 \
throw new RuntimeException("Banner page is printed");<br><br>that message \
needs to be conditionalized too.<br><br>-phil<br><br>On 9/23/16, 10:01 AM, Prasanta \
Sadhukhan wrote: <o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Updated the \
testcase:<br><a href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.02/">htt \
p://cr.openjdk.java.net/~psadhukhan/8165947/webrev.02/</a><br><br>Regards<br>Prasanta<o:p></o:p></p><div><p \
class=MsoNormal>On 9/23/2016 9:47 PM, Philip Race \
wrote:<o:p></o:p></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>The JDK changes are \
fine but I don't think the test is.<br>It assumes that the system default is no \
banner page.<br><br>You need to update the test to check what the system default \
is<br>(banner or no banner) and have the tester "expect" whatever that \
happens to be.<br><br>-phil<br><br>On 9/23/16, 8:30 AM, Prasanta Sadhukhan wrote: \
<o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p \
class=MsoNormal>Hi Phil,<br><br>Please find the modified webrev:<br><a \
href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.01/">http://cr.openjdk.j \
ava.net/~psadhukhan/8165947/webrev.01/</a><br><br>Regards<br>Prasanta<o:p></o:p></p><div><p \
class=MsoNormal>On 9/22/2016 11:10 PM, Prasanta Sadhukhan \
wrote:<o:p></o:p></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal \
style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On \
9/22/2016 11:09 PM, Philip Race wrote:<o:p></o:p></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal \
style='margin-bottom:12.0pt'>OK I see now. <br>The comment should be updated to \
remove mention of the dialog<br>and explain that instead.<br><br>But in that case do \
you still need the "else" in setAttributes?<o:p></o:p></p></blockquote><p \
class=MsoNormal>Yes, right. we do not need the else in setAttributes. will update \
that and comment and publish new \
webrev.<br><br>Regards<br>Prasanta<br><br><o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>-phil.<br><br><br>On \
9/22/16, 10:32 AM, Prasanta Sadhukhan wrote: <o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal \
style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On \
9/22/2016 10:59 PM, Philip Race wrote:<o:p></o:p></p></div><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Your comment refers \
only (and explicitly) to the print dialog :-<o:p></o:p></p><pre>1484 \
* printing Banner page through print dialog via setAttributes().<o:p></o:p></pre><p \
class=MsoNormal style='margin-bottom:12.0pt'>So if we get into that code afterwards \
why do we need this new code ?<o:p></o:p></p></blockquote><p class=MsoNormal>The new \
code is needed because if we have null attributes, then setAttributes() will return \
<o:p></o:p></p><pre>1177 if (attributes == null || service == null) \
{<o:p></o:p></pre><pre>1178 return;<o:p></o:p></pre><pre>1179 \
}<o:p></o:p></pre><p class=MsoNormal>even before it \
reaches<br><br>1271 JobSheets \
jobSheets = (JobSheets)attributes.get(JobSheets.class); \
<br>1272 if (jobSheets != null) { \
<br>1273 \
noJobSheet = jobSheets == JobSheets.NONE; \
<br>1274 } else { \
<br>1275 \
JobSheets js = (JobSheets)getPrintService(). <br>1276 \
getDefaultAttributeValue(JobSheets.class); \
<br>1277 if \
(js != null && js.equals(JobSheets.NONE)) { \
<br>1278 \
noJobSheet = true; <br>1279 \
} <br>1280 } \
<br><br>Regards<br>Prasanta<br><br><o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>I do see that call to \
setAttributes() but I am assuming it does not<br>get in there, else why does it not \
work already for this case?<br>It looks identical to your new code.<br><br>Put \
another way I don't see how the bug even manifests if it works as you \
describe.<br><br>-phil.<br><br>On 9/22/16, 10:10 AM, Prasanta Sadhukhan wrote: \
<o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p \
class=MsoNormal>That's why I call the new code before setAttributes() so that user's \
selection is not overridden. I put a comment regarding that in the fix. \
<br><br>Regards <br>Prasanta <br>On 9/22/2016 10:38 PM, Philip Race wrote: \
<br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p \
class=MsoNormal>What happens if the application does not display a dialog but \
<br>instead the application code explicitly does this: \
<br><br>aset.add(JobSheets.STANDARD); <br>print(aset) <br><br>? <br><br>It appears to \
me you will over-ride that. <br><br>-phil. <br><br>On 9/22/16, 9:54 AM, Prasanta \
Sadhukhan wrote: <br><br><o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hi Phil, <br><br>My \
new code takes care of the problem when attribute is not set by the user who directly \
calls PrinterJob.print(). If no print dialog is shown, then print(attr) seems to be \
called with Null attribute <br>and since noJobSheet was false, it used to print the \
banner page. <br>I now checked only the \
PrintService.getDefaultAttributeValue(JobSheets.class) and if IPP returns \
"none", I change the default noJobSheet to true so that no banner \
page is printed (to honor system default). <br><br>Regards <br>Prasanta <br>On \
9/22/2016 10:16 PM, Philip Race wrote: <br><br><o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>This looks wrong to \
me. Shouldn't the logic look like the one you have earlier in <br>the file ? ie this \
: <br><br>1271 JobSheets jobSheets = \
(JobSheets)attributes.get(JobSheets.class); \
<br>1272 if (jobSheets != null) { \
<br>1273 \
noJobSheet = jobSheets == JobSheets.NONE; \
<br>1274 } else { \
<br>1275 \
JobSheets js = (JobSheets)getPrintService(). <br>1276 \
getDefaultAttributeValue(JobSheets.class); \
<br>1277 if \
(js != null && js.equals(JobSheets.NONE)) { \
<br>1278 \
noJobSheet = true; <br>1279 \
} <br>1280 } <br><br>As it is your \
new code seems to completely disregard any setting by <br>the application in the \
attribute set - which *does not* have anything to do with <br>whether a dialog was \
set. <br><br>Also I reject that this can be a TCK failure. <br>"I got a banner \
page" is something that can be a system configuration <br>parameter and is \
wholly outside anything JCK can (or should) care about. <br>You could fix this but it \
could then behave the same on a different system. <br>In fact my reading of the bug \
is simply that they noticed this when running <br>a TCK test. That does not make it a \
TCK failure. <br>I have removed the tck labels from the bug and JCK can argue with me \
if they want to .. <br><br>-phil. <br><br>On 9/16/16, 3:21 AM, Prasanta Sadhukhan \
wrote: <br><br><o:p></o:p></p><blockquote \
style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal>Hi All, \
<br><br>Please review a fix for a tck failure in jdk9 whereby "banner page" \
(cover page) is printed by default when print() is called directly without any print \
dialog being shown. <br><br>Bug: <a \
href="https://bugs.openjdk.java.net/browse/JDK-8165947">https://bugs.openjdk.java.net/browse/JDK-8165947</a> \
<br>webrev: <a href="http://cr.openjdk.java.net/%7Epsadhukhan/8165947/webrev.00/">http://cr.openjdk.java.net/~psadhukhan/8165947/webrev.00/</a> \
<br><br>Issue was in RasterPrinterJob, "noJobSheet" variable was set to \
false which when passed to PSPrinterJob#printExecCmd(), it results in adding "-o \
job-sheets=standard" to lpr command and <br>therefore, Banner page was getting \
printed by default. <br>Proposed fix is to check for defaultAttributeValue for \
JobSheets attribute so that we can find what is the default value reported by \
underlying platform and set "noJobSheet" value to default jobsheet native \
value <br>(like CUPS report job-sheet=none so that no banner page is to be printed by \
default even though it supports jobsheet) <br><br>I tested "6575247:Banner \
checkbox in PrinterJob print dialog doesn't work" testcase in windows, solaris, \
linux and it works as expected. <br><br>JCK test \
api/javax_swing/interactive/PrintTest.html#PrintTest via command \
<br>"/jdk-9/bin/java -showversion \
-Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel -cp \
/root/jck/JCK-runtime-9/classes: \
-Djava.security.policy=/root/jck/JCK-runtime-9/lib/jck.policy \
javasoft.sqe.tests.api.java.awt.interactive.PrintTest -platform.hasPrinter true \
-TestCaseID ALL" <br>also works ie no banner page is printed by default. \
<br><br>Regards <br>Prasanta <o:p></o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></blockquote></blockquote><p \
class=MsoNormal><o:p> </o:p></p></div></body></html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic