Integrated: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop

2021-08-04 Thread Yi Yang
On Thu, 8 Jul 2021 08:32:49 GMT, Yi Yang  wrote:

> After JDK-8265518(#3615), it's possible to replace all variants of checkIndex 
> by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
> the whole JDK codebase.
> 
> As Mandy suggested, I create this PR for changes involving client code:
> 
> src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java
> src/java.desktop/share/classes/javax/swing/JTabbedPane.java
> test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
> test/jdk/javax/imageio/AppletResourceTest.java
> test/jdk/javax/imageio/ImageReaderReadAll.java
> test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java

This pull request has now been integrated.

Changeset: ea9a5952
Author:Yi Yang 
URL:   
https://git.openjdk.java.net/jdk/commit/ea9a59520de45fe1c2a6706b2a924cbc856a06c6
Stats: 41 lines in 6 files changed: 7 ins; 19 del; 15 mod

8270058: Use Objects.check{Index,FromIndexSize} for java.desktop

Reviewed-by: psadhukhan, pbansal, jdv

-

PR: https://git.openjdk.java.net/jdk/pull/4718


Re: RFR: 8270116: Expand ButtonGroupLayoutTraversalTest.java to run in all LaFs, including Aqua on macOS [v2]

2021-08-04 Thread Prasanta Sadhukhan
On Wed, 4 Aug 2021 21:43:53 GMT, rajat mahajan 
 wrote:

>> Summary: Expanded ButtonGroupLayoutTraversalTest.java to run in all LAFs on 
>> all OS. Added synchronization for focusCnt.
>
> rajat mahajan has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   make variables with static final modifier CAPS, as per coding standard.

Marked as reviewed by psadhukhan (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4937


Re: RFR: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop [v4]

2021-08-04 Thread Jayathirth D V
On Thu, 5 Aug 2021 03:25:49 GMT, Yi Yang  wrote:

>> After JDK-8265518(#3615), it's possible to replace all variants of 
>> checkIndex by 
>> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
>> the whole JDK codebase.
>> 
>> As Mandy suggested, I create this PR for changes involving client code:
>> 
>> src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java
>> src/java.desktop/share/classes/javax/swing/JTabbedPane.java
>> test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
>> test/jdk/javax/imageio/AppletResourceTest.java
>> test/jdk/javax/imageio/ImageReaderReadAll.java
>> test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java
>
> Yi Yang has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   review from @jayathirthrao

Marked as reviewed by jdv (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4718


Re: RFR: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop [v4]

2021-08-04 Thread Yi Yang
> After JDK-8265518(#3615), it's possible to replace all variants of checkIndex 
> by Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
> the whole JDK codebase.
> 
> As Mandy suggested, I create this PR for changes involving client code:
> 
> src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java
> src/java.desktop/share/classes/javax/swing/JTabbedPane.java
> test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
> test/jdk/javax/imageio/AppletResourceTest.java
> test/jdk/javax/imageio/ImageReaderReadAll.java
> test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java

Yi Yang has updated the pull request incrementally with one additional commit 
since the last revision:

  review from @jayathirthrao

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4718/files
  - new: https://git.openjdk.java.net/jdk/pull/4718/files/1db9e872..83ad6590

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4718&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4718&range=02-03

  Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4718.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4718/head:pull/4718

PR: https://git.openjdk.java.net/jdk/pull/4718


Re: RFR: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop [v3]

2021-08-04 Thread Yi Yang
On Thu, 22 Jul 2021 06:29:13 GMT, Yi Yang  wrote:

>> After JDK-8265518(#3615), it's possible to replace all variants of 
>> checkIndex by 
>> Objects.checkIndex/Objects.checkFromToIndex/Objects.checkFromIndexSize in 
>> the whole JDK codebase.
>> 
>> As Mandy suggested, I create this PR for changes involving client code:
>> 
>> src/java.desktop/share/classes/com/sun/media/sound/AudioFloatInputStream.java
>> src/java.desktop/share/classes/javax/swing/JTabbedPane.java
>> test/jdk/java/awt/print/PrinterJob/ImagePrinting/ClippedImages.java
>> test/jdk/javax/imageio/AppletResourceTest.java
>> test/jdk/javax/imageio/ImageReaderReadAll.java
>> test/jdk/javax/imageio/metadata/IIOMetadataFormat/UserPluginMetadataFormatTest.java
>
> Yi Yang has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   typo

Thanks @mrserb @prsadhuk @jayathirthrao and @pankaj-bansal for reviews!

-

PR: https://git.openjdk.java.net/jdk/pull/4718


Re: RFR: 8270058: Use Objects.check{Index, FromIndexSize} for java.desktop [v3]

2021-08-04 Thread Yi Yang
On Fri, 30 Jul 2021 08:59:31 GMT, Jayathirth D V  wrote:

>> Objects.checkIndex itself throws exceptions for wrong values. So this should 
>> be ok. No?
>
> We have specific message here like "Tab count" which we are not passing and 
> will be helpful for debugging in future.

Restored.

-

PR: https://git.openjdk.java.net/jdk/pull/4718


Re: RFR: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9 [v2]

2021-08-04 Thread Sergey Bylokhov
On Wed, 4 Aug 2021 20:10:50 GMT, Phil Race  wrote:

>> These fields
>> -  have not been used by the implementation since JDK8,
>> - are not supposed to be used by applications,
>> - have been deprecated for removal since JDK 9
>> - are non-standard, JDK not Java, classes
>> - very few clients are expected to be using these classes : just those 
>> implementing ATs
>> 
>> 
>> The CSR for this is https://bugs.openjdk.java.net/browse/JDK-8270918
>
> Phil Race has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 
> 9

Marked as reviewed by serb (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/4845


Re: RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v2]

2021-08-04 Thread Sergey Bylokhov
On Tue, 3 Aug 2021 20:04:14 GMT, Alexey Ushakov  wrote:

>> How to reproduce that artifact?
>
> 1. Run SwingSet2
> 2. Click on all tabs starting from the second one 
> 3. On the tab with swing tree control try to expand some tree nodes -> you'll 
> see black rectangles while performing  the clicks
> 
> It may not be reproduced on a first attempt. On my machine it's reproducible 
> with probability at least 50%

Thank you, looking into it.

-

PR: https://git.openjdk.java.net/jdk/pull/4946


Re: RFR: 8270116: Expand ButtonGroupLayoutTraversalTest.java to run in all LaFs, including Aqua on macOS [v2]

2021-08-04 Thread rajat mahajan
On Wed, 4 Aug 2021 14:35:34 GMT, Alexey Ivanov  wrote:

>> I still think nx, ny should be made CAPS...It seems to be the case for 
>> static final constant variables in java/awt test folder...I don't think it 
>> will increase noise as it will impact only in l57
>
> It will affect more lines; these constants are used in for-loops to move 
> focus between buttons as well as to validate the results. Let it be.

Updated nx, ny with CAPS version.

-

PR: https://git.openjdk.java.net/jdk/pull/4937


Re: RFR: 8270116: Expand ButtonGroupLayoutTraversalTest.java to run in all LaFs, including Aqua on macOS [v2]

2021-08-04 Thread rajat mahajan
> Summary: Expanded ButtonGroupLayoutTraversalTest.java to run in all LAFs on 
> all OS. Added synchronization for focusCnt.

rajat mahajan has updated the pull request incrementally with one additional 
commit since the last revision:

  make variables with static final modifier CAPS, as per coding standard.

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4937/files
  - new: https://git.openjdk.java.net/jdk/pull/4937/files/7f683d1e..b05f3d4a

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4937&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4937&range=00-01

  Stats: 10 lines in 1 file changed: 0 ins; 0 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4937.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4937/head:pull/4937

PR: https://git.openjdk.java.net/jdk/pull/4937


Re: RFR: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9 [v2]

2021-08-04 Thread Phil Race
> These fields
> -  have not been used by the implementation since JDK8,
> - are not supposed to be used by applications,
> - have been deprecated for removal since JDK 9
> - are non-standard, JDK not Java, classes
> - very few clients are expected to be using these classes : just those 
> implementing ATs
> 
> 
> The CSR for this is https://bugs.openjdk.java.net/browse/JDK-8270918

Phil Race has updated the pull request incrementally with one additional commit 
since the last revision:

  8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4845/files
  - new: https://git.openjdk.java.net/jdk/pull/4845/files/ba3932f3..c376e501

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4845&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4845&range=00-01

  Stats: 134 lines in 1 file changed: 0 ins; 0 del; 134 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4845.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4845/head:pull/4845

PR: https://git.openjdk.java.net/jdk/pull/4845


Re: RFR: 8268824: Remove unused jdk.accessibility APIs deprecated for removal in JDK 9 [v2]

2021-08-04 Thread Phil Race
On Wed, 21 Jul 2021 07:19:02 GMT, Sergey Bylokhov  wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8268824: Remove unused jdk.accessibility APIs deprecated for removal in 
>> JDK 9
>
> src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AWTEventMonitor.java
>  line 53:
> 
>> 51: public AWTEventMonitor() {}
>> 52: 
>> 53: static private Component componentWithFocus_private = null;
> 
> Can we rename the "new" "xx_private" fields to the shorter version? The 
> javadoc for the protected fields can be applied to the "private version"(but 
> w/o @Deprecated tag).
> 
> So in fact we can change "protected" to the "private", drop the "@Deprecated" 
> tags, and delete the "xx_private" versions of the fields.

I don't think the javadoc is needed since these are now private fields.
I can however rename them to remove _private.

-

PR: https://git.openjdk.java.net/jdk/pull/4845


Re: RFR: 8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL [v2]

2021-08-04 Thread Alexey Ushakov
> Keep MTLLayer opacity in sync with window content view
> Keep layer translucent for translucent windows

Alexey Ushakov has updated the pull request incrementally with one additional 
commit since the last revision:

  8266079: Lanai: AlphaComposite shows differences on Metal compared to OpenGL
  
  Update opacity on textured property change

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4946/files
  - new: https://git.openjdk.java.net/jdk/pull/4946/files/2a77de60..9324a279

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4946&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4946&range=00-01

  Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4946.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4946/head:pull/4946

PR: https://git.openjdk.java.net/jdk/pull/4946


Integrated: 8271456: Avoid looking up standard charsets in "java.desktop" module

2021-08-04 Thread Sergey Bylokhov
On Sun, 1 Aug 2021 07:07:21 GMT, Sergey Bylokhov  wrote:

> This is a request to clean up a desktop module as was done in JDK-8233884 for 
> "java.base" module.
> 
> In many places standard charsets are looked up via their names, for example:
> absolutePath.getBytes("UTF-8");
> 
> This could be done more efficiently(x20 time faster) with use of 
> java.nio.charset.StandardCharsets:
> absolutePath.getBytes(StandardCharsets.UTF_8);
> 
> The later variant also makes the code cleaner, as it is known not to throw 
> UnsupportedEncodingException in contrary to the former variant.
> 
> Tested by the desktop headless/headful tests on linux/windows.

This pull request has now been integrated.

Changeset: 6b55ef3b
Author:Sergey Bylokhov 
URL:   
https://git.openjdk.java.net/jdk/commit/6b55ef3b58ae405c46f440e06b5adb03cec3a500
Stats: 761 lines in 33 files changed: 337 ins; 269 del; 155 mod

8271456: Avoid looking up standard charsets in "java.desktop" module

Reviewed-by: jdv, azvegint, aivanov

-

PR: https://git.openjdk.java.net/jdk/pull/4951


Re: RFR: 8270312: Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java [v2]

2021-08-04 Thread lawrence . andrews
> 1) This testcase was throwing error saying Error: Not a test or directory 
> containing tests: java/awt/print/PrinterJob/XparColor.java
> 2) Added @test tag so that this testcase can be run
> 3) Since Applet is deprecated and its not supported any more in the future 
> release remove applet and make the testcase to run as main
> 4) Since this is a manual testcase instruction frame or dailog was not 
> visible just print dialog was visible so fixed it.
> 5) When the testcase was run via main method two print dialog was shown one 
> was from main method and one more was from constructor. Fixed to show just 
> one print dialog.
> 6) Since JDK 17 introduce metal rendering touching the java2d code thought 
> this testcase will be useful to checking the rendering. 
> 
> @shurymury

lawrence.andrews has updated the pull request incrementally with one additional 
commit since the last revision:

  Added -Dsun.java2d.metal=true , test will be run both as metal as well as 
opengl

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/4769/files
  - new: https://git.openjdk.java.net/jdk/pull/4769/files/a2682bb6..5400714b

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=4769&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=4769&range=00-01

  Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/4769.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/4769/head:pull/4769

PR: https://git.openjdk.java.net/jdk/pull/4769


Re: RFR: 8270312: Error: Not a test or directory containing tests: java/awt/print/PrinterJob/XparColor.java

2021-08-04 Thread lawrence . andrews
On Tue, 13 Jul 2021 14:57:30 GMT, lawrence.andrews 
 wrote:

> 1) This testcase was throwing error saying Error: Not a test or directory 
> containing tests: java/awt/print/PrinterJob/XparColor.java
> 2) Added @test tag so that this testcase can be run
> 3) Since Applet is deprecated and its not supported any more in the future 
> release remove applet and make the testcase to run as main
> 4) Since this is a manual testcase instruction frame or dailog was not 
> visible just print dialog was visible so fixed it.
> 5) When the testcase was run via main method two print dialog was shown one 
> was from main method and one more was from constructor. Fixed to show just 
> one print dialog.
> 6) Since JDK 17 introduce metal rendering touching the java2d code thought 
> this testcase will be useful to checking the rendering. 
> 
> @shurymury

Now this test will be executed both on metal and opengl

-

PR: https://git.openjdk.java.net/jdk/pull/4769


Re: RFR: 8270116: Expand ButtonGroupLayoutTraversalTest.java to run in all LaFs, including Aqua on macOS

2021-08-04 Thread Alexey Ivanov
On Wed, 4 Aug 2021 05:06:13 GMT, Prasanta Sadhukhan  
wrote:

>> @prsadhuk I did what you asked, do you have any more questions or comments 
>> ?, if not could you please approve this PR, thanks.
>
> I still think nx, ny should be made CAPS...It seems to be the case for static 
> final constant variables in java/awt test folder...I don't think it will 
> increase noise as it will impact only in l57

It will affect more lines; these constants are used in for-loops to move focus 
between buttons as well as to validate the results. Let it be.

-

PR: https://git.openjdk.java.net/jdk/pull/4937


Re: RFR: 8271456: Avoid looking up standard charsets in "java.desktop" module [v4]

2021-08-04 Thread Alexey Ivanov
On Tue, 3 Aug 2021 23:42:55 GMT, Sergey Bylokhov  wrote:

>> This is a request to clean up a desktop module as was done in JDK-8233884 
>> for "java.base" module.
>> 
>> In many places standard charsets are looked up via their names, for example:
>> absolutePath.getBytes("UTF-8");
>> 
>> This could be done more efficiently(x20 time faster) with use of 
>> java.nio.charset.StandardCharsets:
>> absolutePath.getBytes(StandardCharsets.UTF_8);
>> 
>> The later variant also makes the code cleaner, as it is known not to throw 
>> UnsupportedEncodingException in contrary to the former variant.
>> 
>> Tested by the desktop headless/headful tests on linux/windows.
>
> Sergey Bylokhov has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Update IPPPrintService.java

I admit I prefer static imports in this case: the code is shorter and is as 
clear. It's pretty obvious where the encoding comes from.

-

Marked as reviewed by aivanov (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4951


Re: RFR: 8267385: Create NSAccessibilityElement implementation for JavaComponentAccessibility [v9]

2021-08-04 Thread Artem Semenov
On Mon, 2 Aug 2021 21:56:37 GMT, Sergey Bylokhov  wrote:

>> Yes, this will not work with a custom list not inherited from JList. 
>> Unfortunately AccessibleJList is not perfect and the functionality you need 
>> is not there.
>> If you have a better solution, please share it. - Could you please advice on 
>> what we can do here?
>
> This is what I meant in the first message, "a11y interface miss 
> setSelectedIndex method". I suggest filing a separate issue to accumulate 
> such use cases and then fix them by adding additional methods to a11y 
> interfaces. Probably something similar will be found in the Table/etc.

Done. [JDK-8271846](https://bugs.openjdk.java.net/browse/JDK-8271846)

-

PR: https://git.openjdk.java.net/jdk/pull/4412


Re: RFR: 8267385: Create NSAccessibilityElement implementation for JavaComponentAccessibility [v9]

2021-08-04 Thread Pankaj Bansal
On Mon, 2 Aug 2021 09:00:14 GMT, Artem Semenov 
 wrote:

>> 8267385: Create NSAccessibilityElement implementation for 
>> JavaComponentAccessibility
>> This pull request contains solutions for the following tickets:
>> * JDK-8267385 Create NSAccessibilityElement implementation for 
>> JavaComponentAccessibility;
>> * JDK-8262031 Create implementation for NSAccessibilityNavigableStaticText 
>> protocol;
>> * JDK-8264287 Create implementation for NSAccessibilityComboBox protocol 
>> peer;
>> * JDK-8264303 Create implementation for NSAccessibilityTabGroup protocol 
>> peer;
>> * JDK-8264292 Create implementation for NSAccessibilityList protocol peer;
>> * JDK-8267387 Create implementation for NSAccessibilityOutline protocol;
>> * JDK-8267388 Create implementation for NSAccessibilityTable protocol.
>
> Artem Semenov has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   1. Fixed problems with vertical navigation in table cells;
>   2. I suggest doing the opposite, leave the CHECK_EXCEPTION and remove the 
> chech and the logging. The CHECK_EXCEPTION is better since it can be 
> configured via properties, and it will chech itself on what thread the 
> current code is executed.

I tested the latest version and all the problems I had mentioned earlier are no 
longer present. I also used few components like Combobox, Sliders, Buttons etc 
and things look good. As Alex mentioned, if there are small issues present, 
they can be fixed later in follow up bugs.

-

Marked as reviewed by pbansal (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/4412