Re: swing-dev Digest, Vol 121, Issue 19

2017-05-30 Thread Avik Niyogi
+1
 With Regards,
Avik Niyogi

> On 30-May-2017, at 10:30 pm, swing-dev-requ...@openjdk.java.net wrote:
> 
> Date: Mon, 29 May 2017 11:49:45 +0530
> From: Prasanta Sadhukhan  >
> To: Sergey Bylokhov  >
> Cc: swing-dev@openjdk.java.net 
> Subject: Re:  [10] RFR: JDK-8075918:The regression-swing
>   case failed as the long Tab titles are not clipped with dots at the
>   end with NimbusLookAndFeel
> Message-ID:  >
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> I tried to incorporate your comments. Please find modified webrev
> 
> http://cr.openjdk.java.net/~psadhukhan/8075918/webrev.03/ 
> 
> 
> Regards
> Prasanta
> On 5/28/2017 8:01 AM, Sergey Bylokhov wrote:
>> Note that you shouldn't replace the clip, but should apply the new clip on 
>> top of the old. This is necessary if the old clip is smaller than new.
>> 
>> - sergey.bylok...@oracle.com  wrote:
>> 
>>> Hi, Prasanta.
>>> 
>>> BasicTabbedPaneUI.paintIcon() as well as
>>> SynthGraphicsUtils.paintText() are called in SynthTabbedPaneUI.
>>>  - paintText() at line 681
>>>  - paintIcon() at line 634
>>> Both methods have a rectangle as a parameter, but it is ignored.
>>> 
>>> - prasanta.sadhuk...@oracle.com  
>>> wrote:
>>> 
 Hi Sergey,
 
 I could get your concern for paintText() but could not find
 paintIcon()
 in SynthGraphicsUtils() so not sure how icon drawing contradicts
 spec.
 Modified webrev:
 http://cr.openjdk.java.net/~psadhukhan/8075918/webrev.01/ 
 
 
 Also, if we are not calling SwingUtilities2.clipStringIfNecessary()
 then
 we are not going to get "..." at the end which this test expects.
>>> But
 I
 could not find anything in spec, that mandates ending with "..." for
 long tab outside
 tab bounds. If source change is ok, I guess we then need to modify
>>> the
 html file modifying the expected result for NimbusL
 
 Regards
 Prasanta
 On 5/25/2017 3:11 AM, Sergey Bylokhov wrote:
> Hi, Prasanta.
> Please take a look to my comments at:
> 
>>> http://mail.openjdk.java.net/pipermail/swing-dev/2016-November/006931.html 
>>> 
>>> http://mail.openjdk.java.net/pipermail/swing-dev/2016-November/006902.html 
>>> 
> The two methods paintText() and paintIcon() are contradict the
>>> spec
 and draw the text and icons outside of the tab.
> - prasanta.sadhuk...@oracle.com 
>  wrote:
> 
>> Hi All,
>> 
>> Please review a fix for an issue where long Tab titiles are not
>> clipped
>> with dots at end for NimbusLookAndFeel L
>> Other L works ok.
>> 
>> Issue was in SynthTabbedPaneUI#paintTab(), the title is not
 clipped
>> but
>> passed to paintText() as it is received.
>> Other L such as Metal, Motif, Windows which uses
>> BasicTabbedPaneUI#paintTab(), the title is clipped
>> 
>>> http://hg.openjdk.java.net/jdk9/client/jdk/file/e748c6a2d2e6/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java#l950
>>>  
>>> 
>> before it is passed to paintText().
>> 
>> Proposed fix is to do the same for SynthTabbedPaneUI#paintTab().
>> 
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8075918 
>> 
>> webrev:
>>> http://cr.openjdk.java.net/~psadhukhan/8075918/webrev.00/ 
>>> 
>> Regards
>> Prasanta
> 



Re: [10] RFR 6962725:Regtest javax/swing/JFileChooser/6738668/bug6738668.java fails under Linux

2017-05-30 Thread Sergey Bylokhov
The new version fails even if run via jtreg?

- prasanta.sadhuk...@oracle.com wrote:

> OK. With revised command line, it fails with new updated test in 7b40
> 
> and passed in 9b170
> 
> /cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java 
> -Djava.security.manager -Djava.security.policy=security.policy
> bug6738668
> tmp dir C:\cygwin64\tmp\
> Exception in thread "main" java.security.AccessControlException:
> access 
> denied (java.io.FilePermission 
> C:\Users\prsadhuk\AppData\Roaming\Microsoft\Windows\Recent read)
>  at 
> java.security.AccessControlContext.checkPermission(AccessControlContext.java:345)
>  at 
> java.security.AccessController.checkPermission(AccessController.java:555)
>  at 
> java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
>  at
> java.lang.SecurityManager.checkRead(SecurityManager.java:888)
> 
> /cygdrive/d/Vbox_Shared/JDK/jdk9-b170/fastdebug/bin/java 
> -Djava.security.manager -Djava.security.policy=security.policy
> bug6738668
> tmp dir C:\cygwin64\tmp\
> Test passed for LookAndFeel javax.swing.plaf.metal.MetalLookAndFeel
> tmp dir C:\cygwin64\tmp\
> Test passed for LookAndFeel javax.swing.plaf.nimbus.NimbusLookAndFeel
> tmp dir C:\cygwin64\tmp\
> Test passed for LookAndFeel
> com.sun.java.swing.plaf.motif.MotifLookAndFeel
> tmp dir C:\cygwin64\tmp\
> Test passed for LookAndFeel 
> com.sun.java.swing.plaf.windows.WindowsLookAndFeel
> tmp dir C:\cygwin64\tmp\
> Test passed for LookAndFeel 
> com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel
> 
> Regards
> Prasanta
> On 5/30/2017 2:59 AM, Sergey Bylokhov wrote:
> > I guess you will need to set security manager which will use your
> policy file:
> >
> https://docs.oracle.com/cd/E13222_01/wls/docs81b/secmanage/java.html
> >
> > - prasanta.sadhuk...@oracle.com wrote:
> >
> >> I am not sure why it is passing in my case. I thought it might be
> >> taking
> >> in some other security policy so I renamed and use a different
> named
> >> policy but it still passed in my windows 7.
> >>
> >> $ /cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java
> >> -Djava.security.policy=my.policy bug6738668
> >> Test passed for LookAndFeel
> javax.swing.plaf.metal.MetalLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.motif.MotifLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.windows.WindowsLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel
> >>
> >> PRSADHUK-IN+prsadhuk@PRSADHUK-IN
> >> /cygdrive/d/jdk10/client/jdk/test/javax/swing/JFileChooser/6738668
> >> $ cat my.policy
> >> grant {
> >>   permission java.io.FilePermission "C:\\temp\\*", "read";
> >>   permission java.io.FilePermission "C:\\temp", "read";
> >>   permission java.util.PropertyPermission "*", "read";
> >> };
> >>
> >> PRSADHUK-IN+prsadhuk@PRSADHUK-IN
> >> /cygdrive/d/jdk10/client/jdk/test/javax/swing/JFileChooser/6738668
> >> $ /cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java
> >> -version
> >> java version "1.7.0-ea-fastdebug"
> >> Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b40)
> >> Java HotSpot(TM) 64-Bit Server VM (build 14.0-b07-fastdebug, mixed
> >> mode)
> >>
> >> BTW, does my updated test fail in your environment with b40?
> >>
> >> Regards
> >> Prasanta
> >> On 5/28/2017 4:10 AM, Sergey Bylokhov wrote:
> >>> There is a comment that JDK-6738668 a regression of JDK-6484091
> >> which was pushed to b20.
> >>> I just checked the test from the command line on b40 and it
> fails,
> >> but passed on b55.
> >>> Can you please check why it was passed in your case.
> >>>
> >>> - prasanta.sadhuk...@oracle.com wrote:
> >>>
>  Hi Sergey,
> 
>  I do not see any comment mention about failure in 7b20 but
> anyways,
> >> I
>  tried with 7b20,7b30,7b40,7b50 and all of them passed with
> >> original
>  and
>  updated test in windows.
> 
>  Regards
>  Prasanta
>  On 5/25/2017 2:30 AM, Sergey Bylokhov wrote:
> > I am not sure but according to the comments of JDK-6738668 it
> was
> >> a
>  regression in 7b20.
> > So I suggest to check a few build between b20 and b54
> >
> > - prasanta.sadhuk...@oracle.com wrote:
> >
> >> Hi Sergey,
> >>
> >> No, it is passing. Actually, the original test is also passing
>  with
> >> 1.7.0 b05 (6738668 is supposedly fixed in 7b55), there's no
> >> SecurityException
> >>
> >> jdk1.7.0/bin/java -Djava.security.policy=security.policy
>  bug6738668
> >> Test passed for LookAndFeel
>  javax.swing.plaf.metal.MetalLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.motif.MotifLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.windows.WindowsLookAndFeel
> >> Test passed for LookAndFeel
> >> com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel
> >>
> >> 

[10] RFR: JDK-8043315: Nimbus: Setting Nimbus.Overrides property affects custom keymap installation

2017-05-30 Thread Prasanta Sadhukhan

Hi All,

Please review a bug fix for Nimbus L where if app sets custom keymap 
and then sets Nimbus.Overrides property,

then the custom keymap is not honoured.
For example, if testapp sets a new action for "space" key press and sets 
sets Nimbus.Overrides property,
 it will not be honoured and default action ie. inserting a "space" 
character will be done.


Issue was NimbusLookAndFeel#shouldUpdateStyleOnEvent() returns true for 
Nimbus.Override property which causes SynthEditorPaneUI#updateStyle() to 
be called which

uninstall set keyboard actions and sets up default keyboard action.

Proposed fix is to check if a keymap is already set (a propertyChange 
event will be fired for when app calls setKeyMap()) then do not reset to 
default keymap.


Bug: https://bugs.openjdk.java.net/browse/JDK-8043315
webrev: http://cr.openjdk.java.net/~psadhukhan/8043315/webrev.00/

Regards
Prasanta



Re: [10] RFR 6962725:Regtest javax/swing/JFileChooser/6738668/bug6738668.java fails under Linux

2017-05-30 Thread Prasanta Sadhukhan
OK. With revised command line, it fails with new updated test in 7b40 
and passed in 9b170


/cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java 
-Djava.security.manager -Djava.security.policy=security.policy bug6738668

tmp dir C:\cygwin64\tmp\
Exception in thread "main" java.security.AccessControlException: access 
denied (java.io.FilePermission 
C:\Users\prsadhuk\AppData\Roaming\Microsoft\Windows\Recent read)
at 
java.security.AccessControlContext.checkPermission(AccessControlContext.java:345)
at 
java.security.AccessController.checkPermission(AccessController.java:555)
at 
java.lang.SecurityManager.checkPermission(SecurityManager.java:549)

at java.lang.SecurityManager.checkRead(SecurityManager.java:888)

/cygdrive/d/Vbox_Shared/JDK/jdk9-b170/fastdebug/bin/java 
-Djava.security.manager -Djava.security.policy=security.policy bug6738668

tmp dir C:\cygwin64\tmp\
Test passed for LookAndFeel javax.swing.plaf.metal.MetalLookAndFeel
tmp dir C:\cygwin64\tmp\
Test passed for LookAndFeel javax.swing.plaf.nimbus.NimbusLookAndFeel
tmp dir C:\cygwin64\tmp\
Test passed for LookAndFeel com.sun.java.swing.plaf.motif.MotifLookAndFeel
tmp dir C:\cygwin64\tmp\
Test passed for LookAndFeel 
com.sun.java.swing.plaf.windows.WindowsLookAndFeel

tmp dir C:\cygwin64\tmp\
Test passed for LookAndFeel 
com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel


Regards
Prasanta
On 5/30/2017 2:59 AM, Sergey Bylokhov wrote:

I guess you will need to set security manager which will use your policy file:
https://docs.oracle.com/cd/E13222_01/wls/docs81b/secmanage/java.html

- prasanta.sadhuk...@oracle.com wrote:


I am not sure why it is passing in my case. I thought it might be
taking
in some other security policy so I renamed and use a different named
policy but it still passed in my windows 7.

$ /cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java
-Djava.security.policy=my.policy bug6738668
Test passed for LookAndFeel javax.swing.plaf.metal.MetalLookAndFeel
Test passed for LookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
Test passed for LookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Test passed for LookAndFeel
com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel

PRSADHUK-IN+prsadhuk@PRSADHUK-IN
/cygdrive/d/jdk10/client/jdk/test/javax/swing/JFileChooser/6738668
$ cat my.policy
grant {
  permission java.io.FilePermission "C:\\temp\\*", "read";
  permission java.io.FilePermission "C:\\temp", "read";
  permission java.util.PropertyPermission "*", "read";
};

PRSADHUK-IN+prsadhuk@PRSADHUK-IN
/cygdrive/d/jdk10/client/jdk/test/javax/swing/JFileChooser/6738668
$ /cygdrive/d/Vbox_Shared/JDK/jdk1.7.0-b40/fastdebug/bin/java
-version
java version "1.7.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.7.0-ea-fastdebug-b40)
Java HotSpot(TM) 64-Bit Server VM (build 14.0-b07-fastdebug, mixed
mode)

BTW, does my updated test fail in your environment with b40?

Regards
Prasanta
On 5/28/2017 4:10 AM, Sergey Bylokhov wrote:

There is a comment that JDK-6738668 a regression of JDK-6484091

which was pushed to b20.

I just checked the test from the command line on b40 and it fails,

but passed on b55.

Can you please check why it was passed in your case.

- prasanta.sadhuk...@oracle.com wrote:


Hi Sergey,

I do not see any comment mention about failure in 7b20 but anyways,

I

tried with 7b20,7b30,7b40,7b50 and all of them passed with

original

and
updated test in windows.

Regards
Prasanta
On 5/25/2017 2:30 AM, Sergey Bylokhov wrote:

I am not sure but according to the comments of JDK-6738668 it was

a

regression in 7b20.

So I suggest to check a few build between b20 and b54

- prasanta.sadhuk...@oracle.com wrote:


Hi Sergey,

No, it is passing. Actually, the original test is also passing

with

1.7.0 b05 (6738668 is supposedly fixed in 7b55), there's no
SecurityException

jdk1.7.0/bin/java -Djava.security.policy=security.policy

bug6738668

Test passed for LookAndFeel

javax.swing.plaf.metal.MetalLookAndFeel

Test passed for LookAndFeel
com.sun.java.swing.plaf.motif.MotifLookAndFeel
Test passed for LookAndFeel
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Test passed for LookAndFeel
com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel

jdk1.7.0/bin/java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.7.0-ea-b05, mixed

mode)

Regards
Prasanta
On 5/24/2017 11:48 AM, Sergey Bylokhov wrote:

Hi, Prasanta.
Please confirm that the updated test fails before JDK-6738668

was

fixed.

Hi ALl,

Please review a testbug fix for an issue where this regression

test

is failing in linux because

JFileChooser was trying to access C:/temp path which does not

exist

in linux.

Proposed fix is to use java.io.tmpdir instead of hardcoded

windows

path.

Bug: https://bugs.openjdk.java.net/browse/JDK-6962725
webrev: