From kcr at openjdk.org Thu May 1 17:24:47 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Thu, 1 May 2025 17:24:47 GMT Subject: RFR: 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events [v5] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 22:44:22 GMT, Pabulaner IV wrote: > Answer to question 2: > > I found the issue and moved the registration of the embedded event handler up. This way the embedded events can be received, even if AWT runs embedded. With this latest update, I can see how this will work; and the log output you provided shows that it wouldn't have in the original form. We'll review the proposed solution when we can. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2845301517 From honkar at openjdk.org Thu May 1 18:40:49 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 1 May 2025 18:40:49 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object In-Reply-To: References: Message-ID: On Mon, 17 Feb 2025 14:06:53 GMT, Daniel Gredler wrote: > On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. > > See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. > > This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. > > The new test class passes on Linux, Windows and macOS. @gredler Tested your fix by applying your changes on top of harfbuzz upgrade - https://github.com/openjdk/jdk/pull/24973 . Initial testing of your fix with IgnoredWhitespaceTest.java test and NLGlyphTest.java looks good. I haven't done a full fledged testing yet. This PR fixes the same issue observed on another test - `java/awt/font/TextLayout/TestControls.java` - [JDK-8353187](https://bugs.openjdk.org/browse/JDK-8353187). You can link the additional JBS ID to this PR with `/issue add 8353187` I will be integrating harfbuzz upgrade PR soon after which you can sync your branch with mainline to test it on your end. ------------- PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2810426871 From dgredler at openjdk.org Thu May 1 19:09:47 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 1 May 2025 19:09:47 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object In-Reply-To: <5mfWz8FHdIhs-j2Hn6q9NwomFhabKffMB9omJfE9phw=.d50f285c-32f4-4f8e-a428-98d3a8680e65@github.com> References: <5mfWz8FHdIhs-j2Hn6q9NwomFhabKffMB9omJfE9phw=.d50f285c-32f4-4f8e-a428-98d3a8680e65@github.com> Message-ID: <31Af0IbTC_NoxDcBkSSNU_57y8t1sahHY1rKDoM_Ju0=.7b18ec9c-f540-490d-92b3-b154d3e0ba72@github.com> On Thu, 3 Apr 2025 22:12:28 GMT, Harshitha Onkar wrote: >> @gredler Yes, JDK harfbuzz was just upgraded to v10.4.0 - https://github.com/openjdk/jdk/pull/23910. >> >> @prrace Do we consider patching the fix from upstream (https://github.com/harfbuzz/harfbuzz/pull/5119) for this upgrade or can it wait till the next time harfbuzz is upgraded on jdk ? > >> @honkar-jdk pls remember we need an updated harfbuzz for this PR to proceed. > > Noted. Thank you for the reminder. @honkar-jdk Great, thanks! I'll keep an eye on the HarfBuzz upgrade PR and sync + test once it has been integrated. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2845524602 From dgredler at openjdk.org Thu May 1 20:05:45 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 1 May 2025 20:05:45 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Tue, 29 Apr 2025 09:55:56 GMT, Nikita Gubarkov wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > By the way, I see that in each implementation, both `charToGlyph` and `charToGlyphRaw` call a common method, like `getGlyph(int uniciode, boolean raw)`. At first there was just `charToGlyph`, then `charToVariationGlyph` was added and now you added a "raw" version for each of them, I see that in the future we will need other variants and how it's already starting an exponential explosion. Overriding all of those methods in each implementation brings quite a bit of boilerplate, and it becomes easier to miss something. Maybe take a step back and refactor this into a single `charToGlyph(int unicode, int variationSelector, boolean raw)` version? > Also, this `raw` parameter only really controls `isDefaultIgnorable` check in the end of each method. Maybe we could factor this out without bringing it separately into each mapper implementation? @YaaZ: Thanks for the additional feedback, please see my thoughts below: > By the way, I see that in each implementation, both charToGlyph and charToGlyphRaw call a common method, like getGlyph(int uniciode, boolean raw). At first there was just charToGlyph, then charToVariationGlyph was added and now you added a "raw" version for each of them, I see that in the future we will need other variants and how it's already starting an exponential explosion. I don't know if I would call two changes to `CharToGlyphMapper` in 20 years an exponential explosion, but I get your point :-) > Overriding all of those methods in each implementation brings quite a bit of boilerplate, and it becomes easier to miss something. True, but again keep in mind that there are only 5 implementations, only one of which (the macOS `CCharToGlyphMapper`) has been added in the last 20 years. > Maybe take a step back and refactor this into a single charToGlyph(int unicode, int variationSelector, boolean raw) version? We'd still need separate methods for `int` vs. `char`, but I think this might reduce 5 methods down to 3? The changeset would be a bit more intrusive (lots of callers would need to change to reflect the new method signature). I'd be interested to hear thoughts from some of the reviewers on this one. > Also, this raw parameter only really controls isDefaultIgnorable check in the end of each method. Maybe we could factor this out without bringing it separately into each mapper implementation? I prefer to think of it as controlling whether or not any transformations to `INVISIBLE_GLYPH_ID` happen (right now it's just for default-ignorable characters, but there may be other scenarios in the future, e.g. `\r`, `\n` and `\t` which currently are handled elsewhere). Any ideas for what this refactoring might look like? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2845646011 From prr at openjdk.org Thu May 1 20:06:45 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 1 May 2025 20:06:45 GMT Subject: RFR: JDK-8355528 : Update HarfBuzz to 11.2.0 In-Reply-To: References: Message-ID: <7uJYkK2vsUG7zEUrn9jJLkD6Tu1iuIYVaHAlNGFWfV0=.d69f55f2-b7f9-42e3-b3e2-fa32fb631ccc@github.com> On Wed, 30 Apr 2025 19:37:29 GMT, Harshitha Onkar wrote: > HarfBuzz upgraded to 11.2.0 > > 4 newly added files and 99 modified files. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24973#pullrequestreview-2810607371 From ngubarkov at openjdk.org Thu May 1 21:57:45 2025 From: ngubarkov at openjdk.org (Nikita Gubarkov) Date: Thu, 1 May 2025 21:57:45 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 3 Apr 2025 11:23:42 GMT, Daniel Gredler wrote: > It looks like this regression actually fits into a longer series of fixes / regressions in this area: > > - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions > - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics > - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions > - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display > > We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. > > It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). > > The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). > > In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. > > Note two intricacies related to `CompositeGlyphMapper`: > 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. > 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. > > The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. > > Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for HarfBuzz integration. (Is there a plan to remove... I was talking about the explosion because there is a scenario in my mind, which I didn't make clear for everybody else. There is a change which I didn't have time to contribute, but would like to: it's related to composite fonts and variation selectors. We may need 2 variants for retrieving a glyph with a variation selector - one strictly matching a variation selector and another with a fallback to the base glyph, multiplied by raw/transformed versions, which adds 2 more methods. Not like it's a big problem, but given that they all end up calling a single method anyway... You get the point. > there may be other scenarios in the future, e.g. \r, \n and \t which currently are handled elsewhere). Are those scenarios specific to a patricular mapper/font type? I was thinking that those transformations are generic. > Any ideas for what this refactoring might look like? I was thinking about moving this default-ignorable or any potential generic transformation into base `CharToGlyphMapper` or even `Font2D`. For example, make default implementation of `CharToGlyphMapper.charToGlyph` check ignorable characters and then call `charToGlyphRaw` - then other implementations would only need to override `charToGlyphRaw`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2845865987 From serb at openjdk.org Thu May 1 22:12:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 1 May 2025 22:12:02 GMT Subject: RFR: 8355790: Enhance code consistency: java.desktop/unix:sun.awt Message-ID: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. To make the code review process easier I have made the following changes: 1. I chose `java.desktop/unix:sun.awt` as the starting package because it contains a relatively small number of classes 2. The public API was not affected so there is no need to worry about a CSR Note: I will submit additional patches in this area later because: 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) 2. I skipped adding `@Override` for anonymous classes Any feedback or suggestions are welcome! Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff) to a simple diff file, it might be more convenient for reviewing the changes. To download the diff file and filter only the modified lines you can use the following script: curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff -o d.txt && grep -E '^+|^-' d.txt The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. ------------- Commit messages: - override in java.desktop/unix:sun.awt - final in java.desktop/unix:sun.awt Changes: https://git.openjdk.org/jdk/pull/24941/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24941&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8355790 Stats: 748 lines in 105 files changed: 646 ins; 1 del; 101 mod Patch: https://git.openjdk.org/jdk/pull/24941.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24941/head:pull/24941 PR: https://git.openjdk.org/jdk/pull/24941 From prr at openjdk.org Thu May 1 22:41:30 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 1 May 2025 22:41:30 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip Message-ID: A simple API to replace java.applet.AudioClip ------------- Commit messages: - 8356049 - 8356049 Changes: https://git.openjdk.org/jdk/pull/24991/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356049 Stats: 320 lines in 7 files changed: 317 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From mvs at openjdk.org Fri May 2 09:29:46 2025 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 2 May 2025 09:29:46 GMT Subject: RFR: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI [v4] In-Reply-To: References: Message-ID: On Mon, 28 Apr 2025 09:32:26 GMT, Manukumar V S wrote: >> java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. >> Also the frame created in this test is not disposed which may interfere with other tests. >> >> Fix: >> Some stabilisations added and the frame is disposed properly. >> >> Testing: >> Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. >> I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. >> With JDK 8u60b04: >> Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane >> at bug8077409Test.main(bug8077409Test.java:142) >> >> With JDK 8u60b20: >> Passed..... > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Removed unwanted code and updated copyright year Any sponsors? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24292#issuecomment-2846779659 From abhiscxk at openjdk.org Fri May 2 10:01:55 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 2 May 2025 10:01:55 GMT Subject: RFR: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI [v4] In-Reply-To: References: Message-ID: <_zlFiWA0VIFjTaoKMr6gGZhuoO3v-IJZJ-Ya5T7g6O4=.1b96b879-27c4-42a3-95a5-f5198800fdfc@github.com> On Mon, 28 Apr 2025 09:32:26 GMT, Manukumar V S wrote: >> java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. >> Also the frame created in this test is not disposed which may interfere with other tests. >> >> Fix: >> Some stabilisations added and the frame is disposed properly. >> >> Testing: >> Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. >> I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. >> With JDK 8u60b04: >> Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane >> at bug8077409Test.main(bug8077409Test.java:142) >> >> With JDK 8u60b20: >> Passed..... > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Removed unwanted code and updated copyright year test/jdk/java/awt/ScrollPane/bug8077409Test.java line 32: > 30: */ > 31: > 32: Extra blank line can be removed. test/jdk/java/awt/ScrollPane/bug8077409Test.java line 58: > 56: add(pane, BorderLayout.CENTER); > 57: setSize(320, 480); > 58: For consistency, blank line can be removed. test/jdk/java/awt/ScrollPane/bug8077409Test.java line 75: > 73: throw new RuntimeException("Wrong position of component in ScrollPane"); > 74: } else { > 75: System.out.println("Passed....."); Redundant print statement. test/jdk/java/awt/ScrollPane/bug8077409Test.java line 85: > 83: protected void processKeyEvent(KeyEvent e) { > 84: super.processKeyEvent(e); > 85: For consistency, blank line can be removed. test/jdk/java/awt/ScrollPane/bug8077409Test.java line 89: > 87: > 88: class MyCanvas extends Canvas { > 89: public Dimension getPreferredSize() { You can add @Override for overridden method test/jdk/java/awt/ScrollPane/bug8077409Test.java line 93: > 91: } > 92: > 93: public void paint(Graphics g) { You can add `@Override` for overridden method ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071382835 PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071386731 PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071384232 PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071386531 PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071385141 PR Review Comment: https://git.openjdk.org/jdk/pull/24292#discussion_r2071384845 From mvs at openjdk.org Fri May 2 10:49:03 2025 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 2 May 2025 10:49:03 GMT Subject: RFR: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI [v5] In-Reply-To: References: Message-ID: <2Y1tZfd5uHIxowWxcws3jxMJDP558uHTUABw7TqOQhE=.9d8930c9-118c-4510-86c2-fa887ae4228a@github.com> > java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. > Also the frame created in this test is not disposed which may interfere with other tests. > > Fix: > Some stabilisations added and the frame is disposed properly. > > Testing: > Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. > I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. > With JDK 8u60b04: > Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane > at bug8077409Test.main(bug8077409Test.java:142) > > With JDK 8u60b20: > Passed..... Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Formatting changes, added @override ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24292/files - new: https://git.openjdk.org/jdk/pull/24292/files/13d1deeb..58349b9a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24292&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24292&range=03-04 Stats: 10 lines in 1 file changed: 2 ins; 8 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24292.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24292/head:pull/24292 PR: https://git.openjdk.org/jdk/pull/24292 From ngubarkov at openjdk.org Fri May 2 16:16:46 2025 From: ngubarkov at openjdk.org (Nikita Gubarkov) Date: Fri, 2 May 2025 16:16:46 GMT Subject: RFR: 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride [v2] In-Reply-To: References: <0IkJpQYFv_3lUjxKvd1T0EqtOeO4wN5XYEX1pJFf6Pc=.0eac5063-1b53-461b-8bc8-ca1320147a5a@github.com> <7PoUZmVaNchLPzKKv-Y2Kb3K2iTCIwF_GBxWgYOeSj8=.7c57eb44-10de-4e95-9fea-07ea39ed53ee@github.com> <9t4GmM3f624NKzcRzc1I4m-jDABNjukX93uJiEge0Bs=.b3a8c0f9-cd9c-4f61-9d80-700e5d37fcc7@github.com> <8dCI6Y3gKiDufYZEKkqrUk7Fn3lz3cwHVyi2gS7-Qck=.e4d29c99-7cce-4aad-a635-31f199970b61@github.com> Message-ID: <7b80MMi1QZ9zqKkL7LCFhaYSBiEMcVc5AgHmrWw5oO4=.23847f28-e1b0-43bb-b88e-2177b7ef9c09@github.com> On Fri, 25 Apr 2025 19:12:39 GMT, Sergey Bylokhov wrote: >> In your sample you provided an example, when raster fits whole pixels (`scanline * (height - 1) + pixelStride * width`), which, I agree, is a perfectly fine case and must be supported by accelerated pipelines. But the question is: should partial pixels be handled by our pipelines too (`scanline * (height - 1) + pixelStride * (width - 1) + maxBandOffset + 1` where `maxBandOffset + 1 < pixelStride`), or should whole pixels be enforced? I am for the latter. > > However, this is not a case of a "partial pixel"- the data for the pixel itself is present. Therefore, the user can still manually create a buffer that discards the tail of the image and it will be accepted: > > DataBuffer manualBuffer = new DataBufferByte( > scanlineStride * (SIZE - 1) + pixelStride * (SIZE - 1) + 2/*maxBandOffset*/ + 1 /*size of last component*/ > ); > > The current logic seems to imply that: > > * The scanline stride doesn't matter for a single-line image, or for the last line in the image. > * The pixel stride is irrelevant if there's only one pixel in the image, or for the last pixel in a row. > > This behavior is validated in src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java#verify, with the exception of the single-pixel image we mentioned earlier. > > I believe that exception for the 1-pixel image is a bug (pixelStride > data.length) that was overlooked during the work on commit [86104df](https://github.com/openjdk/jdk/commit/86104df#diff-f5003f18f0f4594a4859901ea950652467137fb1d07900208a84617036142746R891-L891), where a similar check for scanlineStride > data.length was fixed. Ok, I found another argument as to why I think we should allocate memory according to `pixelStride`, including padding. I am currently optimizing the Vulkan blit and specifically reducing the amount of extra copies, so the issue is real. In order to do draw an image, we need a Vulkan image. To bring raster data into Vulkan image we are currently doing 2 copies: software raster -> VkBuffer -> VkImage. We could get rid of one copy if we imported raster memory as an external allocation and bind VkBuffer to it directly: VkBuffer(software raster) -> VkImage. In theory we could even wrap host memory as an image and use it directly, but I doubt that would be more performant. So, if we try to import raster data as an external allocation, it becomes useless for the purposes of copying or sampling, because Vulkan requires the whole memory region to be resident, it will copy `height` rows of `rowLength` bytes and there is no way it could work in that strange scenario when we have RGBx raster with 1 byte of padding in the end, mapping to RGBA Vulkan format, and there is just a single missing byte in the end of the whole raster ruining our optimization, forcing us to memcpy the whole raster into a temporary buffer, which is just 1 byte larger so that we could properly copy that into Vulkan image. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24111#discussion_r2071847084 From duke at openjdk.org Fri May 2 17:18:51 2025 From: duke at openjdk.org (Hendrik Schick) Date: Fri, 2 May 2025 17:18:51 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip In-Reply-To: References: Message-ID: On Thu, 1 May 2025 22:31:32 GMT, Phil Race wrote: > A simple API to replace java.applet.AudioClip src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 101: > 99: clip.init(stream); > 100: } catch (final Exception e) { > 101: // AudioClip will be no-op if some exception will occurred Suggestion: // AudioClip will be no-op if some exception will occur or 'has occurred' (?) src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 114: > 112: clip.init(uc.getInputStream()); > 113: } catch (final Exception ignored) { > 114: // Playing the clip will be a no-op if an exception occured in inititialization. Suggestion: // Playing the clip will be a no-op if an exception occured in initialization. src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 124: > 122: clip.init(url.openStream()); > 123: } catch (final Exception ignored) { > 124: // Playing the clip will be a no-op if an exception occurred in inititialization. Suggestion: // Playing the clip will be a no-op if an exception occurred in initialization. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917249 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917636 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071917934 From duke at openjdk.org Fri May 2 17:23:50 2025 From: duke at openjdk.org (Hendrik Schick) Date: Fri, 2 May 2025 17:23:50 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip In-Reply-To: References: Message-ID: On Thu, 1 May 2025 22:31:32 GMT, Phil Race wrote: > A simple API to replace java.applet.AudioClip src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 294: > 292: public synchronized void update(LineEvent event) { > 293: if (clip != null) { > 294: if (clip == event.getSource()) { merge the two ifs to one if? test/jdk/javax/sound/SoundClip/SoundClipTest.java line 40: > 38: > 39: public static void main(String[] args) throws Exception { > 40: Suggestion: ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071921500 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071922997 From duke at openjdk.org Fri May 2 17:29:49 2025 From: duke at openjdk.org (Hendrik Schick) Date: Fri, 2 May 2025 17:29:49 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip In-Reply-To: References: Message-ID: On Thu, 1 May 2025 22:31:32 GMT, Phil Race wrote: > A simple API to replace java.applet.AudioClip test/jdk/javax/sound/SoundClip/SoundClipTest.java line 100: > 98: } > 99: } catch (Exception e) { > 100: System.err.println("Exception occured: "+e); Suggestion: System.err.println("Exception occurred: " + e); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2071926408 From achung at openjdk.org Fri May 2 17:35:04 2025 From: achung at openjdk.org (Alisen Chung) Date: Fri, 2 May 2025 17:35:04 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v3] In-Reply-To: References: Message-ID: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> > Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: check eventsCount ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24885/files - new: https://git.openjdk.org/jdk/pull/24885/files/2199d038..711bd81f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24885&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24885&range=01-02 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24885/head:pull/24885 PR: https://git.openjdk.org/jdk/pull/24885 From achung at openjdk.org Fri May 2 18:34:45 2025 From: achung at openjdk.org (Alisen Chung) Date: Fri, 2 May 2025 18:34:45 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v3] In-Reply-To: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> References: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> Message-ID: On Fri, 2 May 2025 17:35:04 GMT, Alisen Chung wrote: >> Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. > > Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: > > check eventsCount I've updated the test to include logging and ran the test 200x without failures. I think it's ok to push the test with these changes so that if the test ever does fail again we can use the logs and analyze the problem. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24885#issuecomment-2847848635 From prr at openjdk.org Fri May 2 23:00:32 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 2 May 2025 23:00:32 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/d5ae1aef..299bce17 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=00-01 Stats: 2 lines in 2 files changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Fri May 2 23:00:33 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 2 May 2025 23:00:33 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: On Fri, 2 May 2025 17:15:29 GMT, Hendrik Schick wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 101: > >> 99: clip.init(stream); >> 100: } catch (final Exception e) { >> 101: // AudioClip will be no-op if some exception will occurred > > Suggestion: > > // AudioClip will be no-op if some exception will occur > > or 'has occurred' (?) I'm just going to delete the comment here as it is a bit out of place. The more interesting question is whether IOException should be thrown or swallowed like all other exceptions. The current code throws it (clearly) and so the app has to handle it. But if we swallow other exceptions ... ? > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 114: > >> 112: clip.init(uc.getInputStream()); >> 113: } catch (final Exception ignored) { >> 114: // Playing the clip will be a no-op if an exception occured in inititialization. > > Suggestion: > > // Playing the clip will be a no-op if an exception occurred in initialization. No plans to fix typos comments for code I'm not touching and expect to delete in the near future > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 124: > >> 122: clip.init(url.openStream()); >> 123: } catch (final Exception ignored) { >> 124: // Playing the clip will be a no-op if an exception occurred in inititialization. > > Suggestion: > > // Playing the clip will be a no-op if an exception occurred in initialization. No plans to fix typos comments for code I'm not touching and expect to delete in the near future > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 294: > >> 292: public synchronized void update(LineEvent event) { >> 293: if (clip != null) { >> 294: if (clip == event.getSource()) { > > merge the two ifs to one if? I could .. but this way it is clearer that clip may actually be null .. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 40: > >> 38: >> 39: public static void main(String[] args) throws Exception { >> 40: > > Suggestion: I like blank lines there > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 100: > >> 98: } >> 99: } catch (Exception e) { >> 100: System.err.println("Exception occured: "+e); > > Suggestion: > > System.err.println("Exception occurred: " + e); I copied that from another test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072221321 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072221421 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072221490 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072222130 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072222289 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2072222456 From serb at openjdk.org Sat May 3 01:02:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 3 May 2025 01:02:52 GMT Subject: RFR: 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride [v2] In-Reply-To: <7b80MMi1QZ9zqKkL7LCFhaYSBiEMcVc5AgHmrWw5oO4=.23847f28-e1b0-43bb-b88e-2177b7ef9c09@github.com> References: <0IkJpQYFv_3lUjxKvd1T0EqtOeO4wN5XYEX1pJFf6Pc=.0eac5063-1b53-461b-8bc8-ca1320147a5a@github.com> <7PoUZmVaNchLPzKKv-Y2Kb3K2iTCIwF_GBxWgYOeSj8=.7c57eb44-10de-4e95-9fea-07ea39ed53ee@github.com> <9t4GmM3f624NKzcRzc1I4m-jDABNjukX93uJiEge0Bs=.b3a8c0f9-cd9c-4f61-9d80-700e5d37fcc7@github.com> <8dCI6Y3gKiDufYZEKkqrUk7Fn3lz3cwHVyi2gS7-Qck=.e4d29c99-7cce-4aad-a635-31f199970b61@github.com> <7b80MMi1QZ9zqKkL7LCFhaYSBiEMcVc5AgHmrWw5oO4=.23847f28-e1b0-43bb-b88e-2177b7ef9c09@ github.com> Message-ID: On Fri, 2 May 2025 16:14:30 GMT, Nikita Gubarkov wrote: >> However, this is not a case of a "partial pixel"- the data for the pixel itself is present. Therefore, the user can still manually create a buffer that discards the tail of the image and it will be accepted: >> >> DataBuffer manualBuffer = new DataBufferByte( >> scanlineStride * (SIZE - 1) + pixelStride * (SIZE - 1) + 2/*maxBandOffset*/ + 1 /*size of last component*/ >> ); >> >> The current logic seems to imply that: >> >> * The scanline stride doesn't matter for a single-line image, or for the last line in the image. >> * The pixel stride is irrelevant if there's only one pixel in the image, or for the last pixel in a row. >> >> This behavior is validated in src/java.desktop/share/classes/sun/awt/image/ByteComponentRaster.java#verify, with the exception of the single-pixel image we mentioned earlier. >> >> I believe that exception for the 1-pixel image is a bug (pixelStride > data.length) that was overlooked during the work on commit [86104df](https://github.com/openjdk/jdk/commit/86104df#diff-f5003f18f0f4594a4859901ea950652467137fb1d07900208a84617036142746R891-L891), where a similar check for scanlineStride > data.length was fixed. > > Ok, I found another argument as to why I think we should allocate memory according to `pixelStride`, including padding. I am currently optimizing the Vulkan blit and specifically reducing the amount of extra copies, so the issue is real. > > In order to do draw an image, we need a Vulkan image. To bring raster data into Vulkan image we are currently doing 2 copies: software raster -> VkBuffer -> VkImage. We could get rid of one copy if we imported raster memory as an external allocation and bind VkBuffer to it directly: VkBuffer(software raster) -> VkImage. In theory we could even wrap host memory as an image and use it directly, but I doubt that would be more performant. > > So, if we try to import raster data as an external allocation, it becomes useless for the purposes of copying or sampling, because Vulkan requires the whole memory region to be resident, it will copy `height` rows of `rowLength` bytes and there is no way it could work in that strange scenario when we have RGBx raster with 1 byte of padding in the end, mapping to RGBA Vulkan format, and there is just a single missing byte in the end of the whole raster ruining our optimization, forcing us to memcpy the whole raster into a temporary buffer, which is just 1 byte larger so that we could properly copy that into Vulkan image. But even if we start allocating raster memory with padding internally, you will still need to support both cases anyway, right? So for now, maybe it's best to implement two versions of the blit: one optimized (assuming properly padded memory) and one fallback (handling the edge case with the missing padding). At runtime, we can select the appropriate version depending on the actual memory layout. Then we can compare performance and see whether supporting both is actually worth it. If the performance difference is significant, we can update our internal allocation strategy to always use the optimized layout, while still supporting custom rasters (with non-standard strides) using the slower path. Just to clarify - are we talking only about padding per pixel, or do we also need full row padding to meet Vulkan?s alignment requirements? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24111#discussion_r2072266843 From serb at openjdk.org Sat May 3 03:36:37 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 3 May 2025 03:36:37 GMT Subject: RFR: 8355078: java.awt.Color.createContext() uses unnecessary synchronization Message-ID: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. Two tests are added: - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() ------------- Commit messages: - Merge branch 'openjdk:master' into colorctx - Update ColorPaintContextBasicTest.java - handle VolatileImage properly - Update ColorPaintContext.java - 8355078: java.awt.Color.createContext() uses unnecessary synchronization Changes: https://git.openjdk.org/jdk/pull/24771/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24771&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8355078 Stats: 304 lines in 4 files changed: 270 ins; 21 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/24771.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24771/head:pull/24771 PR: https://git.openjdk.org/jdk/pull/24771 From liach at openjdk.org Sat May 3 03:36:37 2025 From: liach at openjdk.org (Chen Liang) Date: Sat, 3 May 2025 03:36:37 GMT Subject: RFR: 8355078: java.awt.Color.createContext() uses unnecessary synchronization In-Reply-To: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> References: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> Message-ID: <-_5oVNGUPmnehTXt3lCZZQ2ieSW8PRT21D5b5GVZwI8=.7151f571-311c-45b6-b007-2431790780d3@github.com> On Sun, 20 Apr 2025 08:15:38 GMT, Sergey Bylokhov wrote: > At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. > > > Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. > > Two tests are added: > - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. > - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() Is a CSR requested for the access flags change? Some method flags, notably `native` or `synchronized`, are not part of the API specificaion and not rendered, and thus can be changed without CSR reviews. For example, the [javadoc for this particular method](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/Color.html#createContext(java.awt.image.ColorModel,java.awt.Rectangle,java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform,java.awt.RenderingHints)) does not include the `synchronized` modifier. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24771#issuecomment-2817252429 From serb at openjdk.org Sat May 3 03:36:37 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 3 May 2025 03:36:37 GMT Subject: RFR: 8355078: java.awt.Color.createContext() uses unnecessary synchronization In-Reply-To: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> References: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> Message-ID: <--OqL7L8b4WyVcaOPjzRd5HIOV1otfWrRnUfWHPrqrY=.248a6752-7b11-4207-83a8-e180e4d6cee7@github.com> On Sun, 20 Apr 2025 08:15:38 GMT, Sergey Bylokhov wrote: > At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. > > > Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. > > Two tests are added: > - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. > - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() src/java.desktop/share/classes/java/awt/ColorPaintContext.java line 39: > 37: private final int color; > 38: private volatile WritableRaster savedTile; > 39: Since ColorPaintContext is no longer cached within the Color class, it's unlikely that this object will be accessed by multiple threads in typical JDK usage. Therefore, the synchronized modifier has been removed from the getRaster() method. However, to ensure thread safety in the rare case where a ColorPaintContext instance is shared across threads (if app decides to do so for some reason), the savedTile field has been declared as volatile. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24771#discussion_r2071030293 From ngubarkov at openjdk.org Sat May 3 09:28:45 2025 From: ngubarkov at openjdk.org (Nikita Gubarkov) Date: Sat, 3 May 2025 09:28:45 GMT Subject: RFR: 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride [v2] In-Reply-To: References: <0IkJpQYFv_3lUjxKvd1T0EqtOeO4wN5XYEX1pJFf6Pc=.0eac5063-1b53-461b-8bc8-ca1320147a5a@github.com> <7PoUZmVaNchLPzKKv-Y2Kb3K2iTCIwF_GBxWgYOeSj8=.7c57eb44-10de-4e95-9fea-07ea39ed53ee@github.com> <9t4GmM3f624NKzcRzc1I4m-jDABNjukX93uJiEge0Bs=.b3a8c0f9-cd9c-4f61-9d80-700e5d37fcc7@github.com> <8dCI6Y3gKiDufYZEKkqrUk7Fn3lz3cwHVyi2gS7-Qck=.e4d29c99-7cce-4aad-a635-31f199970b61@github.com> <7b80MMi1QZ9zqKkL7LCFhaYSBiEMcVc5AgHmrWw5oO4=.23847f28-e1b0-43bb-b88e-2177b7ef9c09@ github.com> Message-ID: On Sat, 3 May 2025 00:58:38 GMT, Sergey Bylokhov wrote: > even if we start allocating raster memory with padding internally, you will still need to support both cases anyway, right? I don't think so. If we accept a user-created raster, it will not have a native structs initialized due to https://github.com/openjdk/jdk/pull/24378 anyway, so it will be converted into a known type first, before being used in Vulkan loops. So if we create rasters with optimal layouts internally, we should mostly be fine. Similarly for accepting external rasters (https://github.com/openjdk/jdk/pull/24378), we could only initialize native data if the memory layout matches the requirements of our accelerated loops. > are we talking only about padding per pixel, or do we also need full row padding to meet Vulkan?s alignment requirements? Sorry, not "it will copy `height` rows of `rowLength`", but "it will copy `height` rows of `width` texels with `rowLength` steps". We are talking about per-pixel padding, **not** full row one. Here's the spec on that: https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#copies-buffers-images There is also an alignment limitation: buffer offset and row length must be multiple of texel block size - for our rasters it means that `startingOffset` and `scanlineStride` must be aligned to `pixelStride`, in order to be able to copy from this memory into Vulkan image directly. Again, this requirement is easily fulfilled when creating rasters internally, and can be checked when accepting external rasters. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24111#discussion_r2072359206 From achung at openjdk.org Sun May 4 20:58:47 2025 From: achung at openjdk.org (Alisen Chung) Date: Sun, 4 May 2025 20:58:47 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v11] In-Reply-To: <6A6RT3ZqccBhAhdhEaSDc3Ri0yUWw61Alc2xbYHtXfI=.24af6c9c-b6b8-4f3e-a4c6-61143685eef2@github.com> References: <741DjI-uVAuf4pjN9MqVaKz2iEI-qr-L9c6KCbP7IlY=.e46c1d54-4b0f-4cc3-b572-043923972212@github.com> <6A6RT3ZqccBhAhdhEaSDc3Ri0yUWw61Alc2xbYHtXfI=.24af6c9c-b6b8-4f3e-a4c6-61143685eef2@github.com> Message-ID: On Wed, 30 Apr 2025 21:17:41 GMT, Sergey Bylokhov wrote: > > So this seems to be a bug in macOS, as the reported mouse location is incorrect while it is actually positioned at the edge? > > Probably, there are other macOS APIs that could be used to implement Java_sun_lwawt_macosx_CCursorManager_nativeGetCursorPosition. Or perhaps the methods within it should be called on the appkit thread - I see a potential race, since the mouse is moved asynchronously on appkit, but the coordinates are fetched on the current thread. > > Did you have a chance to check our implementation of setting and getting the cursor? I took a look at the cocoa documentation and I wasn't able to find any APIs that handle clamping. I also looked at our implementation: we create an empty mouse event then grab the location of that event. Since macOS doesn't do clamping, we would need to add clamping code to nativeGetCursorPosition after we grab the location of that empty event. I think it's easier to just do the clamping in CRobot on mouseMove instead since that would be the only way for the mouse to initially reach out of bounds. What do you think? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2849412199 From achung at openjdk.org Sun May 4 20:58:48 2025 From: achung at openjdk.org (Alisen Chung) Date: Sun, 4 May 2025 20:58:48 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v11] In-Reply-To: References: <5eX-W4QVC3rAl-stH-geqadwoXIuYNR02tcNnY93I-8=.de2a402f-675e-48ac-ad29-b40f3b894f96@github.com> Message-ID: On Wed, 30 Apr 2025 15:06:48 GMT, Alexander Zvegintsev wrote: >> These failures when moving to the offscreen point are actually because the new onscreen point being moved to is closer distance-wise than the onscreen point it would have moved to before the fix. > > I think it doesn't look like expected behavior anyway, the pre-clamping one seems more reasonable to me (as for Linux, haven't tested other platforms). > > Anyway, if the we are only having issues getting the mouse pointer coordinates after moving it off-screen on macos, I guess the fix shouldn't change shared code and other platforms. Linux tries to respect one of the bounds if it can, while my code just looks for the closest point across all screens. I think both are reasonable, but I've moved the code into macOS code so the behavior isn't changed on different platforms. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2072709435 From achung at openjdk.org Sun May 4 21:02:45 2025 From: achung at openjdk.org (Alisen Chung) Date: Sun, 4 May 2025 21:02:45 GMT Subject: RFR: JDK-8355528 : Update HarfBuzz to 11.2.0 In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 19:37:29 GMT, Harshitha Onkar wrote: > HarfBuzz upgraded to 11.2.0 > > 4 newly added files and 99 modified files. Just a quick question since usually the third party upgrades I've done don't include new files, did you check that the files are needed for jdk? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24973#issuecomment-2849414631 From abhiscxk at openjdk.org Mon May 5 04:25:48 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 5 May 2025 04:25:48 GMT Subject: RFR: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI [v5] In-Reply-To: <2Y1tZfd5uHIxowWxcws3jxMJDP558uHTUABw7TqOQhE=.9d8930c9-118c-4510-86c2-fa887ae4228a@github.com> References: <2Y1tZfd5uHIxowWxcws3jxMJDP558uHTUABw7TqOQhE=.9d8930c9-118c-4510-86c2-fa887ae4228a@github.com> Message-ID: <00Mvcitec-3Sio9wB9tPw_BtkySKySzbEDpR3BCEO1U=.f1b328dc-0c81-4f81-870d-6d0a341f0d7e@github.com> On Fri, 2 May 2025 10:49:03 GMT, Manukumar V S wrote: >> java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. >> Also the frame created in this test is not disposed which may interfere with other tests. >> >> Fix: >> Some stabilisations added and the frame is disposed properly. >> >> Testing: >> Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. >> I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. >> With JDK 8u60b04: >> Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane >> at bug8077409Test.main(bug8077409Test.java:142) >> >> With JDK 8u60b20: >> Passed..... > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Formatting changes, added @override Looks good to me. ------------- Marked as reviewed by abhiscxk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24292#pullrequestreview-2813774275 From duke at openjdk.org Mon May 5 04:25:48 2025 From: duke at openjdk.org (duke) Date: Mon, 5 May 2025 04:25:48 GMT Subject: RFR: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI [v5] In-Reply-To: <2Y1tZfd5uHIxowWxcws3jxMJDP558uHTUABw7TqOQhE=.9d8930c9-118c-4510-86c2-fa887ae4228a@github.com> References: <2Y1tZfd5uHIxowWxcws3jxMJDP558uHTUABw7TqOQhE=.9d8930c9-118c-4510-86c2-fa887ae4228a@github.com> Message-ID: <5VYFch-1SI6ILWOXfGPmZSueuNSoZNAaZjmUdRCIjIY=.f138d553-c7b3-4b47-ba25-9b28c65057d8@github.com> On Fri, 2 May 2025 10:49:03 GMT, Manukumar V S wrote: >> java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. >> Also the frame created in this test is not disposed which may interfere with other tests. >> >> Fix: >> Some stabilisations added and the frame is disposed properly. >> >> Testing: >> Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. >> I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. >> With JDK 8u60b04: >> Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane >> at bug8077409Test.main(bug8077409Test.java:142) >> >> With JDK 8u60b20: >> Passed..... > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Formatting changes, added @override @openjdk[bot] Your change (at version 58349b9a79690f49ab3ef2174bca1c3805f1ec7f) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24292#issuecomment-2849874937 From kizune at openjdk.org Mon May 5 10:44:48 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 5 May 2025 10:44:48 GMT Subject: RFR: 8355561: [macos] Build failure with Xcode 16.3 In-Reply-To: References: Message-ID: <-sTh2qfUGEuQZ16dmL-Kyx4K_34FVamhKVx30VQ5NGY=.ea6b1294-d618-4a01-9ce6-86d4df5cb92a@github.com> On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov wrote: > Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836 > > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] > 127 | AudioDeviceID devices[count]; > | ^~~~~ > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here > 126 | int count = size/sizeof(AudioDeviceID); > > The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file. > > Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized. Looks good. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24937#pullrequestreview-2814420953 From aturbanov at openjdk.org Mon May 5 12:34:46 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 5 May 2025 12:34:46 GMT Subject: RFR: 8354944: Remove unnecessary PartiallyOrderedSet.nodes In-Reply-To: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> References: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> Message-ID: On Wed, 16 Apr 2025 20:50:24 GMT, Andrey Turbanov wrote: > We can use `javax.imageio.spi.PartiallyOrderedSet#poNodes` directly Can I get a second review? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24699#issuecomment-2850846651 From aturbanov at openjdk.org Mon May 5 12:38:58 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 5 May 2025 12:38:58 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets Message-ID: Cleanup code to use Map.putIfAbsent. It's clearer and faster. ------------- Commit messages: - [PATCH] Remove unnecessary Map.get from XWM.getInsets Changes: https://git.openjdk.org/jdk/pull/24906/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24906&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356175 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24906.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24906/head:pull/24906 PR: https://git.openjdk.org/jdk/pull/24906 From serb at openjdk.org Mon May 5 12:38:58 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 5 May 2025 12:38:58 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Sun, 27 Apr 2025 21:01:07 GMT, Andrey Turbanov wrote: > Cleanup code to use Map.putIfAbsent. It's clearer and faster. looks fine. looks fine ------------- PR Comment: https://git.openjdk.org/jdk/pull/24906#issuecomment-2837033384 PR Comment: https://git.openjdk.org/jdk/pull/24906#issuecomment-2840893704 From acobbs at openjdk.org Mon May 5 13:56:46 2025 From: acobbs at openjdk.org (Archie Cobbs) Date: Mon, 5 May 2025 13:56:46 GMT Subject: RFR: 8355561: [macos] Build failure with Xcode 16.3 In-Reply-To: References: Message-ID: On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov wrote: > Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836 > > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] > 127 | AudioDeviceID devices[count]; > | ^~~~~ > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here > 126 | int count = size/sizeof(AudioDeviceID); > > The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file. > > Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized. Looking forward to getting this fixed so I can build again... ------------- PR Comment: https://git.openjdk.org/jdk/pull/24937#issuecomment-2851089294 From achung at openjdk.org Mon May 5 16:00:56 2025 From: achung at openjdk.org (Alisen Chung) Date: Mon, 5 May 2025 16:00:56 GMT Subject: RFR: 8354219 : Automate javax/swing/JComboBox/ComboPopupBug.java [v9] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 01:23:00 GMT, Anass Baya wrote: >> This test was designed to manually verify that clicking on the JComboBox when the frame containing it is about to close does not cause an IllegalStateException. >> >> The test allowed the tester extra time to click on the JComboBox when closing the frame by adding a Thread.sleep() in the close button handler. >> >> In this test, a JComboBox is displayed with a Close button at the bottom. The tester should click the Close button, then try to click the JComboBox arrow button to display the popup. >> >> In the automated test, we save the JComboBox location size before closing the frame. We then use this information to click on the JComboBox right before the frame is closed. > > Anass Baya has updated the pull request incrementally with one additional commit since the last revision: > > Add waitforidle Marked as reviewed by achung (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24624#pullrequestreview-2815294443 From achung at openjdk.org Mon May 5 16:05:46 2025 From: achung at openjdk.org (Alisen Chung) Date: Mon, 5 May 2025 16:05:46 GMT Subject: RFR: 8355790: Enhance code consistency: java.desktop/unix:sun.awt In-Reply-To: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> References: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> Message-ID: <21CksyRYKYeR-W0GQ5kwosvFvuBksDze3y5B27mOdwo=.a6ebb462-bd4a-4d41-ae12-9798debc1c8f@github.com> On Tue, 29 Apr 2025 00:03:48 GMT, Sergey Bylokhov wrote: > The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. > > To make the code review process easier I have made the following changes: > > 1. I chose `java.desktop/unix:sun.awt` as the starting package because it contains a relatively small number of classes > 2. The public API was not affected so there is no need to worry about a CSR > > Note: I will submit additional patches in this area later because: > > 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) > 2. I skipped adding `@Override` for anonymous classes > > Any feedback or suggestions are welcome! > > Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff) to a simple diff file, it might be more convenient for reviewing the changes. > > To download the diff file and filter only the modified lines you can use the following script: > > > curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff -o d.txt && grep -E '^+|^-' d.txt > > > The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. I've run the clientlibs tests on mach5 and everything passes. ------------- Marked as reviewed by achung (Committer). PR Review: https://git.openjdk.org/jdk/pull/24941#pullrequestreview-2815311855 From duke at openjdk.org Mon May 5 17:10:58 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 5 May 2025 17:10:58 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes Message-ID: This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") 2. The transparent pixel is non-zero 3. There's more than one such consecutive frame Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. ------------- Commit messages: - 8356137: Fixing non-zero transparent pixel with disposal method 1 - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge pull request #5 from openjdk/master - Merge pull request #4 from openjdk/master - Merge pull request #3 from openjdk/master - ... and 2 more: https://git.openjdk.org/jdk/compare/898d4798...5dbf7a11 Changes: https://git.openjdk.org/jdk/pull/25044/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356137 Stats: 155 lines in 3 files changed: 155 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Mon May 5 17:15:47 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 5 May 2025 17:15:47 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes In-Reply-To: References: Message-ID: On Mon, 5 May 2025 17:07:11 GMT, Jeremy Wood wrote: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. For reference, the commented out lines here are my first approach at resolving this problem. image This works, and it may be more readable/intuitive than this current PR. When we initialize saved_image we should flood fill it with transparent pixels. I chose the approach in this PR though because it's lazier. (That is: it should be a little bit less work, CPU-wise.) If anyone wants we can switch to this approach. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2851693643 From prr at openjdk.org Mon May 5 18:47:49 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 5 May 2025 18:47:49 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v3] In-Reply-To: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> References: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> Message-ID: On Fri, 2 May 2025 17:35:04 GMT, Alisen Chung wrote: >> Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. > > Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: > > check eventsCount Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24885#pullrequestreview-2815748937 From prr at openjdk.org Mon May 5 19:26:47 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 5 May 2025 19:26:47 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v11] In-Reply-To: References: <741DjI-uVAuf4pjN9MqVaKz2iEI-qr-L9c6KCbP7IlY=.e46c1d54-4b0f-4cc3-b572-043923972212@github.com> <6A6RT3ZqccBhAhdhEaSDc3Ri0yUWw61Alc2xbYHtXfI=.24af6c9c-b6b8-4f3e-a4c6-61143685eef2@github.com> Message-ID: On Sun, 4 May 2025 20:52:47 GMT, Alisen Chung wrote: > > > So this seems to be a bug in macOS, as the reported mouse location is incorrect while it is actually positioned at the edge? > > > Probably, there are other macOS APIs that could be used to implement Java_sun_lwawt_macosx_CCursorManager_nativeGetCursorPosition. Or perhaps the methods within it should be called on the appkit thread - I see a potential race, since the mouse is moved asynchronously on appkit, but the coordinates are fetched on the current thread. > > > > > > Did you have a chance to check our implementation of setting and getting the cursor? > > I took a look at the cocoa documentation and I wasn't able to find any APIs that handle clamping. I also looked at our implementation: we create an empty mouse event then grab the location of that event. Since macOS doesn't do clamping, we would need to add clamping code to nativeGetCursorPosition after we grab the location of that empty event. I think it's easier to just do the clamping in CRobot on mouseMove instead since that would be the only way for the mouse to initially reach out of bounds. What do you think? I (we) looked at the code that was reporting the off-screen mouse position several weeks ago. What we are doing seems to correspond to all the suggestions on the internet as to how to get mouse position on macOS. I didn't spot any obvious alternative. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2852102362 From serb at openjdk.org Mon May 5 22:48:20 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 5 May 2025 22:48:20 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v11] In-Reply-To: References: <741DjI-uVAuf4pjN9MqVaKz2iEI-qr-L9c6KCbP7IlY=.e46c1d54-4b0f-4cc3-b572-043923972212@github.com> <6A6RT3ZqccBhAhdhEaSDc3Ri0yUWw61Alc2xbYHtXfI=.24af6c9c-b6b8-4f3e-a4c6-61143685eef2@github.com> Message-ID: On Mon, 5 May 2025 19:23:49 GMT, Phil Race wrote: > (we) looked at the code that was reporting the off-screen mouse position several weeks ago. > What we are doing seems to correspond to all the suggestions on the internet as to how to get mouse position on macOS. > I didn't spot any obvious alternative. Previously, we used a different method, which might behave differently (It also used a different thread): https://github.com/openjdk/jdk/commit/eea06f70fc6154be12d066df6669e7c6d8c0bc09#diff-698576e56937835cfc553bbd97fe12fabf954e0a20e7b9c3bfc3a77763fb6bd0L123 I propose developing a native reproducer to investigate the mouse position clamping behavior observed on macOS. The steps would include: 1. Moving the mouse cursor outside the screen bounds. 2. Retrieving the current mouse position. 3. Simulating a mouse click at the current position. 4. Retrieving the mouse position again. 5. Comparing the positions from steps 2 and 4. If the positions differ, we can ask Apple on the following points: 1. Is the clamping of the mouse position during a click an intentional behavior or a bug? 2. If intentional, what is the recommended method for applications to replicate this clamping behavior? 3. If it is a feature intended to be used by certain applications, should we consider bypassing this behavior in the JDK? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2852542797 From honkar at openjdk.org Tue May 6 00:03:16 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 6 May 2025 00:03:16 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object In-Reply-To: References: Message-ID: On Mon, 17 Feb 2025 14:06:53 GMT, Daniel Gredler wrote: > On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. > > See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. > > This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. > > The new test class passes on Linux, Windows and macOS. src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 138: > 136: return code == 0x0009 || code == 0x000a || code == 0x000d; > 137: } > 138: @prrace @gredler Following is an existing issue NOT related to the recent harfbuzz upgrade PR nor this issue fix but it is similar in nature so a separate JBS issue can be created to handle it. I wanted to discuss it before integrating the HB upgrade tomorrow. There seems to be similar issue on windows and linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) that are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` **On Windows:** image **On Linux:** image If adding these codes (0x2028, 0x2029) to platform specific src code (I believe it is NativeGlyphMapper (linux) and WPathGraphics (windows)) fixes the above issue then should we consider moving isIgnorableWhitespace() to common class - `CharToGlyphMapper` instead of macOS specific src? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2074388646 From honkar at openjdk.org Tue May 6 00:13:16 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 6 May 2025 00:13:16 GMT Subject: RFR: JDK-8355528 : Update HarfBuzz to 11.2.0 In-Reply-To: References: Message-ID: On Sun, 4 May 2025 21:00:31 GMT, Alisen Chung wrote: > Just a quick question since usually the third party upgrades I've done don't include new files, did you check that the files are needed for jdk? Yes, only those new files are added from upstream as required to make JDK build successful. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24973#issuecomment-2852806939 From serb at openjdk.org Tue May 6 00:18:00 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 6 May 2025 00:18:00 GMT Subject: RFR: 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout Message-ID: The `java/awt/Toolkit/Headless/HeadlessToolkit.java` test covers some functionality of various methods in the `HeadlessToolkit` class, specifically whether these methods throw a `HeadlessException` or not. The image-related methods do not require access to a remote server via a URL; they can be tested using a URL pointing to a local file. This ensures that the test does not depend on `openjdk.org`. ------------- Commit messages: - 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout Changes: https://git.openjdk.org/jdk/pull/25045/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25045&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356053 Stats: 26 lines in 1 file changed: 15 ins; 4 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/25045.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25045/head:pull/25045 PR: https://git.openjdk.org/jdk/pull/25045 From serb at openjdk.org Tue May 6 02:45:20 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 6 May 2025 02:45:20 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing In-Reply-To: References: Message-ID: On Mon, 5 May 2025 18:55:47 GMT, Phil Race wrote: > Delete the obsolete classes PluginPrinter and EPSPrinter. They were only ever called by the Java Plugin printing for applets. src/java.desktop/share/classes/sun/print/PSPrinterJob.java line 272: > 270: /* non-null if printing EPS for Java Plugin */ > 271: private EPSPrinter epsPrinter = null; > 272: This looks fine, but what about all unused xx_MASK and xx_SHIFT and hexDigits at the start of this class? and unused escapeParens() and mCurMetrics below? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25047#discussion_r2074653014 From mvs at openjdk.org Tue May 6 02:54:25 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 6 May 2025 02:54:25 GMT Subject: Integrated: 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI In-Reply-To: References: Message-ID: On Fri, 28 Mar 2025 11:09:03 GMT, Manukumar V S wrote: > java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI, especially in MacOS machines. > Also the frame created in this test is not disposed which may interfere with other tests. > > Fix: > Some stabilisations added and the frame is disposed properly. > > Testing: > Tested 100 times per platform(macosx-x64,macosx-aarch64,windows-x64,linux-x64) and got all PASS. > I have also tested this on Windows-x64 with JDK 8u60b04 and JDK 8u60b20 as the original issue related to this test(JDK-8077409) was fixed in JDK 8u60b20. > With JDK 8u60b04: > Exception in thread "main" java.lang.RuntimeException: Wrong position of component in ScrollPane > at bug8077409Test.main(bug8077409Test.java:142) > > With JDK 8u60b20: > Passed..... This pull request has now been integrated. Changeset: e09d2e27 Author: Manukumar V S Committer: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/e09d2e275bc646201a8da39bd4b977d3fda97954 Stats: 98 lines in 1 file changed: 23 ins; 40 del; 35 mod 8288471: java/awt/ScrollPane/bug8077409Test.java is unstable and fails intermittently in CI Reviewed-by: abhiscxk, serb ------------- PR: https://git.openjdk.org/jdk/pull/24292 From aturbanov at openjdk.org Tue May 6 09:11:18 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 6 May 2025 09:11:18 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing In-Reply-To: References: Message-ID: On Mon, 5 May 2025 18:55:47 GMT, Phil Race wrote: > Delete the obsolete classes PluginPrinter and EPSPrinter. They were only ever called by the Java Plugin printing for applets. src/java.desktop/share/classes/sun/print/PSPrinterJob.java line 533: > 531: try { > 532: spoolFile = new File(mDestination); > 533: output = new FileOutputStream(spoolFile); Suggestion: output = new FileOutputStream(spoolFile); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25047#discussion_r2075050472 From myankelevich at openjdk.org Tue May 6 10:48:16 2025 From: myankelevich at openjdk.org (Mikhail Yankelevich) Date: Tue, 6 May 2025 10:48:16 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes In-Reply-To: References: Message-ID: On Mon, 5 May 2025 17:07:11 GMT, Jeremy Wood wrote: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. Just a few questions. Also, a copyright in GifImageDecoder.java test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 2: > 1: /* > 2: * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. Nitpick: do you need 2002 here? Isn't it a new file? test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 28: > 26: * @bug 8356137 > 27: * @summary This test verifies a non-zero transparent pixel in gifs works when > 28: * the disposal method changes from 2 to 1, and when the Nitpick: Do you need the `, and when the` ? ? test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 51: > 49: boolean pass = true; > 50: if (new Color(frames[3].getRGB(20, 20), true).getAlpha() != 0) { > 51: System.err.println("Sampling at (20,20) failed"); Do you think it would be cleaner if you jsut throw a `RuntimeException("Sampling at (20,20) failed");` instead of the whole System.err.println("Sampling at (20,20) failed"); pass = false; } if (!pass) throw new Error("See System.err for details"); ? It should result in the same level of details but with better readability imo test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 105: > 103: // we don't expect this to happen, but if something goes > 104: // wrong nobody else will print our stacktrace for us: > 105: e.printStackTrace(); Do you need this print here? Runtime exception should print it out anyway to the system.error afaik test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 133: > 131: } > 132: } catch(Exception e) { > 133: e.printStackTrace(); Do you need to print out the stack trace here when you are throwing it below? test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 143: > 141: return returnValue.toArray(new BufferedImage[0]); > 142: } > 143: } nitpick: could you please add a new line here for github? ? ------------- PR Review: https://git.openjdk.org/jdk/pull/25044#pullrequestreview-2817764726 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075186796 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075200131 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075190122 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075197940 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075193365 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075192144 From ihse at openjdk.org Tue May 6 14:16:32 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 6 May 2025 14:16:32 GMT Subject: RFR: 8354273: Replace even more Unicode characters with ASCII [v3] In-Reply-To: References: Message-ID: > As a follow-up to [JDK-8354213](https://bugs.openjdk.org/browse/JDK-8354213), I found some additional places where unicode characters are unnecessarily used instead of pure ASCII. Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge branch 'master' into restore-more-ascii - Remove incorrectly copied "?anchor" - 8354273: Restore even more pointless unicode characters to ASCII ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24567/files - new: https://git.openjdk.org/jdk/pull/24567/files/876708c2..a07ef96d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24567&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24567&range=01-02 Stats: 273049 lines in 2453 files changed: 80961 ins; 183018 del; 9070 mod Patch: https://git.openjdk.org/jdk/pull/24567.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24567/head:pull/24567 PR: https://git.openjdk.org/jdk/pull/24567 From ihse at openjdk.org Tue May 6 15:39:24 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 6 May 2025 15:39:24 GMT Subject: RFR: 8354273: Replace even more Unicode characters with ASCII [v3] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 14:16:32 GMT, Magnus Ihse Bursie wrote: >> As a follow-up to [JDK-8354213](https://bugs.openjdk.org/browse/JDK-8354213), I found some additional places where unicode characters are unnecessarily used instead of pure ASCII. > > Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Merge branch 'master' into restore-more-ascii > - Remove incorrectly copied "?anchor" > - 8354273: Restore even more pointless unicode characters to ASCII Ping? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24567#issuecomment-2855052189 From naoto at openjdk.org Tue May 6 16:45:26 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 6 May 2025 16:45:26 GMT Subject: RFR: 8354273: Replace even more Unicode characters with ASCII [v3] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 14:16:32 GMT, Magnus Ihse Bursie wrote: >> As a follow-up to [JDK-8354213](https://bugs.openjdk.org/browse/JDK-8354213), I found some additional places where unicode characters are unnecessarily used instead of pure ASCII. > > Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Merge branch 'master' into restore-more-ascii > - Remove incorrectly copied "?anchor" > - 8354273: Restore even more pointless unicode characters to ASCII LGTM ------------- Marked as reviewed by naoto (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24567#pullrequestreview-2818989660 From aivanov at openjdk.org Tue May 6 16:52:16 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 6 May 2025 16:52:16 GMT Subject: RFR: 8354219 : Automate javax/swing/JComboBox/ComboPopupBug.java [v9] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 01:23:00 GMT, Anass Baya wrote: >> This test was designed to manually verify that clicking on the JComboBox when the frame containing it is about to close does not cause an IllegalStateException. >> >> The test allowed the tester extra time to click on the JComboBox when closing the frame by adding a Thread.sleep() in the close button handler. >> >> In this test, a JComboBox is displayed with a Close button at the bottom. The tester should click the Close button, then try to click the JComboBox arrow button to display the popup. >> >> In the automated test, we save the JComboBox location size before closing the frame. We then use this information to click on the JComboBox right before the frame is closed. > > Anass Baya has updated the pull request incrementally with one additional commit since the last revision: > > Add waitforidle Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24624#pullrequestreview-2819005904 From honkar at openjdk.org Tue May 6 16:53:25 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 6 May 2025 16:53:25 GMT Subject: Integrated: JDK-8355528 : Update HarfBuzz to 11.2.0 In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 19:37:29 GMT, Harshitha Onkar wrote: > HarfBuzz upgraded to 11.2.0 > > 4 newly added files and 99 modified files. This pull request has now been integrated. Changeset: b21b3a38 Author: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/b21b3a38a5dbc7eb23c4bd1fd5c0900a3a1b470b Stats: 7130 lines in 104 files changed: 3723 ins; 2257 del; 1150 mod 8355528: Update HarfBuzz to 11.2.0 Reviewed-by: dnguyen, prr ------------- PR: https://git.openjdk.org/jdk/pull/24973 From duke at openjdk.org Tue May 6 16:55:16 2025 From: duke at openjdk.org (duke) Date: Tue, 6 May 2025 16:55:16 GMT Subject: RFR: 8354219 : Automate javax/swing/JComboBox/ComboPopupBug.java [v9] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 01:23:00 GMT, Anass Baya wrote: >> This test was designed to manually verify that clicking on the JComboBox when the frame containing it is about to close does not cause an IllegalStateException. >> >> The test allowed the tester extra time to click on the JComboBox when closing the frame by adding a Thread.sleep() in the close button handler. >> >> In this test, a JComboBox is displayed with a Close button at the bottom. The tester should click the Close button, then try to click the JComboBox arrow button to display the popup. >> >> In the automated test, we save the JComboBox location size before closing the frame. We then use this information to click on the JComboBox right before the frame is closed. > > Anass Baya has updated the pull request incrementally with one additional commit since the last revision: > > Add waitforidle @anass-baya Your change (at version ae836194f01f6622f0e7aba415cc2ab5b254b989) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24624#issuecomment-2855285542 From duke at openjdk.org Tue May 6 17:13:56 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 6 May 2025 17:13:56 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v2] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 10:33:47 GMT, Mikhail Yankelevich wrote: >> Jeremy Wood has updated the pull request incrementally with five additional commits since the last revision: >> >> - 8356137: removing sentence fragment >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075200131 >> - 8356137: fixing typo >> - 8356137: adding empty line at bottom of file >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075192144 >> - 8356137: removing layered pass/fail pattern >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075190122 >> - 8356137: removing (c) 2002 >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075186796 > > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 2: > >> 1: /* >> 2: * Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved. > > Nitpick: do you need 2002 here? Isn't it a new file? OK, this is removed > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 51: > >> 49: boolean pass = true; >> 50: if (new Color(frames[3].getRGB(20, 20), true).getAlpha() != 0) { >> 51: System.err.println("Sampling at (20,20) failed"); > > Do you think it would be cleaner if you jsut throw a `RuntimeException("Sampling at (20,20) failed");` instead of the whole > > System.err.println("Sampling at (20,20) failed"); > pass = false; > } > > if (!pass) > throw new Error("See System.err for details"); > > ? > It should result in the same level of details but with better readability imo I don't have a strong opinion; this is removed. (I often follow that pattern in case I try to add multiple criteria to pass/fail decisions.) > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 143: > >> 141: return returnValue.toArray(new BufferedImage[0]); >> 142: } >> 143: } > > nitpick: could you please add a new line here for github? ? OK, this is updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075926075 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075926374 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075926503 From duke at openjdk.org Tue May 6 17:13:56 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 6 May 2025 17:13:56 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v2] In-Reply-To: References: Message-ID: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. Jeremy Wood has updated the pull request incrementally with five additional commits since the last revision: - 8356137: removing sentence fragment This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2075200131 - 8356137: fixing typo - 8356137: adding empty line at bottom of file This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2075192144 - 8356137: removing layered pass/fail pattern This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2075190122 - 8356137: removing (c) 2002 This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2075186796 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/5dbf7a11..925d558c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=00-01 Stats: 10 lines in 1 file changed: 1 ins; 6 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Tue May 6 17:17:19 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 6 May 2025 17:17:19 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v2] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 10:43:02 GMT, Mikhail Yankelevich wrote: >> Jeremy Wood has updated the pull request incrementally with five additional commits since the last revision: >> >> - 8356137: removing sentence fragment >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075200131 >> - 8356137: fixing typo >> - 8356137: adding empty line at bottom of file >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075192144 >> - 8356137: removing layered pass/fail pattern >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075190122 >> - 8356137: removing (c) 2002 >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/25044#discussion_r2075186796 > > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 28: > >> 26: * @bug 8356137 >> 27: * @summary This test verifies a non-zero transparent pixel in gifs works when >> 28: * the disposal method changes from 2 to 1, and when the > > Nitpick: Do you need the `, and when the` ? ? Thanks, this is updated > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 105: > >> 103: // we don't expect this to happen, but if something goes >> 104: // wrong nobody else will print our stacktrace for us: >> 105: e.printStackTrace(); > > Do you need this print here? Runtime exception should print it out anyway to the system.error afaik Yes, because this eventually is caught here in GifImageDecoder.java: try { if (!readImage(totalframes == 0, disposal_method, delay)) { return; } } catch (Exception e) { if (verbose) { e.printStackTrace(); } return; } In this specific test file: I never expect an exception to be thrown, but one did come up when I was first drafting this test (because of my own error). It was hard to debug because it was unreported. I would prefer to leave these printStackTrace calls in, in case a developer someday makes a change and needs to see potential errors. (Technically I could try to make verbose `true`, but that's declared as a final variable and I don't want to modify GifImageDecoder.java just for this.) > test/jdk/sun/awt/image/gif/bug8356137/GifEmptyBackgroundTest.java line 133: > >> 131: } >> 132: } catch(Exception e) { >> 133: e.printStackTrace(); > > Do you need to print out the stack trace here when you are throwing it below? Yes, this is caught in the same place the other one is ( https://github.com/openjdk/jdk/pull/25044#discussion_r2075930867 ) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075932570 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075930867 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2075932044 From ihse at openjdk.org Tue May 6 18:03:22 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 6 May 2025 18:03:22 GMT Subject: Integrated: 8354273: Replace even more Unicode characters with ASCII In-Reply-To: References: Message-ID: On Thu, 10 Apr 2025 10:18:08 GMT, Magnus Ihse Bursie wrote: > As a follow-up to [JDK-8354213](https://bugs.openjdk.org/browse/JDK-8354213), I found some additional places where unicode characters are unnecessarily used instead of pure ASCII. This pull request has now been integrated. Changeset: 08dd4a75 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/08dd4a75c5b751a66d2e088b0ec9c6d6c443c14a Stats: 11 lines in 8 files changed: 0 ins; 1 del; 10 mod 8354273: Replace even more Unicode characters with ASCII Reviewed-by: naoto ------------- PR: https://git.openjdk.org/jdk/pull/24567 From mblaesing at openjdk.org Tue May 6 18:09:29 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Tue, 6 May 2025 18:09:29 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v2] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: On Mon, 14 Apr 2025 17:19:19 GMT, Matthias Bl?sing wrote: >> - Introduce a lock into WClipboard that protects the code between >> openClipboard/closeClipboard invocations. >> The native side does not allow to open the clipboard multiple >> times or share the opened clipboard between multiple threads. >> >> - Remove of need to call openClipboard/closeClipboard from >> getClipboardFormats by using the win32 call >> GetUpdatedClipboardFormats >> >> - Prevent a race-condition by not registering the connection >> between java and native side of clipboard multiple time, but >> just at construction time. > > Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: > > Adress review comments: Update copyright years and fix whitespace in if condition It would be great to get a review on this. While the issues are "only" P-3 and P-4, the issues leave a very bad image for java on windows. Copy-and-Paste should just work and not fail randomly and maybe even crash the VM. The issue is serious enough for NetBeans, that it will ship a java agent to work around this problem, but that will not implement this change here and is clearly not an option in the long run and thus this needs a real fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2855480128 From prr at openjdk.org Tue May 6 18:37:31 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 6 May 2025 18:37:31 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing [v2] In-Reply-To: References: Message-ID: > Delete the obsolete classes PluginPrinter and EPSPrinter. They were only ever called by the Java Plugin printing for applets. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356208 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25047/files - new: https://git.openjdk.org/jdk/pull/25047/files/1981c859..608deb19 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25047&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25047&range=00-01 Stats: 54 lines in 1 file changed: 0 ins; 53 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25047.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25047/head:pull/25047 PR: https://git.openjdk.org/jdk/pull/25047 From prr at openjdk.org Tue May 6 18:37:32 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 6 May 2025 18:37:32 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing [v2] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 02:42:56 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356208 > > src/java.desktop/share/classes/sun/print/PSPrinterJob.java line 272: > >> 270: /* non-null if printing EPS for Java Plugin */ >> 271: private EPSPrinter epsPrinter = null; >> 272: > > This looks fine, but what about all unused xx_MASK and xx_SHIFT and hexDigits at the start of this class? and unused escapeParens() and mCurMetrics below? I guess un-related to what I was deleting but I will add it in as these can't have been used in a long time. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25047#discussion_r2076044668 From prr at openjdk.org Tue May 6 18:37:32 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 6 May 2025 18:37:32 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing [v2] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 09:08:35 GMT, Andrey Turbanov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356208 > > src/java.desktop/share/classes/sun/print/PSPrinterJob.java line 533: > >> 531: try { >> 532: spoolFile = new File(mDestination); >> 533: output = new FileOutputStream(spoolFile); > > Suggestion: > > output = new FileOutputStream(spoolFile); pre-existing but I guess I can do it since I'm pushing another commit for the other stuff to delete. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25047#discussion_r2076045625 From prr at openjdk.org Tue May 6 19:13:13 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 6 May 2025 19:13:13 GMT Subject: RFR: 8355561: [macos] Build failure with Xcode 16.3 In-Reply-To: References: Message-ID: On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov wrote: > Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836 > > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] > 127 | AudioDeviceID devices[count]; > | ^~~~~ > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here > 126 | int count = size/sizeof(AudioDeviceID); > > The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file. > > Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24937#pullrequestreview-2819348805 From kcr at openjdk.org Tue May 6 21:33:16 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Tue, 6 May 2025 21:33:16 GMT Subject: RFR: 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events [v5] In-Reply-To: References: Message-ID: <8o9fVyLd4V1IWvemx2MjqX3V6NIDAS6T4vCvn-IWOCI=.f504c898-0260-41b5-b280-86065223bbee@github.com> On Tue, 29 Apr 2025 22:43:03 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with three additional commits since the last revision: > > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events You have an objective-C bug in two places in your proposed fix. I left a comment with suggestions as to how to update your fix to address the bug. With that updated fix, I am able to run in both modes -- AWT as primary with JavaFX embedded, and JavaFX as primary with AWT embedded -- and see the OpenURIHandler events being delivered. Without these fixes, the OpenURIHandler events are only delivered when AWT is the primary toolkit. I also verified that there are no problems running with a fixed AWT and unfixed JavaFX or an unfixed AWT and fixed JavaFX. When only one of them (JavaFX or AWT) is fixed, OpenURIHandler events are not delivered when JavaFX is the primary toolkit, which is the same behavior as today. So that's good. I left a couple other comments with requested changes. src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 132: > 130: NSNotificationCenter *ctr = [NSNotificationCenter defaultCenter]; > 131: Class clz = [ApplicationDelegate class]; > 132: [ctr addObserver:clz selector:@selector(_embeddedEvent:) name:@"EmbeddedEvent" object:nil]; `EmbeddedEvent` is too generic a name. I recommend two things: 1. Prefix it with `AWT`, so it would become `AWTEmbeddedEvent` (I think the method name, `_embeddedEvent `, is fine, since it is private to this file) 2. Create a static NSString constant for this string with a comment that it is intended for the primary toolkit to send an event to AWT when AWT is embedded. You probably want to put this string near the top of the file. Related to the second point, this is only needed when running AWT as an embedded toolkit. I recommend putting this registration code in an `if (!isApplicationOwner) { ... }` block. src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 302: > 300: > 301: NSString *url = [[openURLEvent paramDescriptorForKeyword:keyDirectObject] stringValue]; > 302: [self _openURL:url]; `_openURL` is a class method. Using `self` is incorrect and causes a failure in the normal (non-embedded) case. Suggestion: [ApplicationDelegate _openURL:url]; src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 492: > 490: if ([name isEqualToString:@"openURL"]) { > 491: NSString *url = notification.userInfo[@"url"]; > 492: [self _openURL:url]; `_openURL` is a class method. Using `self` is incorrect (technically, it works here because the caller is also a class method in the same class, but it's still a mistake). Suggestion: [ApplicationDelegate _openURL:url]; ------------- PR Review: https://git.openjdk.org/jdk/pull/24379#pullrequestreview-2819539381 PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2076217229 PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2076219525 PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2076221920 From kcr at openjdk.org Tue May 6 21:48:14 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Tue, 6 May 2025 21:48:14 GMT Subject: RFR: 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events [v5] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 22:43:03 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with three additional commits since the last revision: > > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events I updated the JBS title slightly for (I hope) better clarity. Please update the PR title to match. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2856146464 From serb at openjdk.org Tue May 6 22:40:13 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 6 May 2025 22:40:13 GMT Subject: RFR: 8356208: Remove obsolete code in PSPrinterJob for plugin printing [v2] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 18:37:31 GMT, Phil Race wrote: >> Delete the obsolete classes PluginPrinter and EPSPrinter. They were only ever called by the Java Plugin printing for applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356208 Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25047#pullrequestreview-2819861166 From lordpixel at mac.com Tue May 6 22:48:06 2025 From: lordpixel at mac.com (Andrew Thompson) Date: Tue, 6 May 2025 18:48:06 -0400 Subject: Integrated: 8354273: Replace even more Unicode characters with ASCII In-Reply-To: References: Message-ID: <3AE8B671-24CA-4508-BF59-0276057DB8BD@mac.com> > I believe the source code of the JDK should be in US-ASCII Why? This seems like a bizarre thing to believe free of context. In my experience using non-ascii regularly is the only way to make sure that tools which destroy non-ascii data are not introduced into tool chains which then break cases that matter. The downside of making things ascii is you miss when bugs are introduced. The upsides of using ascii everywhere are unclear to me. Also, if it?s 8 bit, it?s not ascii anyway. It?s really Latin-1 or code page-1252 or who knows what. Better to decide everything is utf-8 and fix tools which can?t handle that before they cause issues. Andrew > On May 6, 2025, at 2:04?PM, Magnus Ihse Bursie wrote: > > ?On Thu, 10 Apr 2025 10:18:08 GMT, Magnus Ihse Bursie wrote: > >> As a follow-up to [JDK-8354213](https://bugs.openjdk.org/browse/JDK-8354213), I found some additional places where unicode characters are unnecessarily used instead of pure ASCII. > > This pull request has now been integrated. > > Changeset: 08dd4a75 > Author: Magnus Ihse Bursie > URL: https://git.openjdk.org/jdk/commit/08dd4a75c5b751a66d2e088b0ec9c6d6c443c14a > Stats: 11 lines in 8 files changed: 0 ins; 1 del; 10 mod > > 8354273: Replace even more Unicode characters with ASCII > > Reviewed-by: naoto > > ------------- > > PR: https://git.openjdk.org/jdk/pull/24567 -------------- next part -------------- An HTML attachment was scrubbed... URL: From serb at openjdk.org Tue May 6 23:27:13 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 6 May 2025 23:27:13 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v3] In-Reply-To: References: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> Message-ID: On Fri, 2 May 2025 18:32:29 GMT, Alisen Chung wrote: > I've updated the test to include logging and ran the test 200x without failures. I think it's ok to push the test with these changes so that if the test ever does fail again we can use the logs and analyze the problem. I meant to run the test 200 times with logging but no other changes to find the root cause. The other changes to the test seems unnecessary at first glance. the test operations are already synchronized and delayed when necessary. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24885#issuecomment-2856471543 From dgredler at openjdk.org Tue May 6 23:34:15 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 6 May 2025 23:34:15 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object In-Reply-To: References: Message-ID: On Mon, 5 May 2025 23:45:36 GMT, Harshitha Onkar wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 138: > >> 136: return code == 0x0009 || code == 0x000a || code == 0x000d; >> 137: } >> 138: > > @prrace @gredler > Following is an existing issue NOT related to the recent harfbuzz upgrade PR nor this issue fix but it is similar in nature so a separate JBS issue can be created to handle it. I wanted to discuss it before integrating the HB upgrade tomorrow. > > There seems to be similar issue on windows and linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` > > **On Windows:** > > image > > **On Linux:** > > image > > > If adding these codes (0x2028, 0x2029) to platform specific src code (I believe it is NativeGlyphMapper (linux) and WPathGraphics (windows)) fixes the above issue then should we consider moving isIgnorableWhitespace() to common class - `CharToGlyphMapper` instead of macOS specific src? Yeah, I think right now `\t` `\r` `\n` handling is done separately for each platform, and I think also separately for screen display vs. printing. As an example, this fix addresses the screen display side of things for macOS, but printing on macOS needs to be fixed separately (as can be seen when you run `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java`). I had a quick look at the corresponding macOS printing issue a few months ago and the fix wasn't obvious, especially given how that part of the code is organized (not really 1-to-1 with the other platforms). So I think `\t` `\r` `\n` handling is repeated quite a bit, and if we wanted to handle `0x2028` and `0x2029` exactly like we do `\t` `\r` `\n` then we'd need to change multiple places right now. > should we consider moving isIgnorableWhitespace() to common class - CharToGlyphMapper instead of macOS specific src That sounds like it could be a good idea, but I don't have a sense of how likely it is to cause breakage elsewhere -- it'd be a matter of "do it and check for test regressions". Maybe you have a better gut feel for the likelihood of unintended side-effects? Note these two characters (`0x2028` and `0x2029`) are not default-ignorable, though. It sounds like we just don't want to render their glyphs, if they have any (similar to `\t` `\r` `\n`, which are also not default-ignorable). Over on PR #24412 Nikita has suggested an interesting change to `CharToGlyphMapper` and subclasses which might make this change easier, but I'd like some feedback from a reviewer or two before moving forward. The PR is complete from my POV, but we need some design direction (good as is, or needs tweaks, or need to use a different approach entirely, etc). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2076538725 From serb at openjdk.org Wed May 7 02:57:19 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 7 May 2025 02:57:19 GMT Subject: Integrated: 8355561: [macos] Build failure with Xcode 16.3 In-Reply-To: References: Message-ID: On Mon, 28 Apr 2025 19:47:03 GMT, Sergey Bylokhov wrote: > Multiple similar issues detected in PLATFORM_API_MacOSX_Ports.cpp more info about https://github.com/llvm/llvm-project/issues/62836 > > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] > 127 | AudioDeviceID devices[count]; > | ^~~~~ > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:127:39: note: read of non-const variable 'count' is not allowed in a constant expression > jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_Ports.cpp:126:21: note: declared here > 126 | int count = size/sizeof(AudioDeviceID); > > The usage of VLA has been replaced with malloc/calloc and free, which are already used in this file. > > Note that while this patch adds some validation, I am pretty sure it is still possible to crash these code paths if they are executed concurrently. Access to the native pointers being passed around is not properly synchronized. This pull request has now been integrated. Changeset: 762423d6 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/762423d64d10dcdb37800767d2b2f1b7757c804a Stats: 60 lines in 1 file changed: 37 ins; 0 del; 23 mod 8355561: [macos] Build failure with Xcode 16.3 Reviewed-by: kizune, prr ------------- PR: https://git.openjdk.org/jdk/pull/24937 From duke at openjdk.org Wed May 7 02:58:01 2025 From: duke at openjdk.org (Jeremy Wood) Date: Wed, 7 May 2025 02:58:01 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v3] In-Reply-To: References: Message-ID: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: - 8356120: updating (c) year - 8356137: cleaning up error message ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/925d558c..c7072231 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=01-02 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Wed May 7 03:01:04 2025 From: duke at openjdk.org (Jeremy Wood) Date: Wed, 7 May 2025 03:01:04 GMT Subject: RFR: 8356320: GifImageDecoder can produce wrong image when GCE changes transparent pixel index Message-ID: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> When a gif frame's disposal code is DISPOSAL_BGCOLOR and we're maintaining a saved image: we have to flood-fill the frame's bounds. And if the transparent pixel index changes across frames: we could sometimes flood fill the wrong value, resulting in an opaque rectangle in the output image. (I know this looks similar to https://github.com/openjdk/jdk/pull/25044 , but if you look at the data structure of the sample gifs: they are separate problems with separate solutions.) ------------- Commit messages: - 8356137: updating (c) year - 8356320: adding resource leo.gif - 8356320: fix tpix when we flood-fill a rect and tpix changes index - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge pull request #5 from openjdk/master - ... and 4 more: https://git.openjdk.org/jdk/compare/898d4798...da529dcd Changes: https://git.openjdk.org/jdk/pull/25076/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25076&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356320 Stats: 141 lines in 3 files changed: 140 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25076/head:pull/25076 PR: https://git.openjdk.org/jdk/pull/25076 From duke at openjdk.org Wed May 7 03:08:00 2025 From: duke at openjdk.org (Jeremy Wood) Date: Wed, 7 May 2025 03:08:00 GMT Subject: RFR: 8351913: ToolkitImage renders some gifs wrong [v4] In-Reply-To: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> References: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> Message-ID: > I do not have much background in LZW compression or in C, but I'm reasonably confident this resolves the problem I'm observing. It looks like the GifImageDecoder was not always correctly handling compression codes after the table reached its limit of ~4096. If anyone has suggestions for improvements I'm happy to make adjustments. > > Luckily while debugging this: I was able to compare the flawed implementation (GifImageDecoder) with ImageIO's implementation (GIFImageReader) to help identify how the suffix/prefix tables are supposed to work. > > ImageIO's implementation may have suffered a similar bug (maybe https://bugs.openjdk.org/browse/JDK-7131823 ?), and that appears to have been backported. > > I have dozens of additional test cases for this problem, but unfortunately I don't have the rights to commit them to the OpenJDK repo. Feel free to email me for additional context/test cases. Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8351913: moving test package I have two other PRs in progress that place their tests in a dir like: /jdk/test/jdk/sun/awt/image/gif/bug8351913/ They aren't approved/merged yet, but hopefully all 3 of these new gif bugs will be merged and they'll benefit from being grouped in the same new gif directory. (And maybe more will test/directories will follow.) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24271/files - new: https://git.openjdk.org/jdk/pull/24271/files/d555631c..1733a85e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=02-03 Stats: 0 lines in 2 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24271.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24271/head:pull/24271 PR: https://git.openjdk.org/jdk/pull/24271 From prr at openjdk.org Wed May 7 05:38:19 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 05:38:19 GMT Subject: Integrated: 8356208: Remove obsolete code in PSPrinterJob for plugin printing In-Reply-To: References: Message-ID: On Mon, 5 May 2025 18:55:47 GMT, Phil Race wrote: > Delete the obsolete classes PluginPrinter and EPSPrinter. They were only ever called by the Java Plugin printing for applets. This pull request has now been integrated. Changeset: 4e3ec3c0 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/4e3ec3c04c1c60404b9ec7d5524eaceab6472b67 Stats: 339 lines in 1 file changed: 23 ins; 278 del; 38 mod 8356208: Remove obsolete code in PSPrinterJob for plugin printing Reviewed-by: serb ------------- PR: https://git.openjdk.org/jdk/pull/25047 From serb at openjdk.org Wed May 7 06:06:27 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 7 May 2025 06:06:27 GMT Subject: RFR: 8339561: The test/jdk/java/awt/Paint/ListRepaint.java may fail after JDK-8327401 [v9] In-Reply-To: References: Message-ID: > Several tests modified by https://github.com/openjdk/jdk/pull/19339 have been tweaked, see inline comments. > > Notes: > * We have a few XXXRepaint.java tests and in this patch, I updated all of them to follow the change added to the ListRepaint.java > > @azvegint @aivanov-jdk please take a look. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: - Merge branch 'openjdk:master' into JDK-8339561 - Merge branch 'openjdk:master' into JDK-8339561 - Merge branch 'openjdk:master' into JDK-8339561 - drop null check - copyright - Merge branch 'openjdk:master' into JDK-8339561 - more volatiles - revert change reported in JDK-8339791 - trigger github for new content - trigger github for new content - ... and 7 more: https://git.openjdk.org/jdk/compare/4e3ec3c0...a01d0b8d ------------- Changes: https://git.openjdk.org/jdk/pull/20861/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20861&range=08 Stats: 174 lines in 7 files changed: 48 ins; 45 del; 81 mod Patch: https://git.openjdk.org/jdk/pull/20861.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20861/head:pull/20861 PR: https://git.openjdk.org/jdk/pull/20861 From serb at openjdk.org Wed May 7 09:25:33 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 7 May 2025 09:25:33 GMT Subject: Integrated: 8339561: The test/jdk/java/awt/Paint/ListRepaint.java may fail after JDK-8327401 In-Reply-To: References: Message-ID: On Wed, 4 Sep 2024 20:50:38 GMT, Sergey Bylokhov wrote: > Several tests modified by https://github.com/openjdk/jdk/pull/19339 have been tweaked, see inline comments. > > Notes: > * We have a few XXXRepaint.java tests and in this patch, I updated all of them to follow the change added to the ListRepaint.java > > @azvegint @aivanov-jdk please take a look. This pull request has now been integrated. Changeset: 0844745e Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/0844745e7bd954a96441365f8010741ec1c29dbf Stats: 174 lines in 7 files changed: 48 ins; 45 del; 81 mod 8339561: The test/jdk/java/awt/Paint/ListRepaint.java may fail after JDK-8327401 Reviewed-by: azvegint ------------- PR: https://git.openjdk.org/jdk/pull/20861 From mvs at openjdk.org Wed May 7 12:33:24 2025 From: mvs at openjdk.org (Manukumar V S) Date: Wed, 7 May 2025 12:33:24 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods Message-ID: Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). The description of forceFail() has been expanded, too. A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). ------------- Commit messages: - 8355515: Clarify the purpose of forcePass() and forceFail() methods Changes: https://git.openjdk.org/jdk/pull/25091/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25091&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8355515 Stats: 31 lines in 1 file changed: 29 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25091.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25091/head:pull/25091 PR: https://git.openjdk.org/jdk/pull/25091 From achung at openjdk.org Wed May 7 16:24:30 2025 From: achung at openjdk.org (Alisen Chung) Date: Wed, 7 May 2025 16:24:30 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 Sure I can create a reproducer and submit an issue to Apple, but is there any reason to not fix the clamping on our end as well? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2859214656 From duke at openjdk.org Wed May 7 16:48:01 2025 From: duke at openjdk.org (Pabulaner IV) Date: Wed, 7 May 2025 16:48:01 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v5] In-Reply-To: References: Message-ID: On Tue, 29 Apr 2025 22:43:03 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with three additional commits since the last revision: > > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events I implemented the feedback and changed the pull request title. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2859278162 From duke at openjdk.org Wed May 7 16:48:01 2025 From: duke at openjdk.org (Pabulaner IV) Date: Wed, 7 May 2025 16:48:01 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v5] In-Reply-To: <8o9fVyLd4V1IWvemx2MjqX3V6NIDAS6T4vCvn-IWOCI=.f504c898-0260-41b5-b280-86065223bbee@github.com> References: <8o9fVyLd4V1IWvemx2MjqX3V6NIDAS6T4vCvn-IWOCI=.f504c898-0260-41b5-b280-86065223bbee@github.com> Message-ID: On Tue, 6 May 2025 20:20:04 GMT, Kevin Rushforth wrote: >> Pabulaner IV has updated the pull request incrementally with three additional commits since the last revision: >> >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > > src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 302: > >> 300: >> 301: NSString *url = [[openURLEvent paramDescriptorForKeyword:keyDirectObject] stringValue]; >> 302: [self _openURL:url]; > > `_openURL` is a class method. Using `self` is incorrect and causes a failure in the normal (non-embedded) case. > > Suggestion: > > [ApplicationDelegate _openURL:url]; Thanks for the feedback, I am new to Objective C, so it the feedback is much appreciated! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2078057470 From duke at openjdk.org Wed May 7 16:48:00 2025 From: duke at openjdk.org (Pabulaner IV) Date: Wed, 7 May 2025 16:48:00 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v6] In-Reply-To: References: Message-ID: > When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. > Either the native menu is not shown or the URIs are not received. > > This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. > It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. > > JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 > Co-Author: @FlorianKirmaier Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24379/files - new: https://git.openjdk.org/jdk/pull/24379/files/1aa1831d..42b8707e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24379&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24379&range=04-05 Stats: 14 lines in 1 file changed: 7 ins; 0 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/24379.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24379/head:pull/24379 PR: https://git.openjdk.org/jdk/pull/24379 From duke at openjdk.org Wed May 7 16:51:30 2025 From: duke at openjdk.org (Pabulaner IV) Date: Wed, 7 May 2025 16:51:30 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: References: Message-ID: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> > When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. > Either the native menu is not shown or the URIs are not received. > > This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. > It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. > > JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 > Co-Author: @FlorianKirmaier Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24379/files - new: https://git.openjdk.org/jdk/pull/24379/files/42b8707e..924b17b1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24379&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24379&range=05-06 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24379.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24379/head:pull/24379 PR: https://git.openjdk.org/jdk/pull/24379 From aivanov at openjdk.org Wed May 7 17:03:31 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 7 May 2025 17:03:31 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: On Fri, 2 May 2025 23:00:32 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Changes requested by aivanov (Reviewer). src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java line 97: > 95: public boolean isPlaying() { > 96: return threadState == STATE_PLAYING; > 97: } I think this method should be `synchronized`. (The `threadState` field is modified in `run()` without synchronization, which isn't guaranteed to be visible by other threads. But it's a different issue.) src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 104: > 102: throw e; > 103: } > 104: } Can any other (checked) exception be thrown? I can't see that it's possible, then catching it isn't necessary. src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 113: > 111: clip.init(uc.getInputStream()); > 112: } catch (final Exception ignored) { > 113: // Playing the clip will be a no-op if an exception occured in inititialization. Suggestion: // Playing the clip will be a no-op if an exception occurred in inititialization. src/java.desktop/share/classes/javax/sound/SoundClip.java line 40: > 38: * Typically this means running the application in a desktop environment. > 39: * > 40: * Multiple {@code SoundClip} items can be playing at the same time, and Suggestion: * Typically this means running the application in a desktop environment. * *

* Multiple {@code SoundClip} items can be playing at the same time, and I assume a new paragraph starts with _?Multiple??_. src/java.desktop/share/classes/javax/sound/SoundClip.java line 47: > 45: public final class SoundClip { > 46: > 47: private JavaSoundAudioClip clip; Suggestion: private final JavaSoundAudioClip clip; The value doesn't change after an instance is created, so it can and should be final. src/java.desktop/share/classes/javax/sound/SoundClip.java line 50: > 48: > 49: /** > 50: * Create a {@code SoundClip} instance which will play a clip from the supplied file. Suggestion: * Creates a {@code SoundClip} instance which will play a clip from the supplied file. src/java.desktop/share/classes/javax/sound/SoundClip.java line 52: > 50: * Create a {@code SoundClip} instance which will play a clip from the supplied file. > 51: * > 52: * If the file does not contain recognizable and supported sound data, or Suggestion: *

* If the file does not contain recognizable and supported sound data, or Without `

`, this block will be rendered right after the first sentence above without a paragraph break. If it's intended, I propose removing a seemingly empty line. src/java.desktop/share/classes/javax/sound/SoundClip.java line 56: > 54: * playing the clip will be a no-op. > 55: * > 56: * @param file from which to obtain the sound data Suggestion: * @param file the file from which to obtain the sound data src/java.desktop/share/classes/javax/sound/SoundClip.java line 69: > 67: > 68: private SoundClip() { > 69: } If the no-arg constructor is never used, then it's not needed and it should be removed. src/java.desktop/share/classes/javax/sound/SoundClip.java line 78: > 76: * Returns whether this is a playable sound clip. > 77: * A value of {@code false} means that calling any of the other methods > 78: * of this class is a no-op Suggestion: * of this class is a no-op. src/java.desktop/share/classes/javax/sound/SoundClip.java line 90: > 88: * @return whether sound is currently playing > 89: */ > 90: public boolean isPlaying() { Suggestion: /** * {@return whether sound is currently playing} */ public boolean isPlaying() { src/java.desktop/share/classes/javax/sound/package-info.java line 32: > 30: * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled} > 31: *

> 32: * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi} Suggestion: * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. *

* Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. test/jdk/javax/sound/SoundClip/SoundClipTest.java line 43: > 41: if (!isSoundcardInstalled()) { > 42: return; > 43: } It should throw `jtreg.SkippedException` instead of pretending the test passes. test/jdk/javax/sound/SoundClip/SoundClipTest.java line 60: > 58: if (clip.isPlaying()) { > 59: playing = true; > 60: break; `break` is somewhat redundant since the loop has `!playing` as the condition for executing the body. test/jdk/javax/sound/SoundClip/SoundClipTest.java line 101: > 99: } catch (Exception e) { > 100: System.err.println("Exception occurred: "+e); > 101: } The stack trace of the exception could be crucial to understanding what went wrong, so printing the stack trace could be a better approach than just the error message. I guess you want to pass the test (or as I suggest throw `jtreg.SkippedException`) if anything goes wrong. `AudioSystem.getSourceDataLine` throws `LineUnavailableException` which is checked exception, and if the exception ------------- PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2822446607 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078030777 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078040610 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078061539 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078065416 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078047776 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078048603 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078050809 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078051444 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078053524 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078054567 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078057503 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078067119 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078070770 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078072903 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078084485 From aivanov at openjdk.org Wed May 7 17:03:32 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 7 May 2025 17:03:32 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: On Fri, 2 May 2025 22:55:20 GMT, Phil Race wrote: >> test/jdk/javax/sound/SoundClip/SoundClipTest.java line 40: >> >>> 38: >>> 39: public static void main(String[] args) throws Exception { >>> 40: >> >> Suggestion: > > I like blank lines there But why in the `main` method only? Why is it different from other methods which don't start with a blank line? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078069253 From prr at openjdk.org Wed May 7 18:30:59 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 18:30:59 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v24] In-Reply-To: References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: On Wed, 12 Mar 2025 11:00:30 GMT, Prasanta Sadhukhan wrote: >> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. >> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fix I refined the example program and submitted a support case to Microsoft. I'll attach to the JBS issue that version of the test case (rbm.cpp) and then one (rbma.cpp) showing where we've got to. First there are several elements to understand about menu items https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-menuiteminfoa (1) The menu item can have a string as the "item" (dwTypeData) (2) The menu item can have a bitmap as the "item" (hbmpItem) - Historically you could only have ONE of these because the field used to specify them is the same. Now by using the new MIIM* values you can have both. And - I don't quite understand this - using the old MFT_STRING didn't seem to work at all for me I had to use MIIM_STRING. As well as those you can specify the images to use for the check state - hbmpChecked - if the item is selected - hbmpUnchecked - if it is not selected. Some questions and some answers with Microsoft Q. Why is the highlighting background gone in Windows 11 ? A. That background was part of the ?Reveal? lighting effect used by the old Fluent-Design menus in Windows 10. As of WinUI 2.6 (the style set shipped with Windows 11) the UI team removed that effect across context-menus and other pop-ups to achieve a flatter look that meets new contrast guidelines. So it?s an intentional theme change, not a GDI regression. Q. Why does the item image draw over the default radio button. How can this be anything except a bug ? A. The Win32 menu engine draws the default bullet/checkmark at X = 0 unless you reserve a check-mark column by supplying hbmpChecked (and optionally hbmpUnchecked). When an hbmpItem is also present, both bitmaps occupy the same origin, so the icon ends up covering the bullet. This rule has been in place since the Windows 9x/NT days?older SDK samples illustrate the same overlap if you omit the custom check bitmaps. Because the behaviour is longstanding and documented indirectly (see the remarks under SetMenuItemBitmaps and the SM_CXMENUCHECK metric), the shell team classifies it as by design rather than a bug. Q. Why isn't space automatically left for the default rendering of the checkmark ? Another bug ? A. For historical reasons the menu layout engine only allocates the check-mark column when it has a concrete size for that column, i.e. when hbmpChecked is non-NULL. If you ask for the default glyph while also providing an item icon, Windows assumes you are handling layout yourself. The docs don?t call this out explicitly (agreed, that would be helpful), but the behaviour is consistent and the same on every supported version of Windows, so it is not tracked as a GDI defect. So .. in summary, two things that have been a bug so long they are considered a feature are at the root of this and the visual "cue" we've relied on for in Windows 10 was just an accident of some theming that is now gone. So GDI really does make it hard to have all 3 of these. And maybe we should just not support it ? But if (as GDI programmers) we want an item string and bitmap, and expect feedback that an item is selected, we seem to be forced into needing to specify bitmaps for the checked and un-checked state. But then you lose the default rendering of the bullet that Windows provides ! There's some hoops we can jump through to get close - Use a transparent bitmap for hbmpUnchecked - Use a GDI API - DrawFrameControl - to render a bullet image into a bitmap we use for hbmpChecked. Prasanta previously noted that AWT uses this API already) rbma.cpp illustrates this. This still isn't perfect - the bullet is too large. I'll leave it to others to figure out how we make use of this in the Swing rendering case. Are there any unanswered questions ? This is a long PR so perhaps .. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2859773998 From prr at openjdk.org Wed May 7 19:10:53 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 19:10:53 GMT Subject: RFR: 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout In-Reply-To: References: Message-ID: On Mon, 5 May 2025 17:44:25 GMT, Sergey Bylokhov wrote: > The `java/awt/Toolkit/Headless/HeadlessToolkit.java` test covers some functionality of various methods in the `HeadlessToolkit` class, specifically whether these methods throw a `HeadlessException` or not. The image-related methods do not require access to a remote server via a URL; they can be tested using a URL pointing to a local file. This ensures that the test does not depend on `openjdk.org`. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25045#pullrequestreview-2822920567 From prr at openjdk.org Wed May 7 20:47:16 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 20:47:16 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v3] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/299bce17..392c13f0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=01-02 Stats: 24 lines in 4 files changed: 2 ins; 11 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Wed May 7 20:47:17 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 20:47:17 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 16:26:33 GMT, Alexey Ivanov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java line 97: > >> 95: public boolean isPlaying() { >> 96: return threadState == STATE_PLAYING; >> 97: } > > I think this method should be `synchronized`. > > (The `threadState` field is modified in `run()` without synchronization, which isn't guaranteed to be visible by other threads. But it's a different issue.) ok > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 104: > >> 102: throw e; >> 103: } >> 104: } > > Can any other (checked) exception be thrown? > > I can't see that it's possible, then catching it isn't necessary. The implementations that accept a URLConnection, a URL and an InputStream all do the same. It is probable that was just for IOExceptions but I'm not 100% sure since init() swallows certain pother exception types itself and then just propagates IOException to these and definitely those implementations swallow the propagated IOException. If we are sufficiently sure that it is OK I could do that (ie assume IOException is the only possible exception here), but the first question to answer is whether this new API should also swallow the IOException like the existing ones. The one reason for doing that might be if you wanted to be lazy about when you actually read .. but I doubt we do want to do that. This API isn't for "streaming" so it should consume the data immediately. So I'll remove it as you suggest and leave everything else unchanged and we'll see if anyone has a different opinion. > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 113: > >> 111: clip.init(uc.getInputStream()); >> 112: } catch (final Exception ignored) { >> 113: // Playing the clip will be a no-op if an exception occured in inititialization. > > Suggestion: > > // Playing the clip will be a no-op if an exception occurred in inititialization. As I wrote previously I am not going fixing typos in methods I didn't touch and actually expect to remove when the Applet API is removed. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 40: > >> 38: * Typically this means running the application in a desktop environment. >> 39: * >> 40: * Multiple {@code SoundClip} items can be playing at the same time, and > > Suggestion: > > * Typically this means running the application in a desktop environment. > * > *

> * Multiple {@code SoundClip} items can be playing at the same time, and > > I assume a new paragraph starts with _?Multiple??_. yes > src/java.desktop/share/classes/javax/sound/SoundClip.java line 47: > >> 45: public final class SoundClip { >> 46: >> 47: private JavaSoundAudioClip clip; > > Suggestion: > > private final JavaSoundAudioClip clip; > > The value doesn't change after an instance is created, so it can and should be final. ok. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 50: > >> 48: >> 49: /** >> 50: * Create a {@code SoundClip} instance which will play a clip from the supplied file. > > Suggestion: > > * Creates a {@code SoundClip} instance which will play a clip from the supplied file. ok > src/java.desktop/share/classes/javax/sound/SoundClip.java line 52: > >> 50: * Create a {@code SoundClip} instance which will play a clip from the supplied file. >> 51: * >> 52: * If the file does not contain recognizable and supported sound data, or > > Suggestion: > > *

> * If the file does not contain recognizable and supported sound data, or > > Without `

`, this block will be rendered right after the first sentence above without a paragraph break. If it's intended, I propose removing a seemingly empty line. it is intended to be one sentence so is fine as it is. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 56: > >> 54: * playing the clip will be a no-op. >> 55: * >> 56: * @param file from which to obtain the sound data > > Suggestion: > > * @param file the file from which to obtain the sound data ok > src/java.desktop/share/classes/javax/sound/SoundClip.java line 69: > >> 67: >> 68: private SoundClip() { >> 69: } > > If the no-arg constructor is never used, then it's not needed and it should be removed. ok > src/java.desktop/share/classes/javax/sound/SoundClip.java line 78: > >> 76: * Returns whether this is a playable sound clip. >> 77: * A value of {@code false} means that calling any of the other methods >> 78: * of this class is a no-op > > Suggestion: > > * of this class is a no-op. ok > src/java.desktop/share/classes/javax/sound/SoundClip.java line 90: > >> 88: * @return whether sound is currently playing >> 89: */ >> 90: public boolean isPlaying() { > > Suggestion: > > /** > * {@return whether sound is currently playing} > */ > public boolean isPlaying() { I didn't know you could do that. > src/java.desktop/share/classes/javax/sound/package-info.java line 32: > >> 30: * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled} >> 31: *

>> 32: * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi} > > Suggestion: > > * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. > *

> * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. ok > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 43: > >> 41: if (!isSoundcardInstalled()) { >> 42: return; >> 43: } > > It should throw `jtreg.SkippedException` instead of pretending the test passes. Well perhaps, but this is what every other similar jtreg sound test does. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 60: > >> 58: if (clip.isPlaying()) { >> 59: playing = true; >> 60: break; > > `break` is somewhat redundant since the loop has `!playing` as the condition for executing the body. I suppose .. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 101: > >> 99: } catch (Exception e) { >> 100: System.err.println("Exception occurred: "+e); >> 101: } > > The stack trace of the exception could be crucial to understanding what went wrong, so printing the stack trace could be a better approach than just the error message. > > I guess you want to pass the test (or as I suggest throw `jtreg.SkippedException`) if anything goes wrong. Otherwise, I'd let the exception propagate to fail the test, which could be the right thing to do since the test include the _sound_ key. I think I'd like to get to a place where if you pass @sound these tests should skip this testing and actually FAIL if they can't find sound. Only allowing the skipping if you didn't explicitly pass @sound. I haven't found a way to know if that's possible. I'm going to ask .. This method is copied straight from another test. I think lots of tests use it. I guess since it already prints the exception adding a trace isn't a problem. But it isn't completely reliable. Some systems (cloud ones with "emulated" sound) pass but then the test hangs. I'm probably going to have to do some test exclusion if I can't figure that out but I don't expect it to be in this PR because it'll be something internal to our CI systems. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078341427 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078344831 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078347050 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078363357 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078370154 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078370889 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078372396 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078410687 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078373008 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078374629 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078398834 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078382942 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078447291 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078446904 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2078444767 From prr at openjdk.org Wed May 7 21:11:54 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 21:11:54 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 11:23:05 GMT, Alexey Ivanov wrote: >> When we are unable to create a folder with special characters in windows OS, why do we need to test it using custom `FileSystemView` ? My point is will any developer do this in windows? > > Because the problem is still there, and there are virtual folders on Windows. If a custom `FileSystemView` can return file names with `""` in their name, `JFileChooser` in Windows Look and Feel will render the file name as HTML. > > Isn't it the problem that you're trying to fix? @aivanov-jdk @TejeshR13 This seems stalled because there are conflicting statements - Alexei : you can create a custom FIleSystemView on windows with in path names. - Tejesh : no you can't, or at least it doesn't work when you try to use it. Can we please get that reconciled ? Tejesh pls show the code you used, and Alexei please show how you would do it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2078495631 From prr at openjdk.org Wed May 7 21:19:00 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 21:19:00 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: <6N3u1cHzb-xFQ90zy1zuvLXzrwD9yoy-fsC7R8_cpnY=.7529ded3-50a6-473f-8fa2-98c4ee9d44f5@github.com> On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 Marked as reviewed by prr (Reviewer). I think asking Apple is fine. But I don't know that we'd get an answer. We can always revise this if we learn something new 6 months from now. ------------- PR Review: https://git.openjdk.org/jdk/pull/22781#pullrequestreview-2823231742 PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2860405243 From dgredler at openjdk.org Wed May 7 22:23:02 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 7 May 2025 22:23:02 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: References: Message-ID: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> > On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. > > See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. > > This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. > > The new test class passes on Linux, Windows and macOS. Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Merge branch 'master' into ignored-whitespace - Make Graphics2D.drawString ignore tabs and newlines on macOS - Add actual bug ID - Add ignored whitespace test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23665/files - new: https://git.openjdk.org/jdk/pull/23665/files/a0aeed4a..db3a1ff7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23665&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23665&range=00-01 Stats: 499365 lines in 6751 files changed: 183758 ins; 279967 del; 35640 mod Patch: https://git.openjdk.org/jdk/pull/23665.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23665/head:pull/23665 PR: https://git.openjdk.org/jdk/pull/23665 From serb at openjdk.org Wed May 7 22:47:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 7 May 2025 22:47:56 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 7 May 2025 16:21:19 GMT, Alisen Chung wrote: > Sure I can create a reproducer and submit an issue to Apple, but is there any reason to not fix the clamping on our end as well? Look at how many iterations this PR went through and issues it could introduced. The only suspicious thing here is that mouse movement and clicking behave differently(clamp vs not), it is unclear whether the problem exists in our code or in macOS, or it is a feature. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2860619383 From prr at openjdk.org Wed May 7 22:48:56 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 22:48:56 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test I don't think NativeGlyphMapper - used only when we needs the Xserver to render, or WPathGraphics - a windows printing class are where I'd expect to find anything that could impact the TestControls test. But I agree with the general points - \t \r \n handling can be platform-specific - macOS printing is very different The other PR still needs a proper look on my part I suggest we get this PR pushed but first I'll submit a test job .. unless Harshitha already did that ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2860620842 From prr at openjdk.org Wed May 7 23:08:53 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 23:08:53 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v2] In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 12:25:16 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Made test fully automatic Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2823408481 From honkar at openjdk.org Wed May 7 23:11:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 7 May 2025 23:11:54 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:46:08 GMT, Phil Race wrote: > I suggest we get this PR pushed but first I'll submit a test job .. unless Harshitha already did that ? I haven't done a complete CI run along with this PR changes. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2860653669 From prr at openjdk.org Wed May 7 23:17:55 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 7 May 2025 23:17:55 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: Message-ID: On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky wrote: > This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`) > > Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened. > > I was not able to get response from original author for this issue, so I am creating PR myself. > > **Testing:** > I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. > > Without fix: > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1063 415 6 687 << > > > With fix > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1162 316 6 687 << > > > Many tests are no longer crashing the VM: > > -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Failed. Unexpected exit from test [exit code: 134] > +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Passed. Execution successful > > There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix) > > I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.) Looks reasonable although it seems an odd behaviour (bug?) of XGetICValues ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24197#pullrequestreview-2823434995 From honkar at openjdk.org Wed May 7 23:22:04 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 7 May 2025 23:22:04 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test > As an example, this fix addresses the screen display side of things for macOS, but printing on macOS needs to be fixed separately (as can be seen when you run test/jdk/java/awt/print/PrinterJob/PrintTextTest.java). I had a quick look at the corresponding macOS printing issue a few months ago and the fix wasn't obvious, especially given how that part of the code is organized (not really 1-to-1 with the other platforms). I agree it was not as straightforward to see where to add the fix for windows and linux platforms. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2860675664 From dgredler at openjdk.org Thu May 8 00:17:56 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 8 May 2025 00:17:56 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test I haven't had time to test this latest merge on Windows, but my local testing of the current state on Linux and macOS looks good, so I'm cautiously optimistic. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2860895517 From tr at openjdk.org Thu May 8 04:10:52 2025 From: tr at openjdk.org (Tejesh R) Date: Thu, 8 May 2025 04:10:52 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document In-Reply-To: References: Message-ID: On Wed, 7 May 2025 21:08:53 GMT, Phil Race wrote: >> Because the problem is still there, and there are virtual folders on Windows. If a custom `FileSystemView` can return file names with `""` in their name, `JFileChooser` in Windows Look and Feel will render the file name as HTML. >> >> Isn't it the problem that you're trying to fix? > > @aivanov-jdk @TejeshR13 > This seems stalled because there are conflicting statements > - Alexei : you can create a custom FIleSystemView on windows with in path names. > - Tejesh : no you can't, or at least it doesn't work when you try to use it. > > Can we please get that reconciled ? > Tejesh pls show the code you used, and Alexei please show how you would do it. I tried with this code snippet. import javax.swing.JFileChooser; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileSystemView; import java.io.File; import java.util.Arrays; public class VirtualFileChooser { public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); SwingUtilities.invokeLater(() -> { JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); int result = chooser.showOpenDialog(null); if (result == JFileChooser.APPROVE_OPTION) { File selectedFile = chooser.getSelectedFile(); System.out.println("Selected: " + selectedFile.getAbsolutePath()); } }); } static class VirtualFileSystemView extends FileSystemView { private final File[] roots; public VirtualFileSystemView() { // Create a dummy root folder String name = "

SWING ROCKS!!!111"; roots = new File[]{new File(name)}; } @Override public File createNewFolder(File containingDir) { File folder = new File(containingDir, "New Folder"); folder.mkdir(); return folder; } @Override public File[] getRoots() { return roots; } @Override public File getHomeDirectory() { return roots[0]; } @Override public File getDefaultDirectory() { return roots[0]; } @Override public File[] getFiles(File dir, boolean useFileHiding) { // Simulate a virtual folder structure return new File[]{ new File(dir, "virtualFile1.txt"), new File(dir, "virtualFile2.txt"), new File(dir, "virtualFolder") }; } @Override public boolean isRoot(File file) { return Arrays.asList(roots).contains(file); } @Override public Boolean isTraversable(File f) { return true; } } } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2078849056 From abaya at openjdk.org Thu May 8 07:34:08 2025 From: abaya at openjdk.org (Anass Baya) Date: Thu, 8 May 2025 07:34:08 GMT Subject: Integrated: 8354219 : Automate javax/swing/JComboBox/ComboPopupBug.java In-Reply-To: References: Message-ID: On Mon, 14 Apr 2025 13:50:54 GMT, Anass Baya wrote: > This test was designed to manually verify that clicking on the JComboBox when the frame containing it is about to close does not cause an IllegalStateException. > > The test allowed the tester extra time to click on the JComboBox when closing the frame by adding a Thread.sleep() in the close button handler. > > In this test, a JComboBox is displayed with a Close button at the bottom. The tester should click the Close button, then try to click the JComboBox arrow button to display the popup. > > In the automated test, we save the JComboBox location size before closing the frame. We then use this information to click on the JComboBox right before the frame is closed. This pull request has now been integrated. Changeset: 223eec55 Author: Anass Baya Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/223eec55018f1640cb292b11130e3e1d6451990d Stats: 72 lines in 1 file changed: 29 ins; 14 del; 29 mod 8354219: Automate javax/swing/JComboBox/ComboPopupBug.java Reviewed-by: aivanov, achung ------------- PR: https://git.openjdk.org/jdk/pull/24624 From lkorinth at openjdk.org Thu May 8 15:02:42 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 15:02:42 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor Message-ID: This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. These fixes have been created when I have plown through testcases: JDK-8352719: Add an equals sign to the modules statement JDK-8352709: Remove bad timing annotations from WhileOpTest.java JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE CODETOOLS-7903961: Make default timeout configurable Sometime in the future I will also fix: 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 for which I am awaiting: CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 *After the review I will revert the two first commits, and update the copyrights* ------------- Commit messages: - 8356171: Increase timeout for testcases as preparation for change of default timeout factor - Fix some tests that need an upgrade of JTREG --- REVERT THIS LATER - 8260555 Changes: https://git.openjdk.org/jdk/pull/25122/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25122&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356171 Stats: 556 lines in 272 files changed: 59 ins; 96 del; 401 mod Patch: https://git.openjdk.org/jdk/pull/25122.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25122/head:pull/25122 PR: https://git.openjdk.org/jdk/pull/25122 From stefank at openjdk.org Thu May 8 16:09:00 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Thu, 8 May 2025 16:09:00 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Thanks for tackling this! I look forward to the day when you change TIMEOUT_FACTOR to be 1 by default. I think that will reduce confusion. I made a cursory look through some GC files and I think that looked good. doc/testing.md line 385: > 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a > 384: certain amount of time will apply this factor. If we run in > 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) Maybe Suggestion: interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) ------------- PR Review: https://git.openjdk.org/jdk/pull/25122#pullrequestreview-2825661242 PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080028720 From dfuchs at openjdk.org Thu May 8 16:28:53 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 16:28:53 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* @lkorinth have you run all the tiers where the old default timeout factor of 4 applied? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863633579 From lkorinth at openjdk.org Thu May 8 16:45:56 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 16:45:56 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Before this version, I had run tiers 1-8, with 11 fails. ** DONE 01 serviceability/jvmti/vthread/SuspendResume2/SuspendResume2.java#debug 700 ** DONE 02 jdk/internal/platform/docker/TestUseContainerSupport.java OTHER ** DONE 03 tools/javac/util/IteratorsTest.java 480 ** DONE 04 java/math/BigInteger/LargeValueExceptions.java 480 ** DONE 05 vmTestbase/gc/gctests/WeakReference/weak004/weak004.java OTHER ** DONE 06 compiler/loopstripmining/CheckLoopStripMining.java OTHER ** DONE 07 sun/security/tools/keytool/fakecacerts/TrustedCert.java 480 ** DONE 08 jdk/internal/platform/docker/TestUseContainerSupport.java OTHER ** DONE 09 containers/docker/TestJFRNetworkEvents.java OTHER ** DONE 10 java/foreign/TestMismatch.java 480 ** DONE 11 linux-riscv64-open-cmp-baseline-linux-x64-build-796 OTHER Six of those seems not related to my changes (marked `OTHER`), five I have updated for this run with new timeout. I have fixed the timeouts and rebased (I had one conflict), and I am now again running tier1-8. It will take time, and it looks like I will have more (unrelated) fails this time. After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863670496 PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863675379 From itakiguchi at openjdk.org Thu May 8 16:54:55 2025 From: itakiguchi at openjdk.org (Ichiroh Takiguchi) Date: Thu, 8 May 2025 16:54:55 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: <_eOfl-anqDLwR6jF6HhNA6oxc4ckZMA8GpwnMfWX73M=.bf4264e7-3aeb-40ac-a136-271b2cbb2a11@github.com> References: <3YjyS-OEdDbu9Gx4R4aGdgnH3CQxOmWveykhXMRE858=.ee5cbd82-e7d2-4f3f-b990-02b89841f750@github.com> <_eOfl-anqDLwR6jF6HhNA6oxc4ckZMA8GpwnMfWX73M=.bf4264e7-3aeb-40ac-a136-271b2cbb2a11@github.com> Message-ID: On Wed, 23 Apr 2025 15:10:29 GMT, Zdenek Zambersky wrote: >> Attaching jdk_awt jtreg results (with and without fix). >> [jdk-awt-results.tgz](https://github.com/user-attachments/files/19430946/jdk-awt-results.tgz) > >> @zzambers Sorry for my late reaction. Is it possible to add test result by using `XMODIFIERS=@im=local` ? > > Thank you for you reaction. > > I can do some additional testing. You mean to just run the tests with `XMODIFIERS` env. variable set to given value? Are there any other requirements about test system? Note that I only have access to headless linux/s390x machines, so I used Xvfb as X11 server. @zzambers Sorry I'm late. I could recreate your issue. In my investigation, Case 1: When I specified usable IM name, like `XMODIFIERS=@im=kinput2`, ` XGetICValues` returns like `0x200000000` instead of `0x2`. Case 2: When I specified `XMODIFIERS=@im=local`, ` XGetICValues` returns `0x2`. (It's the same as `XMODIFIERS=@im=none` or XMODIFIERS is unset) I think it means case 2 just handles inside of Xlib without X protocol. Your fix works fine on my test environment. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2863698338 From lkorinth at openjdk.org Thu May 8 17:06:02 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 8 May 2025 17:06:02 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> References: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> Message-ID: On Thu, 8 May 2025 16:04:53 GMT, Stefan Karlsson wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > doc/testing.md line 385: > >> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >> 384: certain amount of time will apply this factor. If we run in >> 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) > > Maybe > Suggestion: > > interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) Thanks for catching this fault of mine. I will update the text and change `interpreted mode`, as it is really `-Xcomp` we are looking at in the RunTest.gmk. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080117016 From kizune at openjdk.org Thu May 8 17:19:51 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 8 May 2025 17:19:51 GMT Subject: RFR: 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout In-Reply-To: References: Message-ID: <-oXa-MwM2L3Wi9ylpW1XTlt-6Q4tdsULT6h8qyIyV-0=.923272d9-bd99-4334-ba8c-4fb0d02d28e2@github.com> On Mon, 5 May 2025 17:44:25 GMT, Sergey Bylokhov wrote: > The `java/awt/Toolkit/Headless/HeadlessToolkit.java` test covers some functionality of various methods in the `HeadlessToolkit` class, specifically whether these methods throw a `HeadlessException` or not. The image-related methods do not require access to a remote server via a URL; they can be tested using a URL pointing to a local file. This ensures that the test does not depend on `openjdk.org`. Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25045#pullrequestreview-2825841095 From dfuchs at openjdk.org Thu May 8 17:43:54 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Thu, 8 May 2025 17:43:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Thank you. I have imported your PR locally and running some HTTP client tests in the CI. Tests have not finished running - but I already see one intermittent failure: `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. It would be good to flush out any such intermittent failures before this PR is integrated. This might require multiple runs before we can get confidence. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2863805648 From prr at openjdk.org Thu May 8 19:21:06 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 19:21:06 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2826144863 From achung at openjdk.org Thu May 8 20:00:40 2025 From: achung at openjdk.org (Alisen Chung) Date: Thu, 8 May 2025 20:00:40 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v4] In-Reply-To: References: Message-ID: <0lPsNSeiz4axJaYDwGkXxjmChM7JE87jXvyjMWtxKJQ=.44de2e2e-16e0-4e95-92fd-48559fb3dfe3@github.com> > Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: - remove author, update summary - revert test, add logging ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24885/files - new: https://git.openjdk.org/jdk/pull/24885/files/711bd81f..efcc2a77 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24885&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24885&range=02-03 Stats: 87 lines in 1 file changed: 26 ins; 45 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/24885.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24885/head:pull/24885 PR: https://git.openjdk.org/jdk/pull/24885 From prr at openjdk.org Thu May 8 20:02:52 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 20:02:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* test/jdk/java/awt/font/NumericShaper/MTTest.java - * @run main/timeout=300/othervm MTTest + * @run main/timeout=1200/othervm MTTest I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java So 300 was fine, and 1200 isn't needed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2864133534 From achung at openjdk.org Thu May 8 20:03:51 2025 From: achung at openjdk.org (Alisen Chung) Date: Thu, 8 May 2025 20:03:51 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v3] In-Reply-To: References: <-VKRExcwuamNGxB1FbvYY_rA-dXICYFodaqiI2QnSe0=.0c5f4481-4016-4333-8360-3c6d519f710b@github.com> Message-ID: <56-CkiOPqQWo_63QhuCLxnk9ZOPw03fdzKl3PZPsxhk=.787cbf57-d426-4c38-82a1-19f1b13404cf@github.com> On Tue, 6 May 2025 23:24:48 GMT, Sergey Bylokhov wrote: > > I've updated the test to include logging and ran the test 200x without failures. I think it's ok to push the test with these changes so that if the test ever does fail again we can use the logs and analyze the problem. > > I meant to run the test 200 times with logging but no other changes to find the root cause. The other changes to the test seems unnecessary at first glance. the test operations are already synchronized and delayed when necessary. I've reverted the test and added logging for the eventsCount. I've run the test thru mach5 again without failures 200x. For now adding logging to the test is probably sufficient for debugging if the failure happens again. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24885#issuecomment-2864135431 From prr at openjdk.org Thu May 8 20:50:06 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 20:50:06 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 > Previously, we used a different method, which might behave differently (It also used a different thread): [eea06f7#diff-698576e56937835cfc553bbd97fe12fabf954e0a20e7b9c3bfc3a77763fb6bd0L123](https://github.com/openjdk/jdk/commit/eea06f70fc6154be12d066df6669e7c6d8c0bc09#diff-698576e56937835cfc553bbd97fe12fabf954e0a20e7b9c3bfc3a77763fb6bd0L123) More on the above .. The fix you linked to was to "unify" getting mouse location. src/macosx/native/sun/awt/CCursorManager.m < [NSEvent mouseLocation] > CGEventRef event = CGEventCreate(NULL); > CGPoint globalPos = CGEventGetLocation(event); src/macosx/native/sun/awt/CRobot.m < CGEventRef event = CGEventCreate(NULL); < CGPoint globalPos = CGEventGetLocation(event); So what it did is delete the code in CRobot that did it and move it into CCursorManager. So CCursorManager now does EXACTLY what Robot used to do. And CCursorManager's old code using NSEvent superficially looked different but these really are the same underlying API https://developer.apple.com/documentation/appkit/nsevent/cgevent?language=objc Moreover, it looks like as part of the "unification" the fix dropped clamping code in Robot (!) https://cr.openjdk.org/%7Epchelko/9/8035568/webrev.02/src/macosx/native/sun/awt/CRobot.m.udiff.html So I guess we are fixing a regression caused by that fix, and perhaps more precisely to the bounds. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2864275801 From serb at openjdk.org Thu May 8 21:12:32 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 8 May 2025 21:12:32 GMT Subject: RFR: 8356571: Re-enable -Wtype-limits for GCC in LCMS Message-ID: The -Wtype-limits warning was previously disabled in the OpenJDK build for LCMS 2.14+ due to upstream issues: https://github.com/openjdk/jdk/pull/11217 The issue was reported to the LCMS project: https://github.com/mm2/Little-CMS/issues/458 It has since been fixed in LCMS 2.17 and integrated into OpenJDK as part of [JDK-8348110](https://bugs.openjdk.org/browse/JDK-8348110). Now that the issue has been resolved, we can re-enable this warning. The build works fine on the system where the initial [issue](https://github.com/openjdk/jdk/pull/11217) could be reproduced. ------------- Commit messages: - 8356571: Re-enable -Wtype-limits for GCC in LCMS Changes: https://git.openjdk.org/jdk/pull/25127/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25127&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356571 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25127.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25127/head:pull/25127 PR: https://git.openjdk.org/jdk/pull/25127 From prr at openjdk.org Thu May 8 21:29:20 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 21:29:20 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v15] In-Reply-To: References: Message-ID: On Mon, 24 Feb 2025 20:10:58 GMT, Alexander Zvegintsev wrote: >> Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: >> >> - merge >> - update specifications, replace default values in specifications with links to default var >> - update glide in test >> - merge >> - fix test with removed robot.glide using points >> - add code tag to specifications in Robot >> - fix syncdelay in ER >> - removing lesser used overridden methods >> - Merge branch 'master' of https://github.com/openjdk/jdk into 8150564 >> - update specification to public default fields, add waitforidle exceptions to specifications >> - ... and 12 more: https://git.openjdk.org/jdk/compare/10791477...30ca6a6b > > src/java.desktop/share/classes/java/awt/Robot.java line 130: > >> 128: >> 129: /** >> 130: * Default 20 milliseconds delay for mouse {@code click} and > > Suggestion: > > * Default delay for mouse {@code click} and > > > There is no need to specify the exact value in the documentation, in case of something it will be much easier to change it later on. Be aware that values of static fields are automatically documented. eg see (https://docs.oracle.com/en/java/javase/21/docs/api/constant-values.html#java.awt.Font.BOLD) And an app really could use knowing what the default is. And these defaults have been battle-tested in ExtendedRobot > src/java.desktop/share/classes/java/awt/Robot.java line 138: > >> 136: * Default 2 pixel step length for mouse {@code glide}. >> 137: */ >> 138: public static final int DEFAULT_STEP_LENGTH = 2; > > Do we want to make the `DEFAULT_DELAY` and `DEFAULT_STEP_LENGTH` configurable? glide has over-rides step length > src/java.desktop/share/classes/java/awt/Robot.java line 792: > >> 790: * and {@code mouseRelease}. Invokes {@code waitForIdle} with a default {@link #DEFAULT_DELAY delay} after >> 791: * {@code mousePress} and {@code mouseRelease} calls. For specifics on valid inputs please see >> 792: * {@link java.awt.Robot#mousePress(int)}. > > It's discussable, and I may be wrong, but I'm not a fan of documentation that is very specific about its implementation. > I prefer the one that was before in the `ExtendedRobot`. > > > Clicks mouse button(s) by calling {@link #mousePress(int)} and {@link #mouseRelease(int)} methods I understand the concern but in this case it is more or less explanation of what the method does. Perhaps it can be adjusted or made in to an apiNote or whatever is best. > src/java.desktop/share/classes/java/awt/Robot.java line 924: > >> 922: x += tDx; >> 923: y += tDy; >> 924: mouseMove((int)x, (int)y); > > `mouseMove` can throw an `IllegalThreadStateException` under certain circumstances. yes should be added to all glide API methods ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2080487052 PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2080487420 PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2080490231 PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2080491661 From prr at openjdk.org Thu May 8 21:57:03 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 21:57:03 GMT Subject: RFR: 8346683: Problem list automated tests that fail on macOS15 Message-ID: We've not been doing regular automated testing on macoS 15.4 and it is well over-due. Extensive testing (all tests run 100 times) reports 3 tests that always fail on macOS 15.4 that we should problem list to enable it. ------------- Commit messages: - 8346683 Changes: https://git.openjdk.org/jdk/pull/25133/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25133&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346683 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25133.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25133/head:pull/25133 PR: https://git.openjdk.org/jdk/pull/25133 From jwaters at openjdk.org Thu May 8 22:08:52 2025 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 8 May 2025 22:08:52 GMT Subject: RFR: 8356571: Re-enable -Wtype-limits for GCC in LCMS In-Reply-To: References: Message-ID: On Thu, 8 May 2025 18:30:11 GMT, Sergey Bylokhov wrote: > The -Wtype-limits warning was previously disabled in the OpenJDK build for LCMS 2.14+ due to upstream issues: https://github.com/openjdk/jdk/pull/11217 > The issue was reported to the LCMS project: https://github.com/mm2/Little-CMS/issues/458 > It has since been fixed in LCMS 2.17 and integrated into OpenJDK as part of [JDK-8348110](https://bugs.openjdk.org/browse/JDK-8348110). > > Now that the issue has been resolved, we can re-enable this warning. > > The build works fine on the system where the initial [issue](https://github.com/openjdk/jdk/pull/11217) could be reproduced. Marked as reviewed by jwaters (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25127#pullrequestreview-2826465217 From prr at openjdk.org Thu May 8 22:33:51 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 8 May 2025 22:33:51 GMT Subject: RFR: 8356571: Re-enable -Wtype-limits for GCC in LCMS In-Reply-To: References: Message-ID: On Thu, 8 May 2025 18:30:11 GMT, Sergey Bylokhov wrote: > The -Wtype-limits warning was previously disabled in the OpenJDK build for LCMS 2.14+ due to upstream issues: https://github.com/openjdk/jdk/pull/11217 > The issue was reported to the LCMS project: https://github.com/mm2/Little-CMS/issues/458 > It has since been fixed in LCMS 2.17 and integrated into OpenJDK as part of [JDK-8348110](https://bugs.openjdk.org/browse/JDK-8348110). > > Now that the issue has been resolved, we can re-enable this warning. > > The build works fine on the system where the initial [issue](https://github.com/openjdk/jdk/pull/11217) could be reproduced. CI Linux build passes ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25127#pullrequestreview-2826493341 From lmesnik at openjdk.org Thu May 8 23:12:52 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Thu, 8 May 2025 23:12:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: <2nBGcIjZC03ee74o34IXFgtoEVTAkQV-xXEC28_oFbI=.da57d5a4-4546-4566-aa79-cacce01562d7@github.com> Message-ID: On Thu, 8 May 2025 17:03:03 GMT, Leo Korinth wrote: >> doc/testing.md line 385: >> >>> 383: (`-timeoutFactor`). Also, some test cases that programmatically wait a >>> 384: certain amount of time will apply this factor. If we run in >>> 385: interpreted mode (`-Xcomp`), [RunTest.gmk](../make/RunTests.gmk) >> >> Maybe >> Suggestion: >> >> interpreted mode (`-Xint`), [RunTest.gmk](../make/RunTests.gmk) > > Thanks for catching this fault of mine. I will update the text and change `interpreted mode`, as it is really `-Xcomp` we are looking at in the RunTest.gmk. yep, let use Xcomp, the Xint is not really supported, a lot of tests might start failing ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25122#discussion_r2080606853 From lmesnik at openjdk.org Fri May 9 00:55:54 2025 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Fri, 9 May 2025 00:55:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <2oUdV1ca6y_cEHL3kTptk3jAlwCwnvsLGhRIAhVEUo8=.010c2226-c5ec-4508-be7f-90d244b2b7dc@github.com> On Thu, 8 May 2025 16:43:10 GMT, Leo Korinth wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. @lkorinth Can you please proposed fix for https://bugs.openjdk.org/browse/JDK-8260555 to make it more clear the complete goal of the fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2864795990 From serb at openjdk.org Fri May 9 02:10:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 9 May 2025 02:10:56 GMT Subject: Integrated: 8356571: Re-enable -Wtype-limits for GCC in LCMS In-Reply-To: References: Message-ID: On Thu, 8 May 2025 18:30:11 GMT, Sergey Bylokhov wrote: > The -Wtype-limits warning was previously disabled in the OpenJDK build for LCMS 2.14+ due to upstream issues: https://github.com/openjdk/jdk/pull/11217 > The issue was reported to the LCMS project: https://github.com/mm2/Little-CMS/issues/458 > It has since been fixed in LCMS 2.17 and integrated into OpenJDK as part of [JDK-8348110](https://bugs.openjdk.org/browse/JDK-8348110). > > Now that the issue has been resolved, we can re-enable this warning. > > The build works fine on the system where the initial [issue](https://github.com/openjdk/jdk/pull/11217) could be reproduced. This pull request has now been integrated. Changeset: 9a0e6f33 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/9a0e6f338f34fb5da16d5f9eb710cdddd4302945 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod 8356571: Re-enable -Wtype-limits for GCC in LCMS Reviewed-by: jwaters, prr ------------- PR: https://git.openjdk.org/jdk/pull/25127 From dholmes at openjdk.org Fri May 9 04:57:50 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 9 May 2025 04:57:50 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* My biggest concern with this change is that potentially any test that implicitly uses the default timeout, and which passes with no problem with a factor of 4, may now need to have an explicit timeout set due to the factor of 1. I see this change in a number of tests (default timeout of 120s expressed as a new timeout of 480s to maintain equivalence**), but how many times did you run the tiers? I fear that the gatekeepers will be playing timeout whack-a-mole once these changes are put in. ** though another option would be to update the jtreg default timeout instead. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865099247 From dmarkov at openjdk.org Fri May 9 06:47:51 2025 From: dmarkov at openjdk.org (Dmitry Markov) Date: Fri, 9 May 2025 06:47:51 GMT Subject: RFR: 8346683: Problem list automated tests that fail on macOS15 In-Reply-To: References: Message-ID: <9nwBRRPsAaKqNRLWYGSPVv6qIvR2TUSxN0OXmbEavEQ=.db072480-2ec8-49b9-ae6c-a73d1c8a0f77@github.com> On Thu, 8 May 2025 21:52:21 GMT, Phil Race wrote: > We've not been doing regular automated testing on macoS 15.4 and it is well over-due. > > Extensive testing (all tests run 100 times) reports 3 tests that always fail on macOS 15.4 that we should problem list to enable it. Marked as reviewed by dmarkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25133#pullrequestreview-2827190059 From dfuchs at openjdk.org Fri May 9 07:18:52 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 07:18:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 17:41:02 GMT, Daniel Fuchs wrote: > Thank you. I have imported your PR locally and running some HTTP client tests in the CI. > Tests have not finished running - but I already see one intermittent failure: > `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. > It would be good to flush out any such intermittent failures before this PR is integrated. > This might require multiple runs before we can get confidence. Results came back - another intermittent timeout failure (much more frequent) observed in: `java/net/httpclient/CancelledResponse.java` on macOS x64 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865413003 From cstein at openjdk.org Fri May 9 07:36:51 2025 From: cstein at openjdk.org (Christian Stein) Date: Fri, 9 May 2025 07:36:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 04:54:52 GMT, David Holmes wrote: > [...] > ** though another option would be to update the jtreg default timeout instead. And affect all other tests, too? I'd rather let the default stay on the former hard-coded 120s value. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865469908 From alanb at openjdk.org Fri May 9 08:12:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 9 May 2025 08:12:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 16:43:10 GMT, Leo Korinth wrote: >> This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). >> >> The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. >> >> In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). >> >> My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. >> >> These fixes have been created when I have plown through testcases: >> JDK-8352719: Add an equals sign to the modules statement >> JDK-8352709: Remove bad timing annotations from WhileOpTest.java >> JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test >> CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE >> CODETOOLS-7903961: Make default timeout configurable >> >> Sometime in the future I will also fix: >> 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 >> >> for which I am awaiting: >> CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 >> >> *After the review I will revert the two first commits, and update the copyrights* > > After I revert the two first commits and go back to a timeout factor of 4, I will run tier 1-8 again. @lkorinth Moving to a TIMEOUT_FACTOR of 1 seems a good goal. Would it be possible to expand a bit on what repeat testing was done to identify the tests to add /timeout ? If I read it correctly, any tests using /timeout=N have been to bumped to 4*N so no change. Most tests don't use /timeout so I assume many runs were done to identify the tests that would timeout with if there was no scaling. Test machines vary, as does the test execution times when running concurrently with other tests, so I think it would help if you could say a bit more, even to confirm that it was many test runs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865581927 From swen at openjdk.org Fri May 9 08:21:23 2025 From: swen at openjdk.org (Shaojin Wen) Date: Fri, 9 May 2025 08:21:23 GMT Subject: RFR: 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hasCode Message-ID: Similar to #24959 and #24971 and #24987, apple.laf.JRSUIControl and apple.laf.JRSUIState in java.desktop can also be simplified similarly. Replace manual bitwise operations in hashCode implementations of JRSUIControl/JRSUIState with Long::hashCode. ------------- Commit messages: - Use Double::hashCode & Long::hashCode Changes: https://git.openjdk.org/jdk/pull/24989/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24989&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356605 Stats: 5 lines in 2 files changed: 0 ins; 1 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/24989.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24989/head:pull/24989 PR: https://git.openjdk.org/jdk/pull/24989 From lkorinth at openjdk.org Fri May 9 08:32:55 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 08:32:55 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* I feel almost all of the comments raised here are for me changing the timeout factor to `1`. I will try to answer those questions here as well, but note that the timeout factor is not to be changed to `1` in this pull request and will remain 4, so excluding bugs I might have introduced, tiers would --- if anything --- be running more stable after the change as I have only increased timeouts. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865644966 From lkorinth at openjdk.org Fri May 9 08:42:58 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 08:42:58 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 07:14:11 GMT, Daniel Fuchs wrote: > Thank you. I have imported your PR locally and running some HTTP client tests in the CI. Tests have not finished running - but I already see one intermittent failure: `java/net/httpclient/RedirectTimeoutTest.java` is timing out intermittently on windows. It would be good to flush out any such intermittent failures before this PR is integrated. This might require multiple runs before we can get confidence. My change of timeout factor to `0.7` is only temporal, as I said: it will be reverted to `4` before integration. Naturally, a few test cases will timeout when I do this /temporal/ change, hopefully `java/net/httpclient/RedirectTimeoutTest.java` will behave well with a timeout factor of `1` instead of `0.7`, but note that I will revert the timeout factor to `4` before integration. The whole idea of running with a timeout factor of `0.7` is to remove intermittent failures. (I had it close to 0.5 or maybe less to begin with until I found and reported CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865685066 From stefank at openjdk.org Fri May 9 08:48:51 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Fri, 9 May 2025 08:48:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> On Fri, 9 May 2025 08:40:44 GMT, Leo Korinth wrote: > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865697701 From lkorinth at openjdk.org Fri May 9 09:02:55 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:02:55 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> On Thu, 8 May 2025 20:00:21 GMT, Phil Race wrote: > test/jdk/java/awt/font/NumericShaper/MTTest.java > > * * @run main/timeout=300/othervm MTTest > > > * * @run main/timeout=1200/othervm MTTest > > > I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. > > https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java > > So 300 was fine, and 1200 isn't needed. I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865742871 From lkorinth at openjdk.org Fri May 9 09:12:19 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:12:19 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> Message-ID: <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> On Fri, 9 May 2025 08:58:15 GMT, Leo Korinth wrote: >> test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> - * @run main/timeout=300/othervm MTTest >> + * @run main/timeout=1200/othervm MTTest >> >> I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. >> >> https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> So 300 was fine, and 1200 isn't needed. > >> test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> * * @run main/timeout=300/othervm MTTest >> >> >> * * @run main/timeout=1200/othervm MTTest >> >> >> I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. >> >> https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java >> >> So 300 was fine, and 1200 isn't needed. > > I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? > @lkorinth Moving to a TIMEOUT_FACTOR of 1 seems a good goal. Would it be possible to expand a bit on what repeat testing was done to identify the tests to add /timeout ? If I read it correctly, any tests using /timeout=N have been to bumped to 4*N so no change if the scaling is adjusted in the future. Most tests don't use /timeout so I assume many runs were done to identify the tests that would timeout with if there was no scaling. Test machines vary, as does the test execution times when running concurrently with other tests, so I think it would help if you could say a bit more, even to confirm that it was many test runs. The code was run as it currently looks (with a timeout factor of `0.7`), what timeout factor do you think I should use to test, and for how many times? At the moment I am awaiting jtreg 7.6, I therefore guess the timeout factor change to `1` will happen after the fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865784064 From cstein at openjdk.org Fri May 9 09:15:51 2025 From: cstein at openjdk.org (Christian Stein) Date: Fri, 9 May 2025 09:15:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> <3-AQ92Sgr9tDJIWDO5OX43uBDLndiDN_3jyRj5t2z6Q=.af7cef0d-c447-4401-b4e0-e11a9bdba35b@github.com> Message-ID: On Fri, 9 May 2025 09:09:34 GMT, Leo Korinth wrote: > At the moment I am awaiting jtreg 7.6, I therefore guess the timeout factor change to 1 will happen after the fork. Note, that I moved the timeout configuration feature to `jtreg` 7.5.2 - which will be released soon. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865793769 From lkorinth at openjdk.org Fri May 9 09:15:52 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 09:15:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> References: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> Message-ID: On Fri, 9 May 2025 08:45:48 GMT, Stefan Karlsson wrote: > > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. > > Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? I think it is worth doing in two steps. First I do not want to postpone these limited changes, and second if I would have problems with JDK-8260555, it would be nice if those changes would be smaller and easier to revert. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865794195 From stefank at openjdk.org Fri May 9 09:19:51 2025 From: stefank at openjdk.org (Stefan Karlsson) Date: Fri, 9 May 2025 09:19:51 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: <1Sa3h-gkyVwOLDdj_wJdFohAGYbhYhbAYIaqHCmW7oY=.3b58c23d-cf55-421b-aeec-e149809826f2@github.com> Message-ID: On Fri, 9 May 2025 09:13:41 GMT, Leo Korinth wrote: > > > My change of timeout factor to 0.7 is only temporal, as I said: it will be reverted to 4 before integration. > > > > > > Is really worth reverting back to 4 instead of trying to get jtreg released with CODETOOLS-7903961 and then integrate this change with a timeout factor of 1? > > I think it is worth doing in two steps. First I do not want to postpone these limited changes, and second if I would have problems with JDK-8260555, it would be nice if those changes would be smaller and easier to revert. I understand the risk of being blocked on JDK-8260555, but frankly, if someone wants to block the change from 4 to 1 I'm not sure this PR is worth doing. We have enough groups represented in this PR so let's ask here: is anyone is opposing the idea of JDK-8260555? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865804474 From dfuchs at openjdk.org Fri May 9 09:33:52 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 09:33:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Fri, 9 May 2025 08:40:44 GMT, Leo Korinth wrote: > The whole idea of running with a timeout factor of `0.7` is to remove intermittent failures. (I had it close to 0.5 or maybe less to begin with until I found and reported CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE) Yes - I understand. My point is that there are probably more tests that will need an extended timeout than those that you have already modified. And we want to find out which before the actual change from 4 to 1.0. IMO if a test fails intermittently with 0.7, it's a good indication that it might continue failling intermittently with 1.0, and therefore it should be updated in this PR too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2865849069 From duke at openjdk.org Fri May 9 10:54:57 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Fri, 9 May 2025 10:54:57 GMT Subject: RFR: 8352149: open/test/jdk/java/awt/Frame/MultiScreenTest.java fails [v4] In-Reply-To: References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: <7lH7KVuhkVxHDhzOqxkyIUNiuGu9812d5lMZL0NpKo8=.2fafe422-6ff9-4954-9f97-19489db1497a@github.com> On Wed, 30 Apr 2025 17:06:39 GMT, Khalid Boulanouare wrote: >> Fixes issue in which the test fails when run on multi-screen machine. >> >> Tested on Ubuntu 24.04, MacOS 15 and Windows 11 >> >> JTREG >> >> runner starting test: java/awt/Frame/MultiScreenTest.java >> runner finished test: java/awt/Frame/MultiScreenTest.java >> Passed. Execution successful > > Khalid Boulanouare has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains one additional commit since the last revision: > > 8352149: test/jdk/java/awt/Frame/MultiScreenTest.java fails in MacOS Test has passed on MacOSX, Linux (Ubuntu X11) and Windows machines. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24752#issuecomment-2866099014 From abhiscxk at openjdk.org Fri May 9 11:57:53 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 9 May 2025 11:57:53 GMT Subject: RFR: 8352149: open/test/jdk/java/awt/Frame/MultiScreenTest.java fails [v4] In-Reply-To: References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: On Wed, 30 Apr 2025 17:06:39 GMT, Khalid Boulanouare wrote: >> Fixes issue in which the test fails when run on multi-screen machine. >> >> Tested on Ubuntu 24.04, MacOS 15 and Windows 11 >> >> JTREG >> >> runner starting test: java/awt/Frame/MultiScreenTest.java >> runner finished test: java/awt/Frame/MultiScreenTest.java >> Passed. Execution successful > > Khalid Boulanouare has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > 8352149: test/jdk/java/awt/Frame/MultiScreenTest.java fails in MacOS It may seem out of scope of this bug but you can add `@Override` annotation for all overridden methods, not mandatory though. Please update PR title. test/jdk/java/awt/Frame/MultiScreenTest.java line 104: > 102: for (int i = 0; i < gc.length && i < 10; i++) { > 103: JFrame f = new JFrame(gc[i]); //test JFrame( gc ) > 104: GCCanvas c = new GCCanvas(gc[i]);//test canvas( gc ) For consistency, add a space before start of comment. Suggestion: GCCanvas c = new GCCanvas(gc[i]); // test canvas( gc ) ------------- PR Review: https://git.openjdk.org/jdk/pull/24752#pullrequestreview-2828017540 PR Comment: https://git.openjdk.org/jdk/pull/24752#issuecomment-2866264022 PR Review Comment: https://git.openjdk.org/jdk/pull/24752#discussion_r2081510982 From dholmes at openjdk.org Fri May 9 12:21:54 2025 From: dholmes at openjdk.org (David Holmes) Date: Fri, 9 May 2025 12:21:54 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: <3CKLh1TDhqMNxlWyINFVMAI6MGe_s2rJrgnfzXYpx2M=.ab9a5cb5-9671-4b90-ba81-83f65b82cd6d@github.com> On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* I saw this PR as preparation for the change of the timeout factor so they could be reviewed distinctly and then integrated close together. So it is natural that people are querying how the proposed changes will work with that change - in particular if it will require explicit timeouts to be added to a lot of tests that don't presently have them. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866338479 From lkorinth at openjdk.org Fri May 9 12:51:52 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 12:51:52 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Every time I rerun the tests, some new testcase fails on timeouts. Even worse is that I get quite a few /totally unrelated/ test failures every time because I am running 8 tiers. I could probably change the timeout factor to 0.6 to weed out some more tests faster, but I can not use a timeout factor of 0.5 or less because of CODETOOLS-7903937. Every 0.1 percent corresponds to 12 seconds. So in absolute measurements I have a margin of 36 seconds now if I would go to a timeout factor of 1. I am also a bit afraid of having too big of a margin --- it will force me to convert possible huge amount of new test cases. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866421573 From duke at openjdk.org Fri May 9 12:53:09 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Fri, 9 May 2025 12:53:09 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux [v5] In-Reply-To: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: > Fixes issue in which the test fails when run on multi-screen machine. > > Tested on Ubuntu 24.04, MacOS 15 and Windows 11 > > JTREG > > runner starting test: java/awt/Frame/MultiScreenTest.java > runner finished test: java/awt/Frame/MultiScreenTest.java > Passed. Execution successful Khalid Boulanouare has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'openjdk:master' into jdk-8352149 - 8352149: test/jdk/java/awt/Frame/MultiScreenTest.java fails in MacOS ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24752/files - new: https://git.openjdk.org/jdk/pull/24752/files/d4f1d3bb..5657f884 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24752&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24752&range=03-04 Stats: 27973 lines in 1022 files changed: 17071 ins; 6627 del; 4275 mod Patch: https://git.openjdk.org/jdk/pull/24752.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24752/head:pull/24752 PR: https://git.openjdk.org/jdk/pull/24752 From duke at openjdk.org Fri May 9 13:05:40 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Fri, 9 May 2025 13:05:40 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux [v6] In-Reply-To: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: > Fixes issue in which the test fails when run on multi-screen machine. > > Tested on Ubuntu 24.04, MacOS 15 and Windows 11 > > JTREG > > runner starting test: java/awt/Frame/MultiScreenTest.java > runner finished test: java/awt/Frame/MultiScreenTest.java > Passed. Execution successful Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: Adds Override for overriden methods ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24752/files - new: https://git.openjdk.org/jdk/pull/24752/files/5657f884..5ec8be63 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24752&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24752&range=04-05 Stats: 13 lines in 1 file changed: 8 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/24752.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24752/head:pull/24752 PR: https://git.openjdk.org/jdk/pull/24752 From lkorinth at openjdk.org Fri May 9 13:06:01 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Fri, 9 May 2025 13:06:01 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* Changing the timeout factor might be preferable to do after the fork. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2866463008 From duke at openjdk.org Fri May 9 13:08:53 2025 From: duke at openjdk.org (Khalid Boulanouare) Date: Fri, 9 May 2025 13:08:53 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux [v6] In-Reply-To: References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: On Fri, 9 May 2025 13:05:40 GMT, Khalid Boulanouare wrote: >> Fixes issue in which the test fails when run on multi-screen machine. >> >> Tested on Ubuntu 24.04, MacOS 15 and Windows 11 >> >> JTREG >> >> runner starting test: java/awt/Frame/MultiScreenTest.java >> runner finished test: java/awt/Frame/MultiScreenTest.java >> Passed. Execution successful > > Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: > > Adds Override for overriden methods Updates to this PR: 1- Title changed to be meaningful for this PR 2- Override annotation added 3- Space inserted before comments. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24752#issuecomment-2866468683 From ihse at openjdk.org Fri May 9 14:20:31 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 9 May 2025 14:20:31 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 Message-ID: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. ------------- Commit messages: - 8356644: Update encoding declaration to UTF-8 Changes: https://git.openjdk.org/jdk/pull/25148/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25148&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356644 Stats: 794 lines in 53 files changed: 2 ins; 9 del; 783 mod Patch: https://git.openjdk.org/jdk/pull/25148.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25148/head:pull/25148 PR: https://git.openjdk.org/jdk/pull/25148 From dfuchs at openjdk.org Fri May 9 16:01:51 2025 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Fri, 9 May 2025 16:01:51 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: On Fri, 9 May 2025 14:14:57 GMT, Magnus Ihse Bursie wrote: > A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. > > While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. > > I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. Changes to net-properties.html LGTM ------------- PR Review: https://git.openjdk.org/jdk/pull/25148#pullrequestreview-2828873053 From aivanov at openjdk.org Fri May 9 16:12:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 9 May 2025 16:12:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v3] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 20:47:16 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Looks good to me except for a few nits. I guess you should also update the copyright years in modified files. src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java line 97: > 95: public boolean isPlaying() { > 96: return threadState == STATE_PLAYING; > 97: } I still think the `isPlaying` should be declared `synchronized`. You resolved my previous comment but nothing's changed in the code. src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 119: > 117: clip.init(url.openStream()); > 118: } catch (final Exception ignored) { > 119: // Playing the clip will be a no-op if an exception occurred in inititialization. Suggestion: // Playing the clip will be a no-op if an exception occurred in initialization. src/java.desktop/share/classes/javax/sound/SoundClip.java line 52: > 50: * Creates a {@code SoundClip} instance which will play a clip from the supplied file. > 51: * > 52: * If the file does not contain recognizable and supported sound data, or If the two sentences are intended to be in one paragraph, I strongly suggest removing the blank line between them. Otherwise, the blank line in the javadoc source hints that the second sentence should be in its own paragraph. src/java.desktop/share/classes/javax/sound/package-info.java line 32: > 30: * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. > 31: *

> 32: * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. The description fits into an unordered list. Suggestion: * The API is divided into sub-packages: *

    *
  • Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. *
  • Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. *
The resulting text could be clearer and easier to skim quickly: > The API is divided into sub-packages: > * Capture, processing and playback of sampled audio data is under `javax. sound. sampled`. > * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under `javax. sound. midi`. test/jdk/javax/sound/SoundClip/SoundClipTest.java line 74: > 72: playing = false; > 73: break; > 74: } Suggestion: if (clip.isPlaying()) { playing = false; } Since you removed the `break` statement from the loop above, this one needs to go too for consistency. test/jdk/javax/sound/SoundClip/SoundClipTest.java line 91: > 89: * on the system. > 90: */ > 91: public static boolean isSoundcardInstalled() { Suggestion: /** * Returns true if at least one soundcard is correctly installed * on the system. */ public static boolean isSoundcardInstalled() { The start of the comment is misaligned. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2828804099 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081937814 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081976115 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081955900 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081966734 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081992607 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081993946 From aivanov at openjdk.org Fri May 9 16:13:00 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 9 May 2025 16:13:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: <_Euttb5yXM4TRolLb5TBTo47_uyfJaYRWxG29Y81uTM=.b9fae9ac-f094-448d-9c7a-e885c2348d7f@github.com> On Wed, 7 May 2025 19:28:46 GMT, Phil Race wrote: > The implementations that accept a URLConnection, a URL and an InputStream all do the same. Yes, but these methods do not declare any exceptions to be thrown. The new method declares `IOException` can be thrown, therefore we can let an `IOException` escape. >> src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 113: >> >>> 111: clip.init(uc.getInputStream()); >>> 112: } catch (final Exception ignored) { >>> 113: // Playing the clip will be a no-op if an exception occured in inititialization. >> >> Suggestion: >> >> // Playing the clip will be a no-op if an exception occurred in initialization. > > As I wrote previously I am not going fixing typos in methods I didn't touch and actually expect to remove when the Applet API is removed. Yes, you wrote but you had updated the comments in both `create(URLConnection)` and `create(URL)`, and both comments contain typos. I wouldn't have noticed if these hadn't been included in the diff. Fixing these typos only takes accepting the suggestions on GitHub. After you accept, if at all, use `git pull origin soundclip_api` in your local repo to get the changes before adding changes to your local branch. >> test/jdk/javax/sound/SoundClip/SoundClipTest.java line 43: >> >>> 41: if (!isSoundcardInstalled()) { >>> 42: return; >>> 43: } >> >> It should throw `jtreg.SkippedException` instead of pretending the test passes. > > Well perhaps, but this is what every other similar jtreg sound test does. Maybe `jtreg.SkippedException` didn't exist when the tests were written. Tests that throw `jtreg.SkippedException` were considered *passed*, but not any more. I don't insist, though. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081947336 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081974458 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2081990095 From honkar at openjdk.org Fri May 9 16:17:02 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 9 May 2025 16:17:02 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test CI Testing looks good. Didn't observe any regressions in the couple of manual tests that I ran with this fix. LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2828903562 From aivanov at openjdk.org Fri May 9 16:38:01 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 9 May 2025 16:38:01 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: <8dLb9b2g1ue8HL8IrTlvat5rX6JqMMjHsCxMbn-ANdw=.7845d47d-2d6b-4590-8e21-314bc6d73e86@github.com> On Wed, 7 May 2025 22:23:02 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: > > - Merge branch 'master' into ignored-whitespace > - Make Graphics2D.drawString ignore tabs and newlines on macOS > - Add actual bug ID > - Add ignored whitespace test Looks good to me, except for formatting suggestions. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 24: > 22: */ > 23: > 24: /** Suggestion: /* It shouldn't use a javadoc comment syntax. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 46: > 44: public static void main(String[] args) throws Exception { > 45: > 46: BufferedImage image = new BufferedImage(600, 600, BufferedImage.TYPE_BYTE_BINARY); Suggestion: public static void main(String[] args) throws Exception { BufferedImage image = new BufferedImage(600, 600, BufferedImage.TYPE_BYTE_BINARY); Just two methods start with a (redundant) blank line. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 80: > 78: private static void test(BufferedImage image, Graphics2D g2d, Font font, String reference, String text) { > 79: > 80: g2d.setFont(font); Suggestion: private static void test(BufferedImage image, Graphics2D g2d, Font font, String reference, String text) { g2d.setFont(font); test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 124: > 122: private static void assertEqual(Rectangle r1, Rectangle r2, String text) { > 123: if (!r1.equals(r2)) { > 124: String escaped = text.replace("\r", "\\r").replace("\n", "\\n").replace("\t", "\\t"); I would format this way, so that each `replace` stands out in the chain of calls. Suggestion: String escaped = text.replace("\r", "\\r") .replace("\n", "\\n") .replace("\t", "\\t"); test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 159: > 157: int height = image.getHeight(); > 158: int[] rowPixels = new int[width]; > 159: for (int y = 0; y < height; y++) { Suggestion: int height = image.getHeight(); int[] rowPixels = new int[width]; for (int y = 0; y < height; y++) { I suggest having a blank line here to introduce a new logical ?block? of code which iterates over the pixels in the image. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 179: > 177: } > 178: } > 179: if (minX != Integer.MAX_VALUE) { Suggestion: } if (minX != Integer.MAX_VALUE) { A blank line here breaks a long method into sections. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2828951322 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082035028 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082034595 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082033475 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082045776 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082038800 PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2082036239 From serb at openjdk.org Fri May 9 16:38:06 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 9 May 2025 16:38:06 GMT Subject: RFR: 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout [v2] In-Reply-To: References: Message-ID: > The `java/awt/Toolkit/Headless/HeadlessToolkit.java` test covers some functionality of various methods in the `HeadlessToolkit` class, specifically whether these methods throw a `HeadlessException` or not. The image-related methods do not require access to a remote server via a URL; they can be tested using a URL pointing to a local file. This ensures that the test does not depend on `openjdk.org`. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'openjdk:master' into JDK-8356053 - 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25045/files - new: https://git.openjdk.org/jdk/pull/25045/files/c82bc634..fa2b3f36 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25045&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25045&range=00-01 Stats: 16619 lines in 559 files changed: 9274 ins; 4478 del; 2867 mod Patch: https://git.openjdk.org/jdk/pull/25045.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25045/head:pull/25045 PR: https://git.openjdk.org/jdk/pull/25045 From prr at openjdk.org Fri May 9 17:44:55 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 17:44:55 GMT Subject: RFR: 8355790: Enhance code consistency: java.desktop/unix:sun.awt In-Reply-To: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> References: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> Message-ID: On Tue, 29 Apr 2025 00:03:48 GMT, Sergey Bylokhov wrote: > The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. > > To make the code review process easier I have made the following changes: > > 1. I chose `java.desktop/unix:sun.awt` as the starting package because it contains a relatively small number of classes > 2. The public API was not affected so there is no need to worry about a CSR > > Note: I will submit additional patches in this area later because: > > 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) > 2. I skipped adding `@Override` for anonymous classes > > Any feedback or suggestions are welcome! > > Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff) to a simple diff file, it might be more convenient for reviewing the changes. > > To download the diff file and filter only the modified lines you can use the following script: > > > curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff -o d.txt && grep -E '^+|^-' d.txt > > > The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24941#pullrequestreview-2829227399 From serb at openjdk.org Fri May 9 17:53:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 9 May 2025 17:53:57 GMT Subject: Integrated: 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout In-Reply-To: References: Message-ID: On Mon, 5 May 2025 17:44:25 GMT, Sergey Bylokhov wrote: > The `java/awt/Toolkit/Headless/HeadlessToolkit.java` test covers some functionality of various methods in the `HeadlessToolkit` class, specifically whether these methods throw a `HeadlessException` or not. The image-related methods do not require access to a remote server via a URL; they can be tested using a URL pointing to a local file. This ensures that the test does not depend on `openjdk.org`. This pull request has now been integrated. Changeset: 375f3dc9 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/375f3dc9ed0f1704e726d0d704420c38a0a5513c Stats: 26 lines in 1 file changed: 15 ins; 4 del; 7 mod 8356053: Test java/awt/Toolkit/Headless/HeadlessToolkit.java fails by timeout Reviewed-by: prr, kizune ------------- PR: https://git.openjdk.org/jdk/pull/25045 From prr at openjdk.org Fri May 9 18:12:55 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 18:12:55 GMT Subject: Integrated: 8346683: Problem list automated tests that fail on macOS15 In-Reply-To: References: Message-ID: <2NSs6PcGmhBcGpZLuAN_YJWPtw46YBNfoU4ge0zNhmo=.27e2e95c-2443-42e1-8422-8ed9db1f6744@github.com> On Thu, 8 May 2025 21:52:21 GMT, Phil Race wrote: > We've not been doing regular automated testing on macoS 15.4 and it is well over-due. > > Extensive testing (all tests run 100 times) reports 3 tests that always fail on macOS 15.4 that we should problem list to enable it. This pull request has now been integrated. Changeset: 30cb94d6 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/30cb94d6b04a2be764a11b38f8bacabc7aaf9388 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod 8346683: Problem list automated tests that fail on macOS15 Reviewed-by: dmarkov ------------- PR: https://git.openjdk.org/jdk/pull/25133 From dnguyen at openjdk.org Fri May 9 18:42:51 2025 From: dnguyen at openjdk.org (Damon Nguyen) Date: Fri, 9 May 2025 18:42:51 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v2] In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 12:25:16 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Made test fully automatic Looks good on my end when testing on MacOS 15.4.1. ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2829382896 From aivanov at openjdk.org Fri May 9 19:11:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 9 May 2025 19:11:56 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v2] In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 12:25:16 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Made test fully automatic Changes requested by aivanov (Reviewer). test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 33: > 31: import java.awt.print.PrinterJob; > 32: import java.io.File; > 33: import java.lang.Override; Suggestion: import java.io.File; No need to import classes from `java.lang` package. test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 48: > 46: * @run main PrintNullString > 47: */ > 48: public class PrintNullString extends Frame { You don't display UI any more, no need to extend `Frame`. test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 63: > 61: } > 62: > 63: private static class TextCanvas extends Panel implements Printable { Suggestion: private static class PrintText implements Printable { `Panel` isn't needed any more, so simple class would do. Better yet, make the test class `PrintNullString` implement `Printable` and embed everything from `TextCanvas` directly to `PrintNullString`. test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 84: > 82: > 83: private void paint(Graphics2D g2d) { > 84: // API 1: null & empty drawString(String, int, int); Now this `paint` method is redundant, you can copy its body directly into `print` above. ------------- PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2829420241 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2082350935 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2082356860 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2082359813 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2082361378 From prr at openjdk.org Fri May 9 19:24:53 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 19:24:53 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> References: <0AKC-4omm-W24u11ifhGm8Do8_5sqwPMJz6q3A71FNE=.f4209d38-51d6-4eda-b11e-d670e5ee5575@github.com> Message-ID: On Fri, 9 May 2025 08:58:15 GMT, Leo Korinth wrote: > > test/jdk/java/awt/font/NumericShaper/MTTest.java > > ``` > > * * @run main/timeout=300/othervm MTTest > > > > > > * * @run main/timeout=1200/othervm MTTest > > ``` > > > > > > > > > > > > > > > > > > > > > > > > I'm puzzling over why you saw this test fail with timeout = 300 .. or perhaps you saw it fail with 0.7 ? Which would amount to 210 seconds .. that might just be enough to cause it to fail because if you look at the whole test you'll see it wants the core loops of the test to run for 180 seconds. > > https://openjdk.github.io/cr/?repo=jdk&pr=25122&range=00#new-144-test/jdk/java/awt/font/NumericShaper/MTTest.java > > So 300 was fine, and 1200 isn't needed. > > I started with a timeout factor less than `0.7` but I got hindered by CODETOOLS-7903937. That is probably the reason. Maybe I should change the timeout to 400? I think it is reasonable to handle a timeout factor somewhat less than 1 to weed out tight test cases. But maybe 300 is good enough? I think 300 is correct for this test. Setting the timeout factor to < 1 is an interesting experiment but I don't think tests that timeout in such a case are automatic candidates to have an increased time out and this one shows why. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2867676176 From kcr at openjdk.org Fri May 9 19:47:55 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Fri, 9 May 2025 19:47:55 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: <_0XbksYxQT_W0ZUwPtj083VR42UYJTotXX40L9671rE=.a239c09b-cc13-402f-888d-07b65eeda7d8@github.com> On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events The updated fix looks good. I verified that it works as expected. I'll approve it early next week if no issues are found during testing. ------------- PR Review: https://git.openjdk.org/jdk/pull/24379#pullrequestreview-2829508181 From prr at openjdk.org Fri May 9 20:35:46 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 20:35:46 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v4] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/392c13f0..52eb9e41 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=02-03 Stats: 17 lines in 4 files changed: 8 ins; 1 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Fri May 9 20:35:50 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 20:35:50 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v3] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 15:30:12 GMT, Alexey Ivanov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/com/sun/media/sound/DataPusher.java line 97: > >> 95: public boolean isPlaying() { >> 96: return threadState == STATE_PLAYING; >> 97: } > > I still think the `isPlaying` should be declared `synchronized`. > > You resolved my previous comment but nothing's changed in the code. I guess I can but I made javax.SoundClip.isPlaying() synchronized and other methods there are also synchronized so ... > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 119: > >> 117: clip.init(url.openStream()); >> 118: } catch (final Exception ignored) { >> 119: // Playing the clip will be a no-op if an exception occurred in inititialization. > > Suggestion: > > // Playing the clip will be a no-op if an exception occurred in initialization. I really have no intention of updating comments I will delete soon. Its just too odd. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 52: > >> 50: * Creates a {@code SoundClip} instance which will play a clip from the supplied file. >> 51: * >> 52: * If the file does not contain recognizable and supported sound data, or > > If the two sentences are intended to be in one paragraph, I strongly suggest removing the blank line between them. Otherwise, the blank line in the javadoc source hints that the second sentence should be in its own paragraph. I misunderstood which line you meant. > src/java.desktop/share/classes/javax/sound/package-info.java line 32: > >> 30: * Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. >> 31: *

>> 32: * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. > > The description fits into an unordered list. > > Suggestion: > > * The API is divided into sub-packages: > *

    > *
  • Capture, processing and playback of sampled audio data is under {@link javax.sound.sampled}. > *
  • Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under {@link javax.sound.midi}. > *
> > > The resulting text could be clearer and easier to skim quickly: >> The API is divided into sub-packages: >> * Capture, processing and playback of sampled audio data is under `javax. sound. sampled`. >> * Sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data is under `javax. sound. midi`. ok > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 74: > >> 72: playing = false; >> 73: break; >> 74: } > > Suggestion: > > if (clip.isPlaying()) { > playing = false; > } > > Since you removed the `break` statement from the loop above, this one needs to go too for consistency. ok > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 91: > >> 89: * on the system. >> 90: */ >> 91: public static boolean isSoundcardInstalled() { > > Suggestion: > > /** > * Returns true if at least one soundcard is correctly installed > * on the system. > */ > public static boolean isSoundcardInstalled() { > > The start of the comment is misaligned. ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082432876 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082434062 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082438861 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082440731 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082441853 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2082442824 From aivanov at openjdk.org Fri May 9 20:42:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 9 May 2025 20:42:53 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v4] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:35:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Looks good. You should probably bump the copyright year in the modified files. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2829601695 From dgredler at openjdk.org Fri May 9 20:48:13 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 9 May 2025 20:48:13 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: > On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. > > See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. > > This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. > > The new test class passes on Linux, Windows and macOS. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions from code review Co-authored-by: Alexey Ivanov ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23665/files - new: https://git.openjdk.org/jdk/pull/23665/files/db3a1ff7..2e37be11 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23665&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23665&range=01-02 Stats: 8 lines in 1 file changed: 4 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/23665.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23665/head:pull/23665 PR: https://git.openjdk.org/jdk/pull/23665 From prr at openjdk.org Fri May 9 20:53:52 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 20:53:52 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: On Fri, 9 May 2025 14:14:57 GMT, Magnus Ihse Bursie wrote: > A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. > > While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. > > I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25148#pullrequestreview-2829627877 From prr at openjdk.org Fri May 9 20:54:46 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 20:54:46 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/52eb9e41..a2da1a1c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=03-04 Stats: 3 lines in 3 files changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Fri May 9 21:30:55 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 21:30:55 GMT Subject: RFR: 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride [v2] In-Reply-To: References: Message-ID: On Wed, 19 Mar 2025 13:06:56 GMT, Nikita Gubarkov wrote: >> 8352407: PixelInterleavedSampleModel with unused components throws RasterFormatException: Incorrect pixel stride > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > The previous approach was wrong for non-pixel interleaving. > > Just align the buffer size to the pixel stride instead, should be better. One definite issue with this fix is that it assumes pixelStride !=0 The spec (at least as far back as JDK 1.3) has allowed pixelStride == 0 So this following code is broken with this change import java.awt.image.*; public class Z { public static void main(String[] args) { int[] offsets = {0}; new ComponentSampleModel(DataBufferInt.TYPE_INT, 1, 1, 0, 0, offsets); } } % java Z Exception in thread "main" java.lang.ArithmeticException: / by zero at java.desktop/java.awt.image.ComponentSampleModel.getBufferSize(ComponentSampleModel.java:284) at java.desktop/java.awt.image.ComponentSampleModel.verify(ComponentSampleModel.java:240) at java.desktop/java.awt.image.ComponentSampleModel.(ComponentSampleModel.java:155) at Z.main(Z.java:6) ------------- PR Comment: https://git.openjdk.org/jdk/pull/24111#issuecomment-2867910475 From prr at openjdk.org Fri May 9 21:43:51 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 9 May 2025 21:43:51 GMT Subject: RFR: 8355078: java.awt.Color.createContext() uses unnecessary synchronization In-Reply-To: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> References: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> Message-ID: On Sun, 20 Apr 2025 08:15:38 GMT, Sergey Bylokhov wrote: > At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. > > > Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. > > Two tests are added: > - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. > - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24771#pullrequestreview-2829740767 From naoto at openjdk.org Fri May 9 23:18:50 2025 From: naoto at openjdk.org (Naoto Sato) Date: Fri, 9 May 2025 23:18:50 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: On Fri, 9 May 2025 14:14:57 GMT, Magnus Ihse Bursie wrote: > A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. > > While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. > > I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. Marked as reviewed by naoto (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25148#pullrequestreview-2829881137 From serb at openjdk.org Sat May 10 09:46:45 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 10 May 2025 09:46:45 GMT Subject: RFR: 8355790: Enhance code consistency: java.desktop/unix:sun.awt [v2] In-Reply-To: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> References: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> Message-ID: <2B1WbBLpaR4EfVGQqIub44UC67tuEpVQ0y-ocjmezqI=.54e69d96-3080-4b78-883f-2c5091122005@github.com> > The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. > > To make the code review process easier I have made the following changes: > > 1. I chose `java.desktop/unix:sun.awt` as the starting package because it contains a relatively small number of classes > 2. The public API was not affected so there is no need to worry about a CSR > > Note: I will submit additional patches in this area later because: > > 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) > 2. I skipped adding `@Override` for anonymous classes > > Any feedback or suggestions are welcome! > > Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff) to a simple diff file, it might be more convenient for reviewing the changes. > > To download the diff file and filter only the modified lines you can use the following script: > > > curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff -o d.txt && grep -E '^+|^-' d.txt > > > The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge branch 'openjdk:master' into overunix - override in java.desktop/unix:sun.awt - final in java.desktop/unix:sun.awt ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24941/files - new: https://git.openjdk.org/jdk/pull/24941/files/7c46a0b6..e4d5c3df Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24941&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24941&range=00-01 Stats: 39454 lines in 1207 files changed: 26470 ins; 7356 del; 5628 mod Patch: https://git.openjdk.org/jdk/pull/24941.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24941/head:pull/24941 PR: https://git.openjdk.org/jdk/pull/24941 From duke at openjdk.org Sat May 10 19:01:59 2025 From: duke at openjdk.org (Jeremy Wood) Date: Sat, 10 May 2025 19:01:59 GMT Subject: RFR: 8351913: ToolkitImage renders some gifs wrong [v4] In-Reply-To: References: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> Message-ID: On Wed, 7 May 2025 03:08:00 GMT, Jeremy Wood wrote: >> I do not have much background in LZW compression or in C, but I'm reasonably confident this resolves the problem I'm observing. It looks like the GifImageDecoder was not always correctly handling compression codes after the table reached its limit of ~4096. If anyone has suggestions for improvements I'm happy to make adjustments. >> >> Luckily while debugging this: I was able to compare the flawed implementation (GifImageDecoder) with ImageIO's implementation (GIFImageReader) to help identify how the suffix/prefix tables are supposed to work. >> >> ImageIO's implementation may have suffered a similar bug (maybe https://bugs.openjdk.org/browse/JDK-7131823 ?), and that appears to have been backported. >> >> I have dozens of additional test cases for this problem, but unfortunately I don't have the rights to commit them to the OpenJDK repo. Feel free to email me for additional context/test cases. > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8351913: moving test package > > I have two other PRs in progress that place their tests in a dir like: > /jdk/test/jdk/sun/awt/image/gif/bug8351913/ > > They aren't approved/merged yet, but hopefully all 3 of these new gif bugs will be merged and they'll benefit from being grouped in the same new gif directory. (And maybe more will test/directories will follow.) I'm closing this for now; it turns out this is not ready for review yet. [This gif](https://pixabay.com/gifs/ginger-gingerbread-man-cookies-9997/) is much improved with this PR, but frame 12 still has issues: According to the app Preview, it should resemble: ![image](https://github.com/user-attachments/assets/23a4e1c7-9be5-4956-ae17-039200360e59) But with this PR it currently resembles (see bottom of image): ![frame-12](https://github.com/user-attachments/assets/2b13b306-447f-4410-9a9a-38b3697c784b) I'm 90% sure these weird artifacts are related to this ticket. Before this PR several frames get mangled, and frame 12 resembled: ![frame-12](https://github.com/user-attachments/assets/5dc57af8-9d47-46f0-bca6-fe235317dc2a) (As before: if anyone feels confident in this subject matter and has any extra capacity I'd appreciate some help, but so far with enough time I've been able to make progress on these issues...) ------------- PR Comment: https://git.openjdk.org/jdk/pull/24271#issuecomment-2869111725 From duke at openjdk.org Sat May 10 19:02:00 2025 From: duke at openjdk.org (Jeremy Wood) Date: Sat, 10 May 2025 19:02:00 GMT Subject: Withdrawn: 8351913: ToolkitImage renders some gifs wrong In-Reply-To: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> References: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> Message-ID: On Thu, 27 Mar 2025 03:40:05 GMT, Jeremy Wood wrote: > I do not have much background in LZW compression or in C, but I'm reasonably confident this resolves the problem I'm observing. It looks like the GifImageDecoder was not always correctly handling compression codes after the table reached its limit of ~4096. If anyone has suggestions for improvements I'm happy to make adjustments. > > Luckily while debugging this: I was able to compare the flawed implementation (GifImageDecoder) with ImageIO's implementation (GIFImageReader) to help identify how the suffix/prefix tables are supposed to work. > > ImageIO's implementation may have suffered a similar bug (maybe https://bugs.openjdk.org/browse/JDK-7131823 ?), and that appears to have been backported. > > I have dozens of additional test cases for this problem, but unfortunately I don't have the rights to commit them to the OpenJDK repo. Feel free to email me for additional context/test cases. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/24271 From serb at openjdk.org Sun May 11 07:42:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 11 May 2025 07:42:56 GMT Subject: Integrated: 8355790: Enhance code consistency: java.desktop/unix:sun.awt In-Reply-To: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> References: <7s8jC8r-uAS3k0NsaKJyhZMzhHVCOFbb-ZStbeBv9Pw=.b78af72d-c17f-4c57-b620-6a630a2aef80@github.com> Message-ID: On Tue, 29 Apr 2025 00:03:48 GMT, Sergey Bylokhov wrote: > The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. > > To make the code review process easier I have made the following changes: > > 1. I chose `java.desktop/unix:sun.awt` as the starting package because it contains a relatively small number of classes > 2. The public API was not affected so there is no need to worry about a CSR > > Note: I will submit additional patches in this area later because: > > 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) > 2. I skipped adding `@Override` for anonymous classes > > Any feedback or suggestions are welcome! > > Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff) to a simple diff file, it might be more convenient for reviewing the changes. > > To download the diff file and filter only the modified lines you can use the following script: > > > curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/24941.diff -o d.txt && grep -E '^+|^-' d.txt > > > The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. This pull request has now been integrated. Changeset: 97d2a379 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/97d2a37927fca993537644e748c8abca58752d44 Stats: 748 lines in 105 files changed: 646 ins; 1 del; 101 mod 8355790: Enhance code consistency: java.desktop/unix:sun.awt Reviewed-by: achung, prr ------------- PR: https://git.openjdk.org/jdk/pull/24941 From aivanov at openjdk.org Sun May 11 17:06:58 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Sun, 11 May 2025 17:06:58 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2831451608 From aivanov at openjdk.org Sun May 11 17:55:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Sun, 11 May 2025 17:55:57 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:48:13 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Alexey Ivanov Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2831460328 From tr at openjdk.org Mon May 12 06:06:53 2025 From: tr at openjdk.org (Tejesh R) Date: Mon, 12 May 2025 06:06:53 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Sun, 27 Apr 2025 21:01:07 GMT, Andrey Turbanov wrote: > Cleanup code to use Map.putIfAbsent. It's clearer and faster. LGTM ------------- Marked as reviewed by tr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24906#pullrequestreview-2831900481 From tr at openjdk.org Mon May 12 06:11:54 2025 From: tr at openjdk.org (Tejesh R) Date: Mon, 12 May 2025 06:11:54 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v4] In-Reply-To: <0lPsNSeiz4axJaYDwGkXxjmChM7JE87jXvyjMWtxKJQ=.44de2e2e-16e0-4e95-92fd-48559fb3dfe3@github.com> References: <0lPsNSeiz4axJaYDwGkXxjmChM7JE87jXvyjMWtxKJQ=.44de2e2e-16e0-4e95-92fd-48559fb3dfe3@github.com> Message-ID: On Thu, 8 May 2025 20:00:40 GMT, Alisen Chung wrote: >> Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. > > Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: > > - remove author, update summary > - revert test, add logging If you are updating the test with debug print, then its better to do it as a sub task of main bug and retain the main bug as open until root cause is found. ------------- PR Review: https://git.openjdk.org/jdk/pull/24885#pullrequestreview-2831909300 From abhiscxk at openjdk.org Mon May 12 07:25:34 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 12 May 2025 07:25:34 GMT Subject: RFR: 8356752: Log mouse enter and exit events for debugging Message-ID: Log mouse events output to analyze the failure in CI pipeline. ------------- Commit messages: - Log mouse events Changes: https://git.openjdk.org/jdk/pull/25176/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25176&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356752 Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25176.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25176/head:pull/25176 PR: https://git.openjdk.org/jdk/pull/25176 From avu at openjdk.org Mon May 12 07:58:53 2025 From: avu at openjdk.org (Alexey Ushakov) Date: Mon, 12 May 2025 07:58:53 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v2] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: <3ej1X8fJ5R49AG9eK0SnIl3WrIuMtk9djq3zB1uFcCM=.ec799248-68e1-4632-b55b-62a3b32a251d@github.com> On Wed, 30 Apr 2025 06:15:33 GMT, Nikita Gubarkov wrote: >> src/java.desktop/share/native/libawt/java2d/Trace.h line 58: >> >>> 56: #ifndef DEBUG >>> 57: #define J2dTrace(level, ...) >>> 58: #define J2dTraceLn(level, ...) >> >> This looks fine, but maybe the string argument could be included as a parameter? Would that improve usability, like better error messages when no arguments are provided, or enhance auto-completion in the IDE?" > > There is a trailing comma problem when passing no extra args. I didn't figure out how to solve it without `__VA_OPT__` or compiler-specific tricks, so I moved the string into variadic part, so that it always has at least one parameter. I think that the benefits (having an arbitrary number of arguments) outweigh the lack of a check for the string argument type. So, I'd let's put some comments here about future use of __VA_OPT__ and integrate this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084052837 From avu at openjdk.org Mon May 12 07:58:52 2025 From: avu at openjdk.org (Alexey Ushakov) Date: Mon, 12 May 2025 07:58:52 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v2] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Tue, 29 Apr 2025 14:04:07 GMT, Nikita Gubarkov wrote: >> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. >> >> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > fixup! 8355904: Use variadic macros for J2dTrace LGTM ------------- Marked as reviewed by avu (Committer). PR Review: https://git.openjdk.org/jdk/pull/24949#pullrequestreview-2832198050 From jdv at openjdk.org Mon May 12 08:42:52 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 12 May 2025 08:42:52 GMT Subject: RFR: 8356752: Log mouse enter and exit events for debugging In-Reply-To: References: Message-ID: On Mon, 12 May 2025 07:20:43 GMT, Abhishek Kumar wrote: > Log mouse events output to analyze the failure in CI pipeline. Marked as reviewed by jdv (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25176#pullrequestreview-2832349394 From abhiscxk at openjdk.org Mon May 12 09:17:56 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 12 May 2025 09:17:56 GMT Subject: Integrated: 8356752: Log mouse enter and exit events for debugging In-Reply-To: References: Message-ID: On Mon, 12 May 2025 07:20:43 GMT, Abhishek Kumar wrote: > Log mouse events output to analyze the failure in CI pipeline. This pull request has now been integrated. Changeset: ab8c808e Author: Abhishek Kumar URL: https://git.openjdk.org/jdk/commit/ab8c808ed8ebec4f70141ee31fbaf312fccf7fa4 Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod 8356752: Log mouse enter and exit events for debugging Reviewed-by: jdv, tr ------------- PR: https://git.openjdk.org/jdk/pull/25176 From tr at openjdk.org Mon May 12 09:17:55 2025 From: tr at openjdk.org (Tejesh R) Date: Mon, 12 May 2025 09:17:55 GMT Subject: RFR: 8356752: Log mouse enter and exit events for debugging In-Reply-To: References: Message-ID: <4aHtxRh2Sgn6K7ODjwBlAAicNivbevZ2p0fU4KyGpIk=.74bbcd8d-d0bf-43c8-9b31-9ee421a45b80@github.com> On Mon, 12 May 2025 07:20:43 GMT, Abhishek Kumar wrote: > Log mouse events output to analyze the failure in CI pipeline. Marked as reviewed by tr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25176#pullrequestreview-2832472783 From kizune at openjdk.org Mon May 12 10:23:01 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 12 May 2025 10:23:01 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" Message-ID: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. ------------- Commit messages: - 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" - Merge pull request #70 from openjdk/master Changes: https://git.openjdk.org/jdk/pull/25179/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25179&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8323545 Stats: 11 lines in 1 file changed: 10 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25179.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25179/head:pull/25179 PR: https://git.openjdk.org/jdk/pull/25179 From dgredler at openjdk.org Mon May 12 11:30:58 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 12 May 2025 11:30:58 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v2] In-Reply-To: References: <1iwy1ZiFNN_E6ykAkMS2AG8upZu2MpWp_DZAMGEThJs=.d25c503f-f4dc-4486-8a7d-87b26594664d@github.com> Message-ID: On Wed, 7 May 2025 22:46:08 GMT, Phil Race wrote: >> Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: >> >> - Merge branch 'master' into ignored-whitespace >> - Make Graphics2D.drawString ignore tabs and newlines on macOS >> - Add actual bug ID >> - Add ignored whitespace test > > I don't think > NativeGlyphMapper - used only when we needs the Xserver to render, or > WPathGraphics - a windows printing class > > are where I'd expect to find anything that could impact the TestControls test. > > But I agree with the general points > - \t \r \n handling can be platform-specific > - macOS printing is very different > > The other PR still needs a proper look on my part > > I suggest we get this PR pushed but first I'll submit a test job .. unless Harshitha already did that ? @prrace @honkar-jdk I've incorporated a few minor formatting changes requested by Alexey. Please let me know if you have any concerns with these latest tweaks, otherwise I will go ahead and mark as ready for integration tomorrow. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2872167214 From aivanov at openjdk.org Mon May 12 12:08:00 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 12:08:00 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v2] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Tue, 29 Apr 2025 14:04:07 GMT, Nikita Gubarkov wrote: >> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. >> >> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > fixup! 8355904: Use variadic macros for J2dTrace Wrapped arguments were aligned to the opening parenthesis of the macro, thus these lines need adjusting. Bump the copyright year in all the modified files, please. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m line 366: > 364: J2dTraceLn(J2D_TRACE_VERBOSE, > 365: "end common encoder because of dest change: %p -> %p", > 366: _destination, dest); Suggestion: J2dTraceLn(J2D_TRACE_VERBOSE, "end common encoder because of dest change: %p -> %p", _destination, dest); Restore aligning of the arguments on the wrapped lines. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/EncoderManager.m line 379: > 377: J2dTraceLn(J2D_TRACE_VERBOSE, > 378: "end common encoder because toggle stencil: %d -> %d", > 379: (int)_useStencil, (int)[_mtlc.clip isShape]); Suggestion: J2dTraceLn(J2D_TRACE_VERBOSE, "end common encoder because toggle stencil: %d -> %d", (int)_useStencil, (int)[_mtlc.clip isShape]); Restore aligning. This applies to other files. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m line 186: > 184: @autoreleasepool { > 185: J2dTraceLn(J2D_TRACE_VERBOSE, "replaceTextureRegion src (dw, dh) : [%d, %d] dest (dx1, dy1) =[%d, %d]", > 186: dw, dh, dx1, dy1); Suggestion: J2dTraceLn(J2D_TRACE_VERBOSE, "replaceTextureRegion src (dw, dh) : [%d, %d] dest (dx1, dy1) =[%d, %d]", dw, dh, dx1, dy1); src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBufImgOps.m line 50: > 48: self = [super init]; > 49: if (self) { > 50: J2dTraceLn(J2D_TRACE_INFO,"Created MTLRescaleOp: isNonPremult=%d", isNonPremult); Suggestion: J2dTraceLn(J2D_TRACE_INFO, "Created MTLRescaleOp: isNonPremult=%d", isNonPremult); Does it look reasonable to add a space after the first argument too? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.m line 254: > 252: } > 253: > 254: J2dTraceLn(J2D_TRACE_VERBOSE, "MTLContext_SetSurfaces: bsrc=%p (tex=%p type=%d), bdst=%p (tex=%p type=%d)", srcOps, srcOps->pTexture, srcOps->drawableType, dstOps, dstOps->pTexture, dstOps->drawableType); This long line is worth wrapping: Suggestion: J2dTraceLn(J2D_TRACE_VERBOSE, "MTLContext_SetSurfaces: bsrc=%p (tex=%p type=%d), bdst=%p (tex=%p type=%d)", srcOps, srcOps->pTexture, srcOps->drawableType, dstOps, dstOps->pTexture, dstOps->drawableType); src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLContext.m line 360: > 358: > 359: - (void)setColorPaint:(int)pixel { > 360: J2dTraceLn(J2D_TRACE_INFO, "MTLContext.setColorPaint: pixel=%08x [r=%d g=%d b=%d a=%d]", pixel, (pixel >> 16) & (0xFF), (pixel >> 8) & 0xFF, (pixel) & 0xFF, (pixel >> 24) & 0xFF); Wrap the line, too? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLGlyphCache.m line 295: > 293: J2dTraceLn(J2D_TRACE_VERBOSE, > 294: " glyph 0x%x: removing cell 0x%x from glyph's list", > 295: glyph, currCellInfo); Suggestion: J2dTraceLn(J2D_TRACE_VERBOSE, " glyph 0x%x: removing cell 0x%x from glyph's list", glyph, currCellInfo); src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.h line 85: > 83: if ((value) == NULL) { \ > 84: J2dTraceLn(J2D_TRACE_ERROR, \ > 85: "%s is null", #value); \ Suggestion: J2dTraceLn(J2D_TRACE_ERROR, \ "%s is null", #value); \ src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLRenderQueue.h line 94: > 92: if ((value)) { \ > 93: J2dTraceLn(J2D_TRACE_ERROR, \ > 94: "%s is false", #value);\ Suggestion: J2dTraceLn(J2D_TRACE_ERROR, \ "%s is false", #value); \ src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLSurfaceData.m line 96: > 94: bmtlsdo->drawableType = rtt ? MTLSD_RT_TEXTURE : MTLSD_TEXTURE; > 95: > 96: J2dTraceLn(J2D_TRACE_VERBOSE, "MTLSurfaceData_initTexture: w=%d h=%d bp=%p [tex=%p] opaque=%d rtt=%d", width, height, bmtlsdo, bmtlsdo->pTexture, isOpaque, rtt); Wrap the line? src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLVertexCache.m line 224: > 222: > 223: J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_AddMaskQuad: %d", > 224: maskCacheIndex); Suggestion: J2dTraceLn(J2D_TRACE_INFO, "MTLVertexCache_AddMaskQuad: %d", maskCacheIndex); src/java.desktop/share/native/common/java2d/opengl/OGLContext.c line 756: > 754: J2dRlsTraceLn(J2D_TRACE_INFO, > 755: "OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)", > 756: maxTexUnits); Suggestion: J2dRlsTraceLn(J2D_TRACE_INFO, "OGLContext_IsLCDShaderSupportAvailable: not enough tex units (%d)", maxTexUnits); However, continuation lines are usually indented by 8 spaces instead of 4 spaces. src/java.desktop/share/native/common/java2d/opengl/OGLContext.c line 986: > 984: J2dRlsTraceLn(J2D_TRACE_WARNING, > 985: "OGLContext_CreateFragmentProgram: compiler msg (%d):\n%s", > 986: infoLogLength, infoLog); Suggestion: J2dRlsTraceLn(J2D_TRACE_WARNING, "OGLContext_CreateFragmentProgram: compiler msg (%d):\n%s", infoLogLength, infoLog); Aligning is weird here, I guess it's fine to amend this. src/java.desktop/share/native/common/java2d/opengl/OGLContext.c line 1018: > 1016: J2dRlsTraceLn(J2D_TRACE_WARNING, > 1017: "OGLContext_CreateFragmentProgram: linker msg (%d):\n%s", > 1018: infoLogLength, infoLog); Suggestion: J2dRlsTraceLn(J2D_TRACE_WARNING, "OGLContext_CreateFragmentProgram: linker msg (%d):\n%s", infoLogLength, infoLog); src/java.desktop/share/native/common/java2d/opengl/OGLRenderQueue.h line 118: > 116: if ((value) == NULL) { \ > 117: J2dTraceLn(J2D_TRACE_ERROR, \ > 118: "%s is null", #value); \ Suggestion: J2dTraceLn(J2D_TRACE_ERROR, \ "%s is null", #value); \ src/java.desktop/windows/native/libawt/java2d/d3d/D3DContext.cpp line 1380: > 1378: pd3dDevice->GetTransform(D3DTS_WORLD, &tx); > 1379: J2dTraceLn(10, > 1380: " %5f %5f %5f %5f", tx._11, tx._12, tx._13, tx._14); I wonder why these lines use 10 as the level instead of constant. Should we update these lines to use a trace constant/define? ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24949#pullrequestreview-2832814532 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084428158 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084429615 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084433163 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084438108 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084440921 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084442259 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084442917 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084444730 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084445157 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084448036 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084450001 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084501289 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084502360 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084503017 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084507075 PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084517205 From aivanov at openjdk.org Mon May 12 12:13:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 12:13:52 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v2] In-Reply-To: <3ej1X8fJ5R49AG9eK0SnIl3WrIuMtk9djq3zB1uFcCM=.ec799248-68e1-4632-b55b-62a3b32a251d@github.com> References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> <3ej1X8fJ5R49AG9eK0SnIl3WrIuMtk9djq3zB1uFcCM=.ec799248-68e1-4632-b55b-62a3b32a251d@github.com> Message-ID: On Mon, 12 May 2025 07:54:23 GMT, Alexey Ushakov wrote: >> There is a trailing comma problem when passing no extra args. I didn't figure out how to solve it without `__VA_OPT__` or compiler-specific tricks, so I moved the string into variadic part, so that it always has at least one parameter. > > I think that the benefits (having an arbitrary number of arguments) outweigh the lack of a check for the string argument type. So, I'd let's put some comments here about future use of __VA_OPT__ and integrate this change. I think we still have the same benefits, and the first argument has to be string? It wasn't enforced at the macro level, but it was suggested by the name of the argument. https://github.com/openjdk/jdk/blob/867aee60dd12c4ea232aaf03f14a45a3d0f91851/src/java.desktop/share/native/libawt/java2d/Trace.c#L38C38-L38C44 The functions that implement traces, `J2dTraceImpl`, still require that the first argument is a string, therefore we should get a compilation error if the first parameter isn't a string. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2084536439 From aivanov at openjdk.org Mon May 12 12:24:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 12:24:56 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Sun, 27 Apr 2025 21:01:07 GMT, Andrey Turbanov wrote: > Cleanup code to use Map.putIfAbsent. It's clearer and faster. Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24906#pullrequestreview-2833019355 From aivanov at openjdk.org Mon May 12 12:24:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 12:24:57 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 06:02:01 GMT, Sergey Bylokhov wrote: > looks fine @mrserb You meant to select the Approve option, didn't you? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24906#issuecomment-2872344120 From duke at openjdk.org Mon May 12 15:27:55 2025 From: duke at openjdk.org (lawrence.andrews) Date: Mon, 12 May 2025 15:27:55 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" In-Reply-To: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: <3cNJ0sGy8OWUyuf_IAUEFaPijSnDSlbTdyyAnZlD3k8=.0f687f07-3a7f-4d4a-9386-2c572e1bface@github.com> On Mon, 12 May 2025 10:18:13 GMT, Alexander Zuev wrote: > This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. LGTM ------------- PR Comment: https://git.openjdk.org/jdk/pull/25179#issuecomment-2873014312 From honkar at openjdk.org Mon May 12 16:20:55 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 16:20:55 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:48:13 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Alexey Ivanov LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/23665#pullrequestreview-2833805424 From honkar at openjdk.org Mon May 12 16:37:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 16:37:54 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Tue, 6 May 2025 23:31:34 GMT, Daniel Gredler wrote: >> src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 138: >> >>> 136: return code == 0x0009 || code == 0x000a || code == 0x000d; >>> 137: } >>> 138: >> >> @prrace @gredler >> Following is an existing issue NOT related to the recent harfbuzz upgrade PR nor this issue fix but it is similar in nature so a separate JBS issue can be created to handle it. I wanted to discuss it before integrating the HB upgrade tomorrow. >> >> There seems to be similar issue on windows and linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` >> >> **On Windows:** >> >> image >> >> **On Linux:** >> >> image >> >> >> If adding these codes (0x2028, 0x2029) to platform specific src code (I believe it is NativeGlyphMapper (linux) and WPathGraphics (windows)) fixes the above issue then should we consider moving isIgnorableWhitespace() to common class - `CharToGlyphMapper` instead of macOS specific src? > > Yeah, I think right now `\t` `\r` `\n` handling is done separately for each platform, and I think also separately for screen display vs. printing. > > As an example, this fix addresses the screen display side of things for macOS, but printing on macOS needs to be fixed separately (as can be seen when you run `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java`). I had a quick look at the corresponding macOS printing issue a few months ago and the fix wasn't obvious, especially given how that part of the code is organized (not really 1-to-1 with the other platforms). > > So I think `\t` `\r` `\n` handling is repeated quite a bit, and if we wanted to handle `0x2028` and `0x2029` exactly like we do `\t` `\r` `\n` then we'd need to change multiple places right now. > >> should we consider moving isIgnorableWhitespace() to common class - CharToGlyphMapper instead of macOS specific src > > That sounds like it could be a good idea, but I don't have a sense of how likely it is to cause breakage elsewhere -- it'd be a matter of "do it and check for test regressions". Maybe you have a better gut feel for the likelihood of unintended side-effects? > > Note these two characters (`0x2028` and `0x2029`) are not default-ignorable, though. It sounds like we just don't want to render their glyphs, if they have any (similar to `\t` `\r` `\n`, which are also not default-ignorable). > > Over on PR #24412 Nikita has suggested an interesting change to `CharToGlyphMapper` and subclasses which might make this change easier, but I'd like some feedback from a reviewer or two before moving forward. The PR is complete from my POV, but we need some design direction (good as is, or needs tweaks, or need to use a different approach entirely, etc). Created a new JBS to track the issue on windows and linux - [JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show a non-zero advance ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085054047 From honkar at openjdk.org Mon May 12 16:55:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 16:55:54 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events @prrace @kevinrushforth @pabulaner Tested all 4 combinations of with/without JDK + with/without JFX fix in both app modes before and after. The updated fix works as expected and no regressions observed. Kevin's suggestion to add !isApplicationOwner check before registering embedded event listener on JDK AppDelegate limits any unwanted side-effects and the event listener is registered as required only - When FX is app owner. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2873294172 From honkar at openjdk.org Mon May 12 16:59:56 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 16:59:56 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: <1iqZn5rEKpz6Q-rQYl0KZ8WFCfUCNvzcOQHmC5mPmco=.09f1d93a-73f7-45c0-9d38-ca605d736af2@github.com> On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 293: > 291: > 292: - (void)_handleOpenURLEvent:(NSAppleEventDescriptor *)openURLEvent withReplyEvent:(NSAppleEventDescriptor *)replyEvent { > 293: AWT_ASSERT_APPKIT_THREAD; @prrace `AWT_ASSERT_APPKIT_THREAD` is removed from handleOpenURLEvent and moved to _openURL(). This should be okay since we have moved the crux of the method (i.e calling java method handleOpenURI) to _openURL now ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2085090521 From kizune at openjdk.org Mon May 12 18:02:56 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 12 May 2025 18:02:56 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: On Wed, 7 May 2025 12:28:52 GMT, Manukumar V S wrote: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). Looks reasonable. Using the blob version of the link to GH as a code example seems unusual but it works. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25091#pullrequestreview-2834051647 From kizune at openjdk.org Mon May 12 18:04:57 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 12 May 2025 18:04:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: <6B5unPv7OtgfkemdfqFB87GPshqPlCXeIbpQgo6dgd0=.a95c2109-39b2-47cd-a0d8-2676f515c484@github.com> On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Seems to be working fine. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2834056592 From aivanov at openjdk.org Mon May 12 19:00:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 19:00:54 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Mon, 12 May 2025 16:33:59 GMT, Harshitha Onkar wrote: >> Yeah, I think right now `\t` `\r` `\n` handling is done separately for each platform, and I think also separately for screen display vs. printing. >> >> As an example, this fix addresses the screen display side of things for macOS, but printing on macOS needs to be fixed separately (as can be seen when you run `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java`). I had a quick look at the corresponding macOS printing issue a few months ago and the fix wasn't obvious, especially given how that part of the code is organized (not really 1-to-1 with the other platforms). >> >> So I think `\t` `\r` `\n` handling is repeated quite a bit, and if we wanted to handle `0x2028` and `0x2029` exactly like we do `\t` `\r` `\n` then we'd need to change multiple places right now. >> >>> should we consider moving isIgnorableWhitespace() to common class - CharToGlyphMapper instead of macOS specific src >> >> That sounds like it could be a good idea, but I don't have a sense of how likely it is to cause breakage elsewhere -- it'd be a matter of "do it and check for test regressions". Maybe you have a better gut feel for the likelihood of unintended side-effects? >> >> Note these two characters (`0x2028` and `0x2029`) are not default-ignorable, though. It sounds like we just don't want to render their glyphs, if they have any (similar to `\t` `\r` `\n`, which are also not default-ignorable). >> >> Over on PR #24412 Nikita has suggested an interesting change to `CharToGlyphMapper` and subclasses which might make this change easier, but I'd like some feedback from a reviewer or two before moving forward. The PR is complete from my POV, but we need some design direction (good as is, or needs tweaks, or need to use a different approach entirely, etc). > > Created a new JBS to track the issue on windows and linux - [JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show a non-zero advance > There seems to be similar issue on Windows and Linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` Are these characters new? I can't remember there were any characters with non-zero width on Linux and Windows. I ran this test (or its previous version) on each HarfBuzz update. No, they were these characters are part of the existing test. I cannot reproduce this problem with 21.0.6. Nor is it reproducible with 21.0.7, the latest GA version of Java 21. Yet I the same picture as you attached on Windows on a recent build of mainline. If that's the case, it seems to be regression rather than an existing issue. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085275529 From aivanov at openjdk.org Mon May 12 19:36:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 12 May 2025 19:36:52 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Mon, 12 May 2025 18:58:25 GMT, Alexey Ivanov wrote: >> Created a new JBS to track the issue on windows and linux - [JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show a non-zero advance > >> There seems to be similar issue on Windows and Linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` > > Are these characters new? I can't remember there were any characters with non-zero width on Linux and Windows. I ran this test (or its previous version) on each HarfBuzz update. > > No, they were these characters are part of the existing test. > > I cannot reproduce this problem with 21.0.6. Nor is it reproducible with 21.0.7, the latest GA version of Java 21. > > Yet I the same picture as you attached on Windows on a recent build of mainline. > > If that's the case, it seems to be regression rather than an existing issue. I also submitted [JDK-8356812](https://bugs.openjdk.org/browse/JDK-8356812): *Create an automated version of TextLayout/TestControls*. Verifying that the widths of all control characters is zero can be automated; the manual version can exist along-side to ensure all the characters are rendered as expected. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085323180 From honkar at openjdk.org Mon May 12 19:42:55 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 19:42:55 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Mon, 12 May 2025 19:34:16 GMT, Alexey Ivanov wrote: >>> There seems to be similar issue on Windows and Linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` >> >> Are these characters new? I can't remember there were any characters with non-zero width on Linux and Windows. I ran this test (or its previous version) on each HarfBuzz update. >> >> No, they were these characters are part of the existing test. >> >> I cannot reproduce this problem with 21.0.6. Nor is it reproducible with 21.0.7, the latest GA version of Java 21. >> >> Yet I the same picture as you attached on Windows on a recent build of mainline. >> >> If that's the case, it seems to be regression rather than an existing issue. > > I also submitted [JDK-8356812](https://bugs.openjdk.org/browse/JDK-8356812): *Create an automated version of TextLayout/TestControls*. > > Verifying that the widths of all control characters is zero can be automated; the manual version can exist along-side to ensure all the characters are rendered as expected. @aivanov-jdk Thanks for testing on older versions of JDK. I'm checking if this issue was caused by harfbuzz upgrade or recent code changes to JDK. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085328760 From dgredler at openjdk.org Mon May 12 20:41:03 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 12 May 2025 20:41:03 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed Message-ID: `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). The following three existing test classes provide good regression test coverage for this change: - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest public class LineBreakMeasurerPerfTest { public static void main(String[] args) { float advance = 0; long start = System.currentTimeMillis(); AttributedString string = new AttributedString("This is a test."); FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); for (int i = 0; i < 100_000; i++) { LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); TextLayout layout = measurer.nextLayout(999); // large enough to not require break advance = Math.max(advance, layout.getAdvance()); } long end = System.currentTimeMillis(); System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); } } ------------- Commit messages: - Avoid double text shaping in some scenarios Changes: https://git.openjdk.org/jdk/pull/25193/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25193&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356814 Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25193.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25193/head:pull/25193 PR: https://git.openjdk.org/jdk/pull/25193 From honkar at openjdk.org Mon May 12 20:57:57 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 20:57:57 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: <6HH0VKf0fffFEl0GR2Zqq6AmDFI-iNKNb34fOji2mP0=.72ba4a3a-ee47-4bef-b3af-564ebdf608d8@github.com> On Mon, 12 May 2025 19:38:34 GMT, Harshitha Onkar wrote: >> I also submitted [JDK-8356812](https://bugs.openjdk.org/browse/JDK-8356812): *Create an automated version of TextLayout/TestControls*. >> >> Verifying that the widths of all control characters is zero can be automated; the manual version can exist along-side to ensure all the characters are rendered as expected. > > @aivanov-jdk Thanks for testing on older versions of JDK. I'm checking if this issue was caused by harfbuzz upgrade or recent code changes to JDK. The above issue is replicable after jdk25+b10 and was introduced by changeset related to **[JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) - Soft hyphens render if not using TextLayout** , https://github.com/openjdk/jdk/pull/22670 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085473996 From honkar at openjdk.org Mon May 12 21:08:53 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 12 May 2025 21:08:53 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: <2pjU3eogoZP4bGad5TWJnPxlTpdVTOAisygH3fvTU2E=.596b6601-a379-4a69-a54d-41788c57db31@github.com> On Tue, 6 May 2025 23:31:34 GMT, Daniel Gredler wrote: >> src/java.desktop/macosx/classes/sun/font/CCharToGlyphMapper.java line 138: >> >>> 136: return code == 0x0009 || code == 0x000a || code == 0x000d; >>> 137: } >>> 138: >> >> @prrace @gredler >> Following is an existing issue NOT related to the recent harfbuzz upgrade PR nor this issue fix but it is similar in nature so a separate JBS issue can be created to handle it. I wanted to discuss it before integrating the HB upgrade tomorrow. >> >> There seems to be similar issue on windows and linux where the hexcode - 0x2028 (line separator) and 0x2029 (paragraph separator) are shown with a non-zero advance - `/java/awt/font/TextLayout/TestControls.java` >> >> **On Windows:** >> >> image >> >> **On Linux:** >> >> image >> >> >> If adding these codes (0x2028, 0x2029) to platform specific src code (I believe it is NativeGlyphMapper (linux) and WPathGraphics (windows)) fixes the above issue then should we consider moving isIgnorableWhitespace() to common class - `CharToGlyphMapper` instead of macOS specific src? > > Yeah, I think right now `\t` `\r` `\n` handling is done separately for each platform, and I think also separately for screen display vs. printing. > > As an example, this fix addresses the screen display side of things for macOS, but printing on macOS needs to be fixed separately (as can be seen when you run `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java`). I had a quick look at the corresponding macOS printing issue a few months ago and the fix wasn't obvious, especially given how that part of the code is organized (not really 1-to-1 with the other platforms). > > So I think `\t` `\r` `\n` handling is repeated quite a bit, and if we wanted to handle `0x2028` and `0x2029` exactly like we do `\t` `\r` `\n` then we'd need to change multiple places right now. > >> should we consider moving isIgnorableWhitespace() to common class - CharToGlyphMapper instead of macOS specific src > > That sounds like it could be a good idea, but I don't have a sense of how likely it is to cause breakage elsewhere -- it'd be a matter of "do it and check for test regressions". Maybe you have a better gut feel for the likelihood of unintended side-effects? > > Note these two characters (`0x2028` and `0x2029`) are not default-ignorable, though. It sounds like we just don't want to render their glyphs, if they have any (similar to `\t` `\r` `\n`, which are also not default-ignorable). > > Over on PR #24412 Nikita has suggested an interesting change to `CharToGlyphMapper` and subclasses which might make this change easier, but I'd like some feedback from a reviewer or two before moving forward. The PR is complete from my POV, but we need some design direction (good as is, or needs tweaks, or need to use a different approach entirely, etc). @gredler This issue _[JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux line and paragraph separator show a non-zero advance_, is re-assigned to you since it is a regression of [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23665#discussion_r2085495237 From prr at openjdk.org Mon May 12 22:52:52 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 12 May 2025 22:52:52 GMT Subject: RFR: 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hasCode In-Reply-To: References: Message-ID: <2ufz9IUTazVEwoNsGiP6v5b5VTRO7ZJKtYfr0TnGWR8=.c3fe46d0-ed36-4f89-af54-ebf38995259b@github.com> On Thu, 1 May 2025 16:16:29 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971 and #24987, apple.laf.JRSUIControl and apple.laf.JRSUIState in java.desktop can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of JRSUIControl/JRSUIState with Long::hashCode. I'm not entirely convinced this "simplification" was worth anyone's time to understand and review. I've run tests and I don't see any failures, but it wasn't likely something we have a test for. You'll need to fix the PR name src/java.desktop/macosx/classes/apple/laf/JRSUIState.java line 186: > 184: @Override > 185: public int hashCode() { > 186: return super.hashCode() ^ Double.hashCode(value); Since this uses Double.hashCode() not Long.hashCode() it would have been nice to have some comments on that. It took a bit of reading and following to learn that Double.hashCode() first uses Double.doubleToRawLongBits and then calls out to Long.hashCode ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24989#pullrequestreview-2834788162 PR Review Comment: https://git.openjdk.org/jdk/pull/24989#discussion_r2085638753 From swen at openjdk.org Mon May 12 23:13:55 2025 From: swen at openjdk.org (Shaojin Wen) Date: Mon, 12 May 2025 23:13:55 GMT Subject: RFR: 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hashCode In-Reply-To: <2ufz9IUTazVEwoNsGiP6v5b5VTRO7ZJKtYfr0TnGWR8=.c3fe46d0-ed36-4f89-af54-ebf38995259b@github.com> References: <2ufz9IUTazVEwoNsGiP6v5b5VTRO7ZJKtYfr0TnGWR8=.c3fe46d0-ed36-4f89-af54-ebf38995259b@github.com> Message-ID: On Mon, 12 May 2025 22:50:34 GMT, Phil Race wrote: > I'm not entirely convinced this "simplification" was worth anyone's time to understand and review. I've run tests and I don't see any failures, but it wasn't likely something we have a test for. You'll need to fix the PR name @pprace, thank you for reviewing this PR. I will follow your advice and will not submit similar PRs in the client module. > src/java.desktop/macosx/classes/apple/laf/JRSUIState.java line 186: > >> 184: @Override >> 185: public int hashCode() { >> 186: return super.hashCode() ^ Double.hashCode(value); > > Since this uses Double.hashCode() not Long.hashCode() it would have been nice to have some comments on that. It took a bit of reading and following to learn that Double.hashCode() first uses Double.doubleToRawLongBits and then calls out to Long.hashCode Double.hashCode is a simple call, and there are no comments in other places where Double.hashCode is used in the JDK source code. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24989#issuecomment-2874418460 PR Review Comment: https://git.openjdk.org/jdk/pull/24989#discussion_r2085653994 From achung at openjdk.org Mon May 12 23:26:09 2025 From: achung at openjdk.org (Alisen Chung) Date: Mon, 12 May 2025 23:26:09 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v15] In-Reply-To: References: Message-ID: On Mon, 24 Feb 2025 21:12:15 GMT, Alexander Zvegintsev wrote: >> Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 22 commits: >> >> - merge >> - update specifications, replace default values in specifications with links to default var >> - update glide in test >> - merge >> - fix test with removed robot.glide using points >> - add code tag to specifications in Robot >> - fix syncdelay in ER >> - removing lesser used overridden methods >> - Merge branch 'master' of https://github.com/openjdk/jdk into 8150564 >> - update specification to public default fields, add waitforidle exceptions to specifications >> - ... and 12 more: https://git.openjdk.org/jdk/compare/10791477...30ca6a6b > > src/java.desktop/share/classes/java/awt/Robot.java line 858: > >> 856: * @since 25 >> 857: */ >> 858: public void glide(int x, int y) { > > I don't see the `public void glide(Point dest)` and `public void glide(Point src, Point dest)` added, it may be convenient in some cases. I've taken a look at all the tests running glide and very few of them actually used glide(Point dest) and glide(Point src, Point dest) so I decided to remove them from them from the migration ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22044#discussion_r2085671341 From achung at openjdk.org Mon May 12 23:35:50 2025 From: achung at openjdk.org (Alisen Chung) Date: Mon, 12 May 2025 23:35:50 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v16] In-Reply-To: References: Message-ID: > Some useful methods in ExtendedRobot should be migrated into Robot itself so that ExtendedRobot can be removed in the future. The tests using ExtendedRobot for these migrated methods are changed to use only Robot (removing unnecessary building of ExtendedRobot). Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: remove specified numbers in constant fields, add exception to documentation in glide ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22044/files - new: https://git.openjdk.org/jdk/pull/22044/files/30ca6a6b..c0cd6e73 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=14-15 Stats: 11 lines in 2 files changed: 8 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22044/head:pull/22044 PR: https://git.openjdk.org/jdk/pull/22044 From serb at openjdk.org Mon May 12 23:59:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 12 May 2025 23:59:52 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" In-Reply-To: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: On Mon, 12 May 2025 10:18:13 GMT, Alexander Zuev wrote: > This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. test/jdk/java/awt/GraphicsDevice/CheckDisplayModes.java line 42: > 40: } > 41: > 42: for (GraphicsDevice graphicDevice : ge.getScreenDevices()) { I remember that, at least in ogl, querying/initializing devices can invalidate the list of existing devices on the fly. It might be better to call getScreenDevices only once, this could(or maybe not) increase the chances to catch the bug." ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25179#discussion_r2085702105 From serb at openjdk.org Tue May 13 00:13:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 00:13:50 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: On Fri, 9 May 2025 14:14:57 GMT, Magnus Ihse Bursie wrote: > A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. > > While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. > > I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. src/demo/share/jfc/CodePointIM/README.html line 5: > 3: > 4: README - CodePointIM > 5: I believe this line is equivalent to simple `` which is widely used in java.desktop's docs. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25148#discussion_r2085710719 From serb at openjdk.org Tue May 13 00:40:03 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 00:40:03 GMT Subject: RFR: 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hashCode In-Reply-To: References: Message-ID: On Thu, 1 May 2025 16:16:29 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971 and #24987, apple.laf.JRSUIControl and apple.laf.JRSUIState in java.desktop can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of JRSUIControl/JRSUIState with Long::hashCode. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24989#pullrequestreview-2834993165 From serb at openjdk.org Tue May 13 00:45:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 00:45:50 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Sun, 27 Apr 2025 21:01:07 GMT, Andrey Turbanov wrote: > Cleanup code to use Map.putIfAbsent. It's clearer and faster. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24906#pullrequestreview-2834999263 From serb at openjdk.org Tue May 13 00:45:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 00:45:50 GMT Subject: RFR: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Wed, 30 Apr 2025 06:02:01 GMT, Sergey Bylokhov wrote: >> Cleanup code to use Map.putIfAbsent. It's clearer and faster. > > looks fine > @mrserb You meant to select the Approve option, didn't you? At that time, it did not have an associated bug ID, so it could not be approved. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24906#issuecomment-2874672251 From serb at openjdk.org Tue May 13 00:48:59 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 00:48:59 GMT Subject: RFR: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code [v4] In-Reply-To: <0lPsNSeiz4axJaYDwGkXxjmChM7JE87jXvyjMWtxKJQ=.44de2e2e-16e0-4e95-92fd-48559fb3dfe3@github.com> References: <0lPsNSeiz4axJaYDwGkXxjmChM7JE87jXvyjMWtxKJQ=.44de2e2e-16e0-4e95-92fd-48559fb3dfe3@github.com> Message-ID: On Thu, 8 May 2025 20:00:40 GMT, Alisen Chung wrote: >> Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. > > Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: > > - remove author, update summary > - revert test, add logging Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24885#pullrequestreview-2835001523 From serb at openjdk.org Tue May 13 02:06:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 02:06:54 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux In-Reply-To: <0IkXQzTfHKgD2Zn6NLHlFZs6jpVi2ub7Zz-K74wObFA=.f53a3a43-53ec-41cd-a95b-d264fef102f8@github.com> References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> <0IkXQzTfHKgD2Zn6NLHlFZs6jpVi2ub7Zz-K74wObFA=.f53a3a43-53ec-41cd-a95b-d264fef102f8@github.com> Message-ID: <-SBD5rSWBUqG_5ToRe8BKD3uXVo9anMyso7nlishEW8=.bf332e96-18bd-4c11-849d-e26f2fbba5fd@github.com> On Thu, 24 Apr 2025 05:23:43 GMT, Abhishek Kumar wrote: > I ran the test (**without your fix**) on Windows, Mac and Linux platform. It failed on Windows and Mac but no issues on Linux. Why it fails on win/mac? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24752#issuecomment-2874809884 From serb at openjdk.org Tue May 13 02:13:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 02:13:51 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v2] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: On Mon, 14 Apr 2025 17:19:19 GMT, Matthias Bl?sing wrote: >> - Introduce a lock into WClipboard that protects the code between >> openClipboard/closeClipboard invocations. >> The native side does not allow to open the clipboard multiple >> times or share the opened clipboard between multiple threads. >> >> - Remove of need to call openClipboard/closeClipboard from >> getClipboardFormats by using the win32 call >> GetUpdatedClipboardFormats >> >> - Prevent a race-condition by not registering the connection >> between java and native side of clipboard multiple time, but >> just at construction time. > > Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: > > Adress review comments: Update copyright years and fix whitespace in if condition is it possible to create a jtreg test for this issue? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2874817388 From serb at openjdk.org Tue May 13 03:04:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 03:04:52 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document In-Reply-To: References: Message-ID: On Thu, 8 May 2025 04:08:30 GMT, Tejesh R wrote: >> @aivanov-jdk @TejeshR13 >> This seems stalled because there are conflicting statements >> - Alexei : you can create a custom FIleSystemView on windows with in path names. >> - Tejesh : no you can't, or at least it doesn't work when you try to use it. >> >> Can we please get that reconciled ? >> Tejesh pls show the code you used, and Alexei please show how you would do it. > > I tried with this code snippet. > > import javax.swing.JFileChooser; > import javax.swing.SwingUtilities; > import javax.swing.UIManager; > import javax.swing.UnsupportedLookAndFeelException; > import javax.swing.filechooser.FileSystemView; > import java.io.File; > import java.util.Arrays; > > public class VirtualFileChooser { > > public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { > UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); > //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); > > > SwingUtilities.invokeLater(() -> { > JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); > > int result = chooser.showOpenDialog(null); > if (result == JFileChooser.APPROVE_OPTION) { > File selectedFile = chooser.getSelectedFile(); > System.out.println("Selected: " + selectedFile.getAbsolutePath()); > } > }); > } > > static class VirtualFileSystemView extends FileSystemView { > > private final File[] roots; > > public VirtualFileSystemView() { > // Create a dummy root folder > String name = "

SWING ROCKS!!!111"; > roots = new File[]{new File(name)}; > } > > @Override > public File createNewFolder(File containingDir) { > > File folder = new File(containingDir, "New Folder"); > folder.mkdir(); > return folder; > } > > @Override > public File[] getRoots() { > return roots; > } > > @Override > public File getHomeDirectory() { > return roots[0]; > } > > @Override > public File getDefaultDirectory() { > return roots[0]; > } > > @Override > public File[] getFiles(File dir, boolean useFileHiding) { > // Simulate a virtual folder structure > return new File[]{ > new File(dir, "virtualFile1.txt"), > new File(dir, "virtualFile2.txt"), > new File(dir, "virtualFolder") > }; > } > > @Override > public boolean isRoot(File file) { > return Arrays.asList(roots).contains(file); > } > > @Override > public Boolean isTraversable(File f) { > return true; > } > ... > Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Illegal char <<> at index 0:

SWING ROCKS!!!111 > at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) > at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142) > at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46) > at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) > at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203) > at java.base/java.nio.file.Path.of(Path.java:148) > at java.base/java.nio.file.Paths.get(Paths.java:69) > at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260) > at java.desktop/javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:724) > at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:242) > at java.desktop/com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon(WindowsFileChooserUI.java:1398) > at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1614) This exception looks like a bug? I think if the file was not found then null is an expected result. For now it can be bypassed by this: import java.io.File; import java.lang.Override; import javax.swing.Icon; import javax.swing.JFileChooser; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileSystemView; public class VirtualFileChooser { public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); SwingUtilities.invokeLater(() -> { JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); int result = chooser.showOpenDialog(null); if (result == JFileChooser.APPROVE_OPTION) { File selectedFile = chooser.getSelectedFile(); System.out.println("Selected: " + selectedFile.getAbsolutePath()); } }); } static class VirtualFileSystemView extends FileSystemView { @Override public File createNewFolder(File containingDir) { return null; } @Override public File[] getRoots() { return new File[]{ new File("/", "

SWING ROCKS!!!111"), new File("/", "virtualFile2.txt"), new File("/", "virtualFolder") }; } @Override public File getHomeDirectory() { return new File("/"); } @Override public File getDefaultDirectory() { return new File("/"); } @Override public File[] getFiles(File dir, boolean useFileHiding) { // Simulate a virtual folder structure return new File[]{ new File("/", "

SWING ROCKS!!!111"), new File(dir, "virtualFile2.txt"), new File(dir, "virtualFolder") }; } @Override public Icon getSystemIcon(File f) { return null; } } } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2085839647 From serb at openjdk.org Tue May 13 03:08:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 03:08:52 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document In-Reply-To: References: Message-ID: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> On Tue, 13 May 2025 03:01:46 GMT, Sergey Bylokhov wrote: >> I tried with this code snippet. >> >> import javax.swing.JFileChooser; >> import javax.swing.SwingUtilities; >> import javax.swing.UIManager; >> import javax.swing.UnsupportedLookAndFeelException; >> import javax.swing.filechooser.FileSystemView; >> import java.io.File; >> import java.util.Arrays; >> >> public class VirtualFileChooser { >> >> public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { >> UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); >> //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); >> >> >> SwingUtilities.invokeLater(() -> { >> JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); >> >> int result = chooser.showOpenDialog(null); >> if (result == JFileChooser.APPROVE_OPTION) { >> File selectedFile = chooser.getSelectedFile(); >> System.out.println("Selected: " + selectedFile.getAbsolutePath()); >> } >> }); >> } >> >> static class VirtualFileSystemView extends FileSystemView { >> >> private final File[] roots; >> >> public VirtualFileSystemView() { >> // Create a dummy root folder >> String name = "

SWING ROCKS!!!111"; >> roots = new File[]{new File(name)}; >> } >> >> @Override >> public File createNewFolder(File containingDir) { >> >> File folder = new File(containingDir, "New Folder"); >> folder.mkdir(); >> return folder; >> } >> >> @Override >> public File[] getRoots() { >> return roots; >> } >> >> @Override >> public File getHomeDirectory() { >> return roots[0]; >> } >> >> @Override >> public File getDefaultDirectory() { >> return roots[0]; >> } >> >> @Override >> public File[] getFiles(File dir, boolean useFileHiding) { >> // Simulate a virtual folder structure >> return new File[]{ >> new File(dir, "virtualFile1.txt"), >> new File(dir, "virtualFile2.txt"), >> new File(dir, "virtualFolder") >> }; >> } >> >> @Override >> public boolean isRoot(File file) { >> return Arr... > >> Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Illegal char <<> at index 0:

SWING ROCKS!!!111 >> at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) >> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142) >> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46) >> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) >> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203) >> at java.base/java.nio.file.Path.of(Path.java:148) >> at java.base/java.nio.file.Paths.get(Paths.java:69) >> at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260) >> at java.desktop/javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:724) >> at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:242) >> at java.desktop/com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon(WindowsFileChooserUI.java:1398) >> at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1614) > > > This exception looks like a bug? I think if the file was not found then null is an expected result. > For now it can be bypassed by this: > > > import java.io.File; > import java.lang.Override; > > import javax.swing.Icon; > import javax.swing.JFileChooser; > import javax.swing.SwingUtilities; > import javax.swing.UIManager; > import javax.swing.UnsupportedLookAndFeelException; > import javax.swing.filechooser.FileSystemView; > > public class VirtualFileChooser { > > public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { > UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); > //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); > > > SwingUtilities.invokeLater(() -> { > JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); > > int result = chooser.showOpenDialog(null); > if (result == JFileChooser.APPROVE_OPTION) { > File selectedFile = chooser.getSelectedFile(); > System.out.println("Selected: " + selectedFile.getAbsolutePath()); > } > }); > } > > static class VirtualFileSystemView extends FileSystemV... Note that the bug occurs both in the list of roots (in the dropdown) and in the list of files. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2085842106 From serb at openjdk.org Tue May 13 03:44:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 03:44:53 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Thu, 8 May 2025 20:46:48 GMT, Phil Race wrote: > Moreover, it looks like as part of the "unification" the fix dropped clamping code in Robot (!) > > https://cr.openjdk.org/%7Epchelko/9/8035568/webrev.02/src/macosx/native/sun/awt/CRobot.m.udiff.html That code executed only if the current mouse position is unknown or outside of the mainscreen, that native code was moved to the java level into the CRobot class by the patch: https://cr.openjdk.org/~pchelko/9/8035568/webrev.02/src/macosx/classes/sun/lwawt/macosx/CRobot.java.sdiff.html ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2874970368 From abhiscxk at openjdk.org Tue May 13 04:00:54 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 13 May 2025 04:00:54 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux In-Reply-To: <-SBD5rSWBUqG_5ToRe8BKD3uXVo9anMyso7nlishEW8=.bf332e96-18bd-4c11-849d-e26f2fbba5fd@github.com> References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> <0IkXQzTfHKgD2Zn6NLHlFZs6jpVi2ub7Zz-K74wObFA=.f53a3a43-53ec-41cd-a95b-d264fef102f8@github.com> <-SBD5rSWBUqG_5ToRe8BKD3uXVo9anMyso7nlishEW8=.bf332e96-18bd-4c11-849d-e26f2fbba5fd@github.com> Message-ID: On Tue, 13 May 2025 02:04:35 GMT, Sergey Bylokhov wrote: > > I ran the test (**without your fix**) on Windows, Mac and Linux platform. It failed on Windows and Mac but no issues on Linux. > > Why it fails on win/mac? On Win/mac, graphic configuration return value is 1 and then there is no frame created as gc.length/2 evaluates to 0. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24752#issuecomment-2874985462 From rkannathpari at openjdk.org Tue May 13 04:54:37 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Tue, 13 May 2025 04:54:37 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v3] In-Reply-To: References: Message-ID: > Hi Reviewers, > > I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. > > Please review and let me know your suggestions. Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: Updated based on suggesion ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24501/files - new: https://git.openjdk.org/jdk/pull/24501/files/5d53c5c9..e2185a98 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=01-02 Stats: 17 lines in 1 file changed: 0 ins; 12 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/24501.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24501/head:pull/24501 PR: https://git.openjdk.org/jdk/pull/24501 From rkannathpari at openjdk.org Tue May 13 05:19:09 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Tue, 13 May 2025 05:19:09 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v4] In-Reply-To: References: Message-ID: > Hi Reviewers, > > I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. > > Please review and let me know your suggestions. Renjith Kannath Pariyangad has updated the pull request incrementally with two additional commits since the last revision: - Removed comment - Updated based on suggesion ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24501/files - new: https://git.openjdk.org/jdk/pull/24501/files/e2185a98..6f4c150b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=02-03 Stats: 81 lines in 1 file changed: 4 ins; 2 del; 75 mod Patch: https://git.openjdk.org/jdk/pull/24501.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24501/head:pull/24501 PR: https://git.openjdk.org/jdk/pull/24501 From rkannathpari at openjdk.org Tue May 13 05:19:09 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Tue, 13 May 2025 05:19:09 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic In-Reply-To: References: Message-ID: On Wed, 16 Apr 2025 19:04:57 GMT, Phil Race wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > I don't think these changes are worth doing. > What I would do is make the test completely automated. > You don't need a user to create a printerjob any more - although you did when this test was first written > Also you can print to file so you don't even need to waste paper. Thanks @prrace, @DamonGuy and @aivanov-jdk for your time and review. Based on the feedback I have removed old UI related stuff, please review and let me know your suggestion if any . ------------- PR Comment: https://git.openjdk.org/jdk/pull/24501#issuecomment-2875072016 From duke at openjdk.org Tue May 13 06:06:53 2025 From: duke at openjdk.org (duke) Date: Tue, 13 May 2025 06:06:53 GMT Subject: RFR: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object [v3] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:48:13 GMT, Daniel Gredler wrote: >> On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. >> >> See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. >> >> This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. >> >> The new test class passes on Linux, Windows and macOS. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Apply suggestions from code review > > Co-authored-by: Alexey Ivanov @gredler Your change (at version 2e37be11fefb88a6f7eee7bd4e46ff93581fbaed) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23665#issuecomment-2875153632 From aturbanov at openjdk.org Tue May 13 08:12:57 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 13 May 2025 08:12:57 GMT Subject: Integrated: 8356175: Remove unnecessary Map.get from XWM.getInsets In-Reply-To: References: Message-ID: On Sun, 27 Apr 2025 21:01:07 GMT, Andrey Turbanov wrote: > Cleanup code to use Map.putIfAbsent. It's clearer and faster. This pull request has now been integrated. Changeset: 522c7b44 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/522c7b446fef17a8400bc589c55b161e939770cc Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod 8356175: Remove unnecessary Map.get from XWM.getInsets Reviewed-by: tr, aivanov, serb ------------- PR: https://git.openjdk.org/jdk/pull/24906 From aturbanov at openjdk.org Tue May 13 08:15:32 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 13 May 2025 08:15:32 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty Message-ID: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. ------------- Commit messages: - [PATCH] Avoid redundant WeakHashMap.get to obtain old value in Toolkit Changes: https://git.openjdk.org/jdk/pull/24691/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24691&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356843 Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24691.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24691/head:pull/24691 PR: https://git.openjdk.org/jdk/pull/24691 From liach at openjdk.org Tue May 13 08:15:32 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 13 May 2025 08:15:32 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. This field is protected; need evaluation about subclass tempering. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24691#issuecomment-2810085858 From aturbanov at openjdk.org Tue May 13 08:15:32 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 13 May 2025 08:15:32 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. It's `final`. What kind of problems can be from `protected` field? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24691#issuecomment-2810188669 From serb at openjdk.org Tue May 13 08:15:32 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 08:15:32 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. looks fine ------------- PR Comment: https://git.openjdk.org/jdk/pull/24691#issuecomment-2874815079 From serb at openjdk.org Tue May 13 08:53:39 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 08:53:39 GMT Subject: RFR: 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 08:38:17 GMT, Andrey Turbanov wrote: > There is no need to call List.contains before List.remove call. > `tagSets` - is an ArrayList. looks fine ------------- PR Comment: https://git.openjdk.org/jdk/pull/24816#issuecomment-2874801400 From aturbanov at openjdk.org Tue May 13 08:53:38 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 13 May 2025 08:53:38 GMT Subject: RFR: 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet Message-ID: There is no need to call List.contains before List.remove call. `tagSets` - is an ArrayList. ------------- Commit messages: - [PATCH] Remove unnecessary List.contains key from TIFFDirectory.removeTagSet Changes: https://git.openjdk.org/jdk/pull/24816/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24816&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356846 Stats: 5 lines in 1 file changed: 0 ins; 3 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24816.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24816/head:pull/24816 PR: https://git.openjdk.org/jdk/pull/24816 From tr at openjdk.org Tue May 13 10:34:38 2025 From: tr at openjdk.org (Tejesh R) Date: Tue, 13 May 2025 10:34:38 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v2] In-Reply-To: References: Message-ID: > The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. > The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. Tejesh R has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge branch 'master' of https://git.openjdk.java.net/jdk into branch_8139228 - Fix for windows L&F - Fix + Manual test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24439/files - new: https://git.openjdk.org/jdk/pull/24439/files/7c190fe3..ebe3d910 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=00-01 Stats: 332004 lines in 3532 files changed: 111256 ins; 205570 del; 15178 mod Patch: https://git.openjdk.org/jdk/pull/24439.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24439/head:pull/24439 PR: https://git.openjdk.org/jdk/pull/24439 From dgredler at openjdk.org Tue May 13 10:41:01 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 13 May 2025 10:41:01 GMT Subject: Integrated: 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object In-Reply-To: References: Message-ID: On Mon, 17 Feb 2025 14:06:53 GMT, Daniel Gredler wrote: > On other platforms like Windows and Linux, the `\n`, `\r` and `\t` characters are ignored when drawing text to a `Graphics2D` object. On macOS this is not currently the case. > > See, for example, `CMap.getControlCodeGlyph(int, boolean)` or `RasterPrinterJob.removeControlChars(String)`. > > This bug was found while running `test/jdk/java/awt/print/PrinterJob/PrintTextTest.java` on macOS. > > The new test class passes on Linux, Windows and macOS. This pull request has now been integrated. Changeset: 85db4631 Author: Daniel Gredler Committer: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/85db4631ae5208fba74fa8b8638c32d4e42d3268 Stats: 195 lines in 2 files changed: 193 ins; 0 del; 2 mod 8350203: [macos] Newlines and tabs are not ignored when drawing text to a Graphics2D object 8353187: Test TextLayout/TestControls fails on macOS: width of 0x9, 0xa, 0xd isn't zero Reviewed-by: honkar, aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/23665 From tr at openjdk.org Tue May 13 11:04:52 2025 From: tr at openjdk.org (Tejesh R) Date: Tue, 13 May 2025 11:04:52 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v2] In-Reply-To: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> References: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> Message-ID: On Tue, 13 May 2025 03:05:32 GMT, Sergey Bylokhov wrote: >>> Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Illegal char <<> at index 0:

SWING ROCKS!!!111 >>> at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46) >>> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) >>> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203) >>> at java.base/java.nio.file.Path.of(Path.java:148) >>> at java.base/java.nio.file.Paths.get(Paths.java:69) >>> at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:724) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:242) >>> at java.desktop/com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon(WindowsFileChooserUI.java:1398) >>> at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1614) >> >> >> This exception looks like a bug? I think if the file was not found then null is an expected result. >> For now it can be bypassed by this: >> >> >> import java.io.File; >> import java.lang.Override; >> >> import javax.swing.Icon; >> import javax.swing.JFileChooser; >> import javax.swing.SwingUtilities; >> import javax.swing.UIManager; >> import javax.swing.UnsupportedLookAndFeelException; >> import javax.swing.filechooser.FileSystemView; >> >> public class VirtualFileChooser { >> >> public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { >> UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); >> //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); >> >> >> SwingUtilities.invokeLater(() -> { >> JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); >> >> int result = chooser.showOpenDialog(null); >> if (result == JFileChooser.APPROVE_OPTION) { >> File selectedFile = chooser.getSelectedFile(); >> System.out.println("Selected: " + selectedFile.getAbsolutePath()); >> } >> ... > > Note that the bug occurs both in the list of roots (in the dropdown) and in the list of files. Yes, thank you for the updated virtual test. I've updated the PR with windows L&F fix and also have updated the test too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2086548132 From aivanov at openjdk.org Tue May 13 16:28:00 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 16:28:00 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v4] In-Reply-To: References: Message-ID: <1VdMVLD7fTyAUZC0rV-0mmyZVZRbqZu1sB2Ht_C3GTk=.306c0442-4921-4ab5-841e-0033b7bd63c9@github.com> On Tue, 13 May 2025 05:19:09 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with two additional commits since the last revision: > > - Removed comment > - Updated based on suggesion Marked as reviewed by aivanov (Reviewer). test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 61: > 59: public static void main(String[] args) throws Exception { > 60: if (PrinterJob.lookupPrintServices().length == 0) { > 61: throw new RuntimeException("Printer not configured or available."); I'd leave the `main` method at the top of the file ? it describes what the test does. ------------- PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2837416278 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2087210314 From serb at openjdk.org Tue May 13 17:10:01 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 17:10:01 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID Message-ID: The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). ------------- Commit messages: - 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID Changes: https://git.openjdk.org/jdk/pull/25202/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25202&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356844 Stats: 4 lines in 1 file changed: 1 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25202.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25202/head:pull/25202 PR: https://git.openjdk.org/jdk/pull/25202 From prr at openjdk.org Tue May 13 17:45:50 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 13 May 2025 17:45:50 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID In-Reply-To: References: Message-ID: <1nMw8umDwMdNT_FZh0RETsuXUiU2PH8UxTrK0VQzxtw=.fb156f9a-892e-4a24-a5a9-2c112acdd982@github.com> On Tue, 13 May 2025 08:19:36 GMT, Sergey Bylokhov wrote: > The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25202#pullrequestreview-2837641755 From aivanov at openjdk.org Tue May 13 18:13:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 18:13:52 GMT Subject: RFR: 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 08:38:17 GMT, Andrey Turbanov wrote: > There is no need to call List.contains before List.remove call. > `tagSets` - is an ArrayList. Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24816#pullrequestreview-2837706376 From aivanov at openjdk.org Tue May 13 18:16:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 18:16:57 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24691#pullrequestreview-2837712897 From honkar at openjdk.org Tue May 13 18:24:28 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 13 May 2025 18:24:28 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 Message-ID: The following line results in unused-result warning on linux/clang. /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); There are two ways to handle it 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. ------------- Commit messages: - unused-result changes Changes: https://git.openjdk.org/jdk/pull/25217/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25217&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8354316 Stats: 7 lines in 2 files changed: 5 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25217.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25217/head:pull/25217 PR: https://git.openjdk.org/jdk/pull/25217 From honkar at openjdk.org Tue May 13 18:32:51 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 13 May 2025 18:32:51 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:19:37 GMT, Harshitha Onkar wrote: > The following line results in unused-result warning on linux/clang. > > > /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function > declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] > 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); > > > There are two ways to handle it > > 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. > > 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. > > NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. make/modules/java.desktop/lib/AwtLibraries.gmk line 281: > 279: DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \ > 280: DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \ > 281: DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \ Probably a question for build team - One thing to be noted here is that: With unused-result line removed and WITHOUT the if block changes in XToolkit.c, I expected the build to fail due to unused-result on linux/gcc but it did not. So is there any chance that this disabled warning is being added from else where for gcc ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2087413125 From aivanov at openjdk.org Tue May 13 18:29:01 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 18:29:01 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID In-Reply-To: References: Message-ID: On Tue, 13 May 2025 08:19:36 GMT, Sergey Bylokhov wrote: > The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). Changes requested by aivanov (Reviewer). src/java.desktop/share/classes/sun/print/CustomOutputBin.java line 2: > 1: /* > 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. Suggestion: * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. The year shouldn't be replaced but added. ------------- PR Review: https://git.openjdk.org/jdk/pull/25202#pullrequestreview-2837743112 PR Review Comment: https://git.openjdk.org/jdk/pull/25202#discussion_r2087407925 From aivanov at openjdk.org Tue May 13 18:38:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 18:38:52 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:30:01 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > make/modules/java.desktop/lib/AwtLibraries.gmk line 281: > >> 279: DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \ >> 280: DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \ >> 281: DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \ > > Probably a question for build team - > One thing to be noted here is that: With unused-result line removed and WITHOUT the if block changes in XToolkit.c, I expected the build to fail due to unused-result on linux/gcc but it did not. > So is there any chance that this disabled warning is being added from else where for gcc ? Maybe gcc doesn't detect this specific case. There could've been other cases which triggered the warning in gcc. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2087418018 From aivanov at openjdk.org Tue May 13 18:38:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 13 May 2025 18:38:53 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:19:37 GMT, Harshitha Onkar wrote: > The following line results in unused-result warning on linux/clang. > > > /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function > declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] > 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); > > > There are two ways to handle it > > 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. > > 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. > > NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c line 696: > 694: if (!isMainThread() && awt_pipe_inited) { > 695: if (write(AWT_WRITEPIPE, &wakeUp_char, 1) < 0) { > 696: // if block is left empty to avoid adding unused-result to Does it make sense to add a trace with `DTRACE_PRINTLN*`? It could be useful for debugging? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2087421715 From serb at openjdk.org Tue May 13 19:11:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:11:53 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/javax/sound/SoundClip.java line 61: > 59: * @throws IOException if there is an error reading from {@code file} > 60: */ > 61: public static SoundClip createSoundClip(File file) throws IOException { Can we gain any benefits by using Path instead? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087467168 From serb at openjdk.org Tue May 13 19:15:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:15:53 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/javax/sound/SoundClip.java line 63: > 61: public static SoundClip createSoundClip(File file) throws IOException { > 62: if (file == null) { > 63: throw new IllegalArgumentException("file must not be null"); Most of the APIs in javax.sound.* throw NullPointerException for null arguments and IllegalArgumentException for other invalid parameters. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087471460 From serb at openjdk.org Tue May 13 19:18:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:18:53 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/javax/sound/SoundClip.java line 78: > 76: * of this class is a no-op. > 77: */ > 78: public synchronized boolean canPlay() { Should we perhaps document the multithreaded use of Clip? Do we really need all these synchronized keywords in the file? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087475827 From serb at openjdk.org Tue May 13 19:26:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:26:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 test/jdk/javax/sound/SoundClip/SoundClipTest.java line 34: > 32: * @key sound headful > 33: * @summary basic testing of javax.sound.SoundClip > 34: * @run main/othervm SoundClipTest javasound.wav What about a non-existent or broken file? Should we check for an IOException in that case? test/jdk/javax/sound/SoundClip/SoundClipTest.java line 41: > 39: public static void main(String[] args) throws Exception { > 40: > 41: if (!isSoundcardInstalled()) { Why we cannot check that the playing sound is a no-op in this case, as specified? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087486464 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087484987 From serb at openjdk.org Tue May 13 19:34:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:34:55 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/javax/sound/SoundClip.java line 35: > 33: /** > 34: * The {@code SoundClip} class is a simple abstraction for playing a sound clip. > 35: * It will play any format that is recognized by the {@code javax.sound} API, I think we should mention in the doc that this is applicable for small audio files since we will load all data into the memory. src/java.desktop/share/classes/javax/sound/SoundClip.java line 45: > 43: * @since 25 > 44: */ > 45: public final class SoundClip { What about considering a different name, such as AudioClip with a static method like AudioClip.create(...)? or maybe Audio....Player? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087496834 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087496010 From serb at openjdk.org Tue May 13 19:49:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:49:52 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 19:09:21 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/javax/sound/SoundClip.java line 61: > >> 59: * @throws IOException if there is an error reading from {@code file} >> 60: */ >> 61: public static SoundClip createSoundClip(File file) throws IOException { > > Can we gain any benefits by using Path instead? Or maybe we can add this API to AudioSystem/clip? Old code File file = new File(file); AudioInputStream audioIn = AudioSystem.getAudioInputStream(...file...); Clip clip = AudioSystem.getClip(); clip.open(audioIn); clip.start(); new code: File file = new File(file); AudioClip clip = AudioSystem.getAudioClip(...file...); clip.play()/canPlay/loop/stop; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087508034 From serb at openjdk.org Tue May 13 19:49:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:49:52 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 19:40:09 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/javax/sound/SoundClip.java line 61: >> >>> 59: * @throws IOException if there is an error reading from {@code file} >>> 60: */ >>> 61: public static SoundClip createSoundClip(File file) throws IOException { >> >> Can we gain any benefits by using Path instead? > > Or maybe we can add this API to AudioSystem/clip? > Old code > > File file = new File(file); > AudioInputStream audioIn = AudioSystem.getAudioInputStream(...file...); > Clip clip = AudioSystem.getClip(); > clip.open(audioIn); > clip.start(); > > new code: > > File file = new File(file); > AudioClip clip = AudioSystem.getAudioClip(...file...); > clip.play()/canPlay/loop/stop; or maybe inject all these simple methods into `javax.sound.sampled.Clip` or its subclass/superclass. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087516819 From serb at openjdk.org Tue May 13 19:49:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 19:49:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 9 May 2025 20:54:46 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/javax/sound/package-info.java line 43: > 41: * @since 25 > 42: */ > 43: package javax.sound; Why javax.sound and not sampled? do we want to support midi files by SoundClip as well? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087511125 From serb at openjdk.org Tue May 13 20:35:36 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 20:35:36 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID [v2] In-Reply-To: References: Message-ID: > The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: Update src/java.desktop/share/classes/sun/print/CustomOutputBin.java Co-authored-by: Alexey Ivanov ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25202/files - new: https://git.openjdk.org/jdk/pull/25202/files/84e2364c..901a1346 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25202&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25202&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25202.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25202/head:pull/25202 PR: https://git.openjdk.org/jdk/pull/25202 From serb at openjdk.org Tue May 13 20:37:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 13 May 2025 20:37:52 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID [v2] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:26:14 GMT, Alexey Ivanov wrote: >> Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: >> >> Update src/java.desktop/share/classes/sun/print/CustomOutputBin.java >> >> Co-authored-by: Alexey Ivanov > > src/java.desktop/share/classes/sun/print/CustomOutputBin.java line 2: > >> 1: /* >> 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. > > Suggestion: > > * Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved. > > The year shouldn't be replaced but added. I keep forgetting that... Thanks a lot! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25202#discussion_r2087591306 From kizune at openjdk.org Tue May 13 20:46:37 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 13 May 2025 20:46:37 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" [v2] In-Reply-To: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: > This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision: Caching getScreenDevices() output in a local variable. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25179/files - new: https://git.openjdk.org/jdk/pull/25179/files/2d8a27f5..d7349fe0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25179&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25179&range=00-01 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25179.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25179/head:pull/25179 PR: https://git.openjdk.org/jdk/pull/25179 From kizune at openjdk.org Tue May 13 20:46:38 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 13 May 2025 20:46:38 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" [v2] In-Reply-To: References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: On Mon, 12 May 2025 23:56:45 GMT, Sergey Bylokhov wrote: >> Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision: >> >> Caching getScreenDevices() output in a local variable. > > test/jdk/java/awt/GraphicsDevice/CheckDisplayModes.java line 42: > >> 40: } >> 41: >> 42: for (GraphicsDevice graphicDevice : ge.getScreenDevices()) { > > I remember that, at least in ogl, querying/initializing devices can invalidate the list of existing devices on the fly. It might be better to call getScreenDevices only once, this could(or maybe not) increase the chances to catch the bug." Ok, storing all devices in a local array to use it in both debug output and actual resolution testing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25179#discussion_r2087601289 From prr at openjdk.org Tue May 13 20:52:50 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 13 May 2025 20:52:50 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } Looks OK. Testing passes. My only concern would have been if these are mutable, but they aren't Unless something casts to a known sub-class that is mutable, but I don't know think that is the case. ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25193#pullrequestreview-2838090850 From prr at openjdk.org Tue May 13 21:28:24 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 13 May 2025 21:28:24 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/a2da1a1c..b3cda856 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=04-05 Stats: 23 lines in 2 files changed: 20 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From swen at openjdk.org Tue May 13 22:19:56 2025 From: swen at openjdk.org (Shaojin Wen) Date: Tue, 13 May 2025 22:19:56 GMT Subject: Integrated: 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hashCode In-Reply-To: References: Message-ID: On Thu, 1 May 2025 16:16:29 GMT, Shaojin Wen wrote: > Similar to #24959 and #24971 and #24987, apple.laf.JRSUIControl and apple.laf.JRSUIState in java.desktop can also be simplified similarly. > > Replace manual bitwise operations in hashCode implementations of JRSUIControl/JRSUIState with Long::hashCode. This pull request has now been integrated. Changeset: 1bded718 Author: Shaojin Wen URL: https://git.openjdk.org/jdk/commit/1bded7188f866a61d03936a9537503b31d603dc2 Stats: 5 lines in 2 files changed: 0 ins; 1 del; 4 mod 8356605: JRSUIControl.hashCode and JRSUIState.hashCode can use Long.hashCode Reviewed-by: prr, serb ------------- PR: https://git.openjdk.org/jdk/pull/24989 From achung at openjdk.org Tue May 13 23:37:51 2025 From: achung at openjdk.org (Alisen Chung) Date: Tue, 13 May 2025 23:37:51 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" [v2] In-Reply-To: References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: On Tue, 13 May 2025 20:46:37 GMT, Alexander Zuev wrote: >> This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. > > Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision: > > Caching getScreenDevices() output in a local variable. Marked as reviewed by achung (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25179#pullrequestreview-2838339543 From mvs at openjdk.org Wed May 14 03:01:50 2025 From: mvs at openjdk.org (Manukumar V S) Date: Wed, 14 May 2025 03:01:50 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: On Wed, 7 May 2025 12:28:52 GMT, Manukumar V S wrote: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). @aivanov-jdk Any comments from your side? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2878491658 From serb at openjdk.org Wed May 14 03:04:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 03:04:51 GMT Subject: RFR: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" [v2] In-Reply-To: References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: On Tue, 13 May 2025 20:46:37 GMT, Alexander Zuev wrote: >> This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. > > Alexander Zuev has updated the pull request incrementally with one additional commit since the last revision: > > Caching getScreenDevices() output in a local variable. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25179#pullrequestreview-2838583830 From serb at openjdk.org Wed May 14 03:14:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 03:14:57 GMT Subject: RFR: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24691#pullrequestreview-2838598416 From rkannathpari at openjdk.org Wed May 14 04:07:08 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Wed, 14 May 2025 04:07:08 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v5] In-Reply-To: References: Message-ID: > Hi Reviewers, > > I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. > > Please review and let me know your suggestions. Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: Moved main fuction to top ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24501/files - new: https://git.openjdk.org/jdk/pull/24501/files/6f4c150b..2c9f9901 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=03-04 Stats: 14 lines in 1 file changed: 7 ins; 7 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24501.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24501/head:pull/24501 PR: https://git.openjdk.org/jdk/pull/24501 From serb at openjdk.org Wed May 14 04:14:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 04:14:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 21:28:24 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 131: > 129: } > 130: } catch (UnsupportedAudioFileException e) { > 131: // not an audio file This code path seems will not be (rarely) executed? The midi file will be handled above by the AudioSystem.getAudioInputStream() via SoftMidiAudioFileReader provider? But if converted midi->sampled data cannot be played via audio device then it might be useful to try MidiDevice, but I do not think it can be done by catching UnsupportedAudioFileException. src/java.desktop/share/classes/javax/sound/SoundClip.java line 93: > 91: * Each time this method is called, the clip is restarted from the beginning. > 92: */ > 93: public synchronized void play() { We might want to clarify that play() and loop() are non-blocking in terms of execution but may keep the application alive if audio threads are still running. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087964236 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087992995 From serb at openjdk.org Wed May 14 04:14:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 04:14:56 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 19:32:00 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/javax/sound/SoundClip.java line 35: > >> 33: /** >> 34: * The {@code SoundClip} class is a simple abstraction for playing a sound clip. >> 35: * It will play any format that is recognized by the {@code javax.sound} API, > > I think we should mention in the doc that this is applicable for small audio files since we will load all data into the memory. Example of memory requirement: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/javax/sound/sampled/Clip.java#L34 > src/java.desktop/share/classes/javax/sound/SoundClip.java line 45: > >> 43: * @since 25 >> 44: */ >> 45: public final class SoundClip { > > What about considering a different name, such as AudioClip with a static method like AudioClip.create(...)? or maybe Audio....Player? Could having both javax.sound.SoundClip and javax.sound.sampled.Clip cause confusion? > src/java.desktop/share/classes/javax/sound/SoundClip.java line 63: > >> 61: public static SoundClip createSoundClip(File file) throws IOException { >> 62: if (file == null) { >> 63: throw new IllegalArgumentException("file must not be null"); > > Most of the APIs in javax.sound.* throw NullPointerException for null arguments and IllegalArgumentException for other invalid parameters. it is even noticed for both subpackages, it is better to use NPE here as well: * Please note: In the {@code javax.sound.sampled.spi} APIs, a {@code null} * reference parameter to methods is incorrect unless explicitly documented on * the method as having a meaningful interpretation. Usage to the contrary is * incorrect coding and may result in a run time exception either immediately or * at some later time. {@code NullPointerException} is an example of typical and * acceptable run time exception for such cases. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 41: > >> 39: public static void main(String[] args) throws Exception { >> 40: >> 41: if (!isSoundcardInstalled()) { > > Why we cannot check that the playing sound is a no-op in this case, as specified? Why do not check this case as well? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087976970 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087986810 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087974279 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087985318 From serb at openjdk.org Wed May 14 04:25:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 04:25:52 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:36:18 GMT, Alexey Ivanov wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c line 696: > >> 694: if (!isMainThread() && awt_pipe_inited) { >> 695: if (write(AWT_WRITEPIPE, &wakeUp_char, 1) < 0) { >> 696: // if block is left empty to avoid adding unused-result to > > Does it make sense to add a trace with `DTRACE_PRINTLN*`? > > It could be useful for debugging? yes If write does not return 1 might indicate an error, it would be good to log it. so we can skip this long comment ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2088003281 From serb at openjdk.org Wed May 14 04:37:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 04:37:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 04:10:44 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/javax/sound/SoundClip.java line 93: > >> 91: * Each time this method is called, the clip is restarted from the beginning. >> 92: */ >> 93: public synchronized void play() { > > We might want to clarify that play() and loop() are non-blocking in terms of execution but may keep the application alive if audio threads are still running. And still do we want to have all of them synchronized? so the app may affect these methods by synchronized(soundClip)? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2088012769 From serb at openjdk.org Wed May 14 04:42:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 04:42:52 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 04:35:22 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/javax/sound/SoundClip.java line 93: >> >>> 91: * Each time this method is called, the clip is restarted from the beginning. >>> 92: */ >>> 93: public synchronized void play() { >> >> We might want to clarify that play() and loop() are non-blocking in terms of execution but may keep the application alive if audio threads are still running. > > And still do we want to have all of them synchronized? so the app may affect these methods by synchronized(soundClip)? > * Each time this method is called, the clip is restarted from the beginning. Note that calls within 30 ms are ignored: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java#L158 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2088016451 From kizune at openjdk.org Wed May 14 05:02:55 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Wed, 14 May 2025 05:02:55 GMT Subject: Integrated: 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" In-Reply-To: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> References: <_YE9ifFDv0XSJfwJXoX-TkY9OLaXlD1d7NkQWxiTJsU=.5aaa2457-1dce-4d95-be85-1e78dbb46a89@github.com> Message-ID: On Mon, 12 May 2025 10:18:13 GMT, Alexander Zuev wrote: > This test fails intermittently, sometimes it does not fail in half a year so i was unable to catch it myself to do any reasonable debugging. In this pull request I am adding debug output to understand at least what graphics device is connected to the test machine and which graphics mode on which device gives us problem. Next time test fails we will at least have some hint on what's going on. This pull request has now been integrated. Changeset: e07c65b8 Author: Alexander Zuev URL: https://git.openjdk.org/jdk/commit/e07c65b892ecb02d6b52877508131de3a2067e23 Stats: 14 lines in 1 file changed: 12 ins; 0 del; 2 mod 8323545: java/awt/GraphicsDevice/CheckDisplayModes.java fails with "exit code: 133" Reviewed-by: achung, serb ------------- PR: https://git.openjdk.org/jdk/pull/25179 From ihse at openjdk.org Wed May 14 06:35:56 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 14 May 2025 06:35:56 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: <12he4bTHjyqUILsl4m4lQOE7_dSLFWMgcx7812qaoZY=.f0bc7143-3bc0-432f-8a51-2bacade3e9a6@github.com> On Tue, 13 May 2025 00:10:50 GMT, Sergey Bylokhov wrote: >> A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. >> >> While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. >> >> I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. > > src/demo/share/jfc/CodePointIM/README.html line 5: > >> 3: >> 4: README - CodePointIM >> 5: > > I believe this line is equivalent to simple `` which is widely used in java.desktop's docs. That seems reasonable, yes. However, I'd like to keep this change to the absolute minimum. Feel free to open a separate issue for fixing this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25148#discussion_r2088152886 From ihse at openjdk.org Wed May 14 06:35:57 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 14 May 2025 06:35:57 GMT Subject: Integrated: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> Message-ID: <1uf8Qu09x2byR-S1kMvt4zMdBu_BKZHCvx13v-uaxYc=.9e974fe5-0125-4001-99f6-acbba3ea517d@github.com> On Fri, 9 May 2025 14:14:57 GMT, Magnus Ihse Bursie wrote: > A handful of html and xml files in the JDK source tree claims to have encodings like `ISO-8859-1`, when they are in fact pure US-ASCII files. > > While perhaps technically correct, this is misleading, and goes contrary to the efforts of turning the source code into UTF-8 proper. > > I chose between marking them as "ASCII" and "UTF-8", but chose the latter, since otherwise if they ever were to be updated with a non-ASCII character, the value would have been unspecified, and after JDK-8301971, all files in the JDK repository will be interpreted as UTF-8. This pull request has now been integrated. Changeset: dd251599 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/dd2515993bf76f424e4c56d529ae1541f55e3f8b Stats: 794 lines in 53 files changed: 2 ins; 9 del; 783 mod 8356644: Update encoding declaration to UTF-8 Reviewed-by: prr, naoto ------------- PR: https://git.openjdk.org/jdk/pull/25148 From serb at openjdk.org Wed May 14 06:52:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 06:52:55 GMT Subject: RFR: 8356644: Update encoding declaration to UTF-8 In-Reply-To: <12he4bTHjyqUILsl4m4lQOE7_dSLFWMgcx7812qaoZY=.f0bc7143-3bc0-432f-8a51-2bacade3e9a6@github.com> References: <8loaLnxoQ6Om5EqhX9_nORypM5UjgVz3DYJnMinZ77w=.bd323a79-0fd6-4b16-8edb-193fec7fbb13@github.com> <12he4bTHjyqUILsl4m4lQOE7_dSLFWMgcx7812qaoZY=.f0bc7143-3bc0-432f-8a51-2bacade3e9a6@github.com> Message-ID: On Wed, 14 May 2025 06:32:30 GMT, Magnus Ihse Bursie wrote: > That seems reasonable, yes. However, I'd like to keep this change to the absolute minimum. Feel free to open a separate issue for fixing this. FIled: https://bugs.openjdk.org/browse/JDK-8356937 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25148#discussion_r2088181402 From dgredler at openjdk.org Wed May 14 07:42:50 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 14 May 2025 07:42:50 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Tue, 13 May 2025 20:49:59 GMT, Phil Race wrote: > Looks OK. Testing passes. My only concern would have been if these are mutable, but they aren't Unless something casts to a known sub-class that is mutable, but I don't know think that is the case. It doesn't look like it, but let me know if you'd like me to make `ExtendedTextSourceLabel` final and make all the instance variables private, just to tighten things up. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25193#issuecomment-2879071641 From jwaters at openjdk.org Wed May 14 11:31:59 2025 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 14 May 2025 11:31:59 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: References: Message-ID: On Wed, 23 Oct 2024 05:07:37 GMT, Julian Waters wrote: > After 8339120, gcc began catching many different instances of unused code in the Windows specific codebase. Some of these seem to be bugs. I've taken the effort to mark out all the relevant globals and locals that trigger the unused warnings and addressed all of them by commenting out the code as appropriate. I am confident that in many cases this simplistic approach of commenting out code does not fix the underlying issue, and the warning actually found a bug that should be fixed. In these instances, I will be aiming to fix these bugs with help from reviewers, so I recommend anyone reviewing who knows more about the code than I do to see whether there is indeed a bug that needs fixing in a different way than what I did > > build.log on release configuration: > > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp:3560:39: warning: '_VKS_ALT_MASK' defined but not used [-Wunused-const-variable=] > 3560 | static const UINT _VKS_ALT_MASK = 0x04; > | ^~~~~~~~~~~~~ > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp: In member function 'void CSegTable::MakeTable()': > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp:1361:14: warning: typedef 'PSUBTABLE' locally defined but not used [-Wunused-local-typedefs] > 1361 | } SUBTABLE, *PSUBTABLE; > | ^~~~~~~~~ > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp: In member function 'virtual void CEUDCSegTable::Create(LPCWSTR)': > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp:1588:10: warning: typedef 'PHEAD' locally defined but not used [-Wunused-local-typedefs] > 1588 | } HEAD, *PHEAD; > | ^~~~~ > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp:1595:11: warning: typedef 'PENTRY' locally defined but not used [-Wunused-local-typedefs] > 1595 | } ENTRY, *PENTRY; > | ^~~~~~ > C:/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/src/java.desktop/windows/... Keep open ------------- PR Comment: https://git.openjdk.org/jdk/pull/21655#issuecomment-2879835298 From aivanov at openjdk.org Wed May 14 12:11:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 14 May 2025 12:11:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 03:46:37 GMT, Sergey Bylokhov wrote: >> src/java.desktop/share/classes/javax/sound/SoundClip.java line 63: >> >>> 61: public static SoundClip createSoundClip(File file) throws IOException { >>> 62: if (file == null) { >>> 63: throw new IllegalArgumentException("file must not be null"); >> >> Most of the APIs in javax.sound.* throw NullPointerException for null arguments and IllegalArgumentException for other invalid parameters. > > it is even noticed for both subpackages, it is better to use NPE here as well: > > * Please note: In the {@code javax.sound.sampled.spi} APIs, a {@code null} > * reference parameter to methods is incorrect unless explicitly documented on > * the method as having a meaningful interpretation. Usage to the contrary is > * incorrect coding and may result in a run time exception either immediately or > * at some later time. {@code NullPointerException} is an example of typical and > * acceptable run time exception for such cases. I still think `IllegalArgumentException` is better and clearer if we check the value of the parameter before proceeding to doing anything with the parameter and bail out if the parameter has an invalid value. `NullPointerException`, on the other hand, indicates the code accessed an object but the reference was `null`. (This could occur, for example, if parameters aren't validated.) Although both exception indicate a coding error, they have different semantics. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2088789154 From ihse at openjdk.org Wed May 14 14:28:10 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 14 May 2025 14:28:10 GMT Subject: RFR: 8356977: UTF-8 cleanups Message-ID: I found a few other places in the code that can be cleaned up after the conversion to UTF-8. ------------- Commit messages: - Replace uncessary unicode characters with ASCII in instructions, and fix typo - Seems like typos in the comments - Fix unicode sequences in comments (previously missed) Changes: https://git.openjdk.org/jdk/pull/25228/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25228&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356977 Stats: 21 lines in 16 files changed: 0 ins; 0 del; 21 mod Patch: https://git.openjdk.org/jdk/pull/25228.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25228/head:pull/25228 PR: https://git.openjdk.org/jdk/pull/25228 From ihse at openjdk.org Wed May 14 14:34:37 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 14 May 2025 14:34:37 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 Message-ID: After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. ------------- Commit messages: - 8356978: Convert unicode sequences in Java source code to UTF-8 Changes: https://git.openjdk.org/jdk/pull/25229/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25229&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356978 Stats: 9616 lines in 90 files changed: 0 ins; 0 del; 9616 mod Patch: https://git.openjdk.org/jdk/pull/25229.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25229/head:pull/25229 PR: https://git.openjdk.org/jdk/pull/25229 From ihse at openjdk.org Wed May 14 15:16:18 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 14 May 2025 15:16:18 GMT Subject: RFR: 8356980: Better handling of non-breaking space Message-ID: Non-breaking space characters are problematic. They look identical to the normal space character, but is not. For that reason, it should never be typed as an UTF-8 literal, but only by using unicode sequences. I have checked: * U+00A0 NO-BREAK SPACE (NBSP) * U+202F NARROW NO-BREAK SPACE (NNBSP) * U+2007 FIGURE SPACE * U+2060 WORD JOINER In some places, these character were used when an ordinary space should have been used. I replaced those with normal space. In other places, they were correct, but as literals instead of unicode sequences. I replaced those instances with sequences. ------------- Commit messages: - Use sequences for valid nbsp usage - Remove mistaken nbsp Changes: https://git.openjdk.org/jdk/pull/25234/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25234&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356980 Stats: 36 lines in 8 files changed: 0 ins; 2 del; 34 mod Patch: https://git.openjdk.org/jdk/pull/25234.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25234/head:pull/25234 PR: https://git.openjdk.org/jdk/pull/25234 From prr at openjdk.org Wed May 14 17:01:55 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 14 May 2025 17:01:55 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: Message-ID: On Wed, 14 May 2025 15:11:24 GMT, Magnus Ihse Bursie wrote: > Non-breaking space characters are problematic. They look identical to the normal space character, but is not. For that reason, it should never be typed as an UTF-8 literal, but only by using unicode sequences. > > I have checked: > * U+00A0 NO-BREAK SPACE (NBSP) > * U+202F NARROW NO-BREAK SPACE (NNBSP) > * U+2007 FIGURE SPACE > * U+2060 WORD JOINER > > In some places, these character were used when an ordinary space should have been used. I replaced those with normal space. In other places, they were correct, but as literals instead of unicode sequences. I replaced those instances with sequences. src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties line 39: > 37: GTKColorChooserPanel.hue.textAndMnemonic=&Teinte : > 38: > 39: GTKColorChooserPanel.red.textAndMnemonic=Roug&e\u00a0: So, this exactly reverses what was done in the fix for https://bugs.openjdk.org/browse/JDK-8301991 But I think you know that .. since you commented on the PR The fix was done by @justin-curtis-lu and reviewed by @naotoj so I think I'd like to get their opinion on this ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2089371921 From prr at openjdk.org Wed May 14 17:12:52 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 14 May 2025 17:12:52 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Wed, 14 May 2025 07:40:07 GMT, Daniel Gredler wrote: > > Looks OK. Testing passes. My only concern would have been if these are mutable, but they aren't Unless something casts to a known sub-class that is mutable, but I don't know think that is the case. > > It doesn't look like it, but let me know if you'd like me to make `ExtendedTextSourceLabel` final and make all the instance variables private, just to tighten things up. I don't think we need to do that. If it is done, a separate clean up PR would be better rather than adding it in here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25193#issuecomment-2880960222 From jlu at openjdk.org Wed May 14 17:21:54 2025 From: jlu at openjdk.org (Justin Lu) Date: Wed, 14 May 2025 17:21:54 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: Message-ID: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> On Wed, 14 May 2025 16:59:23 GMT, Phil Race wrote: >> Non-breaking space characters are problematic. They look identical to the normal space character, but is not. For that reason, it should never be typed as an UTF-8 literal, but only by using unicode sequences. >> >> I have checked: >> * U+00A0 NO-BREAK SPACE (NBSP) >> * U+202F NARROW NO-BREAK SPACE (NNBSP) >> * U+2007 FIGURE SPACE >> * U+2060 WORD JOINER >> >> In some places, these character were used when an ordinary space should have been used. I replaced those with normal space. In other places, they were correct, but as literals instead of unicode sequences. I replaced those instances with sequences. > > src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties line 39: > >> 37: GTKColorChooserPanel.hue.textAndMnemonic=&Teinte : >> 38: >> 39: GTKColorChooserPanel.red.textAndMnemonic=Roug&e\u00a0: > > So, this exactly reverses what was done in the fix for https://bugs.openjdk.org/browse/JDK-8301991 > But I think you know that .. since you commented on the PR > > The fix was done by @justin-curtis-lu and reviewed by > @naotoj so I think I'd like to get their opinion on this For the l10n files, they are synced by the translation team and we don't edit them. IMO, I think it's fine leaving those ones as is. Especially because language rules can cause different spacing and punctuation characters, so generally we don't ensure translations are equivalent to the original file's value in that regard. (So viewing them as a Unicode escape sequence vs UTF-8 literal may not bring much benefit.) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2089399946 From naoto at openjdk.org Wed May 14 17:36:51 2025 From: naoto at openjdk.org (Naoto Sato) Date: Wed, 14 May 2025 17:36:51 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: On Wed, 14 May 2025 17:18:35 GMT, Justin Lu wrote: >> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties line 39: >> >>> 37: GTKColorChooserPanel.hue.textAndMnemonic=&Teinte : >>> 38: >>> 39: GTKColorChooserPanel.red.textAndMnemonic=Roug&e\u00a0: >> >> So, this exactly reverses what was done in the fix for https://bugs.openjdk.org/browse/JDK-8301991 >> But I think you know that .. since you commented on the PR >> >> The fix was done by @justin-curtis-lu and reviewed by >> @naotoj so I think I'd like to get their opinion on this > > For the l10n files, they are synced by the translation team and we don't edit them. IMO, I think it's fine leaving those ones as is. Especially because language rules can cause different spacing and punctuation characters, so generally we don't ensure translations are equivalent to the original file's value in that regard. (So viewing them as a Unicode escape sequence vs UTF-8 literal may not bring much benefit.) I believe it is OK to leave these as UTF-8 native characters, as these files are l10n resource bundles. If we wanted to replace those look-alike spaces to unicode escapes, other characters may also need the same treatment, such as hyphen-minus, quotations, etc. In fact there are lot more look alikes defined in the unicode consortium (https://www.unicode.org/Public/security/latest/confusables.txt), and I don't think we would want to convert them. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2089424644 From dgredler at openjdk.org Wed May 14 17:50:08 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 14 May 2025 17:50:08 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 Message-ID: If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. ------------- Commit messages: - Handle ignorable whitespace correctly with Type1 fonts Changes: https://git.openjdk.org/jdk/pull/25235/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25235&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356966 Stats: 16 lines in 2 files changed: 8 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/25235.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25235/head:pull/25235 PR: https://git.openjdk.org/jdk/pull/25235 From serb at openjdk.org Wed May 14 18:36:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 18:36:55 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 12:09:16 GMT, Alexey Ivanov wrote: >> it is even noticed for both subpackages, it is better to use NPE here as well: >> >> * Please note: In the {@code javax.sound.sampled.spi} APIs, a {@code null} >> * reference parameter to methods is incorrect unless explicitly documented on >> * the method as having a meaningful interpretation. Usage to the contrary is >> * incorrect coding and may result in a run time exception either immediately or >> * at some later time. {@code NullPointerException} is an example of typical and >> * acceptable run time exception for such cases. > > I still think `IllegalArgumentException` is better and clearer if we check the value of the parameter before proceeding to doing anything with the parameter and bail out if the parameter has an invalid value. > > `NullPointerException`, on the other hand, indicates the code accessed an object but the reference was `null`. (This could occur, for example, if parameters aren't validated.) > > Although both exception indicate a coding error, they have different semantics. I respectfully disagree for a few reasons: > NullPointerException, on the other hand, indicates the code accessed an object but the reference was null. (This could occur, for example, if parameters aren't validated.) Implementation and documentation of Objects.requireNonNull including its use in our codebase and in newly added code suggests that it is intended for validating parameters before dereferencing them. This contradicts the strict separation you're implying. Additionally as I mentioned earlier the javax.sound.** code already uses npe for null parameter checks. Introducing a mix of exception styles would reduce consistency. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2089520351 From achung at openjdk.org Wed May 14 18:50:57 2025 From: achung at openjdk.org (Alisen Chung) Date: Wed, 14 May 2025 18:50:57 GMT Subject: Integrated: 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code In-Reply-To: References: Message-ID: On Fri, 25 Apr 2025 19:49:02 GMT, Alisen Chung wrote: > Test was failing on Ubuntu, looks to be a synchronous error in the test so I rewrote it to improve stability. This pull request has now been integrated. Changeset: e91088a9 Author: Alisen Chung URL: https://git.openjdk.org/jdk/commit/e91088a9e8193b81a1de82d48effd8c8c0f3b45d Stats: 5 lines in 1 file changed: 1 ins; 1 del; 3 mod 8343739: Test java/awt/event/KeyEvent/ExtendedKeyCode/ExtendedKeyCodeTest.java failed: Wrong extended key code Reviewed-by: serb, prr ------------- PR: https://git.openjdk.org/jdk/pull/24885 From honkar at openjdk.org Wed May 14 20:41:55 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 14 May 2025 20:41:55 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 17:45:54 GMT, Daniel Gredler wrote: > If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. > > This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. > > It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. Since this issue specifically occurs on some flavors of linux (RHEL,SLES) I wasn't able verify the fix. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 126: > 124: .replace("\t", "\\t"); > 125: String msg = String.format("for text '%s' with font '%s': %s != %s", > 126: escaped, font.getName(), r1.toString(), r2.toString()); Suggestion: you could get more details about the font using font.toString() or font.getAttributes() ------------- PR Review: https://git.openjdk.org/jdk/pull/25235#pullrequestreview-2841436270 PR Review Comment: https://git.openjdk.org/jdk/pull/25235#discussion_r2089697980 From honkar at openjdk.org Wed May 14 21:28:37 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 14 May 2025 21:28:37 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: References: Message-ID: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> > The following line results in unused-result warning on linux/clang. > > > /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function > declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] > 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); > > > There are two ways to handle it > > 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. > > > There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html > > > 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. > > NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: DTRACE added ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25217/files - new: https://git.openjdk.org/jdk/pull/25217/files/f1172662..91f3d409 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25217&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25217&range=00-01 Stats: 4 lines in 1 file changed: 0 ins; 3 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25217.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25217/head:pull/25217 PR: https://git.openjdk.org/jdk/pull/25217 From honkar at openjdk.org Wed May 14 21:28:37 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 14 May 2025 21:28:37 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 04:23:18 GMT, Sergey Bylokhov wrote: >> src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c line 696: >> >>> 694: if (!isMainThread() && awt_pipe_inited) { >>> 695: if (write(AWT_WRITEPIPE, &wakeUp_char, 1) < 0) { >>> 696: // if block is left empty to avoid adding unused-result to >> >> Does it make sense to add a trace with `DTRACE_PRINTLN*`? >> >> It could be useful for debugging? > > yes If write does not return 1 might indicate an error, it would be good to log it. so we can skip this long comment Updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2089778602 From dgredler at openjdk.org Wed May 14 21:40:47 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 14 May 2025 21:40:47 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: > If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. > > This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. > > It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Include additional font information in message ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25235/files - new: https://git.openjdk.org/jdk/pull/25235/files/2c118da5..13130c4c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25235&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25235&range=00-01 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25235.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25235/head:pull/25235 PR: https://git.openjdk.org/jdk/pull/25235 From dgredler at openjdk.org Wed May 14 21:40:48 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 14 May 2025 21:40:48 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 20:38:47 GMT, Harshitha Onkar wrote: > I wasn't able replicate and verify the fix myself as I don't have specific linux flavors (RHEL,SLES) to test it . I had to build in a clean SUSE Docker image (`registry.suse.com/suse/sle15:15.3`). Here are my notes on the steps required, if you want to try to replicate (you'll want to adjust the git repo / branch, I think): zypper in -y wget wget https://download.java.net/java/GA/jdk24.0.1/24a58e0e276943138bf3e963e6291ac2/9/GPL/openjdk-24.0.1_linux-x64_bin.tar.gz zypper in -y tar zypper in -y gzip tar -xvzf openjdk-24.0.1_linux-x64_bin.tar.gz wget https://builds.shipilev.net/jtreg/jtreg-7.5.1%2B1.zip zypper in -y unzip unzip jtreg-7.5.1+1.zip zypper in -y git git clone https://github.com/gredler/jdk.git cd jdk git checkout ignored-whitespace zypper in -y autoconf make awk zip gcc11 gcc11-c++ alsa-devel cups-devel fontconfig-devel update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20 update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-11 20 zypper in -y libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel bash configure --with-boot-jdk=/jdk-24.0.1 --with-jtreg=/jtreg make images ../jtreg/bin/jtreg -jdk:build/linux-x86_64-server-release/images/jdk/ -w build/jtreg/work -r build/jtreg/report -verbose:all test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java >> java.lang.RuntimeException: Fontconfig head is null, check your fonts or fonts configuration zypper in -y ghostscript-fonts-std fc-list ../jtreg/bin/jtreg -jdk:build/linux-x86_64-server-release/images/jdk/ -w build/jtreg/work -r build/jtreg/report -verbose:all test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2881641220 From serb at openjdk.org Wed May 14 22:18:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 14 May 2025 22:18:52 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: <0uH-6ZiwZcJSccs_3Fjwh7OiHRO-PJCisDiv8Dyju8c=.22ee3992-431d-4a1d-a9e0-74dac955b6a5@github.com> On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c line 695: > 693: static char wakeUp_char = 'p'; > 694: if (!isMainThread() && awt_pipe_inited) { > 695: if (write(AWT_WRITEPIPE, &wakeUp_char, 1) < 0) { No strong preference between write() < 0, < 1, or != 1, it depends on how strict we want to be. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2089843696 From duke at openjdk.org Wed May 14 23:12:57 2025 From: duke at openjdk.org (Jeremy Wood) Date: Wed, 14 May 2025 23:12:57 GMT Subject: Withdrawn: 8356137: GifImageDecode can produce opaque image when disposal method changes In-Reply-To: References: Message-ID: On Mon, 5 May 2025 17:07:11 GMT, Jeremy Wood wrote: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Wed May 14 23:12:56 2025 From: duke at openjdk.org (Jeremy Wood) Date: Wed, 14 May 2025 23:12:56 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v3] In-Reply-To: References: Message-ID: <0-nDWHrDL6PXZdjMaAc4kGSAwS0S72_LDnvCDcmluN8=.fd91595d-d767-4b6e-9656-2b44899f1909@github.com> On Wed, 7 May 2025 02:58:01 GMT, Jeremy Wood wrote: >> This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: >> >> 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") >> 2. The transparent pixel is non-zero >> 3. There's more than one such consecutive frame >> >> Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. > > Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: > > - 8356120: updating (c) year > - 8356137: cleaning up error message Closing for now; I want to focus on one PR at a time. I can reopen this after #25076 . ------------- PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2881794176 From serb at openjdk.org Thu May 15 00:09:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 15 May 2025 00:09:52 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2841767253 From duke at openjdk.org Thu May 15 00:31:31 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 00:31:31 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v4] In-Reply-To: References: Message-ID: <5Cr3SzVTw-FqqDTWkLhpzGww0_9bqgK5iapQMLMz924=.c63779b6-9b17-4f30-a17e-e97d87761c44@github.com> > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. Jeremy Wood has updated the pull request incrementally with five additional commits since the last revision: - 8356137: readding transparency check at (20, 20) - GifComparison: fixing error message - GifComparison: code cleanup - 8356137: change package to access GifComparison - GifComparison: adding common helper class for gif bugs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/c7072231..cfa679a8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=02-03 Stats: 590 lines in 4 files changed: 452 ins; 138 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Thu May 15 00:31:31 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 00:31:31 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v3] In-Reply-To: References: Message-ID: <1migULIogbSlLq8wO6M6kODyynhbkowNqMYSQvzsQ4w=.3339b4b7-00ea-4812-b0fa-c4edf60830a2@github.com> On Wed, 7 May 2025 02:58:01 GMT, Jeremy Wood wrote: >> This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: >> >> 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") >> 2. The transparent pixel is non-zero >> 3. There's more than one such consecutive frame >> >> Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. > > Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: > > - 8356120: updating (c) year > - 8356137: cleaning up error message Reopening: I think this PR should come first. I have a set of 4 tickets related to GIF problems (8356137, 8356320, 8351913, and one TBD based on incident 9078482). I wrote a helper class GifComparison that all 4 PR's can use. It compares the output of the AWT-based parser with the ImageIO parser, and it fails if there's any deviation. Once the GIfComparison clears code review the others PRs will be only a few lines of code. This PR can pass in isolation. The PR for the TBD bug can pass in isolation, but it's blocked by triage (for now). The PR for 8356320 relies on the TBD bug to pass. The PR for 8351913 can pass in isolation, but I want to save that for last because of [this comment](https://github.com/openjdk/jdk/pull/24271#issuecomment-2831430009) With all 4 PRs merged: I've scanned over 100 modern gifs from popular websites (like giphy, pixabay) and found the ToolkitImage renderer to be identical to ImageIO's renderer. (And I've visually inspected most of those results, too.) So I don't anticipate adding to this set of 4 issues. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2881889090 From duke at openjdk.org Thu May 15 00:33:19 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 00:33:19 GMT Subject: RFR: 8356320: GifImageDecoder can produce wrong image when GCE changes transparent pixel index In-Reply-To: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> References: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> Message-ID: On Wed, 7 May 2025 02:55:12 GMT, Jeremy Wood wrote: > When a gif frame's disposal code is DISPOSAL_BGCOLOR and we're maintaining a saved image: we have to flood-fill the frame's bounds. And if the transparent pixel index changes across frames: we could sometimes flood fill the wrong value, resulting in an opaque rectangle in the output image. > > (I know this looks similar to https://github.com/openjdk/jdk/pull/25044 , but if you look at the data structure of the sample gifs: they are separate problems with separate solutions.) Closing temporarily. As noted [here](https://github.com/openjdk/jdk/pull/25044#issuecomment-2881889090): this new test case is blocked. Once incident report 9078482 clears: I can make a PR for that new ticket. Once that ticket is merged: this test will pass. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25076#issuecomment-2881892650 From duke at openjdk.org Thu May 15 00:33:19 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 00:33:19 GMT Subject: Withdrawn: 8356320: GifImageDecoder can produce wrong image when GCE changes transparent pixel index In-Reply-To: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> References: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> Message-ID: On Wed, 7 May 2025 02:55:12 GMT, Jeremy Wood wrote: > When a gif frame's disposal code is DISPOSAL_BGCOLOR and we're maintaining a saved image: we have to flood-fill the frame's bounds. And if the transparent pixel index changes across frames: we could sometimes flood fill the wrong value, resulting in an opaque rectangle in the output image. > > (I know this looks similar to https://github.com/openjdk/jdk/pull/25044 , but if you look at the data structure of the sample gifs: they are separate problems with separate solutions.) This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25076 From duke at openjdk.org Thu May 15 00:33:19 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 00:33:19 GMT Subject: RFR: 8356320: GifImageDecoder can produce wrong image when GCE changes transparent pixel index [v2] In-Reply-To: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> References: <3RTnzdT8-vrt_0nq19kYPZh0-zexouw2d3FjxNY2R5Q=.53abc5a2-b5d9-4386-9c8d-36f2677dfccc@github.com> Message-ID: > When a gif frame's disposal code is DISPOSAL_BGCOLOR and we're maintaining a saved image: we have to flood-fill the frame's bounds. And if the transparent pixel index changes across frames: we could sometimes flood fill the wrong value, resulting in an opaque rectangle in the output image. > > (I know this looks similar to https://github.com/openjdk/jdk/pull/25044 , but if you look at the data structure of the sample gifs: they are separate problems with separate solutions.) Jeremy Wood has updated the pull request incrementally with five additional commits since the last revision: - 8356320: fixing copy & paste typo - GifComparison: fixing error message - GifComparison: code cleanup - 8356320: change package to access GifComparison - GifComparison: adding common helper class for gif bugs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25076/files - new: https://git.openjdk.org/jdk/pull/25076/files/da529dcd..178c006f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25076&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25076&range=00-01 Stats: 586 lines in 4 files changed: 447 ins; 139 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25076.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25076/head:pull/25076 PR: https://git.openjdk.org/jdk/pull/25076 From serb at openjdk.org Thu May 15 02:21:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 15 May 2025 02:21:57 GMT Subject: RFR: 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet In-Reply-To: References: Message-ID: On Wed, 23 Apr 2025 08:38:17 GMT, Andrey Turbanov wrote: > There is no need to call List.contains before List.remove call. > `tagSets` - is an ArrayList. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24816#pullrequestreview-2841983842 From serb at openjdk.org Thu May 15 02:27:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 15 May 2025 02:27:50 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: On Wed, 14 May 2025 17:34:45 GMT, Naoto Sato wrote: >> For the l10n files, they are synced by the translation team and we don't edit them. IMO, I think it's fine leaving those ones as is. Especially because language rules can cause different spacing and punctuation characters, so generally we don't ensure translations are equivalent to the original file's value in that regard. (So viewing them as a Unicode escape sequence vs UTF-8 literal may not bring much benefit.) > > I believe it is OK to leave these as UTF-8 native characters, as these files are l10n resource bundles. If we wanted to replace those look-alike spaces to unicode escapes, other characters may also need the same treatment, such as hyphen-minus, quotations, etc. In fact there are lot more look alikes defined in the unicode consortium (https://www.unicode.org/Public/security/latest/confusables.txt), and I don't think we would want to convert them. maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2090083320 From serb at openjdk.org Thu May 15 02:30:59 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 15 May 2025 02:30:59 GMT Subject: RFR: 8355203: [macos] AquaButtonUI and AquaRootPaneUI repaint default button unnecessarily In-Reply-To: References: <9ok7x8AADpGFkVPORr8UGxQeNb3l-5fyjngxBuQc-aY=.e0207e50-b7db-403a-8c76-7626b6b4e10e@github.com> Message-ID: On Mon, 21 Apr 2025 21:09:44 GMT, Jeremy Wood wrote: >> Just to confirm, have you checked that the default button pulse has been disabled since macOS Yosemite? > >> have you checked that the default button pulse has been disabled since macOS Yosemite > > No; I'm not sure how to check that with 100% certainty. Does anyone know of a resource to confirm how older Mac UI's looked? (I don't have access to a Mavericks machine (which should pulse) or a Yosemite machine (which should not pulse).) > > Wikipedia says the pulsing was discontinued with Yosemite: > > image > > I can find old videos featuring a non-pulsing default button. Here's one from 2015: > > https://www.youtube.com/watch?v=tzgP3YwGwRw @mickleness please take a look https://bugs.openjdk.org/browse/JDK-8356061 ------------- PR Comment: https://git.openjdk.org/jdk/pull/24778#issuecomment-2882033393 From davidalayachew at gmail.com Thu May 15 03:01:25 2025 From: davidalayachew at gmail.com (David Alayachew) Date: Wed, 14 May 2025 23:01:25 -0400 Subject: [External] : Re: Windows Magnifier does not work with my Swing applications In-Reply-To: References: Message-ID: Hey, any updates on this? I understand if not, but accessibility in Swing is important to me, even more so for the abovementioned reasons. On Tue, Feb 11, 2025 at 5:52?AM David Alayachew wrote: > And thank you. > > On Tue, Feb 11, 2025, 12:50?AM Abhishek Kumar < > abhishek.cx.kumar at oracle.com> wrote: > >> Hello David, >> >> >> >> Yeah, I will evaluate if existing JDK implementation can be extended to >> work with Windows Magnifier. I didn?t get enough time to look into this >> issue due to other issues but this is on my to-do list. I will update my >> findings on JBS after my analysis. >> >> >> >> Thank you for your patience. >> >> >> >> Regards, >> >> Abhishek >> >> >> >> *From: *David Alayachew >> *Date: *Tuesday, 11 February 2025 at 4:39?AM >> *To: *Philip Race >> *Cc: *Abhishek Kumar , >> client-libs-dev at openjdk.org >> *Subject: *[External] : Re: Windows Magnifier does not work with my >> Swing applications >> >> Ok, ty vm. Hey Abhishek, any updates? >> >> >> >> On Mon, Feb 10, 2025, 5:50?PM Philip Race wrote: >> >> I think I asked Abhishek to take a look. >> >> -phil. >> >> On 2/10/25 2:41 PM, David Alayachew wrote: >> >> Poke. >> >> Any new info? >> >> >> >> On Fri, Jan 17, 2025, 8:05?AM David Alayachew >> wrote: >> >> Hello Phil, >> >> Did you get any more info about this issue? >> >> >> >> On Tue, Dec 17, 2024, 11:58?AM David Alayachew >> wrote: >> >> Thanks Phil. >> >> >> >> Yeah, I am A-OK as long as this something that is looked into and the JBS >> Bug Report is updated with the findings. If this isn't too bad, this would >> be a solid inclusion. But if it's not worth the effort, I just want the JBS >> to be updated, and then I can put that as an answer for my StackOverflow >> post. >> >> >> >> Thanks again for taking a look into this. >> >> >> >> On Tue, Dec 17, 2024 at 11:56?AM Philip Race >> wrote: >> >> Perhaps .. if it is an easy fix but I do not know the specifics and the >> evaluator of that bug wrote >> "the magnifier cannot receive PropertyChangeEvents from Swing. This is a >> limitation in the Window magnifier. >> The Windows magnifier could be modified by Microsoft to receive such >> events but the work would need to be done by Microsoft." >> >> then went on to add that other magnifiers do work .. >> >> I also don't know how tied in this would be to implementing support for >> the Windows Accessibility API. >> >> Swing apps today use something called JavaAccessBridge and there are >> screen readers out there that support it. >> >> It would be good to have another look at this specific issue, but I can't >> make any promises. >> >> -phil. >> >> On 12/15/24 1:04 PM, David Alayachew wrote: >> >> Hello Client Libs Dev Team, >> >> >> >> My eyesite has started to deteriorate significantly, so I have been using >> the built-in Accessibility tool called Windows (Screen) Magnifier >> (available since Windows XP at least). It zooms in and out of the screen by >> pressing the Windows Key and (+) or (-). >> >> >> >> This works great because, as I type stuff, the magnifier will follow my >> text, so that I don't have to keep manually moving the magnifier whenever >> what I type inevitably ends up off-screen (off-view?). >> >> >> >> This feature works great for basically every other application I have, >> except my Swing apps. I make a lot of Swing apps, and I use a bunch too. >> And this Magnifier feature that follows text does not work for any of the >> ones I have tried. >> >> >> >> This feature does work on basically every other application I have. To >> name a few. >> >> >> >> * Notepad++ >> >> * WordPad >> >> * Firefox >> >> * Git Bash >> >> >> >> Here is a Bug Report referring to this problem. >> >> >> >> https://bugs.openjdk.org/browse/JDK-5079680 >> >> >> >> The resolution was listed as "Future Project". Any chance that the future >> can be now? >> >> >> >> I know that Swing is largely in maintenance mode, but if this were to get >> added, practically ALL Swing apps would receive a significant boost in >> accessibility. I think that's worth making some significant changes for. >> >> >> >> Finally, here is a StackOverflow post I made discussing the same subject. >> >> >> >> https://stackoverflow.com/questions/79281778 >> >> >> >> >> Thank you for your time. >> >> David Alayachew >> >> >> >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From naoto at openjdk.org Thu May 15 03:20:51 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 15 May 2025 03:20:51 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: On Thu, 15 May 2025 02:25:30 GMT, Sergey Bylokhov wrote: >> I believe it is OK to leave these as UTF-8 native characters, as these files are l10n resource bundles. If we wanted to replace those look-alike spaces to unicode escapes, other characters may also need the same treatment, such as hyphen-minus, quotations, etc. In fact there are lot more look alikes defined in the unicode consortium (https://www.unicode.org/Public/security/latest/confusables.txt), and I don't think we would want to convert them. > > maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? Maybe, but sometimes it is intentional. CLDR has once switched normal spaces to NBSP/NNBSP for certain locales (https://unicode-org.atlassian.net/browse/CLDR-14032). And we cannot tell if it is intentional or not. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2090140891 From duke at openjdk.org Thu May 15 04:10:01 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 04:10:01 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine Message-ID: Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. I added a little bit of logging that might also help identify what's happening. Does anyone have any more suggestions? ------------- Commit messages: - 8356061: additional output in the event of failure - 8356061: slowing down RootPaneDefaultButtonTest - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge pull request #5 from openjdk/master - ... and 4 more: https://git.openjdk.org/jdk/compare/5e50a584...b7270924 Changes: https://git.openjdk.org/jdk/pull/25244/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25244&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356061 Stats: 43 lines in 1 file changed: 16 ins; 8 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/25244.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25244/head:pull/25244 PR: https://git.openjdk.org/jdk/pull/25244 From abhishek.cx.kumar at oracle.com Thu May 15 05:19:36 2025 From: abhishek.cx.kumar at oracle.com (Abhishek Kumar) Date: Thu, 15 May 2025 05:19:36 +0000 Subject: [External] : Re: Windows Magnifier does not work with my Swing applications In-Reply-To: References: Message-ID: Hello David, I didn?t get enough time to investigate it further due to other priority work. But I will try to look into this issue ASAP. Regards, Abhishek From: David Alayachew Date: Thursday, 15 May 2025 at 8:32?AM To: Abhishek Kumar Cc: Philip Race , Ajit Ghaisas , client-libs-dev at openjdk.org Subject: Re: [External] : Re: Windows Magnifier does not work with my Swing applications Hey, any updates on this? I understand if not, but accessibility in Swing is important to me, even more so for the abovementioned reasons. On Tue, Feb 11, 2025 at 5:52?AM David Alayachew > wrote: And thank you. On Tue, Feb 11, 2025, 12:50?AM Abhishek Kumar > wrote: Hello David, Yeah, I will evaluate if existing JDK implementation can be extended to work with Windows Magnifier. I didn?t get enough time to look into this issue due to other issues but this is on my to-do list. I will update my findings on JBS after my analysis. Thank you for your patience. Regards, Abhishek From: David Alayachew > Date: Tuesday, 11 February 2025 at 4:39?AM To: Philip Race > Cc: Abhishek Kumar >, client-libs-dev at openjdk.org > Subject: [External] : Re: Windows Magnifier does not work with my Swing applications Ok, ty vm. Hey Abhishek, any updates? On Mon, Feb 10, 2025, 5:50?PM Philip Race > wrote: I think I asked Abhishek to take a look. -phil. On 2/10/25 2:41 PM, David Alayachew wrote: Poke. Any new info? On Fri, Jan 17, 2025, 8:05?AM David Alayachew > wrote: Hello Phil, Did you get any more info about this issue? On Tue, Dec 17, 2024, 11:58?AM David Alayachew > wrote: Thanks Phil. Yeah, I am A-OK as long as this something that is looked into and the JBS Bug Report is updated with the findings. If this isn't too bad, this would be a solid inclusion. But if it's not worth the effort, I just want the JBS to be updated, and then I can put that as an answer for my StackOverflow post. Thanks again for taking a look into this. On Tue, Dec 17, 2024 at 11:56?AM Philip Race > wrote: Perhaps .. if it is an easy fix but I do not know the specifics and the evaluator of that bug wrote "the magnifier cannot receive PropertyChangeEvents from Swing. This is a limitation in the Window magnifier. The Windows magnifier could be modified by Microsoft to receive such events but the work would need to be done by Microsoft." then went on to add that other magnifiers do work .. I also don't know how tied in this would be to implementing support for the Windows Accessibility API. Swing apps today use something called JavaAccessBridge and there are screen readers out there that support it. It would be good to have another look at this specific issue, but I can't make any promises. -phil. On 12/15/24 1:04 PM, David Alayachew wrote: Hello Client Libs Dev Team, My eyesite has started to deteriorate significantly, so I have been using the built-in Accessibility tool called Windows (Screen) Magnifier (available since Windows XP at least). It zooms in and out of the screen by pressing the Windows Key and (+) or (-). This works great because, as I type stuff, the magnifier will follow my text, so that I don't have to keep manually moving the magnifier whenever what I type inevitably ends up off-screen (off-view?). This feature works great for basically every other application I have, except my Swing apps. I make a lot of Swing apps, and I use a bunch too. And this Magnifier feature that follows text does not work for any of the ones I have tried. This feature does work on basically every other application I have. To name a few. * Notepad++ * WordPad * Firefox * Git Bash Here is a Bug Report referring to this problem. https://bugs.openjdk.org/browse/JDK-5079680 The resolution was listed as "Future Project". Any chance that the future can be now? I know that Swing is largely in maintenance mode, but if this were to get added, practically ALL Swing apps would receive a significant boost in accessibility. I think that's worth making some significant changes for. Finally, here is a StackOverflow post I made discussing the same subject. https://stackoverflow.com/questions/79281778 Thank you for your time. David Alayachew -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbaesken at openjdk.org Thu May 15 07:37:56 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Thu, 15 May 2025 07:37:56 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 21:40:47 GMT, Daniel Gredler wrote: >> If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. >> >> This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. >> >> It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Include additional font information in message I added your PR to our build/test queue, let's see if it fixes the issues. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2882856563 From aturbanov at openjdk.org Thu May 15 08:00:00 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 15 May 2025 08:00:00 GMT Subject: Integrated: 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty In-Reply-To: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> References: <-cCKHkV-RiLXVpaxjKw6ZT6Hh6GnDvd-6HUMaVCFepg=.3b741470-0438-46af-8a4c-b13619b9e501@github.com> Message-ID: On Wed, 16 Apr 2025 14:48:04 GMT, Andrey Turbanov wrote: > To obtain previous value of `HashMap` we can use result of `.put` call. In this case we can avoid redundant `.get` call. This pull request has now been integrated. Changeset: e557b695 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/e557b6956bdf9b0d89ad69427c7b4a97a65868ea Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod 8356843: Avoid redundant HashMap.get to obtain old value in Toolkit.setDesktopProperty Reviewed-by: aivanov, serb ------------- PR: https://git.openjdk.org/jdk/pull/24691 From davidalayachew at gmail.com Thu May 15 08:45:25 2025 From: davidalayachew at gmail.com (David Alayachew) Date: Thu, 15 May 2025 04:45:25 -0400 Subject: [External] : Re: Windows Magnifier does not work with my Swing applications In-Reply-To: References: Message-ID: Understood. Ty vm. On Thu, May 15, 2025, 1:19?AM Abhishek Kumar wrote: > Hello David, > > > > I didn?t get enough time to investigate it further due to other priority > work. But I will try to look into this issue ASAP. > > > > Regards, > > Abhishek > > > > *From: *David Alayachew > *Date: *Thursday, 15 May 2025 at 8:32?AM > *To: *Abhishek Kumar > *Cc: *Philip Race , Ajit Ghaisas < > ajit.ghaisas at oracle.com>, client-libs-dev at openjdk.org < > client-libs-dev at openjdk.org> > *Subject: *Re: [External] : Re: Windows Magnifier does not work with my > Swing applications > > Hey, any updates on this? I understand if not, but accessibility in Swing > is important to me, even more so for the abovementioned reasons. > > > > On Tue, Feb 11, 2025 at 5:52?AM David Alayachew > wrote: > > And thank you. > > > > On Tue, Feb 11, 2025, 12:50?AM Abhishek Kumar < > abhishek.cx.kumar at oracle.com> wrote: > > Hello David, > > > > Yeah, I will evaluate if existing JDK implementation can be extended to > work with Windows Magnifier. I didn?t get enough time to look into this > issue due to other issues but this is on my to-do list. I will update my > findings on JBS after my analysis. > > > > Thank you for your patience. > > > > Regards, > > Abhishek > > > > *From: *David Alayachew > *Date: *Tuesday, 11 February 2025 at 4:39?AM > *To: *Philip Race > *Cc: *Abhishek Kumar , > client-libs-dev at openjdk.org > *Subject: *[External] : Re: Windows Magnifier does not work with my Swing > applications > > Ok, ty vm. Hey Abhishek, any updates? > > > > On Mon, Feb 10, 2025, 5:50?PM Philip Race wrote: > > I think I asked Abhishek to take a look. > > -phil. > > On 2/10/25 2:41 PM, David Alayachew wrote: > > Poke. > > Any new info? > > > > On Fri, Jan 17, 2025, 8:05?AM David Alayachew > wrote: > > Hello Phil, > > Did you get any more info about this issue? > > > > On Tue, Dec 17, 2024, 11:58?AM David Alayachew > wrote: > > Thanks Phil. > > > > Yeah, I am A-OK as long as this something that is looked into and the JBS > Bug Report is updated with the findings. If this isn't too bad, this would > be a solid inclusion. But if it's not worth the effort, I just want the JBS > to be updated, and then I can put that as an answer for my StackOverflow > post. > > > > Thanks again for taking a look into this. > > > > On Tue, Dec 17, 2024 at 11:56?AM Philip Race > wrote: > > Perhaps .. if it is an easy fix but I do not know the specifics and the > evaluator of that bug wrote > "the magnifier cannot receive PropertyChangeEvents from Swing. This is a > limitation in the Window magnifier. > The Windows magnifier could be modified by Microsoft to receive such > events but the work would need to be done by Microsoft." > > then went on to add that other magnifiers do work .. > > I also don't know how tied in this would be to implementing support for > the Windows Accessibility API. > > Swing apps today use something called JavaAccessBridge and there are > screen readers out there that support it. > > It would be good to have another look at this specific issue, but I can't > make any promises. > > -phil. > > On 12/15/24 1:04 PM, David Alayachew wrote: > > Hello Client Libs Dev Team, > > > > My eyesite has started to deteriorate significantly, so I have been using > the built-in Accessibility tool called Windows (Screen) Magnifier > (available since Windows XP at least). It zooms in and out of the screen by > pressing the Windows Key and (+) or (-). > > > > This works great because, as I type stuff, the magnifier will follow my > text, so that I don't have to keep manually moving the magnifier whenever > what I type inevitably ends up off-screen (off-view?). > > > > This feature works great for basically every other application I have, > except my Swing apps. I make a lot of Swing apps, and I use a bunch too. > And this Magnifier feature that follows text does not work for any of the > ones I have tried. > > > > This feature does work on basically every other application I have. To > name a few. > > > > * Notepad++ > > * WordPad > > * Firefox > > * Git Bash > > > > Here is a Bug Report referring to this problem. > > > > https://bugs.openjdk.org/browse/JDK-5079680 > > > > The resolution was listed as "Future Project". Any chance that the future > can be now? > > > > I know that Swing is largely in maintenance mode, but if this were to get > added, practically ALL Swing apps would receive a significant boost in > accessibility. I think that's worth making some significant changes for. > > > > Finally, here is a StackOverflow post I made discussing the same subject. > > > > https://stackoverflow.com/questions/79281778 > > > > > Thank you for your time. > > David Alayachew > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abhiscxk at openjdk.org Thu May 15 08:51:52 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 15 May 2025 08:51:52 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Mon, 12 May 2025 13:40:06 GMT, Anass Baya wrote: >However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. This causes the test to proceed immediately to the validation step: if (fd.isVisible()) { throw new RuntimeException("File Dialog is not closed"); I don't see the existing code ignores the second attempt, that is due to longer delay put after the robot operations. You can add print statements and observe the behavior. However, I agree the countdown latch should be initialize to 2 to behave correctly. } Other enhancements look good as threads are not required to verify the test. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2883052617 PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2883059066 From abhiscxk at openjdk.org Thu May 15 09:16:52 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 15 May 2025 09:16:52 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Mon, 12 May 2025 13:40:06 GMT, Anass Baya wrote: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Tested updated test on JDK1.6.0_25 and JDK1.6.0_29 and I don't see any behavior difference. [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243) says that issue is resolved in b29. Did you verify the test as per [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243) ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2883123277 From ihse at openjdk.org Thu May 15 09:19:53 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 15 May 2025 09:19:53 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: On Thu, 15 May 2025 03:18:30 GMT, Naoto Sato wrote: >> maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? > > Maybe, but sometimes it is intentional. CLDR has once switched normal spaces to NBSP/NNBSP for certain locales (https://unicode-org.atlassian.net/browse/CLDR-14032). And we cannot tell if it is intentional or not. > So, this exactly reverses what was done in the fix for JDK-8301991 No, it doesn't. I still agree with that fix -- the overwhelming majority of characters should indeed be UTF-8 instead of unicode sequences. This is about a very specific character, that is impossible to visually tell the difference on screen from ordinary space. Technically, it might be that some of these lines in the properties files are reversals of JDK-8301991, but that's just basically coincidence. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2090692617 From ihse at openjdk.org Thu May 15 09:19:53 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 15 May 2025 09:19:53 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: On Thu, 15 May 2025 09:16:10 GMT, Magnus Ihse Bursie wrote: >> Maybe, but sometimes it is intentional. CLDR has once switched normal spaces to NBSP/NNBSP for certain locales (https://unicode-org.atlassian.net/browse/CLDR-14032). And we cannot tell if it is intentional or not. > >> So, this exactly reverses what was done in the fix for JDK-8301991 > > No, it doesn't. I still agree with that fix -- the overwhelming majority of characters should indeed be UTF-8 instead of unicode sequences. > > This is about a very specific character, that is impossible to visually tell the difference on screen from ordinary space. > > Technically, it might be that some of these lines in the properties files are reversals of JDK-8301991, but that's just basically coincidence. > maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? That seems unlikely. The pattern is used consistently in the French translations, where `Foo:` in the original is replaced with `Foo :` with a non-breaking space. I guess it is a French orthographic rule to have a space before the colon, and I understand why it really must be non-breaking in that case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2090695445 From lkorinth at openjdk.org Thu May 15 09:20:03 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 15 May 2025 09:20:03 GMT Subject: RFR: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* After an offline discussion, we agreed to wait a bit with this change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25122#issuecomment-2883137218 From lkorinth at openjdk.org Thu May 15 09:20:03 2025 From: lkorinth at openjdk.org (Leo Korinth) Date: Thu, 15 May 2025 09:20:03 GMT Subject: Withdrawn: 8356171: Increase timeout for testcases as preparation for change of default timeout factor In-Reply-To: References: Message-ID: On Thu, 8 May 2025 14:51:24 GMT, Leo Korinth wrote: > This change tries to add timeout to individual testcases so that I am able to run them with a timeout factor of 1 in the future (JDK-8260555). > > The first commit changes the timeout factor to 0.7, so that I can run tests and test the change (it will finally be changed to 1.0 in JDK-8260555). The next commit excludes some junit/testng tests where I can currently not change the timeout factor (CODETOOLS-7903961). Both these commits will be reverted before integrating the change. I will also apply copyright updates after the review. > > In addition to changing the timeout factor, I am also using a library call to parse the timeout factor from the java properties (I can not use the library function everywhere as jtreg does not allow me to add @library notations to non testcase files). > > My approach has been to run all test, and afterwards updating those that fails due to a timeout factor. The amount of updated testcases is huge, and my strategy has been to quadruple the timeout if I could not directly see that less was needed (thus the timeout will be the same after JDK-8260555 is implemented). In a few places I have added a bit more timeout so that it will work with the 0.7 timeout factor. > > These fixes have been created when I have plown through testcases: > JDK-8352719: Add an equals sign to the modules statement > JDK-8352709: Remove bad timing annotations from WhileOpTest.java > JDK-8352074: Test MemoryLeak.java seems not to test what it is supposed to test > CODETOOLS-7903937: JTREG uses timeout factor on socket timeout but not on KEEPALIVE > CODETOOLS-7903961: Make default timeout configurable > > Sometime in the future I will also fix: > 8260555: Change the default TIMEOUT_FACTOR from 4 to 1 > > for which I am awaiting: > CODETOOLS-7903961 that is fixed in jtreg 7.6, but we are still running 7.5.1+1 > > *After the review I will revert the two first commits, and update the copyrights* This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25122 From abhiscxk at openjdk.org Thu May 15 10:44:51 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 15 May 2025 10:44:51 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Mon, 12 May 2025 13:40:06 GMT, Anass Baya wrote: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details test/jdk/ProblemList.txt line 819: > 817: java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all > 818: java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all > 819: java/awt/FileDialog/DoubleActionESC.java GTKFileDialog linux-all For problem listing this test, you need to add the bug-id [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) Suggestion: java/awt/FileDialog/DoubleActionESC.java 8356981 linux-all ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2090875926 From rgiulietti at openjdk.org Thu May 15 12:35:51 2025 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Thu, 15 May 2025 12:35:51 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> Message-ID: <1Z5g-LlFwSPrcqtTBmrDetQQL7_hF0j73n-37JRCpug=.3a763994-156c-44fb-8945-f02b1994e620@github.com> On Thu, 15 May 2025 09:17:42 GMT, Magnus Ihse Bursie wrote: >>> So, this exactly reverses what was done in the fix for JDK-8301991 >> >> No, it doesn't. I still agree with that fix -- the overwhelming majority of characters should indeed be UTF-8 instead of unicode sequences. >> >> This is about a very specific character, that is impossible to visually tell the difference on screen from ordinary space. >> >> Technically, it might be that some of these lines in the properties files are reversals of JDK-8301991, but that's just basically coincidence. > >> maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? > > That seems unlikely. The pattern is used consistently in the French translations, where `Foo:` in the original is replaced with `Foo :` with a non-breaking space. I guess it is a French orthographic rule to have a space before the colon, and I understand why it really must be non-breaking in that case. FYI, the style guide for France [recommends](https://fr.wikipedia.org/wiki/Espace_ins%C3%A9cable#En_France): - U+202F (Narrow No-Break Space NNBSP) preceding semicolon, question mark, and exclamation mark. - U+00A0 (No-Break Space NBSP) preceding colon. Similar conventions are used in other French speaking countries. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2091068610 From abaya at openjdk.org Thu May 15 13:51:07 2025 From: abaya at openjdk.org (Anass Baya) Date: Thu, 15 May 2025 13:51:07 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v2] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with one additional commit since the last revision: Update test/jdk/ProblemList.txt Co-authored-by: Abhishek Kumar ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/a8ca48e8..0e234a54 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From abaya at openjdk.org Thu May 15 14:26:57 2025 From: abaya at openjdk.org (Anass Baya) Date: Thu, 15 May 2025 14:26:57 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 09:12:36 GMT, Abhishek Kumar wrote: >> **Analysis :** >> >> Whether the test passes on the main line or fails, the behavior is still incorrect. >> This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. >> >> However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. >> >> This causes the test to proceed immediately to the validation step: >> >> if (fd.isVisible()) { >> throw new RuntimeException("File Dialog is not closed"); >> } >> >> At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) >> >> To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. >> >> **Proposed fix:** >> >> set the CountDownLatch to 2 >> >> **Proposed enhancements :** >> >> Remove unnecessary threads (Thread and Thread-2) >> Properly handle delays and robot.waitForIdle() >> Avoid indefinite blocking on latch.await() >> >> With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds >> >> The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details > > Ran updated test on JDK1.6.0_25 and JDK1.6.0_29 and I don't see any behavior difference and the test passes always on my local machine (Ubuntu 22.04). File dialog opened seems a XToolKit based dialog not the GTK based dialog. > > [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243) says that issue is resolved in b29. > So, test should **fail for b25** and **pass for b29** > > Did you verify the test as per [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243) ? Hello @kumarabhi006, Thank you for your review. Did you try to reproduce the bug manually first with b25 before proceeding with the automated test ? >From my side, I proceed that way: I revert the fix on the mainline, the test fails 20/20 times. Then, when I reapply the fix, the test passes 20/20 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2884009898 From abhiscxk at openjdk.org Thu May 15 15:20:51 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 15 May 2025 15:20:51 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 14:24:36 GMT, Anass Baya wrote: > Did you try to reproduce the bug manually first with b25 before proceeding with the automated test ? Yes, I tried with the manual applet test with b25 and b29. There is an exception thrown (related with security permission) for the first time whenever Show File Dialog button is clicked but on next click File Dialog is shown and it's getting closed on `ESC` press. The behavior is same for b25 and b29 both. For automated test, it's same behavior and there is no exception thrown. Debug prints for b25 and b29: Show File Dialog Set File Dialog Visible Press ESC Button Before latch countDown : 2 After latch countDown : 1 Show File Dialog Set File Dialog Visible Press ESC Button Before latch countDown : 1 After latch countDown : 0 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2884210888 From abaya at openjdk.org Thu May 15 15:32:53 2025 From: abaya at openjdk.org (Anass Baya) Date: Thu, 15 May 2025 15:32:53 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 15:17:47 GMT, Abhishek Kumar wrote: >> Hello @kumarabhi006, >> Thank you for your review. >> >> Did you try to reproduce the bug manually first with b25 before proceeding with the automated test ? >> From my side, I proceed that way: I revert the fix on the mainline, the test fails 20/20 times. >> Then, when I reapply the fix, the test passes 20/20 > >> Did you try to reproduce the bug manually first with b25 before proceeding with the automated test ? > > Yes, I tried with the manual applet test with b25 and b29. > There is an exception thrown (related with security permission) for the first time whenever Show File Dialog button is clicked but on next click File Dialog is shown and it's getting closed on `ESC` press (Behaves same for repeat operations). > > The behavior is same for b25 and b29 both. > > For automated test, it's same behavior and there is no exception thrown. > Debug prints for b25 and b29: > > Show File Dialog > Set File Dialog Visible > Press ESC Button > Before latch countDown : 2 > After latch countDown : 1 > Show File Dialog > Set File Dialog Visible > Press ESC Button > Before latch countDown : 1 > After latch countDown : 0 @kumarabhi006 As I understand, you're not able to reproduce the issue with b25( the version that doent include the fix), even when testing manually. So it's unclear whether the automated test is actually effective since you are not reproducing the issue manually As I mentioned earlier, to check the test's effectiveness, I reverted the fix on the mainline ? and the test failed 20 out of 20 times. Then, when I reapplied the fix, the test passed 20 out of 20 times. Maybe you could try running the test in a loop. According to [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243), the issue reproduction is intermittent ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2884250541 From kcr at openjdk.org Thu May 15 15:42:58 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Thu, 15 May 2025 15:42:58 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events LGTM. All testing complete. NOTE: The order of integration of the two PRs (AWT and JavaFX) doesn't matter. However, taking one without the other will be ineffective, so wait for both PRs to be approved before integrating either of them. ------------- Marked as reviewed by kcr (Author). PR Review: https://git.openjdk.org/jdk/pull/24379#pullrequestreview-2844212594 From aivanov at openjdk.org Thu May 15 16:16:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 15 May 2025 16:16:57 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 21:40:47 GMT, Daniel Gredler wrote: >> If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. >> >> This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. >> >> It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Include additional font information in message Looks good to me. I didn't try to reproduce the problem. Let's wait for @MBaesken test results. test/jdk/java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java line 1: > 1: /* Add 8356966 to the `@bug` tag in the test. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25235#pullrequestreview-2844313205 PR Review Comment: https://git.openjdk.org/jdk/pull/25235#discussion_r2091546737 From honkar at openjdk.org Thu May 15 16:23:55 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 15 May 2025 16:23:55 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events LGTM apart from minor inline comments src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 494: > 492: } > 493: > 494: + (void)_embeddedEvent:(NSNotification *)notification { @kevinrushforth @prrace Is '_embeddedEvent' too generic, does it need to be changed to something more inline with OpenURI e.g '_openURIEvent' ? ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24379#pullrequestreview-2844335685 PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2091559784 From honkar at openjdk.org Thu May 15 16:31:01 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 15 May 2025 16:31:01 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v5] In-Reply-To: References: Message-ID: On Wed, 7 May 2025 16:43:57 GMT, Pabulaner IV wrote: >> Pabulaner IV has updated the pull request incrementally with three additional commits since the last revision: >> >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events >> - 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > > I implemented the feedback and changed the pull request title. @pabulaner Changes look good. Please wait until @prrace has gotten a chance to review and approve this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2884418615 From kcr at openjdk.org Thu May 15 16:31:04 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Thu, 15 May 2025 16:31:04 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Thu, 15 May 2025 16:20:57 GMT, Harshitha Onkar wrote: >> Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: >> >> 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events > > src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 494: > >> 492: } >> 493: >> 494: + (void)_embeddedEvent:(NSNotification *)notification { > > @kevinrushforth @prrace > > Is '_embeddedEvent' too generic, does it need to be changed to something more inline with OpenURI e.g '_openURIEvent' ? As I noted in an earlier comment, I think the method name, _embeddedEvent , is fine, since it is private to this file. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2091568016 From kcr at openjdk.org Thu May 15 16:31:05 2025 From: kcr at openjdk.org (Kevin Rushforth) Date: Thu, 15 May 2025 16:31:05 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Thu, 15 May 2025 16:25:56 GMT, Kevin Rushforth wrote: >> src/java.desktop/macosx/native/libawt_lwawt/awt/ApplicationDelegate.m line 494: >> >>> 492: } >>> 493: >>> 494: + (void)_embeddedEvent:(NSNotification *)notification { >> >> @kevinrushforth @prrace >> >> Is '_embeddedEvent' too generic, does it need to be changed to something more inline with OpenURI e.g '_openURIEvent' ? > > As I noted in an earlier comment, I think the method name, _embeddedEvent , is fine, since it is private to this file. Also, while it is only used for openURI today, it could be used to pass additional messages in the future, so even if he were to change it, it shouldn't have "openURI" in the name. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2091569752 From honkar at openjdk.org Thu May 15 16:35:59 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 15 May 2025 16:35:59 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Thu, 15 May 2025 16:26:55 GMT, Kevin Rushforth wrote: >> As I noted in an earlier comment, I think the method name, _embeddedEvent , is fine, since it is private to this file. > > Also, while it is only used for openURI today, it could be used to pass additional messages in the future, so even if he were to change it, it shouldn't have "openURI" in the name. Good point. Agreed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24379#discussion_r2091581008 From aivanov at openjdk.org Thu May 15 16:35:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 15 May 2025 16:35:59 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v2] In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 13:51:07 GMT, Anass Baya wrote: >> **Analysis :** >> >> Whether the test passes on the main line or fails, the behavior is still incorrect. >> This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. >> >> However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. >> >> This causes the test to proceed immediately to the validation step: >> >> if (fd.isVisible()) { >> throw new RuntimeException("File Dialog is not closed"); >> } >> >> At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) >> >> To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. >> >> **Proposed fix:** >> >> set the CountDownLatch to 2 >> >> **Proposed enhancements :** >> >> Remove unnecessary threads (Thread and Thread-2) >> Properly handle delays and robot.waitForIdle() >> Avoid indefinite blocking on latch.await() >> >> With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds >> >> The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details > > Anass Baya has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/ProblemList.txt > > Co-authored-by: Abhishek Kumar A sanity check: does the updated test reproduce the problem reported in [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243)? I'm pretty sure it should. test/jdk/java/awt/FileDialog/DoubleActionESC.java line 56: > 54: private static volatile CountDownLatch latch; > 55: private static final int REPEAT_COUNT = 2; > 56: private static final long LATCH_TIMEOUT = 4; Suggestion: private static final int REPEAT_COUNT = 2; private static final long LATCH_TIMEOUT = 4; private static final CountDownLatch latch = new CountDownLatch(REPEAT_COUNT); test/jdk/java/awt/FileDialog/DoubleActionESC.java line 81: > 79: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); > 80: robot.waitForIdle(); > 81: robot.delay(1000); Can the delay be reduced to `500`? test/jdk/java/awt/FileDialog/DoubleActionESC.java line 89: > 87: } > 88: > 89: latch.await(LATCH_TIMEOUT, SECONDS); Throw an exception if the timeout is reached ? the test already failed. test/jdk/java/awt/FileDialog/DoubleActionESC.java line 90: > 88: > 89: latch.await(LATCH_TIMEOUT, SECONDS); > 90: if (fd.isVisible()) { I'm on the fence here? Calling `fd.isVisible()` on EDT is more reliable; but it's not strictly required for AWT components. test/jdk/java/awt/FileDialog/DoubleActionESC.java line 92: > 90: if (fd.isVisible()) { > 91: throw new RuntimeException("File Dialog is not closed"); > 92: } Dispose of `fd` too (in the finally block). ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25184#pullrequestreview-2844332500 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2091558746 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2091564010 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2091576832 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2091578738 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2091575682 From aivanov at openjdk.org Thu May 15 16:38:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 15 May 2025 16:38:52 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 08:46:46 GMT, Abhishek Kumar wrote: > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > > throw new RuntimeException("File Dialog is not closed"); > > } > > I don't see the existing code ignores the second attempt, that is due to longer delay put after the robot operations. You can add print statements and observe the behavior. > > However, I agree the countdown latch should be initialize to 2 to behave correctly. Technically, longer delays do add up, yet if it takes longer to display the dialog and hide it, it's well possible that the dialog isn't hidden by the time the main thread reaches the point where it calls `fd.isVisible()`. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2884439345 From mblaesing at openjdk.org Thu May 15 16:48:47 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 15 May 2025 16:48:47 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v3] In-Reply-To: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: > - Introduce a lock into WClipboard that protects the code between > openClipboard/closeClipboard invocations. > The native side does not allow to open the clipboard multiple > times or share the opened clipboard between multiple threads. > > - Remove of need to call openClipboard/closeClipboard from > getClipboardFormats by using the win32 call > GetUpdatedClipboardFormats > > - Prevent a race-condition by not registering the connection > between java and native side of clipboard multiple time, but > just at construction time. Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: Add crash reproducer as jtreg test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24614/files - new: https://git.openjdk.org/jdk/pull/24614/files/4fa4ef90..e5ebf59f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24614&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24614&range=01-02 Stats: 67 lines in 1 file changed: 67 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24614.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24614/head:pull/24614 PR: https://git.openjdk.org/jdk/pull/24614 From mblaesing at openjdk.org Thu May 15 17:00:56 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 15 May 2025 17:00:56 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v2] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: <70CaDViNDBcpE7Nno03joM9Dov0f27h7swxpBiPFSFc=.a9e9ce1a-db48-4921-bd99-8578af5ba9ef@github.com> On Tue, 13 May 2025 02:11:14 GMT, Sergey Bylokhov wrote: >> Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: >> >> Adress review comments: Update copyright years and fix whitespace in if condition > > is it possible to create a jtreg test for this issue? @mrserb added the reproducer and validated, that it works: - *fastdebug* build: Before this change assertion is hit quickly, this will not be reported as a testfailure as the assertion handler displays a message and only blocks further execution of that thread, after the change no assertion is hit. - *release* build: Before this change the JVM crashes and that is reported as a test failure, after the change the code runs through. The test was run via: CONF=windows-x86_64-server-release make test TEST="test/jdk/java/awt/Clipboard/ConcurrentClipboardAccessTest.java" # and CONF=windows-x86_64-server-fastdebug make test TEST="test/jdk/java/awt/Clipboard/ConcurrentClipboardAccessTest.java" ------------- PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2884495131 From dgredler at openjdk.org Thu May 15 17:20:06 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 15 May 2025 17:20:06 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v3] In-Reply-To: References: Message-ID: > If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. > > This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. > > It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Update bug tag in test class ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25235/files - new: https://git.openjdk.org/jdk/pull/25235/files/13130c4c..fe1fda57 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25235&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25235&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25235.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25235/head:pull/25235 PR: https://git.openjdk.org/jdk/pull/25235 From serb at openjdk.org Thu May 15 17:23:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 15 May 2025 17:23:52 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine In-Reply-To: References: Message-ID: On Thu, 15 May 2025 04:05:38 GMT, Jeremy Wood wrote: > Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. > > I added a little bit of logging that might also help identify what's happening. > > Does anyone have any more suggestions? test/jdk/com/apple/laf/RootPane/RootPaneDefaultButtonTest.java line 131: > 129: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); > 130: > 131: robot.delay(1000); it will be useful to add the same delay before the first call to test, right after invokeAndWait.....setVisible(...) Also please move creation and access_to all Swing components to EDT(button, radioButton1) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25244#discussion_r2091656355 From aivanov at openjdk.org Thu May 15 17:51:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 15 May 2025 17:51:54 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v3] In-Reply-To: References: Message-ID: <6pfFk3ULMg49y3gxczuSVrbx-Vf9gX_RoJPU7kjmkmY=.727cf914-7c02-4faa-b07f-5a3f4f7711dd@github.com> On Thu, 15 May 2025 17:20:06 GMT, Daniel Gredler wrote: >> If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. >> >> This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. >> >> It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update bug tag in test class Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25235#pullrequestreview-2844554557 From naoto at openjdk.org Thu May 15 18:32:53 2025 From: naoto at openjdk.org (Naoto Sato) Date: Thu, 15 May 2025 18:32:53 GMT Subject: RFR: 8356977: UTF-8 cleanups In-Reply-To: References: Message-ID: <5oMrogxJyi1_OsPAGntbPTiR5aCIFOTuDSUTKOv7wyo=.b715c9d2-0cdd-4585-a262-bdbe5a72a5fa@github.com> On Wed, 14 May 2025 14:23:31 GMT, Magnus Ihse Bursie wrote: > I found a few other places in the code that can be cleaned up after the conversion to UTF-8. test/jdk/sun/text/resources/LocaleDataTest.java line 106: > 104: * FormatData/fr_FR/MonthNames/0=janvier > 105: * FormatData/fr_FR/MonthNames/1=f?vrier > 106: * LocaleNames/fr_FR/US=?tats-Unis This test data (LocaleData.cldr) is explicitly encoded in ISO-8859-1 with unicode escapes for characters outside of it. So only changing these ones in comment does not seem correct. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2091757029 From duke at openjdk.org Thu May 15 19:22:06 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 19:22:06 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v2] In-Reply-To: References: Message-ID: > Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. > > I added a little bit of logging that might also help identify what's happening. > > Does anyone have any more suggestions? Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: - 8356061: restructuring to move things to EDT This was requested here: https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 mrserb asked: "Also please move creation and access_to all Swing components to EDT" (I'm not sure this will help much? My understanding was *creation* of Swing components could happen off the EDT as long as they were made displayable on the EDT.) Now we still call jc.getLocationOnScreen off the EDT. If that posed a thread-based problem it'd probably manifest as a IllegalComponentStateException, which is not mentioned in 8356061. - 8356061: adding 1000ms pause after window construction This was requested here: https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 So now we'll pause at least 1.1s before the first call to `jc.getLocationOnScreen`, and at least 2.1s before the first call to `robot.getPixelColor(x, y)`. (getLocationOnScreen has never failed with an IllegalStateException.) ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25244/files - new: https://git.openjdk.org/jdk/pull/25244/files/b7270924..b076c964 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25244&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25244&range=00-01 Stats: 183 lines in 1 file changed: 92 ins; 77 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/25244.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25244/head:pull/25244 PR: https://git.openjdk.org/jdk/pull/25244 From duke at openjdk.org Thu May 15 19:31:52 2025 From: duke at openjdk.org (Jeremy Wood) Date: Thu, 15 May 2025 19:31:52 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v2] In-Reply-To: References: Message-ID: On Thu, 15 May 2025 17:21:37 GMT, Sergey Bylokhov wrote: >> Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: >> >> - 8356061: restructuring to move things to EDT >> >> This was requested here: >> https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 >> >> mrserb asked: "Also please move creation and access_to all Swing components to EDT" >> >> (I'm not sure this will help much? My understanding was *creation* of Swing components could happen off the EDT as long as they were made displayable on the EDT.) >> >> Now we still call jc.getLocationOnScreen off the EDT. If that posed a thread-based problem it'd probably manifest as a IllegalComponentStateException, which is not mentioned in 8356061. >> - 8356061: adding 1000ms pause after window construction >> >> This was requested here: >> https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 >> >> So now we'll pause at least 1.1s before the first call to `jc.getLocationOnScreen`, and at least 2.1s before the first call to `robot.getPixelColor(x, y)`. >> >> (getLocationOnScreen has never failed with an IllegalStateException.) > > test/jdk/com/apple/laf/RootPane/RootPaneDefaultButtonTest.java line 131: > >> 129: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); >> 130: >> 131: robot.delay(1000); > > it will be useful to add the same delay before the first call to test, right after invokeAndWait.....setVisible(...) > Also please move creation and access_to all Swing components to EDT(button, radioButton1) I added an additional delay. I'm not sure exactly what refactor you're looking for, but I rewrote the test to put more in the EDT. (I double-checked that the test still passes, but that doesn't prove much since I've never reproduced a failure.) I did try at one point blocking the testing thread until the EDT had a chance to complete an invokeLater runnable, but that didn't seem to make a difference so I didn't commit it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25244#discussion_r2091836908 From prr at openjdk.org Thu May 15 21:18:00 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 15 May 2025 21:18:00 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24379#pullrequestreview-2844987602 From duke at openjdk.org Thu May 15 21:20:56 2025 From: duke at openjdk.org (duke) Date: Thu, 15 May 2025 21:20:56 GMT Subject: RFR: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit [v7] In-Reply-To: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> References: <7WiIudj17C-fXWZL1FxnPqXrtk2sQH2V_kAX7Yy6s3w=.50d1a1df-f653-4a9b-abec-e170e3a9cf09@github.com> Message-ID: On Wed, 7 May 2025 16:51:30 GMT, Pabulaner IV wrote: >> When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. >> Either the native menu is not shown or the URIs are not received. >> >> This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. >> It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. >> >> JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 >> Co-Author: @FlorianKirmaier > > Pabulaner IV has updated the pull request incrementally with one additional commit since the last revision: > > 8332947: [macos] java.awt.desktop.OpenURIHandler is not receiving events @pabulaner Your change (at version 924b17b166fa88b02b38c4a046e177fa7e5ccccf) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24379#issuecomment-2885075019 From duke at openjdk.org Thu May 15 22:38:59 2025 From: duke at openjdk.org (Pabulaner IV) Date: Thu, 15 May 2025 22:38:59 GMT Subject: Integrated: 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit In-Reply-To: References: Message-ID: <1-SbOb8AwwmdoaYmhLe9rEbV6hQFkhk_eF_P7Cl6sLM=.e717838a-fe0c-41b2-85c1-f17afdfeeb0b@github.com> On Wed, 2 Apr 2025 14:15:28 GMT, Pabulaner IV wrote: > When trying to register an open URI handler when using JavaFX with a native menu, this task fails on Mac. > Either the native menu is not shown or the URIs are not received. > > This pull request fixes this issue if AWT is registered after JavaFX, so that AWT runs embedded inside JavaFX. > It fixes this by introducing a native event to AWT, which can be used by JavaFX to forward events such as an openURL event. > > JavaFX Pull Request: https://github.com/openjdk/jfx/pull/1755 > Co-Author: @FlorianKirmaier This pull request has now been integrated. Changeset: f6b0f016 Author: Paul H Committer: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/f6b0f016f6da5d9c96b21c74d3b906ed8e6ae4b4 Stats: 31 lines in 1 file changed: 28 ins; 3 del; 0 mod 8332947: [macos] OpenURIHandler events not received when AWT is embedded in another toolkit Reviewed-by: kcr, honkar, prr ------------- PR: https://git.openjdk.org/jdk/pull/24379 From duke at openjdk.org Fri May 16 01:51:50 2025 From: duke at openjdk.org (duke) Date: Fri, 16 May 2025 01:51:50 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: On Wed, 7 May 2025 12:28:52 GMT, Manukumar V S wrote: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). @manukumarvs Your change (at version 68f72e4684b703c79853739c43009db225e8173e) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2885424356 From achung at openjdk.org Fri May 16 02:02:55 2025 From: achung at openjdk.org (Alisen Chung) Date: Fri, 16 May 2025 02:02:55 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v11] In-Reply-To: References: <741DjI-uVAuf4pjN9MqVaKz2iEI-qr-L9c6KCbP7IlY=.e46c1d54-4b0f-4cc3-b572-043923972212@github.com> <6A6RT3ZqccBhAhdhEaSDc3Ri0yUWw61Alc2xbYHtXfI=.24af6c9c-b6b8-4f3e-a4c6-61143685eef2@github.com> Message-ID: On Mon, 5 May 2025 22:45:50 GMT, Sergey Bylokhov wrote: > I propose developing a native reproducer to investigate the mouse position clamping behavior observed on macOS. The steps would include: > > 1. Moving the mouse cursor outside the screen bounds. > 2. Retrieving the current mouse position. > 3. Simulating a mouse click at the current position. > 4. Retrieving the mouse position again. > 5. Comparing the positions from steps 2 and 4. I have attached a native reproducer to the JBS issue. The result is that getting the location of the mouse after the mouseMove and mousePress/Release both result in the offscreen coordinates, so it is reproducible natively. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2885437648 From mbaesken at openjdk.org Fri May 16 06:38:54 2025 From: mbaesken at openjdk.org (Matthias Baesken) Date: Fri, 16 May 2025 06:38:54 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: On Thu, 15 May 2025 07:35:06 GMT, Matthias Baesken wrote: >> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: >> >> Include additional font information in message > > I added your PR to our build/test queue, let's see if it fixes the issues. > Looks good to me. I didn't try to reproduce the problem. Let's wait for @MBaesken test results. Test results look good, with your PR the issue is gone on the 2 Linux machines where we noticed it before . ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2885779628 From abhiscxk at openjdk.org Fri May 16 07:27:02 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 16 May 2025 07:27:02 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 16:36:28 GMT, Alexey Ivanov wrote: > > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > > This causes the test to proceed immediately to the validation step: > > > if (fd.isVisible()) { > > > throw new RuntimeException("File Dialog is not closed"); > > > } > > > > > > I don't see the existing code ignores the second attempt, that is due to longer delay put after the robot operations. You can add print statements and observe the behavior. > > However, I agree the countdown latch should be initialize to 2 to behave correctly. > > Technically, longer delays do add up, yet if it takes longer to display the dialog and hide it, it's well possible that the dialog isn't hidden by the time the main thread reaches the point where it calls `fd.isVisible()`. Yes, I agree. That's why I am in favour of increasing the latch count to 2 which will ensure everything is all right. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2885876078 From abhiscxk at openjdk.org Fri May 16 07:27:02 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 16 May 2025 07:27:02 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 15:30:15 GMT, Anass Baya wrote: >>> Did you try to reproduce the bug manually first with b25 before proceeding with the automated test ? >> >> Yes, I tried with the manual applet test with b25 and b29. >> There is an exception thrown (related with security permission) for the first time whenever Show File Dialog button is clicked but on next click File Dialog is shown and it's getting closed on `ESC` press (Behaves same for repeat operations). >> >> The behavior is same for b25 and b29 both. >> >> For automated test, it's same behavior and there is no exception thrown. >> Debug prints for b25 and b29: >> >> Show File Dialog >> Set File Dialog Visible >> Press ESC Button >> Before latch countDown : 2 >> After latch countDown : 1 >> Show File Dialog >> Set File Dialog Visible >> Press ESC Button >> Before latch countDown : 1 >> After latch countDown : 0 > > @kumarabhi006 > As I understand, you're not able to reproduce the issue with b25( the version that doent include the fix), even when testing manually. So it's unclear whether the automated test is actually effective since you are not reproducing the issue manually > > As I mentioned earlier, to check the test's effectiveness, I reverted the fix on the mainline ? and the test failed 20 out of 20 times. Then, when I reapplied the fix, the test passed 20 out of 20 times. > > Maybe you could try running the test in a loop. According to [JDK-5097243](https://bugs.openjdk.org/browse/JDK-5097243), the issue reproduction is intermittent @anass-baya Could you please add the CI link in JBS ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25184#issuecomment-2885877557 From duke at openjdk.org Fri May 16 10:32:06 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 16 May 2025 10:32:06 GMT Subject: RFR: 8357034: GifImageDecoder can produce wrong transparent pixels Message-ID: If there are two consecutive frames that use DISPOSAL_SAVE, but the transparent pixel index changed: we might accidentally send the wrong data to the ImageConsumer. We already had logic that submits info "the hard way" (see comment in code); this PR just makes sure we trigger that block. There are 4 tickets/PRs that use this new GifComparison class. I recommend not reviewing this PR until #25044 clears code review. (See https://github.com/openjdk/jdk/pull/25044#issuecomment-2881889090 ) ------------- Commit messages: - 8357034: fixing ticket number - GifComparison: fixing error message - Incident 9078482: fix when new trans index is in saved images - GifComparison: code cleanup - GifComparison: adding common helper class for gif bugs - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'openjdk:master' into master - ... and 7 more: https://git.openjdk.org/jdk/compare/5e50a584...5b982b12 Changes: https://git.openjdk.org/jdk/pull/25264/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25264&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357034 Stats: 471 lines in 4 files changed: 470 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25264.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25264/head:pull/25264 PR: https://git.openjdk.org/jdk/pull/25264 From tr at openjdk.org Fri May 16 10:48:53 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 16 May 2025 10:48:53 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v2] In-Reply-To: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> References: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> Message-ID: On Tue, 13 May 2025 03:05:32 GMT, Sergey Bylokhov wrote: >>> Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Illegal char <<> at index 0:

SWING ROCKS!!!111 >>> at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46) >>> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) >>> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203) >>> at java.base/java.nio.file.Path.of(Path.java:148) >>> at java.base/java.nio.file.Paths.get(Paths.java:69) >>> at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:724) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:242) >>> at java.desktop/com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon(WindowsFileChooserUI.java:1398) >>> at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1614) >> >> >> This exception looks like a bug? I think if the file was not found then null is an expected result. >> For now it can be bypassed by this: >> >> >> import java.io.File; >> import java.lang.Override; >> >> import javax.swing.Icon; >> import javax.swing.JFileChooser; >> import javax.swing.SwingUtilities; >> import javax.swing.UIManager; >> import javax.swing.UnsupportedLookAndFeelException; >> import javax.swing.filechooser.FileSystemView; >> >> public class VirtualFileChooser { >> >> public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { >> UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); >> //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); >> >> >> SwingUtilities.invokeLater(() -> { >> JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); >> >> int result = chooser.showOpenDialog(null); >> if (result == JFileChooser.APPROVE_OPTION) { >> File selectedFile = chooser.getSelectedFile(); >> System.out.println("Selected: " + selectedFile.getAbsolutePath()); >> } >> ... > > Note that the bug occurs both in the list of roots (in the dropdown) and in the list of files. @mrserb @aivanov-jdk Can u please re-review the updated changes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2092813657 From amitkumar at openjdk.org Fri May 16 11:35:29 2025 From: amitkumar at openjdk.org (Amit Kumar) Date: Fri, 16 May 2025 11:35:29 GMT Subject: RFR: 8356643: Switching focus causes Segmentation Fault on zLinux Message-ID: In OpenJKD code, for big endian architecture, `XIMPreeditState` is considered `unsigned int` whereas in `xlib` code it is `unsigned long` [source](https://github.com/mirror/libX11/blob/ff8706a5eae25b8bafce300527079f68a201d27f/include/X11/Xlib.h#L1267). Now, openjdk compiled code pushes a frame and allots the address, just 4 bytes away, because it considers state to be a int, from the store `callers_sp` : 2: /x $r15 = 0x3ff8137da20 3: x/2xg 0x3ff8137da20 0x3ff8137da20: 0x000003ff8137daf0 0x000003fffa2a9a86 `0x000003ff8137daf0` is callers sp for s390x. And this is address for `state` : (gdb) p &state $9 = (unsigned int *) 0x3ff8137da1c which is just 4 byte away from the callers sp: (gdb) p/x 0x3ff8137da20 - 4 $10 = 0x3ff8137da1c Now while executing `_XimDecodePreeditState` method from xlib library where `state` is of type `unsigned long` we are going to emit a 8-byte instruction.: (gdb) disassemble _XimDecodePreeditState Dump of assembler code for function _XimDecodePreeditState: => 0x000003ff989f3360 <+0>: llgf %r1,8(%r2) 0x000003ff989f3366 <+6>: lghi %r2,1 0x000003ff989f336a <+10>: lg %r1,0(%r3,%r1) 0x000003ff989f3370 <+16>: stg %r1,0(%r4) 0x000003ff989f3376 <+22>: br %r14 End of assembler dump. `0x000003ff989f3370 <+16>: stg %r1,0(%r4) ` here `r4` is pointing the `state` variable. And the moment this write happens we will corrupt the first 4 byte of callers_sp, which will cause issue while the stack-unwinding. And at the end JVM will crash with segmentation fault. This is always reproducible with the test case provided in the JBS. And test only failed with compiler (c1 & c2) but passed always with interpreter. ------------- Commit messages: - fix datatype mismatch Changes: https://git.openjdk.org/jdk/pull/25266/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25266&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356643 Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25266.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25266/head:pull/25266 PR: https://git.openjdk.org/jdk/pull/25266 From aivanov at openjdk.org Fri May 16 12:18:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 16 May 2025 12:18:59 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: <8gMOJCtNcN-Ou84pCTXuEV5h2AFnT0QMVOsYlPeD1EQ=.a967e9ae-1268-477a-8cb0-c503a7c63f39@github.com> On Wed, 7 May 2025 12:28:52 GMT, Manukumar V S wrote: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). Changes requested by aivanov (Reviewer). After reading the description again, I started to wonder which adverb suits better: [?forcibly?](https://en.wiktionary.org/wiki/forcibly) or [?forcefully?](https://en.wiktionary.org/wiki/forcefully). Does any native English speaker have an opinion? test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 160: > 158: * the test will be forcefully Passed/Failed accordingly. > 159: * Code examples are given in the corresponding method javadoc. > 160: *

Suggestion: * *

* For semi-automatic tests, use {@code forcePass} or * {@code forceFail} methods to forcibly pass or fail the test * when it's determined that the required conditions are already met * or cannot be met correspondingly. * These methods release {@code awaitAndCheck}, and * the test will complete successfully or fail. *

* Refer to examples of using these methods in the description of the * {@link #forcePass() forcePass} and {@link #forceFail() forceFail} methods. The empty `

` in the end before a heading is redundant and will be ignored. test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1325: > 1323: *

> 1324: * Use this method in semi-automatic tests when > 1325: * the test determines that all/any of the conditions for passing the test are not met. Suggestion: *

* Use this method in semi-automatic tests when * it is determined that the conditions for passing the test cannot be met. I still don't like this phrase? but I can't come up with a different one. test/jdk/java/awt/regtesthelpers/PassFailJFrame.java line 1342: > 1340: *

> 1341: * Use this method in semi-automatic tests when > 1342: * the test determines that all/any of the conditions for passing the test are not met. Suggestion: * Use this method in semi-automatic tests when * it is determined that the conditions for passing the test cannot be met. ------------- PR Review: https://git.openjdk.org/jdk/pull/25091#pullrequestreview-2846421361 PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2886557839 PR Review Comment: https://git.openjdk.org/jdk/pull/25091#discussion_r2092914570 PR Review Comment: https://git.openjdk.org/jdk/pull/25091#discussion_r2092919697 PR Review Comment: https://git.openjdk.org/jdk/pull/25091#discussion_r2092931090 From aph at openjdk.org Fri May 16 12:21:00 2025 From: aph at openjdk.org (Andrew Haley) Date: Fri, 16 May 2025 12:21:00 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: Message-ID: <5fiGZhiUeut1V4c4CAVraAsa4-Lv-B5z8Bvt19UK4X8=.72aa6db8-b7c7-40d7-9928-aa8ccf9567f9@github.com> On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky wrote: > This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`) > > Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened. > > I was not able to get response from original author for this issue, so I am creating PR myself. > > **Testing:** > I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. > > Without fix: > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1063 415 6 687 << > > > With fix > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1162 316 6 687 << > > > Many tests are no longer crashing the VM: > > -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Failed. Unexpected exit from test [exit code: 134] > +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Passed. Execution successful > > There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix) > > I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.) That looks right, and it should also be good for backports. The root cause must be a bug in Xlib, though. Has anyone found it, or reported it? ------------- Marked as reviewed by aph (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24197#pullrequestreview-2846458677 From amitkumar at openjdk.org Fri May 16 12:24:52 2025 From: amitkumar at openjdk.org (Amit Kumar) Date: Fri, 16 May 2025 12:24:52 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: Message-ID: On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky wrote: > This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`) > > Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened. > > I was not able to get response from original author for this issue, so I am creating PR myself. > > **Testing:** > I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. > > Without fix: > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1063 415 6 687 << > > > With fix > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1162 316 6 687 << > > > Many tests are no longer crashing the VM: > > -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Failed. Unexpected exit from test [exit code: 134] > +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Passed. Execution successful > > There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix) > > I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.) LGTM. I did the effort again as this issue was not under cpu:s390 tag, So I missed it. ------------- Marked as reviewed by amitkumar (Committer). PR Review: https://git.openjdk.org/jdk/pull/24197#pullrequestreview-2846469382 From amitkumar at openjdk.org Fri May 16 12:25:57 2025 From: amitkumar at openjdk.org (Amit Kumar) Date: Fri, 16 May 2025 12:25:57 GMT Subject: RFR: 8356643: Switching focus causes Segmentation Fault on zLinux In-Reply-To: References: Message-ID: <9KYgVTUFweo2qW69Tp6v3b9yw2NwA3BGcdIKR_LgJk8=.55bfdfc5-39c8-483a-b0b3-91a6126394f7@github.com> On Fri, 16 May 2025 11:29:26 GMT, Amit Kumar wrote: > In OpenJKD code, for big endian architecture, `XIMPreeditState` is considered `unsigned int` whereas in `xlib` code it is `unsigned long` [source](https://github.com/mirror/libX11/blob/ff8706a5eae25b8bafce300527079f68a201d27f/include/X11/Xlib.h#L1267). > > Now, openjdk compiled code pushes a frame and allots the address, just 4 bytes away, because it considers state to be a int, from the store `callers_sp` : > > > 2: /x $r15 = 0x3ff8137da20 > 3: x/2xg 0x3ff8137da20 > 0x3ff8137da20: 0x000003ff8137daf0 0x000003fffa2a9a86 > > > `0x000003ff8137daf0` is callers sp for s390x. And this is address for `state` : > > (gdb) p &state > $9 = (unsigned int *) 0x3ff8137da1c > > > which is just 4 byte away from the callers sp: > > (gdb) p/x 0x3ff8137da20 - 4 > $10 = 0x3ff8137da1c > > > Now while executing `_XimDecodePreeditState` method from xlib library where `state` is of type `unsigned long` we are going to emit a 8-byte instruction.: > > (gdb) disassemble _XimDecodePreeditState > Dump of assembler code for function _XimDecodePreeditState: > => 0x000003ff989f3360 <+0>: llgf %r1,8(%r2) > 0x000003ff989f3366 <+6>: lghi %r2,1 > 0x000003ff989f336a <+10>: lg %r1,0(%r3,%r1) > 0x000003ff989f3370 <+16>: stg %r1,0(%r4) > 0x000003ff989f3376 <+22>: br %r14 > End of assembler dump. > > > `0x000003ff989f3370 <+16>: stg %r1,0(%r4) ` here `r4` is pointing the `state` variable. And the moment this write happens we will corrupt the first 4 byte of callers_sp, which will cause issue while the stack-unwinding. And at the end JVM will crash with segmentation fault. This is always reproducible with the test case provided in the JBS. And test only failed with compiler (c1 & c2) but passed always with interpreter. closing in favour of https://github.com/openjdk/jdk/pull/24197 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25266#issuecomment-2886572360 From amitkumar at openjdk.org Fri May 16 12:25:57 2025 From: amitkumar at openjdk.org (Amit Kumar) Date: Fri, 16 May 2025 12:25:57 GMT Subject: Withdrawn: 8356643: Switching focus causes Segmentation Fault on zLinux In-Reply-To: References: Message-ID: On Fri, 16 May 2025 11:29:26 GMT, Amit Kumar wrote: > In OpenJKD code, for big endian architecture, `XIMPreeditState` is considered `unsigned int` whereas in `xlib` code it is `unsigned long` [source](https://github.com/mirror/libX11/blob/ff8706a5eae25b8bafce300527079f68a201d27f/include/X11/Xlib.h#L1267). > > Now, openjdk compiled code pushes a frame and allots the address, just 4 bytes away, because it considers state to be a int, from the store `callers_sp` : > > > 2: /x $r15 = 0x3ff8137da20 > 3: x/2xg 0x3ff8137da20 > 0x3ff8137da20: 0x000003ff8137daf0 0x000003fffa2a9a86 > > > `0x000003ff8137daf0` is callers sp for s390x. And this is address for `state` : > > (gdb) p &state > $9 = (unsigned int *) 0x3ff8137da1c > > > which is just 4 byte away from the callers sp: > > (gdb) p/x 0x3ff8137da20 - 4 > $10 = 0x3ff8137da1c > > > Now while executing `_XimDecodePreeditState` method from xlib library where `state` is of type `unsigned long` we are going to emit a 8-byte instruction.: > > (gdb) disassemble _XimDecodePreeditState > Dump of assembler code for function _XimDecodePreeditState: > => 0x000003ff989f3360 <+0>: llgf %r1,8(%r2) > 0x000003ff989f3366 <+6>: lghi %r2,1 > 0x000003ff989f336a <+10>: lg %r1,0(%r3,%r1) > 0x000003ff989f3370 <+16>: stg %r1,0(%r4) > 0x000003ff989f3376 <+22>: br %r14 > End of assembler dump. > > > `0x000003ff989f3370 <+16>: stg %r1,0(%r4) ` here `r4` is pointing the `state` variable. And the moment this write happens we will corrupt the first 4 byte of callers_sp, which will cause issue while the stack-unwinding. And at the end JVM will crash with segmentation fault. This is always reproducible with the test case provided in the JBS. And test only failed with compiler (c1 & c2) but passed always with interpreter. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25266 From aivanov at openjdk.org Fri May 16 12:45:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 16 May 2025 12:45:53 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: On Mon, 12 May 2025 17:59:51 GMT, Alexander Zuev wrote: > Looks reasonable. Using the blob version of the link to GH as a code example seems unusual but it works. It's the simplest way, and an explicit commit ensures the link always points to the line where the method is used. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2886615942 From azvegint at openjdk.org Fri May 16 13:50:44 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 16 May 2025 13:50:44 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place Message-ID: The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. It is a JCK conformance failure. --- In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): 1. It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. However, our robot implementation is mostly uses XTEST, but there is an exception: for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, on mouse press we call XTestFakeButtonEvent and it is handled by libei, so the click happens where is the actual mouse cursor is in the system. That is why the test fails. To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. It would be a simple solution, but 2. This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. --- So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. Most of the code can be reused, and it has everything we need. * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLocation()` uses the X11 API to get the mouse pointer location, `XRobotPeer#mouseMove` still calls the old API to update the mouse position within the XWayland server. This workaround is necessary to pass the another conformance test. ------------- Commit messages: - 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place Changes: https://git.openjdk.org/jdk/pull/25265/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25265&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351907 Stats: 941 lines in 13 files changed: 804 ins; 51 del; 86 mod Patch: https://git.openjdk.org/jdk/pull/25265.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25265/head:pull/25265 PR: https://git.openjdk.org/jdk/pull/25265 From vdyakov at openjdk.org Fri May 16 15:52:53 2025 From: vdyakov at openjdk.org (Victor Dyakov) Date: Fri, 16 May 2025 15:52:53 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place In-Reply-To: References: Message-ID: On Fri, 16 May 2025 10:40:22 GMT, Alexander Zvegintsev wrote: > The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. > It is a JCK conformance failure. > > --- > > In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. > > The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): > > 1. > > It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. > > However, our robot implementation is mostly uses XTEST, but there is an exception: > for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. > > So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, > on mouse press we call XTestFakeButtonEvent and it is handled by libei, > so the click happens where is the actual mouse cursor is in the system. That is why the test fails. > > To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. > > It would be a simple solution, but > > > 2. > > This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. > > It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. > > --- > > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. > Most of the code can be reused, and it has everything we need. > > > * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. > * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. > * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) > * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLo... @honkar-jdk @prrace please review ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2887102044 From prr at openjdk.org Fri May 16 18:21:59 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:21:59 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: <5fiGZhiUeut1V4c4CAVraAsa4-Lv-B5z8Bvt19UK4X8=.72aa6db8-b7c7-40d7-9928-aa8ccf9567f9@github.com> References: <5fiGZhiUeut1V4c4CAVraAsa4-Lv-B5z8Bvt19UK4X8=.72aa6db8-b7c7-40d7-9928-aa8ccf9567f9@github.com> Message-ID: On Fri, 16 May 2025 12:18:09 GMT, Andrew Haley wrote: > That looks right, and it should also be good for backports. The root cause must be a bug in Xlib, though. Has anyone found it, or reported it? That was my thought too : "Looks reasonable although it seems an odd behaviour (bug?) of XGetICValues" ------------- PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2887398135 From prr at openjdk.org Fri May 16 18:30:56 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:30:56 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 03:31:47 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 131: > >> 129: } >> 130: } catch (UnsupportedAudioFileException e) { >> 131: // not an audio file > > This code path seems will not be (rarely) executed? > The midi file will be handled above by the AudioSystem.getAudioInputStream() via SoftMidiAudioFileReader provider? But if converted midi->sampled data cannot be played via audio device then it might be useful to try MidiDevice, but I do not think it can be done by catching UnsupportedAudioFileException. Perhaps but that's the behaviour today and I don't see the need to change it in order to provide a different API to reach here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093505994 From prr at openjdk.org Fri May 16 18:30:59 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:30:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 19:32:00 GMT, Sergey Bylokhov wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356049 > > src/java.desktop/share/classes/javax/sound/SoundClip.java line 35: > >> 33: /** >> 34: * The {@code SoundClip} class is a simple abstraction for playing a sound clip. >> 35: * It will play any format that is recognized by the {@code javax.sound} API, > > I think we should mention in the doc that this is applicable for small audio files since we will load all data into the memory. What is small ? I would not want to try to define that. Since the application supplies the file it is in control of that and should know what it is supplying. Lots of APIs read files and don't mention that they need enough memory to hold the data in the file. The Applet case was historically even more constrained (64 Mb heap for applets once upon a time) and it seemed to be fine without this. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 45: > >> 43: * @since 25 >> 44: */ >> 45: public final class SoundClip { > > What about considering a different name, such as AudioClip with a static method like AudioClip.create(...)? or maybe Audio....Player? I picked SoundClip because AudioClip over AudioClip for a few reasons. Mapping to the Sound API name for one and because there's already an AudioClip. "Player" might be construed as a UI component. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 63: > >> 61: public static SoundClip createSoundClip(File file) throws IOException { >> 62: if (file == null) { >> 63: throw new IllegalArgumentException("file must not be null"); > > Most of the APIs in javax.sound.* throw NullPointerException for null arguments and IllegalArgumentException for other invalid parameters. Using NPE hadn't escaped me. I think that was probably common practice back then, but I think IAE is better here. > src/java.desktop/share/classes/javax/sound/SoundClip.java line 78: > >> 76: * of this class is a no-op. >> 77: */ >> 78: public synchronized boolean canPlay() { > > Should we perhaps document the multithreaded use of Clip? Do we really need all these synchronized keywords in the file? The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. I don't think there's anything to document. > src/java.desktop/share/classes/javax/sound/package-info.java line 43: > >> 41: * @since 25 >> 42: */ >> 43: package javax.sound; > > Why javax.sound and not sampled? do we want to support midi files by SoundClip as well? That and a top-level is easier to find. I did spend some time debating with myself over whether to create a new package just for this class but it made the most sense. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 34: > >> 32: * @key sound headful >> 33: * @summary basic testing of javax.sound.SoundClip >> 34: * @run main/othervm SoundClipTest javasound.wav > > What about a non-existent or broken file? Should we check for an IOException in that case? I could do a minor test enhancement for this case. I don't think it would be an IOException for a broken file, it would just not be playable. > test/jdk/javax/sound/SoundClip/SoundClipTest.java line 41: > >> 39: public static void main(String[] args) throws Exception { >> 40: >> 41: if (!isSoundcardInstalled()) { > > Why we cannot check that the playing sound is a no-op in this case, as specified? The intent is that this should always run on a system with sound. It just might happen that it isn't, so this isn't a case to start adding tests. That might be better done by feeding it unplayable data. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087653970 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087618093 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087623944 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087626652 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087628133 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087631361 PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087647725 From prr at openjdk.org Fri May 16 18:31:00 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:31:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 19:45:48 GMT, Sergey Bylokhov wrote: >> Or maybe we can add this API to AudioSystem/clip? >> Old code >> >> File file = new File(file); >> AudioInputStream audioIn = AudioSystem.getAudioInputStream(...file...); >> Clip clip = AudioSystem.getClip(); >> clip.open(audioIn); >> clip.start(); >> >> new code: >> >> File file = new File(file); >> AudioClip clip = AudioSystem.getAudioClip(...file...); >> clip.play()/canPlay/loop/stop; > > or maybe inject all these simple methods into `javax.sound.sampled.Clip` or its subclass/superclass. > Can we gain any benefits by using Path instead? You had mentioned that and I looked but I didn't see any compelling reason. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2087621643 From prr at openjdk.org Fri May 16 18:31:00 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:31:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 04:40:26 GMT, Sergey Bylokhov wrote: >> And still do we want to have all of them synchronized? so the app may affect these methods by synchronized(soundClip)? > >> * Each time this method is called, the clip is restarted from the beginning. > Note that calls within 30 ms are ignored: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java#L158 I don't think any of the above requires changes. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093507736 From prr at openjdk.org Fri May 16 18:35:54 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:35:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 03:50:12 GMT, Sergey Bylokhov wrote: >> What is small ? I would not want to try to define that. >> Since the application supplies the file it is in control of that and should know what it is supplying. >> Lots of APIs read files and don't mention that they need enough memory to hold the data in the file. >> The Applet case was historically even more constrained (64 Mb heap for applets once upon a time) and >> it seemed to be fine without this. > > Example of memory requirement: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/javax/sound/sampled/Clip.java#L34 That's not defining small. Its about another topic entirely : positioning. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093514437 From prr at openjdk.org Fri May 16 18:39:58 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:39:58 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 04:01:17 GMT, Sergey Bylokhov wrote: >> I picked SoundClip because AudioClip over AudioClip for a few reasons. Mapping to the Sound API name for one and because there's already an AudioClip. "Player" might be construed as a UI component. > > Could having both javax.sound.SoundClip and javax.sound.sampled.Clip cause confusion? I don't see a big problem here. Naming is a choice and SoundClip is a sensible choice here and anything else would just be a different choice which someone else might disagree with. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093518982 From prr at openjdk.org Fri May 16 18:45:54 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 18:45:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: <3-KbtEsAwLLS8Ge__LmkptkvGdoQZ7sBTLWDeNFaZIw=.1b3f6fa1-bffe-448a-a3d7-3a2ebdbc9f79@github.com> On Wed, 14 May 2025 18:34:40 GMT, Sergey Bylokhov wrote: > I respectfully disagree for a few reasons: > > > NullPointerException, on the other hand, indicates the code accessed an object but the reference was null. (This could occur, for example, if parameters aren't validated.) > > Implementation and documentation of Objects.requireNonNull including its use in our codebase and in newly added code suggests that it is intended for validating parameters before dereferencing them. This contradicts the strict separation you're implying. > > Additionally as I mentioned earlier the javax.sound.** code already uses npe for null parameter checks. Introducing a mix of exception styles would reduce consistency. The verbiage on those "sub" packages says it applies to those sub-packages not others. Moreover it was not there in the original Java Sound API docs. There was no "careful thought" given to NPE being the way to do things. It was added to avoid having to explicitly retroactively specify @throws NPE on however many methods didn't actually declare it in their spec and "accidentally" threw NPE. So not a design practice to follow. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093526197 From serb at openjdk.org Fri May 16 19:11:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 19:11:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place In-Reply-To: References: Message-ID: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> On Fri, 16 May 2025 10:40:22 GMT, Alexander Zvegintsev wrote: > The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. > It is a JCK conformance failure. > > --- > > In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. > > The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): > > 1. > > It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. > > However, our robot implementation is mostly uses XTEST, but there is an exception: > for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. > > So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, > on mouse press we call XTestFakeButtonEvent and it is handled by libei, > so the click happens where is the actual mouse cursor is in the system. That is why the test fails. > > To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. > > It would be a simple solution, but > > > 2. > > This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. > > It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. > > --- > > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. > Most of the code can be reused, and it has everything we need. > > > * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. > * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. > * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) > * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLo... src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java line 259: > 257: try { > 258: Process process = > 259: new ProcessBuilder("/usr/bin/gnome-shell", "--version") Before the patch the getGnomeShellMajorVersion was guarded by the "gnome.equals(getDesktop()))" should we do the same in XdgDesktopPortal? or maybe we can at least check if gnome-shell exists so we don't waste time launching it? or is ProcessBuilder's performance good enough? BTW how it is expected to work on KDE + wayland? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2093555459 From aivanov at openjdk.org Fri May 16 20:09:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 16 May 2025 20:09:57 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v2] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 10:34:38 GMT, Tejesh R wrote: >> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. >> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. > > Tejesh R has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Merge branch 'master' of https://git.openjdk.java.net/jdk into branch_8139228 > - Fix for windows L&F > - Fix + Manual test Changes requested by aivanov (Reviewer). src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java line 1195: > 1193: setIcon(fc.getIcon(file)); > 1194: setEnabled(isSelectableInList(file)); > 1195: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); Suggestion: putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); No method call above uses explicit `this`, I see no reason to use it here either. This comment applies to all the modified files. src/java.desktop/share/classes/sun/swing/FilePane.java line 1238: > 1236: setText(text); > 1237: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); > 1238: return this; Be consistent at least inside one file. Here you removed the blank line, but below at 1632?1635 you preserved the blank line. src/java.desktop/share/classes/sun/swing/FilePane.java line 1635: > 1633: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); > 1634: > 1635: return this; I prefer this style everywhere: all the code that sets up the component, a blank line followed by the `return` statement. I'd add a blank line before `putClientProperty` as well ? setting the `"html.disable"` property isn't the part of previous statements which configure the renderer component one way or another, and, with blank lines around this call, it will stand out in the code. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 68: > 66: .instructions(INSTRUCTIONS) > 67: .columns(45) > 68: .testUI(initialize()) In majority of cases, you should pass a method reference rather than the result of a method call to `testUI`. As it's written, the `initialize` is executed on the main thread, and its result?the list frames?is passed to `PassFailJFrame`. What you actually want is `HTMLFileName::initialize`. In this case, the `PassFailJFrame` framework will call the `initialize` method on EDT when the time to create UI comes. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 69: > 67: .columns(45) > 68: .testUI(initialize()) > 69: .position(PassFailJFrame.Position.TOP_LEFT_CORNER) Suggestion: .positionTestUIRightColumn() I suggest using [**`positionTestUIRightColumnCentered`**](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIRightColumnCentered()) to lay out the entire test UI in the centre of the screen. Since two file choosers take quite a lot of space, the file chooser at the bottom doesn't fit the screen if you use [`positionTestUIRightColumn`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIRightColumn()). Alternatively, you can choose a horizontal layout with [`positionTestUIBottomRowCentered`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIBottomRowCentered()). test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 79: > 77: } > 78: > 79: public static List initialize() { Suggestion: private static List initialize() { test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 84: > 82: String fileName = homeDir + File.separator + > 83: "

Testing Name"; > 84: directory = new File(fileName); You shouldn't create the files in the home directory of the user any way. Create them in the current directory which is a scratch directory when the test is run with jtreg; the contents of the scratch directory is automatically removed by jtreg when the test exits, even if the test itself fails to remove its own temporary files. Yet if you create the files in the user's home, all these files and directories will be still be around if anything goes awry in the test. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 85: > 83: "

Testing Name"; > 84: directory = new File(fileName); > 85: directory.mkdir(); Do you need the directory at all? Use `VirtualFileSystemView` for all platforms. The fact that it's possible to create files with HTML tags in the name is irrelevant to the test. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 96: > 94: jfc = new JFileChooser(homeDir); > 95: jfc_HTML_Enabled = new JFileChooser(homeDir); > 96: } I suggest creating a method that creates one file chooser placed in a frame; pass a boolean parameter to specify whether to set the `"html.disable"` property to `false` or keep its default value of `true`. Then your `initialize` method would be as simple as a single return statement: private static List initialize() { return List.of(createFileChooser(true), createFileChooser(false)); } test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 107: > 105: } > 106: > 107: static class VirtualFileSystemView extends FileSystemView { Suggestion: private static class VirtualFileSystemView extends FileSystemView { ------------- PR Review: https://git.openjdk.org/jdk/pull/24439#pullrequestreview-2847459647 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093571535 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093578359 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093586784 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093592420 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093595668 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093604829 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093609644 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093604201 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093617717 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2093604589 From azvegint at openjdk.org Fri May 16 20:45:39 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 16 May 2025 20:45:39 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: > The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. > It is a JCK conformance failure. > > --- > > In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. > > The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): > > 1. > > It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. > > However, our robot implementation is mostly uses XTEST, but there is an exception: > for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. > > So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, > on mouse press we call XTestFakeButtonEvent and it is handled by libei, > so the click happens where is the actual mouse cursor is in the system. That is why the test fails. > > To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. > > It would be a simple solution, but > > > 2. > > This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. > > It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. > > --- > > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. > Most of the code can be reused, and it has everything we need. > > > * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. > * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. > * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) > * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLo... Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: Only call getGnomeShellMajorVersion when the desktop is Gnome. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25265/files - new: https://git.openjdk.org/jdk/pull/25265/files/f75e0ed7..5d08133e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25265&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25265&range=00-01 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25265.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25265/head:pull/25265 PR: https://git.openjdk.org/jdk/pull/25265 From azvegint at openjdk.org Fri May 16 20:45:39 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 16 May 2025 20:45:39 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> References: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> Message-ID: On Fri, 16 May 2025 19:09:41 GMT, Sergey Bylokhov wrote: > Before the patch the getGnomeShellMajorVersion was guarded by the "gnome.equals(getDesktop()))" should we do the same in XdgDesktopPortal? Thanks, this is a good point, updated. > or maybe we can at least check if gnome-shell exists so we don't waste time launching it? or is ProcessBuilder's performance good enough? It's actually pretty fast for a non-existent binary, only 1 ms The `getGnomeShellMajorVersion` check takes about 33 ms on my machine when the binary is in the system. Alternatively we can try to receive this version via DBUS API and see if it is faster. It is definitely available through introspection: `gdbus introspect --session --dest org.gnome.Shell --object-path /org/gnome/Shell | grep ShellVersion` But not as part of this issue, [JDK-8357174](https://bugs.openjdk.org/browse/JDK-8357174) created. > BTW how it is expected to work on KDE + wayland? It is not a supported configuration.However, when I tested it a while ago, it only worked in a single-screen scenario for the Screencast. There was an issue with the screen streams; they did not specify their `x` and `y` coordinates. This prevented the correct arrangement of multiple screens. I don't know if this has been fixed, but the issue is addressed in our code here: https://github.com/openjdk/jdk/blob/3dd34517000e4ce1a21619922c62c025f98aad44/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c#L132-L155 In this case, the Screencast is simply disabled. The Remote Desktop uses the same streams from Screencast portal to control the mouse position. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2093639881 From serb at openjdk.org Fri May 16 20:53:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 20:53:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: <7uFWKUMMkDky6Qy3Z5-DW7tPyAMIXj3RDP6XbvQi_1s=.b2a9faea-99e6-4142-a159-d2e68280cfbd@github.com> On Fri, 16 May 2025 18:33:01 GMT, Phil Race wrote: >> Example of memory requirement: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/javax/sound/sampled/Clip.java#L34 > > That's not defining small. Its about another topic entirely : positioning. But then you may get exactly the same bug we discussed recently about converting midi files into audio stream and loading all that into the memory. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093663955 From serb at openjdk.org Fri May 16 20:53:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 20:53:55 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: <3-KbtEsAwLLS8Ge__LmkptkvGdoQZ7sBTLWDeNFaZIw=.1b3f6fa1-bffe-448a-a3d7-3a2ebdbc9f79@github.com> References: <3-KbtEsAwLLS8Ge__LmkptkvGdoQZ7sBTLWDeNFaZIw=.1b3f6fa1-bffe-448a-a3d7-3a2ebdbc9f79@github.com> Message-ID: On Fri, 16 May 2025 18:43:33 GMT, Phil Race wrote: >It was added to avoid having to explicitly retroactively specify @throws NPE on however many methods didn't actually declare it in their spec and "accidentally" threw NPE. No, in many cases NPE was explicitly added to many methods in that packages, even if npe had not been thrown before. It is better to use NPE. Check how many "@throws NullPointerException if XXX is {@code null}" is in that code, and compare that with usage of IllegalArgumentException. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093662600 From serb at openjdk.org Fri May 16 21:00:59 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:00:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 18:25:15 GMT, Phil Race wrote: >> src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java line 131: >> >>> 129: } >>> 130: } catch (UnsupportedAudioFileException e) { >>> 131: // not an audio file >> >> This code path seems will not be (rarely) executed? >> The midi file will be handled above by the AudioSystem.getAudioInputStream() via SoftMidiAudioFileReader provider? But if converted midi->sampled data cannot be played via audio device then it might be useful to try MidiDevice, but I do not think it can be done by catching UnsupportedAudioFileException. > > Perhaps but that's the behaviour today and I don't see the need to change it in order to provide a different API to reach here. My point was not about adding a different API, but about changing this logic, which I believe no longer works well after the Gervill integration. For MIDI files, we should first attempt to play them as audio files(we do it now). But if no audio output devices are available then should fallback to this code path and use a MidiDevice directly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093670550 From prr at openjdk.org Fri May 16 21:01:00 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 21:01:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: <3-KbtEsAwLLS8Ge__LmkptkvGdoQZ7sBTLWDeNFaZIw=.1b3f6fa1-bffe-448a-a3d7-3a2ebdbc9f79@github.com> Message-ID: On Fri, 16 May 2025 20:50:14 GMT, Sergey Bylokhov wrote: > > It was added to avoid having to explicitly retroactively specify @throws NPE on however many methods didn't actually declare it in their spec and "accidentally" threw NPE. > > No, in many cases NPE was explicitly added to many methods in that packages, even if npe had not been thrown before. It is better to use NPE. Check how many "@throws NullPointerException if XXX is {@code null}" is in that code, and compare that with usage of IllegalArgumentException. So even if some parts ofthe fix up did add NPE after the fact - documenting what was already happening by accident doesn't seem to support a clear design desicion or an essential need to use NPE in this case ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093669729 From serb at openjdk.org Fri May 16 21:01:01 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:01:01 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 18:26:47 GMT, Phil Race wrote: >>> * Each time this method is called, the clip is restarted from the beginning. >> Note that calls within 30 ms are ignored: https://github.com/openjdk/jdk/blob/2c4e8d211a030c85488e656a9a851d10dd0f9c11/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java#L158 > > I don't think any of the above requires changes. Still, it's worth making some arguments: - Why are all these methods marked as synchronized? - Why don't we want to specify that the application will be blocked from exiting if sound is playing? especially if loop() was called. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093667050 From prr at openjdk.org Fri May 16 21:05:57 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 21:05:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: <7uFWKUMMkDky6Qy3Z5-DW7tPyAMIXj3RDP6XbvQi_1s=.b2a9faea-99e6-4142-a159-d2e68280cfbd@github.com> References: <7uFWKUMMkDky6Qy3Z5-DW7tPyAMIXj3RDP6XbvQi_1s=.b2a9faea-99e6-4142-a159-d2e68280cfbd@github.com> Message-ID: On Fri, 16 May 2025 20:51:39 GMT, Sergey Bylokhov wrote: > But then you may get exactly the same bug we discussed recently about converting midi files into audio stream and loading all that into the memory. I think that shows that you can't document what small is ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093672960 From serb at openjdk.org Fri May 16 21:05:58 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:05:58 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 21:00:20 GMT, Phil Race wrote: >> src/java.desktop/share/classes/javax/sound/SoundClip.java line 78: >> >>> 76: * of this class is a no-op. >>> 77: */ >>> 78: public synchronized boolean canPlay() { >> >> Should we perhaps document the multithreaded use of Clip? Do we really need all these synchronized keywords in the file? > > The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. I don't think there's anything to document. Hmm I did not see all this responses for yesterday... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093674887 From serb at openjdk.org Fri May 16 21:05:59 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:05:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 03:58:41 GMT, Sergey Bylokhov wrote: >> The intent is that this should always run on a system with sound. It just might happen that it isn't, so this isn't a case to start adding tests. >> That might be better done by feeding it unplayable data. > > Why do not check this case as well? But it is part of the new spec: > * if the implementation does not find a suitable output device for the data, > * playing the clip will be a no-op. It is better to cover it if we have a chance than just exiting. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093673788 From serb at openjdk.org Fri May 16 21:10:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:10:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 21:03:18 GMT, Sergey Bylokhov wrote: >> The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. I don't think there's anything to document. > > Hmm I did not see all this responses for yesterday... >The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. But previously it was protected by methods in the non-public JavaSoundAudioClip, which extended AudioClip. Now SoundClip wraps JavaSoundAudioClip with the same results. Moreover, previously synchronized was not part of the public API, now it is. One of the benefits to remove them is that it will not be possible to abuse synchronized(SoundClip) which will block execution of its methods. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093678819 From prr at openjdk.org Fri May 16 21:16:50 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 21:16:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> Message-ID: On Fri, 16 May 2025 20:28:25 GMT, Alexander Zvegintsev wrote: > The getGnomeShellMajorVersion check takes about 33 ms on my machine when the binary is in the system. This seems like it is the 'common case', and I think we discussed the performance when it was added (yes we did I just checked) even though at that time it was only for SystemTray and it was noted then that DBUS would be a better solution : https://github.com/openjdk/jdk/pull/17860#discussion_r1490283265 We've started using it for Robot too, but its still not on a "start up" path, so its still a nice-to-have but not at all critical. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2093684318 From serb at openjdk.org Fri May 16 21:17:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:17:55 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: <3-KbtEsAwLLS8Ge__LmkptkvGdoQZ7sBTLWDeNFaZIw=.1b3f6fa1-bffe-448a-a3d7-3a2ebdbc9f79@github.com> Message-ID: On Fri, 16 May 2025 20:57:42 GMT, Phil Race wrote: >>>It was added to avoid having to explicitly retroactively specify @throws NPE on however many methods didn't actually declare it in their spec and "accidentally" threw NPE. >> >> No, in many cases NPE was explicitly added to many methods in that packages, even if npe had not been thrown before. It is better to use NPE. Check how many "@throws NullPointerException if XXX is {@code null}" is in that code, and compare that with usage of IllegalArgumentException. > >> > It was added to avoid having to explicitly retroactively specify @throws NPE on however many methods didn't actually declare it in their spec and "accidentally" threw NPE. >> >> No, in many cases NPE was explicitly added to many methods in that packages, even if npe had not been thrown before. It is better to use NPE. Check how many "@throws NullPointerException if XXX is {@code null}" is in that code, and compare that with usage of IllegalArgumentException. > > So even if some parts ofthe fix up did add NPE after the fact - documenting what was already happening by accident doesn't seem to support a clear design desicion or an essential need to use NPE in this case That is not an accident, most of that API already thrown IllegalArgumentException and we could change to throw it on null as well, but the whole JavaSound api was checked and unified to throw only one NPE. What is the point of adding an IllegalArgumentException just for that one case? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093684901 From dgredler at openjdk.org Fri May 16 21:49:55 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 16 May 2025 21:49:55 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 06:35:45 GMT, Matthias Baesken wrote: >> I added your PR to our build/test queue, let's see if it fixes the issues. > >> Looks good to me. I didn't try to reproduce the problem. Let's wait for @MBaesken test results. > > Test results look good, with your PR the issue is gone on the 2 Linux machines where we noticed it before . @MBaesken Thanks for the confirmation! @honkar-jdk Do you feel OK approving based on the test feedback above? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2887731013 From azvegint at openjdk.org Fri May 16 21:53:55 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 16 May 2025 21:53:55 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> Message-ID: On Fri, 16 May 2025 21:14:17 GMT, Phil Race wrote: > I think we discussed the performance when it was added (yes we did I just checked) even though at that time it was only for SystemTray and it was noted then that DBUS would be a better solution : https://github.com/openjdk/jdk/pull/17860#discussion_r1490283265 Oh, thanks for the reminder. > but its still not on a "start up" path It's not exactly in there, but it might be pretty close. It's being [called](https://github.com/openjdk/jdk/commit/f75e0ed7c313700044557db6ea09cfd9e85eac70#diff-bc685def01d3c123e569dec4b2dfe03163da3853321e94d2fa81f93e049412c2L1524) now during the static initialization of `MouseEvent`, for example, when the pointer is moved to a frame by a user: java.lang.Exception: Stack trace at java.base/java.lang.Thread.dumpStack(Thread.java:1991) at java.desktop/sun.awt.X11.XToolkit.getNumberOfButtons(XToolkit.java:1526) at java.desktop/java.awt.event.MouseEvent.(MouseEvent.java:404) at java.desktop/sun.awt.X11.XWindow.handleXCrossingEvent(XWindow.java:995) at java.desktop/sun.awt.X11.XComponentPeer.handleXCrossingEvent(XComponentPeer.java:74) at java.desktop/sun.awt.X11.XBaseWindow.dispatchEvent(XBaseWindow.java:1155) at java.desktop/sun.awt.X11.XBaseWindow.dispatchToWindow(XBaseWindow.java:1113) at java.desktop/sun.awt.X11.XToolkit.dispatchEvent(XToolkit.java:592) at java.desktop/sun.awt.X11.XToolkit.run(XToolkit.java:705) at java.desktop/sun.awt.X11.XToolkit.run(XToolkit.java:621) at java.base/java.lang.Thread.run(Thread.java:1447) It's still not critical though. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2093712590 From serb at openjdk.org Fri May 16 21:56:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 21:56:53 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: <7uFWKUMMkDky6Qy3Z5-DW7tPyAMIXj3RDP6XbvQi_1s=.b2a9faea-99e6-4142-a159-d2e68280cfbd@github.com> Message-ID: On Fri, 16 May 2025 21:01:13 GMT, Phil Race wrote: >> But then you may get exactly the same bug we discussed recently about converting midi files into audio stream and loading all that into the memory. > >> But then you may get exactly the same bug we discussed recently about converting midi files into audio stream and loading all that into the memory. > > I think that shows that you can't document what small is it depends from the heap, but we may document it similar to what Clip(link above) currently say: > * The {@code Clip} ........ can load all data prior to playback, instead of being streamed in real time. at least we should check that similar "big boom" will not happen. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093714330 From prr at openjdk.org Fri May 16 22:04:54 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 22:04:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: Message-ID: <1Un21fM0uraTLpioLLwvcMP55EMzRWoSCVYZ_THMh6w=.94cd92e5-0018-4bad-9c72-311d507de878@github.com> On Fri, 16 May 2025 21:07:49 GMT, Sergey Bylokhov wrote: > > The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. > > But previously it was protected by methods in the non-public JavaSoundAudioClip, which extended AudioClip. Now SoundClip wraps JavaSoundAudioClip with the same results. Moreover, previously synchronized was not part of the public API, now it is. > > One of the benefits to remove them is that it will not be possible to abuse synchronized(SoundClip) which will block execution of its methods. That is no different than with the applet AudioClip .. it doesn't matter whether it is in the API doc, they are all synchronized. And I don't know why an app would hold a lock that prevents itself from working. We can later - meaning in another release - remove synchronized if there's a compelling reason to do so, but I would have thought it better to be explicit about this - unlike applet AudioClip. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093722139 From prr at openjdk.org Fri May 16 22:04:54 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 22:04:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: <1Un21fM0uraTLpioLLwvcMP55EMzRWoSCVYZ_THMh6w=.94cd92e5-0018-4bad-9c72-311d507de878@github.com> References: <1Un21fM0uraTLpioLLwvcMP55EMzRWoSCVYZ_THMh6w=.94cd92e5-0018-4bad-9c72-311d507de878@github.com> Message-ID: On Fri, 16 May 2025 22:01:11 GMT, Phil Race wrote: >>>The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. >> But previously it was protected by methods in the non-public JavaSoundAudioClip, which extended AudioClip. Now SoundClip wraps JavaSoundAudioClip with the same results. Moreover, previously synchronized was not part of the public API, now it is. >> >> One of the benefits to remove them is that it will not be possible to abuse synchronized(SoundClip) which will block execution of its methods. > >> > The API calls are best protected this way just like the ones in AudioClip were. There's no advantage in removing them. >> > But previously it was protected by methods in the non-public JavaSoundAudioClip, which extended AudioClip. Now SoundClip wraps JavaSoundAudioClip with the same results. Moreover, previously synchronized was not part of the public API, now it is. >> >> One of the benefits to remove them is that it will not be possible to abuse synchronized(SoundClip) which will block execution of its methods. > > That is no different than with the applet AudioClip .. it doesn't matter whether it is in the API doc, they are all synchronized. And I don't know why an app would hold a lock that prevents itself from working. > We can later - meaning in another release - remove synchronized if there's a compelling reason to do so, but I would have thought it better to be explicit about this - unlike applet AudioClip. > Hmm I did not see all this responses for yesterday... I umm went to add new comments today and it looked like I did not submit a previous batch of pending replies ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093722549 From serb at openjdk.org Fri May 16 22:05:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 16 May 2025 22:05:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> Message-ID: <-5JfOcgmQU0aU4Zj_9GbtNHyCv2qbe-fK1jSTXqXIcc=.164fcc53-248f-4c08-802d-23276862149f@github.com> On Fri, 16 May 2025 21:51:00 GMT, Alexander Zvegintsev wrote: > It's still not critical though. that looks fine. Maybe as a temporary solution, we can preload this property at Toolkit startup in a separate thread, and wait for XdgDesktopPortal/etc only if that thread hasn't completed yet? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2093722225 From duke at openjdk.org Fri May 16 22:09:59 2025 From: duke at openjdk.org (Florian) Date: Fri, 16 May 2025 22:09:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v2] In-Reply-To: References: Message-ID: On Fri, 2 May 2025 23:00:32 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 I wonder about the limitation to `java.io.File` as source for sound clips. Allowing playback from an `InputStream` allows developers to use their own packaging, compression, bundling, or use dynamically generated sound clips, and to work around missing file access permissions. How about this additional factory method: public static SoundClip createSoundClip(InputStream file) throws IOException; The implementation is simple, because it boils down to an InputStream internally anyway, and testing is equally simple. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2848551015 From prr at openjdk.org Fri May 16 22:09:59 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 22:09:59 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v5] In-Reply-To: References: <7uFWKUMMkDky6Qy3Z5-DW7tPyAMIXj3RDP6XbvQi_1s=.b2a9faea-99e6-4142-a159-d2e68280cfbd@github.com> Message-ID: On Fri, 16 May 2025 21:53:14 GMT, Sergey Bylokhov wrote: > it depends from the heap, but we may document it similar to what Clip(link above) currently say: > > > * The {@code Clip} ........ can load all data prior to playback, instead of being streamed in real time. > > at least we should check that similar "big boom" will not happen. Then that's up to the app to not use such a big file, and its no different than the existing API. Adding a new way of getting there doesn't require going to fix a long time questionable problem. And as I wrote before "The Applet case was historically even more constrained (64 Mb heap for applets once upon a time) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24991#discussion_r2093726348 From prr at openjdk.org Fri May 16 23:09:42 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 16 May 2025 23:09:42 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API Message-ID: Update the some code examples and accompanying images to no longer mention or display as applets. ------------- Commit messages: - 8357176 Changes: https://git.openjdk.org/jdk/pull/25278/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357176 Stats: 164 lines in 17 files changed: 47 ins; 20 del; 97 mod Patch: https://git.openjdk.org/jdk/pull/25278.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25278/head:pull/25278 PR: https://git.openjdk.org/jdk/pull/25278 From honkar at openjdk.org Fri May 16 23:31:50 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 16 May 2025 23:31:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 20:45:39 GMT, Alexander Zvegintsev wrote: >> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. >> It is a JCK conformance failure. >> >> --- >> >> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. >> >> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): >> >> 1. >> >> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. >> >> However, our robot implementation is mostly uses XTEST, but there is an exception: >> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. >> >> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, >> on mouse press we call XTestFakeButtonEvent and it is handled by libei, >> so the click happens where is the actual mouse cursor is in the system. That is why the test fails. >> >> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. >> >> It would be a simple solution, but >> >> >> 2. >> >> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. >> >> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. >> >> --- >> >> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). >> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. >> Most of the code can be reused, and it has everything we need. >> >> >> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. >> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. >> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) >> * Since w... > > Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: > > Only call getGnomeShellMajorVersion when the desktop is Gnome. @azvegint > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and restore_token functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. Since there is a manual part (i.e granting permission for the 1st time) , is it a good idea to convert the OELMouseTest.java (test attached to JBS) as a semi-automated PassFailJFrame test and run it on linux platforms with awt.robot.screenshotMethod property - dbusRemoteDesktop (and skipping if not) and this way there would be a dedicated jtreg test for this fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2887839657 From honkar at openjdk.org Fri May 16 23:34:50 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 16 May 2025 23:34:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 20:45:39 GMT, Alexander Zvegintsev wrote: >> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. >> It is a JCK conformance failure. >> >> --- >> >> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. >> >> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): >> >> 1. >> >> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. >> >> However, our robot implementation is mostly uses XTEST, but there is an exception: >> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. >> >> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, >> on mouse press we call XTestFakeButtonEvent and it is handled by libei, >> so the click happens where is the actual mouse cursor is in the system. That is why the test fails. >> >> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. >> >> It would be a simple solution, but >> >> >> 2. >> >> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. >> >> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. >> >> --- >> >> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). >> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. >> Most of the code can be reused, and it has everything we need. >> >> >> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. >> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. >> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) >> * Since w... > > Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: > > Only call getGnomeShellMajorVersion when the desktop is Gnome. Review in-progress. I would require some time to go over the fix in detail to understand and test it. ------------- PR Review: https://git.openjdk.org/jdk/pull/25265#pullrequestreview-2847762631 From honkar at openjdk.org Fri May 16 23:39:51 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 16 May 2025 23:39:51 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v3] In-Reply-To: References: Message-ID: On Thu, 15 May 2025 17:20:06 GMT, Daniel Gredler wrote: >> If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. >> >> This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. >> >> It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update bug tag in test class Marked as reviewed by honkar (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25235#pullrequestreview-2847765614 From honkar at openjdk.org Fri May 16 23:39:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 16 May 2025 23:39:52 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v3] In-Reply-To: References: Message-ID: On Wed, 14 May 2025 20:38:47 GMT, Harshitha Onkar wrote: >> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: >> >> Update bug tag in test class > > I wasn't able replicate and verify the fix myself as I don't have specific linux flavors (RHEL,SLES) to test it . > @honkar-jdk Do you feel OK approving based on the test feedback above? Sure. Approved. When this code is touched again adding isIgnorableWhitespace() to `CharToGlyphMapper` would be ideal. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2887845552 From honkar at openjdk.org Sat May 17 00:09:00 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Sat, 17 May 2025 00:09:00 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java Message-ID: CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. Test failure is not reproducible when the test is run individually (multiple times) on CI. Rewritten the test and added debug logs that will be helpful to figure out the issue. - Added code to capture screenshot (entire screen as well as the frame) in case of failure. - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. ------------- Commit messages: - copyright year - CopyAreaOOB: debug logs Changes: https://git.openjdk.org/jdk/pull/25279/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357082 Stats: 114 lines in 2 files changed: 59 ins; 27 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/25279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25279/head:pull/25279 PR: https://git.openjdk.org/jdk/pull/25279 From duke at openjdk.org Sat May 17 02:01:01 2025 From: duke at openjdk.org (duke) Date: Sat, 17 May 2025 02:01:01 GMT Subject: Withdrawn: 6734168: BasicButtonUI uses wrong FontMetrics to Layout JButtons text In-Reply-To: <4L7IZ1vyx4DQViAeZUzvA2LcoY7a-QKF-CUaAQBEO0c=.ec145df4-4e9b-40de-84c0-249b67cd9077@github.com> References: <4L7IZ1vyx4DQViAeZUzvA2LcoY7a-QKF-CUaAQBEO0c=.ec145df4-4e9b-40de-84c0-249b67cd9077@github.com> Message-ID: On Fri, 21 Mar 2025 11:26:34 GMT, Prasanta Sadhukhan wrote: > javax.swing.plaf.basic.BasicButtonUI uses wrong FontMetrics object to layout the text on a JButton. > The paint(Graphics, JComponent) method of BasicButtonUI calculates the [FontMetrics](https://github.com/openjdk/jdk/blob/6656254c346ef505a48652fdf4dedd6edc020e33/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonUI.java#L331) using the passed Graphics object without setting the buttons font before. If the buttons font varies from the currently set font of the passed graphics object, the font metrics do not fit the metrics of the expected font leading to truncated text on the button. > In WindowsLookAndFeel, the font in passed graphics object differs from currently set font as in > > button font javax.swing.plaf.FontUIResource[family=Tahoma,name=Tahoma,style=plain,size=10] > graphics font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=12] > > whereas in Metal and other L&F it is > `font javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=bold,size=12]` > > so the fix is made in Windows L&F to ensure to set the font of the button to the passed graphics object font before calculating the current FontMetrics. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/24152 From mvs at openjdk.org Sun May 18 13:20:46 2025 From: mvs at openjdk.org (Manukumar V S) Date: Sun, 18 May 2025 13:20:46 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods [v2] In-Reply-To: References: Message-ID: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Formatting changes, wordings changed ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25091/files - new: https://git.openjdk.org/jdk/pull/25091/files/68f72e46..9f0a6321 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25091&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25091&range=00-01 Stats: 15 lines in 1 file changed: 3 ins; 1 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/25091.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25091/head:pull/25091 PR: https://git.openjdk.org/jdk/pull/25091 From mvs at openjdk.org Sun May 18 13:20:46 2025 From: mvs at openjdk.org (Manukumar V S) Date: Sun, 18 May 2025 13:20:46 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: <8gMOJCtNcN-Ou84pCTXuEV5h2AFnT0QMVOsYlPeD1EQ=.a967e9ae-1268-477a-8cb0-c503a7c63f39@github.com> References: <8gMOJCtNcN-Ou84pCTXuEV5h2AFnT0QMVOsYlPeD1EQ=.a967e9ae-1268-477a-8cb0-c503a7c63f39@github.com> Message-ID: On Fri, 16 May 2025 12:16:40 GMT, Alexey Ivanov wrote: > After reading the description again, I started to wonder which adverb suits better: [?forcibly?](https://en.wiktionary.org/wiki/forcibly) or [?forcefully?](https://en.wiktionary.org/wiki/forcefully). Does any native English speaker have an opinion? I think forcefully is more apt compared to forcibly, changed it accordingly. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2888984691 From serb at openjdk.org Sun May 18 22:59:36 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 18 May 2025 22:59:36 GMT Subject: RFR: 8355078: java.awt.Color.createContext() uses unnecessary synchronization [v2] In-Reply-To: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> References: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> Message-ID: > At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. > > > Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. > > Two tests are added: > - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. > - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision: - Merge branch 'openjdk:master' into colorctx - Merge branch 'openjdk:master' into colorctx - Update ColorPaintContextBasicTest.java - handle VolatileImage properly - Update ColorPaintContext.java - 8355078: java.awt.Color.createContext() uses unnecessary synchronization ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24771/files - new: https://git.openjdk.org/jdk/pull/24771/files/30008b2c..72876482 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24771&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24771&range=00-01 Stats: 51757 lines in 1566 files changed: 25015 ins; 18534 del; 8208 mod Patch: https://git.openjdk.org/jdk/pull/24771.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24771/head:pull/24771 PR: https://git.openjdk.org/jdk/pull/24771 From serb at openjdk.org Mon May 19 00:06:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 00:06:54 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: <07s-WJJc4k0HyDey7NWxID39ua5z4xxbKbEJShmWBFo=.00b3686c-0e29-4e55-9d37-8210ed44f344@github.com> On Fri, 16 May 2025 23:04:28 GMT, Phil Race wrote: > Update the some code examples and accompanying images to no longer mention or display as applets. It seems the new screenshots could be improved by capturing them on a HiDPI (Retina) display, as the current images appear blurry. And to eliminate background elements in the corners, it might be better to capture screenshots of undecorated windows as was done in the old images. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2889291657 From serb at openjdk.org Mon May 19 02:10:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 02:10:50 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: Message-ID: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> On Sat, 17 May 2025 00:03:23 GMT, Harshitha Onkar wrote: > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 88: > 86: > 87: private static void createTestUI() { > 88: frame = new Frame(); You do not need to call all these methods on the EDT, these are AWT components that should handle multithreaded usage (main/EDT/toolkit threads). It is possible that the issue is only reproducible on macOS due to synchronization problems related to the metal pipeline? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2094728292 From serb at openjdk.org Mon May 19 02:15:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 02:15:51 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v2] In-Reply-To: References: Message-ID: On Thu, 15 May 2025 19:22:06 GMT, Jeremy Wood wrote: >> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. >> >> I added a little bit of logging that might also help identify what's happening. >> >> Does anyone have any more suggestions? > > Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: > > - 8356061: restructuring to move things to EDT > > This was requested here: > https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 > > mrserb asked: "Also please move creation and access_to all Swing components to EDT" > > (I'm not sure this will help much? My understanding was *creation* of Swing components could happen off the EDT as long as they were made displayable on the EDT.) > > Now we still call jc.getLocationOnScreen off the EDT. If that posed a thread-based problem it'd probably manifest as a IllegalComponentStateException, which is not mentioned in 8356061. > - 8356061: adding 1000ms pause after window construction > > This was requested here: > https://github.com/openjdk/jdk/pull/25244#discussion_r2091656355 > > So now we'll pause at least 1.1s before the first call to `jc.getLocationOnScreen`, and at least 2.1s before the first call to `robot.getPixelColor(x, y)`. > > (getLocationOnScreen has never failed with an IllegalStateException.) I think the test can be greatly simplified if you redirect all rendering into a BufferedImage, in that case the use of robot can be removed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2889420453 From serb at openjdk.org Mon May 19 02:15:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 02:15:52 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v2] In-Reply-To: References: Message-ID: On Thu, 15 May 2025 19:29:43 GMT, Jeremy Wood wrote: >> test/jdk/com/apple/laf/RootPane/RootPaneDefaultButtonTest.java line 131: >> >>> 129: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); >>> 130: >>> 131: robot.delay(1000); >> >> it will be useful to add the same delay before the first call to test, right after invokeAndWait.....setVisible(...) >> Also please move creation and access_to all Swing components to EDT(button, radioButton1) > > I added an additional delay. I'm not sure exactly what refactor you're looking for, but I rewrote the test to put more in the EDT. > > (I double-checked that the test still passes, but that doesn't prove much since I've never reproduced a failure.) > > I did try at one point blocking the testing thread until the EDT had a chance to complete an invokeLater runnable, but that didn't seem to make a difference so I didn't commit it. The code in test() which access swing components(various buttons) also should be moved to EDT. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25244#discussion_r2094730331 From duke at openjdk.org Mon May 19 05:37:05 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 19 May 2025 05:37:05 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: > Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. > > I added a little bit of logging that might also help identify what's happening. > > Does anyone have any more suggestions? Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8356061: removing robot This is in response to: https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25244/files - new: https://git.openjdk.org/jdk/pull/25244/files/b076c964..9f91249a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25244&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25244&range=01-02 Stats: 285 lines in 1 file changed: 106 ins; 169 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/25244.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25244/head:pull/25244 PR: https://git.openjdk.org/jdk/pull/25244 From duke at openjdk.org Mon May 19 05:37:06 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 19 May 2025 05:37:06 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: <9R-BsAB7i3C9axKGhxezRSqNlTWhXl0C1qIlSMs9Qzs=.a2f1598b-313e-4c28-a3f7-a1f98a24dad1@github.com> On Mon, 19 May 2025 02:11:35 GMT, Sergey Bylokhov wrote: >> I added an additional delay. I'm not sure exactly what refactor you're looking for, but I rewrote the test to put more in the EDT. >> >> (I double-checked that the test still passes, but that doesn't prove much since I've never reproduced a failure.) >> >> I did try at one point blocking the testing thread until the EDT had a chance to complete an invokeLater runnable, but that didn't seem to make a difference so I didn't commit it. > > The code in test() which access swing components(various buttons) also should be moved to EDT. I'm not sure I agree, but that becomes moot after https://github.com/openjdk/jdk/pull/25244/commits/9f91249a424b190990fc3056644b5aac8caa0a5b ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25244#discussion_r2094867526 From duke at openjdk.org Mon May 19 05:39:51 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 19 May 2025 05:39:51 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v2] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 02:13:35 GMT, Sergey Bylokhov wrote: > I think the test can be greatly simplified if you redirect all rendering into a BufferedImage OK, the test is rewritten to use a BufferedImage. I'm still not convinced I understand the nature of the original failure (why, given the screenshot provided, would a pixel in this test be r=55,g=55,b=55?). I don't think these changes are bad, but since I don't understand the original failure I'm not convinced this work is addressing it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2889678140 From psadhukhan at openjdk.org Mon May 19 06:14:37 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 19 May 2025 06:14:37 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() Message-ID: The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. Fixed by setting the divider location before rendering the left and right components.. ------------- Commit messages: - jcheck - 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() Changes: https://git.openjdk.org/jdk/pull/25294/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356594 Stats: 161 lines in 2 files changed: 160 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25294.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294 PR: https://git.openjdk.org/jdk/pull/25294 From azvegint at openjdk.org Mon May 19 06:19:53 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 19 May 2025 06:19:53 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 23:28:58 GMT, Harshitha Onkar wrote: > Since you mentioned there is a manual part (i.e granting permission for the 1st time) , is it a good idea to convert the OELMouseTest.java (test attached to JBS) as a semi-automated PassFailJFrame test and run it on linux platforms with awt.robot.screenshotMethod property - dbusRemoteDesktop (and skipping if not) and this way there would be a dedicated jtreg test for this fix or is there an existing test we could re-use ? I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2889749455 From azvegint at openjdk.org Mon May 19 06:19:54 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 19 May 2025 06:19:54 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: <-5JfOcgmQU0aU4Zj_9GbtNHyCv2qbe-fK1jSTXqXIcc=.164fcc53-248f-4c08-802d-23276862149f@github.com> References: <8JCrFisXgNtBSXxxVA_QkcG3LObiggKIPfEBVdb3NO0=.47a846aa-4a05-4a9b-85e7-5cd1d3b146eb@github.com> <-5JfOcgmQU0aU4Zj_9GbtNHyCv2qbe-fK1jSTXqXIcc=.164fcc53-248f-4c08-802d-23276862149f@github.com> Message-ID: On Fri, 16 May 2025 22:01:19 GMT, Sergey Bylokhov wrote: > Maybe as a temporary solution, we can preload this property at Toolkit startup in a separate thread, and wait for XdgDesktopPortal/etc only if that thread hasn't completed yet? Maybe, but not as part of this fix. I don't want to overcomplicate things, especially since there will be multiple backports. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2094914513 From aturbanov at openjdk.org Mon May 19 08:11:04 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:11:04 GMT Subject: Integrated: 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet In-Reply-To: References: Message-ID: <8zSOCwrhe_9n6VAHFvY8_oTZ4SCV7unTglnbSPSZsGM=.62a727c9-1aeb-428a-98a6-0ade3d4dc923@github.com> On Wed, 23 Apr 2025 08:38:17 GMT, Andrey Turbanov wrote: > There is no need to call List.contains before List.remove call. > `tagSets` - is an ArrayList. This pull request has now been integrated. Changeset: 2fb3329d Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/2fb3329d71532a4c40dba2e2698572e4ab5ceb19 Stats: 5 lines in 1 file changed: 0 ins; 3 del; 2 mod 8356846: Remove unnecessary List.contains key from TIFFDirectory.removeTagSet Reviewed-by: aivanov, serb ------------- PR: https://git.openjdk.org/jdk/pull/24816 From aturbanov at openjdk.org Mon May 19 08:14:29 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:14:29 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener Message-ID: Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` ------------- Commit messages: - [PATCH] Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener Changes: https://git.openjdk.org/jdk/pull/24692/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24692&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357224 Stats: 4 lines in 1 file changed: 0 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24692.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24692/head:pull/24692 PR: https://git.openjdk.org/jdk/pull/24692 From liach at openjdk.org Mon May 19 08:14:29 2025 From: liach at openjdk.org (Chen Liang) Date: Mon, 19 May 2025 08:14:29 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: <3fueyKPoeYAA-G-74gjNyqfJ8qE2HSa8g54Lq-ZSsyg=.8978ab07-e214-4c61-9ad6-0c2e19629335@github.com> On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov wrote: > Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` Makes sense. This map is private, and its value is always non-null (only one other put site), so I believe things are fine here. Let another reviewer in area to confirm this change. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24692#pullrequestreview-2773119715 PR Comment: https://git.openjdk.org/jdk/pull/24692#issuecomment-2810091497 From serb at openjdk.org Mon May 19 08:14:29 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 08:14:29 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov wrote: > Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` src/java.desktop/share/classes/java/awt/Toolkit.java line 1745: > 1743: synchronized (this) { > 1744: SelectiveAWTEventListener selectiveListener = > 1745: listener2SelectiveListener.remove(localL); While analyzing the implementation of this method, I noticed a potential bug at the beginning. Should it instead be: if (localL == null) { return; } ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24692#discussion_r2089545502 From aturbanov at openjdk.org Mon May 19 08:14:29 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:14:29 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: On Wed, 14 May 2025 18:52:55 GMT, Sergey Bylokhov wrote: >> Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` > > src/java.desktop/share/classes/java/awt/Toolkit.java line 1745: > >> 1743: synchronized (this) { >> 1744: SelectiveAWTEventListener selectiveListener = >> 1745: listener2SelectiveListener.remove(localL); > > While analyzing the implementation of this method, I noticed a potential bug at the beginning. Should it instead be: > > if (localL == null) { > return; > } > > ? Looks like yes. I think it's worth to create a separate issue to fix it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24692#discussion_r2095112071 From abhiscxk at openjdk.org Mon May 19 08:20:01 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 19 May 2025 08:20:01 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos Message-ID: Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. Verified the updated test in CI on macOS 14.7 machine and there is no failure. ------------- Commit messages: - Test Stabilization Changes: https://git.openjdk.org/jdk/pull/25299/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356145 Stats: 17 lines in 1 file changed: 12 ins; 2 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25299/head:pull/25299 PR: https://git.openjdk.org/jdk/pull/25299 From aturbanov at openjdk.org Mon May 19 08:26:27 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:26:27 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent Message-ID: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> No need to call `List.indexOf(Object)` before `List.remove(int)`. Instead we can call `List.remove(Object)` directly. It's faster and cleaner. `invalidComponents` is an ArrayList. ------------- Commit messages: - [PATCH] Remove unnecessary List.indexOf key from RepaintManager.removeInvalidComponent Changes: https://git.openjdk.org/jdk/pull/24845/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24845&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357226 Stats: 6 lines in 1 file changed: 0 ins; 3 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24845.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24845/head:pull/24845 PR: https://git.openjdk.org/jdk/pull/24845 From serb at openjdk.org Mon May 19 08:26:28 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 08:26:28 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> Message-ID: On Thu, 24 Apr 2025 09:29:24 GMT, Andrey Turbanov wrote: > No need to call `List.indexOf(Object)` before `List.remove(int)`. Instead we can call `List.remove(Object)` directly. It's faster and cleaner. > `invalidComponents` is an ArrayList. src/java.desktop/share/classes/javax/swing/RepaintManager.java line 394: > 392: } > 393: if (invalidComponents != null) { > 394: invalidComponents.remove(component); I guess the `addInvalidComponent` above can be simplified as well? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2065042601 From aturbanov at openjdk.org Mon May 19 08:26:28 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:26:28 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> Message-ID: <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> On Mon, 28 Apr 2025 23:48:04 GMT, Sergey Bylokhov wrote: >> No need to call `List.indexOf(Object)` before `List.remove(int)`. Instead we can call `List.remove(Object)` directly. It's faster and cleaner. >> `invalidComponents` is an ArrayList. > > src/java.desktop/share/classes/javax/swing/RepaintManager.java line 394: > >> 392: } >> 393: if (invalidComponents != null) { >> 394: invalidComponents.remove(component); > > I guess the `addInvalidComponent` above can be simplified as well? Simplified how? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2066621174 From serb at openjdk.org Mon May 19 08:26:28 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 08:26:28 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> Message-ID: On Tue, 29 Apr 2025 14:09:51 GMT, Andrey Turbanov wrote: >> src/java.desktop/share/classes/javax/swing/RepaintManager.java line 394: >> >>> 392: } >>> 393: if (invalidComponents != null) { >>> 394: invalidComponents.remove(component); >> >> I guess the `addInvalidComponent` above can be simplified as well? > > Simplified how? the loop over invalidComponents ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2067799531 From aturbanov at openjdk.org Mon May 19 08:26:28 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Mon, 19 May 2025 08:26:28 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> Message-ID: On Wed, 30 Apr 2025 03:33:36 GMT, Sergey Bylokhov wrote: >> Simplified how? > > the loop over invalidComponents Do you suggest to use `List.indexOf` instead of manual loop? https://github.com/openjdk/jdk/blob/375ac6d446332f0763ce294b200143ff63865cf6/src/java.desktop/share/classes/javax/swing/RepaintManager.java#L366-L371 This loop uses `==` comparison, while `List.indexOf` uses `equals()`. It could change semantic ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2068043227 From serb at openjdk.org Mon May 19 08:26:28 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 08:26:28 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> Message-ID: On Wed, 30 Apr 2025 07:23:06 GMT, Andrey Turbanov wrote: >> the loop over invalidComponents > > Do you suggest to use `List.indexOf` instead of manual loop? > https://github.com/openjdk/jdk/blob/375ac6d446332f0763ce294b200143ff63865cf6/src/java.desktop/share/classes/javax/swing/RepaintManager.java#L366-L371 > > This loop uses `==` comparison, while `List.indexOf` uses `equals()`. It could change semantic ok, the it is fine as is. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2085735458 From duke at openjdk.org Mon May 19 09:18:54 2025 From: duke at openjdk.org (duke) Date: Mon, 19 May 2025 09:18:54 GMT Subject: RFR: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 [v3] In-Reply-To: References: Message-ID: <0mS3Twl3Ele2298nEB4g0IeJgupYV50zLiklKvUbsCo=.cf79a466-0921-4491-a647-7b7b241c9779@github.com> On Thu, 15 May 2025 17:20:06 GMT, Daniel Gredler wrote: >> If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. >> >> This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. >> >> It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update bug tag in test class @gredler Your change (at version fe1fda577f6797df4b1d7d8f062bf370971062a8) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25235#issuecomment-2890263679 From abhiscxk at openjdk.org Mon May 19 10:24:50 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 19 May 2025 10:24:50 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: References: Message-ID: On Mon, 19 May 2025 08:15:29 GMT, Abhishek Kumar wrote: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. Verified the test on different macOS versions and added the CI link in JBS ------------- PR Comment: https://git.openjdk.org/jdk/pull/25299#issuecomment-2890482912 From jdv at openjdk.org Mon May 19 11:12:51 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 19 May 2025 11:12:51 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: References: Message-ID: On Mon, 19 May 2025 08:15:29 GMT, Abhishek Kumar wrote: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. Marked as reviewed by jdv (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2850370859 From aivanov at openjdk.org Mon May 19 11:28:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 11:28:54 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: <8gMOJCtNcN-Ou84pCTXuEV5h2AFnT0QMVOsYlPeD1EQ=.a967e9ae-1268-477a-8cb0-c503a7c63f39@github.com> Message-ID: <5_HX1epfWLTiCKDe4F_U5dhaaeZ7CdU0E7IRVsNS_rs=.a6f1a09f-8c15-4175-9e65-2016030032d3@github.com> On Sun, 18 May 2025 13:16:47 GMT, Manukumar V S wrote: > > After reading the description again, I started to wonder which adverb suits better: [?forcibly?](https://en.wiktionary.org/wiki/forcibly) or [?forcefully?](https://en.wiktionary.org/wiki/forcefully). Does any native English speaker have an opinion? > > I think forcefully is more apt compared to forcibly, changed it accordingly. I talked to a native speaker, and _?forcibly?_ is the right word in this situation. Please revert. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2890655051 From dgredler at openjdk.org Mon May 19 11:31:59 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 19 May 2025 11:31:59 GMT Subject: Integrated: 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 17:45:54 GMT, Daniel Gredler wrote: > If the new test (`IgnoredWhitespaceTest`) runs on a system with Type1 physical fonts, it fails because the Type1 handling of ignorable whitespace characters does not match the behavior of the TrueType and macOS glyph mappers. > > This PR updates the Type1 glyph mapper to follow the same rules in this area as the other glyph mappers. > > It would probably be a good idea to consolidate all of this into the `CharToGlyphMapper` superclass at some point, so that we're not duplicating this handling across the subclasses, but some users are reporting failing builds and I wanted to keep the PR simple. This pull request has now been integrated. Changeset: 3acfa9e4 Author: Daniel Gredler Committer: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/3acfa9e4e7be2f37ac55f97348aad4f74ba802a0 Stats: 17 lines in 2 files changed: 8 ins; 0 del; 9 mod 8356966: java/awt/Graphics2D/DrawString/IgnoredWhitespaceTest.java fails on Linux after JDK-8350203 Reviewed-by: honkar, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/25235 From aivanov at openjdk.org Mon May 19 12:19:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 12:19:52 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: References: Message-ID: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> On Mon, 19 May 2025 08:15:29 GMT, Abhishek Kumar wrote: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. Changes requested by aivanov (Reviewer). test/jdk/java/awt/List/ListEnterExitTest.java line 1: > 1: /* I strongly suggest making `MouseEnterExitListener` a static nested class inside `ListEnterExitTest`. This prevents any duplicate class names from other classes when one works with tests in an IDE. test/jdk/java/awt/List/ListEnterExitTest.java line 90: > 88: robot.waitForIdle(); > 89: robot.delay(100); > 90: I don't really understand why `waitForIdle` and `delay` are needed here at all. Robot just moves mouse to generate mouse enter and exit events. It can do so without any delays, can't it? test/jdk/java/awt/List/ListEnterExitTest.java line 92: > 90: > 91: robot.mousePress(InputEvent.BUTTON1_MASK); > 92: robot.mouseRelease(InputEvent.BUTTON1_MASK); Is this mouse press needed only to release `mouseEnterExitListener.wait`? I suggest using a `CountDownLatch` to replace `MouseEnterExitListener.passed_1` and `passed_2`. The code would need to time-await for both latches to be released. Then `MouseEnterExitListener.mousePressed` can be removed completely together with the synchronized block above. ------------- PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2850541693 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095578628 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095570577 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2095576436 From aivanov at openjdk.org Mon May 19 12:28:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 12:28:52 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: <95g0weiARkYC01wgCQbJNJD1iwc_RpCUS3sH1i1K_-A=.333d4836-3718-41c3-a998-4e2bccad3c1b@github.com> On Mon, 19 May 2025 08:10:42 GMT, Andrey Turbanov wrote: >> src/java.desktop/share/classes/java/awt/Toolkit.java line 1745: >> >>> 1743: synchronized (this) { >>> 1744: SelectiveAWTEventListener selectiveListener = >>> 1745: listener2SelectiveListener.remove(localL); >> >> While analyzing the implementation of this method, I noticed a potential bug at the beginning. Should it instead be: >> >> if (localL == null) { >> return; >> } >> >> ? > > Looks like yes. I think it's worth to create a separate issue to fix it. It doesn't matter, it looks? `localL` is `null` if and only if listener is `null`. However, I'd put the null-check above the call to `deProxyAWTEventListener` to avoid any confusion. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24692#discussion_r2095589937 From aivanov at openjdk.org Mon May 19 12:28:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 12:28:51 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov wrote: > Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24692#pullrequestreview-2850572034 From dgredler at openjdk.org Mon May 19 12:29:51 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 19 May 2025 12:29:51 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } If any reviewers have some extra cycles, I'd appreciate a second review on this one. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/25193#issuecomment-2890826777 From aivanov at openjdk.org Mon May 19 12:37:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 12:37:54 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> Message-ID: On Tue, 13 May 2025 00:47:09 GMT, Sergey Bylokhov wrote: >> Do you suggest to use `List.indexOf` instead of manual loop? >> https://github.com/openjdk/jdk/blob/375ac6d446332f0763ce294b200143ff63865cf6/src/java.desktop/share/classes/javax/swing/RepaintManager.java#L366-L371 >> >> This loop uses `==` comparison, while `List.indexOf` uses `equals()`. It could change semantic > > ok, the it is fine as is. Yet there could be a logical error anyway? `addInvalidComponent` uses identity comparison when adding a component but `removeInvalidComponent` relies on `equals` method to remove a component. If a component overrides `equals`, it could lead to unpredictable behaviour: a wrong component could be removed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2095611426 From aivanov at openjdk.org Mon May 19 12:54:58 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 12:54:58 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: On Fri, 16 May 2025 23:04:28 GMT, Phil Race wrote: > Update the some code examples and accompanying images to no longer mention or display as applets. src/java.desktop/share/classes/java/awt/GridBagLayout.java line 243: > 241: * right-to-left container. > 242: * > 243: *
Is it possible to keep the width small as it was? src/java.desktop/share/classes/java/awt/GridBagLayout.java line 288: > 286: * public class GridBagLayoutExample { > 287: * > 288: * static void addButton(String name, Suggestion: * private static void addButton(String name, src/java.desktop/share/classes/java/awt/GridBagLayout.java line 295: > 293: * gridbag.setConstraints(button, c); > 294: * frame.add(button); > 295: * } The `add` method should indented by 4 spaces to the right. src/java.desktop/share/classes/java/awt/GridBagLayout.java line 303: > 301: * GridBagLayout gridbag = new GridBagLayout(); > 302: * GridBagConstraints c = new GridBagConstraints(); > 303: * frame.setLayout(gridbag); The `main` method should be indented by 4 spaces to the right, it's inside `GridBagLayoutExample` class. src/java.desktop/share/classes/java/awt/MediaTracker.java line 108: > 106: * tracker.addImage(bg, 0); > 107: * for (int i = 0; i < 5; i++) { > 108: * anim[i] = tk.getImage("anim"+i+".gif"); Suggestion: * anim[i] = tk.getImage("anim" + i + ".gif"); src/java.desktop/share/classes/java/awt/doc-files/BorderLayout-1.png line 1: > 1: ?PNG The images would look better with square borders? which are left on Windows 10 only. If it's possible to make the pixels on the rounded corners transparent or at least white, the images would look better. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095631052 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095624810 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095625842 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095627784 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095635506 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2095643191 From mvs at openjdk.org Mon May 19 12:57:43 2025 From: mvs at openjdk.org (Manukumar V S) Date: Mon, 19 May 2025 12:57:43 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods [v3] In-Reply-To: References: Message-ID: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Forcibly wordings changed ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25091/files - new: https://git.openjdk.org/jdk/pull/25091/files/9f0a6321..ff288f0e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25091&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25091&range=01-02 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25091.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25091/head:pull/25091 PR: https://git.openjdk.org/jdk/pull/25091 From aivanov at openjdk.org Mon May 19 13:05:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 13:05:57 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: <07s-WJJc4k0HyDey7NWxID39ua5z4xxbKbEJShmWBFo=.00b3686c-0e29-4e55-9d37-8210ed44f344@github.com> References: <07s-WJJc4k0HyDey7NWxID39ua5z4xxbKbEJShmWBFo=.00b3686c-0e29-4e55-9d37-8210ed44f344@github.com> Message-ID: On Mon, 19 May 2025 00:04:33 GMT, Sergey Bylokhov wrote: > It seems the new screenshots could be improved by capturing them on a HiDPI (Retina) display, as the current images appear blurry. And to eliminate background elements in the corners, it might be better to capture screenshots of undecorated windows as was done in the old images. To make the screenshots look good on High DPI displays, we need several images (preferably at 100%, 150% and 200% as the most common scales) and use the [**`srcset` attribute**](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#srcset) of the `` element to provide different resolutions. If you just create a screenshot on (Retina at 200% scale), the screenshots will be *too large* and still blurry as browsers will still scale up the screenshots to the scale of the display because the [`src` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#src) is treated as 100%-scale candidate only. --- If we agree to go this way, I can create screenshots on Windows 10 (which still uses square window borders) in different resolutions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2890944411 From tr at openjdk.org Mon May 19 13:52:16 2025 From: tr at openjdk.org (Tejesh R) Date: Mon, 19 May 2025 13:52:16 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v3] In-Reply-To: References: Message-ID: > The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. > The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Review fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24439/files - new: https://git.openjdk.org/jdk/pull/24439/files/ebe3d910..d4660c75 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=01-02 Stats: 80 lines in 7 files changed: 16 ins; 21 del; 43 mod Patch: https://git.openjdk.org/jdk/pull/24439.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24439/head:pull/24439 PR: https://git.openjdk.org/jdk/pull/24439 From tr at openjdk.org Mon May 19 13:52:20 2025 From: tr at openjdk.org (Tejesh R) Date: Mon, 19 May 2025 13:52:20 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 19:24:36 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: >> >> - Merge branch 'master' of https://git.openjdk.java.net/jdk into branch_8139228 >> - Fix for windows L&F >> - Fix + Manual test > > src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java line 1195: > >> 1193: setIcon(fc.getIcon(file)); >> 1194: setEnabled(isSelectableInList(file)); >> 1195: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); > > Suggestion: > > putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); > > No method call above uses explicit `this`, I see no reason to use it here either. > > This comment applies to all the modified files. Updated. > src/java.desktop/share/classes/sun/swing/FilePane.java line 1238: > >> 1236: setText(text); >> 1237: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); >> 1238: return this; > > Be consistent at least inside one file. Here you removed the blank line, but below at 1632?1635 you preserved the blank line. Updated. > src/java.desktop/share/classes/sun/swing/FilePane.java line 1635: > >> 1633: this.putClientProperty("html.disable", getFileChooser().getClientProperty("html.disable")); >> 1634: >> 1635: return this; > > I prefer this style everywhere: all the code that sets up the component, a blank line followed by the `return` statement. > > I'd add a blank line before `putClientProperty` as well ? setting the `"html.disable"` property isn't the part of previous statements which configure the renderer component one way or another, and, with blank lines around this call, it will stand out in the code. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 68: > >> 66: .instructions(INSTRUCTIONS) >> 67: .columns(45) >> 68: .testUI(initialize()) > > In majority of cases, you should pass a method reference rather than the result of a method call to `testUI`. > > As it's written, the `initialize` is executed on the main thread, and its result?the list frames?is passed to `PassFailJFrame`. > > What you actually want is `HTMLFileName::initialize`. In this case, the `PassFailJFrame` framework will call the `initialize` method on EDT when the time to create UI comes. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 69: > >> 67: .columns(45) >> 68: .testUI(initialize()) >> 69: .position(PassFailJFrame.Position.TOP_LEFT_CORNER) > > Suggestion: > > .positionTestUIRightColumn() > > I suggest using [**`positionTestUIRightColumnCentered`**](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIRightColumnCentered()) to lay out the entire test UI in the centre of the screen. > > Since two file choosers take quite a lot of space, the file chooser at the bottom doesn't fit the screen if you use [`positionTestUIRightColumn`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIRightColumn()). > > Alternatively, you can choose a horizontal layout with [`positionTestUIBottomRowCentered`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIBottomRowCentered()). Yeah, [positionTestUIBottomRowCentered](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIBottomRowCentered()) works better. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 79: > >> 77: } >> 78: >> 79: public static List initialize() { > > Suggestion: > > private static List initialize() { Updated > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 84: > >> 82: String fileName = homeDir + File.separator + >> 83: "

Testing Name"; >> 84: directory = new File(fileName); > > You shouldn't create the files in the home directory of the user any way. Create them in the current directory which is a scratch directory when the test is run with jtreg; the contents of the scratch directory is automatically removed by jtreg when the test exits, even if the test itself fails to remove its own temporary files. > > Yet if you create the files in the user's home, all these files and directories will be still be around if anything goes awry in the test. Since I have used virtual file system, this would be skipped now. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 85: > >> 83: "

Testing Name"; >> 84: directory = new File(fileName); >> 85: directory.mkdir(); > > Do you need the directory at all? > > Use `VirtualFileSystemView` for all platforms. The fact that it's possible to create files with HTML tags in the name is irrelevant to the test. I've used VirtualFileSystemView to all platforms. Having both directory and file with HTML tags in the virtual FSV is helpful in verifying both File Pane and Directory ComboBox view too. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 96: > >> 94: jfc = new JFileChooser(homeDir); >> 95: jfc_HTML_Enabled = new JFileChooser(homeDir); >> 96: } > > I suggest creating a method that creates one file chooser placed in a frame; pass a boolean parameter to specify whether to set the `"html.disable"` property to `false` or keep its default value of `true`. > > Then your `initialize` method would be as simple as a single return statement: > > > private static List initialize() { > return List.of(createFileChooser(true), createFileChooser(false)); > } Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 107: > >> 105: } >> 106: >> 107: static class VirtualFileSystemView extends FileSystemView { > > Suggestion: > > private static class VirtualFileSystemView extends FileSystemView { Updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095746398 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095746660 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095746841 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095747011 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095747986 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095752012 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095753291 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095748627 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095753544 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2095751839 From duke at openjdk.org Mon May 19 14:19:51 2025 From: duke at openjdk.org (duke) Date: Mon, 19 May 2025 14:19:51 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 12:57:43 GMT, Manukumar V S wrote: >> Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. >> >> forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). >> >> The description of forceFail() has been expanded, too. >> >> >> A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Forcibly wordings changed @manukumarvs Your change (at version ff288f0eb783215eabcfbe97a3d382fff91d7c76) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2891205393 From aivanov at openjdk.org Mon May 19 14:14:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 14:14:52 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 12:57:43 GMT, Manukumar V S wrote: >> Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. >> >> forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). >> >> The description of forceFail() has been expanded, too. >> >> >> A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Forcibly wordings changed Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25091#pullrequestreview-2850924030 From aivanov at openjdk.org Mon May 19 14:30:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 14:30:51 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 12:57:43 GMT, Manukumar V S wrote: >> Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. >> >> forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). >> >> The description of forceFail() has been expanded, too. >> >> >> A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Forcibly wordings changed I've regenerated the javadoc for `PassFailJFrame`: * [Description of `forcePass` and `forceFail` methods](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#forcePassAndFail) in the top documentation; * [`forcePass`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#forcePass()), * [`forceFail`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#forceFail()), * [`forceFail(String)`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#forceFail(java.lang.String)). ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2891248330 From aivanov at openjdk.org Mon May 19 14:35:57 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 14:35:57 GMT Subject: RFR: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: <8gMOJCtNcN-Ou84pCTXuEV5h2AFnT0QMVOsYlPeD1EQ=.a967e9ae-1268-477a-8cb0-c503a7c63f39@github.com> Message-ID: On Sun, 18 May 2025 13:16:47 GMT, Manukumar V S wrote: >> After reading the description again, I started to wonder which adverb suits better: [?forcibly?](https://en.wiktionary.org/wiki/forcibly) or [?forcefully?](https://en.wiktionary.org/wiki/forcefully). Does any native English speaker have an opinion? > >> After reading the description again, I started to wonder which adverb suits better: [?forcibly?](https://en.wiktionary.org/wiki/forcibly) or [?forcefully?](https://en.wiktionary.org/wiki/forcefully). Does any native English speaker have an opinion? > I think forcefully is more apt compared to forcibly, changed it accordingly. @manukumarvs I'll leave the PR open for another day before sponsoring in case anyone else wants to leave a comment. Then I'll sponsor integration of the fix. Thank you. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25091#issuecomment-2891263943 From aivanov at openjdk.org Mon May 19 17:27:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 19 May 2025 17:27:53 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID [v2] In-Reply-To: References: Message-ID: <082o5pddclhoK1wjwQicxbQiy2XZspFNObVuoY7TyhI=.0a8e21fc-f793-47b6-a594-9e079923254d@github.com> On Tue, 13 May 2025 20:35:36 GMT, Sergey Bylokhov wrote: >> The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update src/java.desktop/share/classes/sun/print/CustomOutputBin.java > > Co-authored-by: Alexey Ivanov Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25202#pullrequestreview-2851537515 From prr at openjdk.org Mon May 19 18:01:52 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 19 May 2025 18:01:52 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 20:45:39 GMT, Alexander Zvegintsev wrote: >> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. >> It is a JCK conformance failure. >> >> --- >> >> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. >> >> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): >> >> 1. >> >> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. >> >> However, our robot implementation is mostly uses XTEST, but there is an exception: >> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. >> >> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, >> on mouse press we call XTestFakeButtonEvent and it is handled by libei, >> so the click happens where is the actual mouse cursor is in the system. That is why the test fails. >> >> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. >> >> It would be a simple solution, but >> >> >> 2. >> >> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. >> >> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. >> >> --- >> >> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). >> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. >> Most of the code can be reused, and it has everything we need. >> >> >> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. >> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. >> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) >> * Since w... > > Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: > > Only call getGnomeShellMajorVersion when the desktop is Gnome. I've looked at the code. I've run a build from Alexander and another I did and done some testing on Fedora 42 - which is gnome 48. I see the expected tokens and the robot-based tests I did worked as expected. Waiting to see some results from our internal CI testing systems on systems with gnome < 47 and wayland and if that looks good I will approve ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2891841152 From serb at openjdk.org Mon May 19 19:11:09 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 19:11:09 GMT Subject: RFR: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID [v3] In-Reply-To: References: Message-ID: > The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). Sergey Bylokhov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: - Merge branch 'openjdk:master' into JDK-8356844 - Update src/java.desktop/share/classes/sun/print/CustomOutputBin.java Co-authored-by: Alexey Ivanov - 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25202/files - new: https://git.openjdk.org/jdk/pull/25202/files/901a1346..8b699711 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25202&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25202&range=01-02 Stats: 29535 lines in 731 files changed: 11453 ins; 13953 del; 4129 mod Patch: https://git.openjdk.org/jdk/pull/25202.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25202/head:pull/25202 PR: https://git.openjdk.org/jdk/pull/25202 From serb at openjdk.org Mon May 19 21:35:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 21:35:56 GMT Subject: Integrated: 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID In-Reply-To: References: Message-ID: On Tue, 13 May 2025 08:19:36 GMT, Sergey Bylokhov wrote: > The serialVersionUID field in sun.print.CustomOutputBin is missing the `@Serial` annotation. This is the only one missing usage of `@Serial` in the java.desktop module. The class was introduced in [JDK-8314070](https://bugs.openjdk.org/browse/JDK-8314070), after the `@Serial` annotation was applied to java.desktop in [JDK-8259522](https://bugs.openjdk.org/browse/JDK-8259522). This pull request has now been integrated. Changeset: fbeea1da Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/fbeea1daef6a65875d713395c489483762d804fe Stats: 4 lines in 1 file changed: 1 ins; 2 del; 1 mod 8356844: Missing @Serial annotation for sun.print.CustomOutputBin#serialVersionUID Reviewed-by: aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/25202 From kizune at openjdk.org Mon May 19 21:43:54 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 19 May 2025 21:43:54 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() In-Reply-To: References: Message-ID: On Mon, 19 May 2025 06:06:17 GMT, Prasanta Sadhukhan wrote: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. Looks good. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25294#pullrequestreview-2852056409 From azvegint at openjdk.org Mon May 19 23:06:39 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 19 May 2025 23:06:39 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v3] In-Reply-To: References: Message-ID: > The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. > It is a JCK conformance failure. > > --- > > In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. > > The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): > > 1. > > It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. > > However, our robot implementation is mostly uses XTEST, but there is an exception: > for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. > > So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, > on mouse press we call XTestFakeButtonEvent and it is handled by libei, > so the click happens where is the actual mouse cursor is in the system. That is why the test fails. > > To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. > > It would be a simple solution, but > > > 2. > > This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. > > It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. > > --- > > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. > Most of the code can be reused, and it has everything we need. > > > * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. > * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. > * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) > * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLo... Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: call OpenPipeWireRemote even for remote desktop session calls ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25265/files - new: https://git.openjdk.org/jdk/pull/25265/files/5d08133e..b8a430ef Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25265&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25265&range=01-02 Stats: 7 lines in 1 file changed: 0 ins; 7 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25265.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25265/head:pull/25265 PR: https://git.openjdk.org/jdk/pull/25265 From azvegint at openjdk.org Mon May 19 23:06:39 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 19 May 2025 23:06:39 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Fri, 16 May 2025 20:45:39 GMT, Alexander Zvegintsev wrote: >> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. >> It is a JCK conformance failure. >> >> --- >> >> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. >> >> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): >> >> 1. >> >> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. >> >> However, our robot implementation is mostly uses XTEST, but there is an exception: >> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. >> >> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, >> on mouse press we call XTestFakeButtonEvent and it is handled by libei, >> so the click happens where is the actual mouse cursor is in the system. That is why the test fails. >> >> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. >> >> It would be a simple solution, but >> >> >> 2. >> >> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. >> >> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. >> >> --- >> >> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). >> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. >> Most of the code can be reused, and it has everything we need. >> >> >> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. >> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. >> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) >> * Since w... > > Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: > > Only call getGnomeShellMajorVersion when the desktop is Gnome. Phil discovered a hang on Fedora 42, it happens when we call: 1. mouseMove 2. createScreenCapture withing the same remote desktop session We got the following error if: - the remote desktop session [initialized without the OpenPipeWireRemote call](https://github.com/azvegint/jdk/blob/5d08133ed00c6f22b71ffe6349591e11ea2813ed/src/java.desktop/unix/native/libawt_xawt/awt/screencast_portal.c#L1131-L1135) - reusing this session and trying to use pipewire > startStream:471 screenId#65: stream connecting 0x7f026c84d0f0 onStreamStateChanged:417 screenId#65[loc(0,0) size(1280x832)] state 0 (unconnected) -> 1 (connecting) err (null) onCoreError:614 !!! pipewire error: id 0, seq: 0, res: -88 (Unknown error -88): connection error Although it didn't hang on other systems, but it still printed this error in debug mode. It worked because of [the retry](https://github.com/azvegint/jdk/blob/5d08133ed00c6f22b71ffe6349591e11ea2813ed/src/java.desktop/unix/native/libawt_xawt/awt/screencast_pipewire.c#L1034). Fortunately, it hangs on Fedora 42. Removing this "optimization" resolves the issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2892471853 From serb at openjdk.org Mon May 19 23:06:39 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 23:06:39 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 06:17:27 GMT, Alexander Zvegintsev wrote: > I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage. Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2892474018 From serb at openjdk.org Mon May 19 23:47:59 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 19 May 2025 23:47:59 GMT Subject: Integrated: 8355078: java.awt.Color.createContext() uses unnecessary synchronization In-Reply-To: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> References: <0pWUD-E-stDoqVTXFmlRNJ2skEMIjeto6VFl6ydxyc0=.de5400a3-69a2-4621-a91a-45bdfbca4dd2@github.com> Message-ID: On Sun, 20 Apr 2025 08:15:38 GMT, Sergey Bylokhov wrote: > At some point, java.awt.Color.createContext() was marked as synchronized to support caching of a ColorPaintContext instance. The cache was later removed, but the synchronized modifier remained. Since there is no shared mutable state anymore, the synchronization is no longer necessary and can be safely removed. > > > Note: This code path is rarely executed because a special optimization was introduced in [SunGraphics2D.setPaint](https://github.com/openjdk/jdk/blob/c514f135ccf08c3be016a32ae8f2c055fb941857/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L1003). As a result, unless a custom wrapper around the Color class is used, the Color.createContext() method is typically bypassed during rendering. > > Two tests are added: > - ColorPaintContextBasicTest: Checks if different image types (BufferedImage and VolatileImage) produce the same results when using different ways to fill the image (setColor, setPaint, and custom Paint). This test intentionally uses a custom Paint implementation to bypass the optimization and ensure that Color.createContext() is invoked verifying its correct behavior. > - ColorPaintContextStateTrackerTest: Checks that the raster used in ColorPaintContext.getRaster() can be properly cached in video memory and we do not need to call icr.markDirty() in ColorPaintContext.getRaster() This pull request has now been integrated. Changeset: 890456f0 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/890456f0f78cc37c72b438a50ddf2605e1dfd91b Stats: 304 lines in 4 files changed: 270 ins; 21 del; 13 mod 8355078: java.awt.Color.createContext() uses unnecessary synchronization Reviewed-by: prr ------------- PR: https://git.openjdk.org/jdk/pull/24771 From serb at openjdk.org Tue May 20 00:11:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 20 May 2025 00:11:51 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() In-Reply-To: References: Message-ID: On Mon, 19 May 2025 06:06:17 GMT, Prasanta Sadhukhan wrote: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 71: > 69: point = openDialogButton.getLocationOnScreen(); > 70: }); > 71: robot.mouseMove(point.x, point.y); When I run the test on my macOS laptop, it fails because the click occured on the window border instead of the button. It would be good to slightly shift the click position to ensure it reliably hits the button across platforms. btw it is better to use EventQueue.invokeAndWait instead of SwingUtilities.invokeAndWait. The latter was added early on, while the former consolidates all event-dispatching utilities in one class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2096631099 From serb at openjdk.org Tue May 20 00:11:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 20 May 2025 00:11:51 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() In-Reply-To: References: Message-ID: On Tue, 20 May 2025 00:08:05 GMT, Sergey Bylokhov wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 71: > >> 69: point = openDialogButton.getLocationOnScreen(); >> 70: }); >> 71: robot.mouseMove(point.x, point.y); > > When I run the test on my macOS laptop, it fails because the click occured on the window border instead of the button. It would be good to slightly shift the click position to ensure it reliably hits the button across platforms. > > btw it is better to use EventQueue.invokeAndWait instead of SwingUtilities.invokeAndWait. The latter was added early on, while the former consolidates all event-dispatching utilities in one class. maybe we can loop over installed L&F? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2096631567 From honkar at openjdk.org Tue May 20 01:10:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 20 May 2025 01:10:52 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v3] In-Reply-To: References: Message-ID: <_eAwlEaVObxYp4H1oWrT9EMiPBmKbL96TsBSG2ddoRc=.6b4bda2b-a914-4266-bd2d-fa1956f2122a@github.com> On Mon, 19 May 2025 23:06:39 GMT, Alexander Zvegintsev wrote: >> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. >> It is a JCK conformance failure. >> >> --- >> >> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. >> >> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): >> >> 1. >> >> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. >> >> However, our robot implementation is mostly uses XTEST, but there is an exception: >> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. >> >> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, >> on mouse press we call XTestFakeButtonEvent and it is handled by libei, >> so the click happens where is the actual mouse cursor is in the system. That is why the test fails. >> >> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. >> >> It would be a simple solution, but >> >> >> 2. >> >> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. >> >> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. >> >> --- >> >> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). >> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. >> Most of the code can be reused, and it has everything we need. >> >> >> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. >> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. >> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) >> * Since w... > > Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: > > call OpenPipeWireRemote even for remote desktop session calls On Ubuntu 24.04 (Gnome 46) tested using default awt.robot.screenshotMethod(`dbusScreencast`) and by setting it to `dbusRemoteDesktop`, it works well in both cases, no regressions observed. On Ubuntu25.04 (Gnome 48) the default - dbusRemoteDesktop works well. I haven't able to test the fix on OL10 yet. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2892620300 From serb at openjdk.org Tue May 20 02:00:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 20 May 2025 02:00:52 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: References: Message-ID: On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov wrote: > Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null` Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24692#pullrequestreview-2852324895 From serb at openjdk.org Tue May 20 02:02:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 20 May 2025 02:02:51 GMT Subject: RFR: 8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent In-Reply-To: References: <_pLf9918EhjvAMh1-FIb3HkaneujwjTe4iCEGPMBK8Y=.080f1cea-4fd5-4b94-9523-87bd20d11bbc@github.com> <55SDjO2Fj4yDEsB7Zbe3YacApuZZ5C-8x8VRO8aREJs=.3e97052f-7bd7-4dc2-83b2-4f4ecbe3bc47@github.com> Message-ID: <7_E9lw5GWsglpDpKuOSrzGfg-TWZl5sJkwLoZOr9Ieg=.13505891-52f1-4eef-8a6d-8e45dbbcd08b@github.com> On Mon, 19 May 2025 12:35:13 GMT, Alexey Ivanov wrote: >> ok, then it is fine as is. > > Yet there could be a logical error anyway? `addInvalidComponent` uses identity comparison when adding a component but `removeInvalidComponent` relies on `equals` method to remove a component. > > If a component overrides `equals`, it could lead to unpredictable behaviour: a wrong component could be removed. Then it's better to use "==" in all cases, what do you think? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24845#discussion_r2096713898 From abhiscxk at openjdk.org Tue May 20 04:15:52 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 20 May 2025 04:15:52 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> References: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> Message-ID: On Mon, 19 May 2025 12:12:22 GMT, Alexey Ivanov wrote: >> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. >> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. >> >> Verified the updated test in CI on macOS 14.7 machine and there is no failure. > > test/jdk/java/awt/List/ListEnterExitTest.java line 90: > >> 88: robot.waitForIdle(); >> 89: robot.delay(100); >> 90: > > I don't really understand why `waitForIdle` and `delay` are needed here at all. > > Robot just moves mouse to generate mouse enter and exit events. It can do so without any delays, can't it? There is an intermittent failure observed only on macOS 14.7.1 machines. So, I added a small delay and after that on multiple runs in CI, I don't see any failures. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2096870648 From abhiscxk at openjdk.org Tue May 20 04:20:54 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 20 May 2025 04:20:54 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: References: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> Message-ID: On Tue, 20 May 2025 04:12:59 GMT, Abhishek Kumar wrote: >> test/jdk/java/awt/List/ListEnterExitTest.java line 90: >> >>> 88: robot.waitForIdle(); >>> 89: robot.delay(100); >>> 90: >> >> I don't really understand why `waitForIdle` and `delay` are needed here at all. >> >> Robot just moves mouse to generate mouse enter and exit events. It can do so without any delays, can't it? > > There is an intermittent failure observed only on macOS 14.7.1 machines. So, I added a small delay and after that on multiple runs in CI, I don't see any failures. There is an intermittent failure observed only on macOS 14.7.1 machines. So, I added a small delay and after that on multiple runs in CI, I don't see any failures. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2096877644 From psadhukhan at openjdk.org Tue May 20 04:34:36 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 20 May 2025 04:34:36 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: References: Message-ID: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Click position fixed..L&F iteration ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25294/files - new: https://git.openjdk.org/jdk/pull/25294/files/25482e5c..d1671bdd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=00-01 Stats: 74 lines in 1 file changed: 21 ins; 0 del; 53 mod Patch: https://git.openjdk.org/jdk/pull/25294.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294 PR: https://git.openjdk.org/jdk/pull/25294 From psadhukhan at openjdk.org Tue May 20 05:01:54 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 20 May 2025 05:01:54 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 00:08:45 GMT, Sergey Bylokhov wrote: >> test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 71: >> >>> 69: point = openDialogButton.getLocationOnScreen(); >>> 70: }); >>> 71: robot.mouseMove(point.x, point.y); >> >> When I run the test on my macOS laptop, it fails because the click occured on the window border instead of the button. It would be good to slightly shift the click position to ensure it reliably hits the button across platforms. >> >> btw it is better to use EventQueue.invokeAndWait instead of SwingUtilities.invokeAndWait. The latter was added early on, while the former consolidates all event-dispatching utilities in one class. > > maybe we can loop over installed L&F? click position fixed......L&F iterated..... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2096924822 From abhiscxk at openjdk.org Tue May 20 07:08:08 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 20 May 2025 07:08:08 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v2] In-Reply-To: References: Message-ID: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Review comment fix, latch and other changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25299/files - new: https://git.openjdk.org/jdk/pull/25299/files/1f4d5e82..f7e1c2c3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=00-01 Stats: 54 lines in 1 file changed: 14 ins; 26 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/25299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25299/head:pull/25299 PR: https://git.openjdk.org/jdk/pull/25299 From mvs at openjdk.org Tue May 20 07:37:26 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 07:37:26 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java Message-ID: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). ------------- Commit messages: - 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java Changes: https://git.openjdk.org/jdk/pull/25319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357305 Stats: 143 lines in 1 file changed: 139 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From abhiscxk at openjdk.org Tue May 20 07:53:30 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 20 May 2025 07:53:30 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> References: <4Uo7SgKZMLYdTumK8iQgnU4tM2GIDKBaL-tnUZl2atU=.1821a43d-d262-4218-aec2-e69f0956f587@github.com> Message-ID: <3VPaWmqWO0DbnJkCHiARXQj8Kd1-IHP8CgrjZVh59yk=.39272ac6-ee13-4b77-a4f5-9afa134f7b7b@github.com> On Mon, 19 May 2025 12:16:57 GMT, Alexey Ivanov wrote: >> Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: >> >> - File merge >> - Review comment fix, latch and other changes >> - Test Stabilization > > test/jdk/java/awt/List/ListEnterExitTest.java line 1: > >> 1: /* > > I strongly suggest making `MouseEnterExitListener` a static nested class inside `ListEnterExitTest`. This prevents any duplicate class names from other classes when one works with tests in an IDE. Updated. > test/jdk/java/awt/List/ListEnterExitTest.java line 92: > >> 90: >> 91: robot.mousePress(InputEvent.BUTTON1_MASK); >> 92: robot.mouseRelease(InputEvent.BUTTON1_MASK); > > Is this mouse press needed only to release `mouseEnterExitListener.wait`? > > I suggest using a `CountDownLatch` to replace `MouseEnterExitListener.passed_1` and `passed_2`. The code would need to time-await for both latches to be released. > > Then `MouseEnterExitListener.mousePressed` can be removed completely together with the synchronized block above. Updated with CountDownlatch to track mouse enter and exit events. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2097240158 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2097239878 From abhiscxk at openjdk.org Tue May 20 07:53:30 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 20 May 2025 07:53:30 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: References: Message-ID: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: - File merge - Review comment fix, latch and other changes - Test Stabilization ------------- Changes: https://git.openjdk.org/jdk/pull/25299/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=02 Stats: 61 lines in 1 file changed: 20 ins; 25 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/25299.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25299/head:pull/25299 PR: https://git.openjdk.org/jdk/pull/25299 From aivanov at openjdk.org Tue May 20 10:18:04 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 10:18:04 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 07:32:41 GMT, Manukumar V S wrote: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). I see that `MenuItemTest` class exists in `bug4729669.java`: https://github.com/openjdk/jdk/blob/e961b13cd68bc352b86af17c7e53df8537519beb/test/jdk/javax/swing/JMenuItem/bug4729669.java#L80 Is it similar to the one that you copied? If that `MenuItemTest` class is identical, I suggest moving both tests into a subdirectory and promoting `MenuItemTest` into a public class in that subdirectory which is located in its own `.java` file. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2893798782 From azvegint at openjdk.org Tue May 20 10:35:50 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 20 May 2025 10:35:50 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v2] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 23:02:54 GMT, Sergey Bylokhov wrote: > > I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage. > > Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)? Sure, [updated](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements#AutomatedclientGUItestingsystemsetuprequirements-Wayland). ------------- PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2893849751 From jdv at openjdk.org Tue May 20 11:19:58 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Tue, 20 May 2025 11:19:58 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood wrote: >> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. >> >> I added a little bit of logging that might also help identify what's happening. >> >> Does anyone have any more suggestions? > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8356061: removing robot > > This is in response to: > https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453 I think the original issue of getting same RGB color for both default and non-default button is happening because when we move mouse pointer to a location and pick the color from the same location using robot, sometimes it picks the color of mouse pointer and not UI component(this issue is observed only in macOS aarch64 machines). Since we have completely removed usage of robot in this test case, we should not see same color for default and non-default buttons anymore. LGTM. ------------- Marked as reviewed by jdv (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25244#pullrequestreview-2853766216 From mvs at openjdk.org Tue May 20 11:33:51 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 11:33:51 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 10:15:11 GMT, Alexey Ivanov wrote: > I see that `MenuItemTest` class exists in `bug4729669.java`: > > https://github.com/openjdk/jdk/blob/e961b13cd68bc352b86af17c7e53df8537519beb/test/jdk/javax/swing/JMenuItem/bug4729669.java#L80 > > Is it similar to the one that you copied? > > If that `MenuItemTest` class is identical, I suggest moving both tests into a subdirectory and promoting `MenuItemTest` into a public class in that subdirectory which is located in its own `.java` file. No, these are no exactly the same, the doMenuItemTest(boolean isLeft) method in bug4729669.java has only one parameter, but the doMenuItemTest(boolean isLeft, String lafName, int frameY) method has three parameters in bug6197830.java. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2894001580 From aivanov at openjdk.org Tue May 20 11:55:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 11:55:51 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 11:31:01 GMT, Manukumar V S wrote: > > I see that `MenuItemTest` class exists in `bug4729669.java`: > > https://github.com/openjdk/jdk/blob/e961b13cd68bc352b86af17c7e53df8537519beb/test/jdk/javax/swing/JMenuItem/bug4729669.java#L80 > > > > Is it similar to the one that you copied? > > If that `MenuItemTest` class is identical, I suggest moving both tests into a subdirectory and promoting `MenuItemTest` into a public class in that subdirectory which is located in its own `.java` file. > > No, these are no exactly the same, the doMenuItemTest(boolean isLeft) method in bug4729669.java has only one parameter, but the doMenuItemTest(boolean isLeft, String lafName, int frameY) method has three parameters in bug6197830.java. Can they be merged together? If possible, I'd like to eliminate code duplication and extract common code. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2894100567 From aivanov at openjdk.org Tue May 20 12:05:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 12:05:53 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 11:52:58 GMT, Alexey Ivanov wrote: > > > I see that `MenuItemTest` class exists in `bug4729669.java`: > > > https://github.com/openjdk/jdk/blob/e961b13cd68bc352b86af17c7e53df8537519beb/test/jdk/javax/swing/JMenuItem/bug4729669.java#L80 > > > > > > Is it similar to the one that you copied? > > > If that `MenuItemTest` class is identical, I suggest moving both tests into a subdirectory and promoting `MenuItemTest` into a public class in that subdirectory which is located in its own `.java` file. > > > > > > No, these are no exactly the same, the doMenuItemTest(boolean isLeft) method in bug4729669.java has only one parameter, but the doMenuItemTest(boolean isLeft, String lafName, int frameY) method has three parameters in bug6197830.java. > > Can they be merged together? > > If possible, I'd like to eliminate code duplication and extract common code. The only difference is the Look-and-Feel parameter, which can be abstracted by pulling out common code. Then `frameY` is used to position the test frame. It's not needed if [`PassFailJFrame.Builder.positionTestUIBottomRowCentered`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIBottomRowCentered()) or [`positionTestUIRightColumnCentered`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.Builder.html#positionTestUIRightColumnCentered()) are used. For the case where multiple L&Fs are tested, a custom layout could be implemented to position test windows in two columns and two rows, which is easy with [`WindowLayouts`](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/WindowLayouts.html). Is Motif L&F still supported? I guess it is but it's deprecated. https://github.com/openjdk/jdk/blob/ab985a7c5d313304e6d601571885dcb871967259/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java#L51-L57 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2894154602 From mvs at openjdk.org Tue May 20 12:09:00 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 12:09:00 GMT Subject: Integrated: 8355515: Clarify the purpose of forcePass() and forceFail() methods In-Reply-To: References: Message-ID: On Wed, 7 May 2025 12:28:52 GMT, Manukumar V S wrote: > Clarified the purpose of forcePass() and forceFail() methods and recommended usage of these methods. > > forcePass() contained an incorrect sample; it's addressed by [JDK-8355441](https://bugs.openjdk.org/browse/JDK-8355441). > > The description of forceFail() has been expanded, too. > > > A new section in the description of the PassFailJFrame added to describe forcePass() and forceFail(). This pull request has now been integrated. Changeset: 1a97eb42 Author: Manukumar V S Committer: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/1a97eb429b520b7c4e625b97553c954d065c00cb Stats: 33 lines in 1 file changed: 31 ins; 0 del; 2 mod 8355515: Clarify the purpose of forcePass() and forceFail() methods Reviewed-by: aivanov, kizune ------------- PR: https://git.openjdk.org/jdk/pull/25091 From mvs at openjdk.org Tue May 20 12:10:51 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 12:10:51 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 12:03:23 GMT, Alexey Ivanov wrote: > > > I see that `MenuItemTest` class exists in `bug4729669.java`: > > > https://github.com/openjdk/jdk/blob/e961b13cd68bc352b86af17c7e53df8537519beb/test/jdk/javax/swing/JMenuItem/bug4729669.java#L80 > > > > > > Is it similar to the one that you copied? > > > If that `MenuItemTest` class is identical, I suggest moving both tests into a subdirectory and promoting `MenuItemTest` into a public class in that subdirectory which is located in its own `.java` file. > > > > > > No, these are no exactly the same, the doMenuItemTest(boolean isLeft) method in bug4729669.java has only one parameter, but the doMenuItemTest(boolean isLeft, String lafName, int frameY) method has three parameters in bug6197830.java. > > Can they be merged together? > > If possible, I'd like to eliminate code duplication and extract common code. Yes, I can try that. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2894168382 From zzambers at openjdk.org Tue May 20 14:21:58 2025 From: zzambers at openjdk.org (Zdenek Zambersky) Date: Tue, 20 May 2025 14:21:58 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: <5fiGZhiUeut1V4c4CAVraAsa4-Lv-B5z8Bvt19UK4X8=.72aa6db8-b7c7-40d7-9928-aa8ccf9567f9@github.com> Message-ID: On Fri, 16 May 2025 18:19:22 GMT, Phil Race wrote: > That looks right, and it should also be good for backports. The root cause must be a bug in Xlib, though. Has anyone found it, or reported it? I have not identified the root cause. I think bug could also be in kinput2 or it's interaction with X11/Xlib (as scenario with kinput2 is problematic case as far as I understand). Unfortunately this would be very difficult to debug for me, as I have no experience with input of Asian characters (kinput2) and RHEL (8) does not offer kinput2 package. In addition I can only do testing remotely on temporarily loaned s390x headless machine. So I do not plan to dig deeper into this myself and I rely on observations by @takiguc here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2894608187 From zzambers at openjdk.org Tue May 20 14:42:57 2025 From: zzambers at openjdk.org (Zdenek Zambersky) Date: Tue, 20 May 2025 14:42:57 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: <5fiGZhiUeut1V4c4CAVraAsa4-Lv-B5z8Bvt19UK4X8=.72aa6db8-b7c7-40d7-9928-aa8ccf9567f9@github.com> Message-ID: On Tue, 20 May 2025 14:18:06 GMT, Zdenek Zambersky wrote: >>> That looks right, and it should also be good for backports. The root cause must be a bug in Xlib, though. Has anyone found it, or reported it? >> >> That was my thought too : "Looks reasonable although it seems an odd behaviour (bug?) of XGetICValues" > >> That looks right, and it should also be good for backports. The root cause must be a bug in Xlib, though. Has anyone found it, or reported it? > > I have not identified the root cause. I think bug could also be in kinput2 or it's interaction with X11/Xlib (as scenario with kinput2 is problematic case as far as I understand). > > Unfortunately this would be very difficult to debug for me, as I have no experience with input of Asian characters (kinput2) and RHEL (8) does not offer kinput2 package. In addition I can only do testing remotely on temporarily loaned s390x headless machine. So I do not plan to dig deeper into this myself and I rely on observations by @takiguc here. > @zzambers Sorry for my late reaction. Is it possible to add test result by using `XMODIFIERS=@im=local` ? I have now also tested this scenario (fixed jdk + `XMODIFIERS=@im=local` + Xvfb): - my reproducer -> ok (no crash) - jdk_awt tests: TEST TOTAL PASS FAIL ERROR SKIP >> jtreg:test/jdk:jdk_awt 2171 1218 260 6 687 << No crashes (stack smashing), even less failures (even though lot of changes in failures could probably be attributed to unstable tests... :/ ) ------------- PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2894683771 From zzambers at openjdk.org Tue May 20 14:45:57 2025 From: zzambers at openjdk.org (Zdenek Zambersky) Date: Tue, 20 May 2025 14:45:57 GMT Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: Message-ID: On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky wrote: > This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`) > > Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened. > > I was not able to get response from original author for this issue, so I am creating PR myself. > > **Testing:** > I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. > > Without fix: > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1063 415 6 687 << > > > With fix > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1162 316 6 687 << > > > Many tests are no longer crashing the VM: > > -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Failed. Unexpected exit from test [exit code: 134] > +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Passed. Execution successful > > There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix) > > I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.) Attaching jdk_awt results with `XMODIFIERS=@im=local`: [jdk-awt-results-im-local.tar.gz](https://github.com/user-attachments/files/20349889/jdk-awt-results-im-local.tar.gz) ------------- PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2894695574 From kizune at openjdk.org Tue May 20 15:58:01 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 20 May 2025 15:58:01 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 07:53:30 GMT, Abhishek Kumar wrote: >> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. >> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. >> >> Verified the updated test in CI on macOS 14.7 machine and there is no failure. > > Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: > > - File merge > - Review comment fix, latch and other changes > - Test Stabilization Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2854768458 From kizune at openjdk.org Tue May 20 15:59:57 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 20 May 2025 15:59:57 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: <5AbtaN3spDPIwctnzjsCh9jUGtqjx4A5SJB-_6ZZEPY=.7441f23a-794b-43e3-913c-934bf6db6543@github.com> On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2854775307 From aivanov at openjdk.org Tue May 20 16:04:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 16:04:55 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Marked as reviewed by aivanov (Reviewer). src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c line 1: > 1: /* Bump the copyright year to 2025. ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2854784582 PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2098346273 From mvs at openjdk.org Tue May 20 16:18:48 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 16:18:48 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Rearranged and reused code by creating a new Helper MenuItemTestHelper.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/adf3a94d..1f027147 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=00-01 Stats: 710 lines in 5 files changed: 311 ins; 399 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From aivanov at openjdk.org Tue May 20 18:10:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 18:10:59 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> Message-ID: On Tue, 20 May 2025 16:18:48 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Rearranged and reused code by creating a new Helper MenuItemTestHelper.java Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 2: > 1: /* > 2: * Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. I'd keep 2005 year as the start of the copyright ? it's not a brand new class, you just pulled it out of another class. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 43: > 41: import javax.swing.UIManager; > 42: > 43: class MenuItemTestHelper { I would've kept `MenuItemTest` as the name of the class. It's find either way. I'd also mark this class as `final`. It may be `public` or be left with the default access. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 53: > 51: } catch (Exception e) { > 52: e.printStackTrace(); > 53: } I wonder if we should actually wrap the exception into `RuntimeException` and let it propagate to fail the test. I think we should; if Look and Feel wasn't set as expected, the test won't test that part of the functionality. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 65: > 63: > 64: public int getIconWidth() { return 10; } > 65: public int getIconHeight() { return 10; } I suggest keeping the multiline version of the methods, I find it easier to read. Let IDE collapse the code for you. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 69: > 67: > 68: Icon myIcon2 = new Icon() { > 69: public void paintIcon(Component c, Graphics g, int x, int y) { I'd add the `@Override` annotations to all the overridden methods. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 74: > 72: g.fillRect(x, y, 15, 10); > 73: g.setColor(color); > 74: } Perhaps, both `Icon` instances could even be refactored into its own class that accepts color, width and height. However, this is close to over-engineering the test code? test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 85: > 83: menuBar.add(createSomeIconsMenu(myIcon, myIcon2)); > 84: > 85: String title = "Menu Item Test " + (isLeft ? "(Left-to-right)" : "(Right-to-left)"); Suggestion: String title = (isLeft ? "(Left-to-right)" : "(Right-to-left)") + " - Menu Item Test"; I suggest flipping the title so that the most relevant part is always visible rather than truncated. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 87: > 85: String title = "Menu Item Test " + (isLeft ? "(Left-to-right)" : "(Right-to-left)"); > 86: JFrame frame = new JFrame(title); > 87: frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); Closing the frame is handled by `PassFailJFrame`, so `setDefaultCloseOperation` is redundant. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 89: > 87: frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > 88: frame.setJMenuBar(menuBar); > 89: frame.applyComponentOrientation(isLeft ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT); Suggestion: frame.applyComponentOrientation(isLeft ? ComponentOrientation.LEFT_TO_RIGHT : ComponentOrientation.RIGHT_TO_LEFT); This avoids a long line. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 100: > 98: frame.setSize(300, 300); > 99: frame.setLocation(isLeft ? 0 : 600, frameY); > 100: frame.setVisible(true); `setLocation` shouldn't be need if you use `PassFailJFrame` layouts for positioning. Then `frameY` becomes redundant. `setVisible(true)` isn't need either. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 120: > 118: > 119: JRadioButtonMenuItem rm2 = new JRadioButtonMenuItem("And icon."); > 120: rm2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, KeyEvent.SHIFT_MASK)); Suggestion: rm2.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, KeyEvent.SHIFT_DOWN_MASK)); test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 139: > 137: > 138: private static JMenu createNoNothingMenu() { > 139: final JMenu menu2 = new JMenu("No nothing"); Suggestion: final JMenu noMenu = new JMenu("No nothing"); I'd rename it to `noMenu` to represent `NoNothing` from the method name. Otherwise, it can be just `menu`, there's no other `menu` in scope any more. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 148: > 146: PassFailJFrame.log("menu.width = " + width); > 147: } > 148: }); Suggestion: item.addActionListener((e) -> PassFailJFrame.log("menu.width = " + menu2.getPopupMenu().getWidth())); Let's be concise. test/jdk/javax/swing/JMenuItem/MenuItemTest/bug4729669.java line 49: > 47: .columns(35) > 48: .testUI(bug4729669::createTestUI) > 49: .position(PassFailJFrame.Position.TOP_LEFT_CORNER) Suggestion: .positionTestUIRightColumn() test/jdk/javax/swing/JMenuItem/MenuItemTest/bug6197830.java line 46: > 44: > 45: public static void main(String[] args) throws Exception { > 46: PassFailJFrame.builder() Use `.positionTestUIBottomRowCentered()`, it works perfectly well. Then remove all the `.setLocation` calls from `createTestUI`. ------------- PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2854867797 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098398095 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098469033 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098479317 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098411293 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098429701 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098416620 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098533147 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098431170 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098545578 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098445060 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098588166 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098549320 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098543901 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098443874 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098560543 From aivanov at openjdk.org Tue May 20 18:11:00 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 18:11:00 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> Message-ID: On Tue, 20 May 2025 16:33:38 GMT, Alexey Ivanov wrote: >> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: >> >> Review comments fixed : Rearranged and reused code by creating a new Helper MenuItemTestHelper.java > > test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 74: > >> 72: g.fillRect(x, y, 15, 10); >> 73: g.setColor(color); >> 74: } > > Perhaps, both `Icon` instances could even be refactored into its own class that accepts color, width and height. > > However, this is close to over-engineering the test code? Anyway, it makes the code cleaner: private static final class ColoredIcon implements Icon { private final Color color; private final int width; private final int height; private ColoredIcon(Color color, int width, int height) { this.color = color; this.width = width; this.height = height; } @Override public void paintIcon(Component c, Graphics g, int x, int y) { Color oldColor = g.getColor(); g.setColor(color); g.fillRect(x, y, width, height); g.setColor(oldColor); } @Override public int getIconWidth() { return width; } @Override public int getIconHeight() { return height; } } It may be a record, yet using a class will make backporting to previous versions easier. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098585654 From mvs at openjdk.org Tue May 20 18:34:28 2025 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 20 May 2025 18:34:28 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v3] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Formatting changes,copyright,cosmetic changes,etc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/1f027147..098ea0de Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=01-02 Stats: 69 lines in 2 files changed: 22 ins; 35 del; 12 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From aivanov at openjdk.org Tue May 20 18:52:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 18:52:55 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v3] In-Reply-To: References: Message-ID: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com> On Mon, 19 May 2025 13:52:16 GMT, Tejesh R wrote: >> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. >> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Review fix Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 29: > 27: import javax.swing.filechooser.FileSystemView; > 28: import java.io.File; > 29: import java.util.List; Suggestion: import java.io.File; import java.util.List; import javax.swing.Icon; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.filechooser.FileSystemView; We haven't reached an agreement, yet `java.*` packages usually go before `javax.*` packages in the list of imports. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 45: > 43: String INSTRUCTIONS = """ > 44: 1. FileChooser shows up a virtual directory and file with name > 45: "

Testing Name". The file name is now `Swing Rocks!` test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 51: > 49: ComboBox remains in plain text, then test PASS. > 50: If it appears to be in HTML format with Pink color, > 51: then test FAILS. Suggestion: ComboBox remains in plain text, then test passes. If it appears to be in HTML format with Pink color, then test fails. You could be more specific: _?click **Fail**?_ if a condition isn't met. (Otherwise, continue with the test.) End the instructions with _?click **Pass**?_. Anyway, the instructions are pretty clear as they are, so real change is required. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 59: > 57: ComboBox remains in HTML format string, then test PASS. > 58: If it appears to be in plain text, then test FAILS. > 59: (Verify for all Look and Feel). How do I verify for all Look and Feels? The test has to iterate over all L&F, and repeat the same thing for each L&F. Ideally, it should be an automated test. However, I'm fine with postponing any efforts to automate the test but I'd like to try to automate it. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 60: > 58: If it appears to be in plain text, then test FAILS. > 59: (Verify for all Look and Feel). > 60: """; Suggestion: """; Avoid trailing space, it's not needed. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 85: > 83: frame.pack(); > 84: return frame; > 85: } Suggestion: private static JFrame createFileChooser(boolean htmlEnabled) { JFileChooser jfc = new JFileChooser(new VirtualFileSystemView()); jfc.putClientProperty("html.disable", htmlEnabled); jfc.setControlButtonsAreShown(false); JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); frame.add(jfc); frame.pack(); return frame; } I think this way is cleaner: create the file chooser, configure it?; then create the frame, put the file chooser into the frame. `html_enabled` ? `htmlEnabled`, which aligns to the Java style. ? I added `jfc.setControlButtonsAreShown(false)` to hide the *Open* and *Cancel* buttons. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 96: > 94: public File[] getRoots() { > 95: return new File[]{ > 96: new File("/", "

SWING ROCKS!!!111"), Suggestion: new File("/", "

Swing Rocks!"), Use title case? ------------- PR Review: https://git.openjdk.org/jdk/pull/24439#pullrequestreview-2855169377 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098639699 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098604737 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098653423 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098604212 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098598944 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098610838 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098642534 From aivanov at openjdk.org Tue May 20 18:52:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 18:52:56 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v3] In-Reply-To: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> References: <9eWBFqqVGM6xc824gwLDzpRT6cYOORMC1bFkdzFrseA=.424e137c-e5d9-4fb9-a2b1-e5a675b8ac6b@github.com> Message-ID: On Tue, 13 May 2025 03:05:32 GMT, Sergey Bylokhov wrote: >>> Exception in thread "AWT-EventQueue-0" java.nio.file.InvalidPathException: Illegal char <<> at index 0:

SWING ROCKS!!!111 >>> at java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:191) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:142) >>> at java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:46) >>> at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92) >>> at java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:203) >>> at java.base/java.nio.file.Path.of(Path.java:148) >>> at java.base/java.nio.file.Paths.get(Paths.java:69) >>> at java.desktop/sun.awt.shell.ShellFolder.getShellFolder(ShellFolder.java:260) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getShellFolder(FileSystemView.java:724) >>> at java.desktop/javax.swing.filechooser.FileSystemView.getSystemIcon(FileSystemView.java:242) >>> at java.desktop/com.sun.java.swing.plaf.windows.WindowsFileChooserUI$WindowsFileView.getIcon(WindowsFileChooserUI.java:1398) >>> at java.desktop/javax.swing.JFileChooser.getIcon(JFileChooser.java:1614) >> >> >> This exception looks like a bug? I think if the file was not found then null is an expected result. >> For now it can be bypassed by this: >> >> >> import java.io.File; >> import java.lang.Override; >> >> import javax.swing.Icon; >> import javax.swing.JFileChooser; >> import javax.swing.SwingUtilities; >> import javax.swing.UIManager; >> import javax.swing.UnsupportedLookAndFeelException; >> import javax.swing.filechooser.FileSystemView; >> >> public class VirtualFileChooser { >> >> public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { >> UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); >> //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"); >> >> >> SwingUtilities.invokeLater(() -> { >> JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); >> >> int result = chooser.showOpenDialog(null); >> if (result == JFileChooser.APPROVE_OPTION) { >> File selectedFile = chooser.getSelectedFile(); >> System.out.println("Selected: " + selectedFile.getAbsolutePath()); >> } >> ... > > Note that the bug occurs both in the list of roots (in the dropdown) and in the list of files. Now @mrserb deserves being a co-author. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2098641113 From serb at openjdk.org Tue May 20 19:01:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 20 May 2025 19:01:55 GMT Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener In-Reply-To: <95g0weiARkYC01wgCQbJNJD1iwc_RpCUS3sH1i1K_-A=.333d4836-3718-41c3-a998-4e2bccad3c1b@github.com> References: <95g0weiARkYC01wgCQbJNJD1iwc_RpCUS3sH1i1K_-A=.333d4836-3718-41c3-a998-4e2bccad3c1b@github.com> Message-ID: <9Lzt5tfT0nBGGv-3Bv2DEUil_hT4hV_sJZ4iXi8L5RU=.465ecb13-f771-482e-b085-bb704fa26e61@github.com> On Mon, 19 May 2025 12:23:27 GMT, Alexey Ivanov wrote: >> Looks like yes. I think it's worth to create a separate issue to fix it. > > It doesn't matter, it looks? `localL` is `null` if and only if listener is `null`. > > However, I'd put the null-check above the call to `deProxyAWTEventListener` to avoid any confusion. listener and proxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So this method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. so it is just a code clarification. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24692#discussion_r2098669264 From aivanov at openjdk.org Tue May 20 19:17:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 19:17:52 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v3] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Tue, 20 May 2025 18:34:28 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Formatting changes,copyright,cosmetic changes,etc There are still unresolved comments, and I added new ones. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 148: > 146: > 147: private record ColoredIcon(Color color, int width, > 148: int height) implements Icon { Suggestion: private record ColoredIcon(Color color, int width, int height) implements Icon { This would be better. Otherwise, I'd wrap all the parameters, including `width` because both `width` and `height` are tightly connected. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 150: > 148: int height) implements Icon { > 149: @Override > 150: public void paintIcon(Component c, Graphics g, int x, int y) { Suggestion: @Override public void paintIcon(Component c, Graphics g, int x, int y) { You have reduce indentation of the entire `ColoredIcon` class. test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 161: > 159: } > 160: @Override > 161: public int getIconHeight() { I'm still for having blank lines between the methods: it makes scanning the code easier as you clearly see where a method ends and another starts. There's no penalty for additional lines, but they improve readability, in my opinion. In an IDE, you can always collapse unimportant sections, like this helper class, and get it out of your view. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2855300606 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098678566 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098679939 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098683738 From aivanov at openjdk.org Tue May 20 19:20:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 19:20:53 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> Message-ID: On Tue, 20 May 2025 17:01:26 GMT, Alexey Ivanov wrote: >> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: >> >> Review comments fixed : Rearranged and reused code by creating a new Helper MenuItemTestHelper.java > > test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 43: > >> 41: import javax.swing.UIManager; >> 42: >> 43: class MenuItemTestHelper { > > I would've kept `MenuItemTest` as the name of the class. It's fine either way. > > I'd also mark this class as `final`. It may be `public` or be left with the default access. However, `-Helper` could be better ? the name of the class clearly indicates that this class is not _a test_ but a helper class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2098697447 From prr at openjdk.org Tue May 20 19:30:54 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 20 May 2025 19:30:54 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: On Mon, 19 May 2025 12:44:35 GMT, Alexey Ivanov wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > src/java.desktop/share/classes/java/awt/GridBagLayout.java line 243: > >> 241: * right-to-left container. >> 242: * >> 243: *
> > Is it possible to keep the width small as it was? I doubt it - unless you make the font really small, maybe? If you look at how it is today you'll see the buttons are packed together using Motif L&F https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/GridBagLayout.html BTW I tried a couple of times to upload javadoc to cr.openjdk.org so I could show the new rendered javadoc but uploads failed ... > src/java.desktop/share/classes/java/awt/GridBagLayout.java line 288: > >> 286: * public class GridBagLayoutExample { >> 287: * >> 288: * static void addButton(String name, > > Suggestion: > > * private static void addButton(String name, ok ... > src/java.desktop/share/classes/java/awt/GridBagLayout.java line 295: > >> 293: * gridbag.setConstraints(button, c); >> 294: * frame.add(button); >> 295: * } > > The `add` method should indented by 4 spaces to the right. adjusting > src/java.desktop/share/classes/java/awt/GridBagLayout.java line 303: > >> 301: * GridBagLayout gridbag = new GridBagLayout(); >> 302: * GridBagConstraints c = new GridBagConstraints(); >> 303: * frame.setLayout(gridbag); > > The `main` method should be indented by 4 spaces to the right, it's inside `GridBagLayoutExample` class. will adjust > src/java.desktop/share/classes/java/awt/MediaTracker.java line 108: > >> 106: * tracker.addImage(bg, 0); >> 107: * for (int i = 0; i < 5; i++) { >> 108: * anim[i] = tk.getImage("anim"+i+".gif"); > > Suggestion: > > * anim[i] = tk.getImage("anim" + i + ".gif"); ok ... > src/java.desktop/share/classes/java/awt/doc-files/BorderLayout-1.png line 1: > >> 1: ?PNG > > The images would look better with square borders? which are left on Windows 10 only. > > If it's possible to make the pixels on the rounded corners transparent or at least white, the images would look better. I did not feel like getting into manual touch up of these images. In some cases they are a massive improvement over what was there before regardless eg this is how FlowLayout looks today https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/doc-files/FlowLayout-1.gif ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098687639 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098711963 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098711724 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098711524 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098712376 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098711098 From aivanov at openjdk.org Tue May 20 19:37:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 19:37:56 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 07:53:30 GMT, Abhishek Kumar wrote: >> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. >> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. >> >> Verified the updated test in CI on macOS 14.7 machine and there is no failure. > > Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: > > - File merge > - Review comment fix, latch and other changes > - Test Stabilization Changes requested by aivanov (Reviewer). test/jdk/java/awt/List/ListEnterExitTest.java line 54: > 52: private final int LATCH_TIMEOUT = 3; > 53: private static volatile CountDownLatch mouseEnterLatch = new CountDownLatch(1); > 54: private static volatile CountDownLatch mouseExitLatch = new CountDownLatch(1); Suggestion: private static final int X_OFFSET = 30; private static final int Y_OFFSET = 40; private static final int LATCH_TIMEOUT = 3; private final CountDownLatch mouseEnterLatch = new CountDownLatch(1); private final CountDownLatch mouseExitLatch = new CountDownLatch(1); test/jdk/java/awt/List/ListEnterExitTest.java line 97: > 95: > 96: if (!mouseEnterLatch.await(LATCH_TIMEOUT, TimeUnit.SECONDS)) { > 97: System.out.println("mouseEnterLatch count is : " + mouseEnterLatch.getCount()); This print is redundant: if `mouseEnterLatch` isn't released yet, its count is 1 ? it can't have any other value. At the same, the count could change right after the timeout occurred which would lead to a very confusing output. Thus, I recommend removing printing the count of a latch. test/jdk/java/awt/List/ListEnterExitTest.java line 114: > 112: } > 113: > 114: static class MouseEnterExitListener extends MouseAdapter { Suggestion: private class MouseEnterExitListener extends MouseAdapter { Removing `static` allows removing `static` modifier from the latches. In fact, the `MouseEnterExitListener` class can be eliminated altogether? Yet the code could be clearer this way. ------------- PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2855348060 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2098709525 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2098723381 PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2098717008 From aivanov at openjdk.org Tue May 20 19:42:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 19:42:53 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: References: Message-ID: <0UXVLm0ygz9yjB3TznU-sRYTvk4wIjzDZxwOSnL2YwM=.17c929b3-5d96-44a3-9ca5-06f012bc0cdc@github.com> On Tue, 20 May 2025 07:53:30 GMT, Abhishek Kumar wrote: >> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. >> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. >> >> Verified the updated test in CI on macOS 14.7 machine and there is no failure. > > Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: > > - File merge > - Review comment fix, latch and other changes > - Test Stabilization test/jdk/java/awt/List/ListEnterExitTest.java line 40: > 38: > 39: import java.awt.event.InputEvent; > 40: import java.awt.event.MouseAdapter; `InputEvent` isn't used in the class. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2098730419 From aivanov at openjdk.org Tue May 20 19:49:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 19:49:51 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: On Tue, 20 May 2025 19:12:21 GMT, Phil Race wrote: > BTW I tried a couple of times to upload javadoc to cr.openjdk.org so I could show the new rendered javadoc but uploads failed ... I experienced some issues with uploading files to cr.openjdk.org some time ago; recently it worked well, however, the login isn't instantaneous. I uploaded the updated javadoc for `PassFailJFrame` yesterday. Yeah, it would be helpful to look at the updated javadoc. If I have some time, I'll build updated javadoc and upload it? >> src/java.desktop/share/classes/java/awt/doc-files/BorderLayout-1.png line 1: >> >>> 1: ?PNG >> >> The images would look better with square borders? which are left on Windows 10 only. >> >> If it's possible to make the pixels on the rounded corners transparent or at least white, the images would look better. > > I did not feel like getting into manual touch up of these images. In some cases they are a massive improvement over what was there before regardless eg this is how FlowLayout looks today > https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/java/awt/doc-files/FlowLayout-1.gif I absolutely agree, the new screenshots are of a better quality. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098739075 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098739983 From aivanov at openjdk.org Tue May 20 20:02:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 20 May 2025 20:02:51 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: <-fB8yPUWis2KHIf76x2T6MX_orW3Ys4SKLzhAPYbwsA=.d3c81c1c-80e8-4e45-921f-d878a7fb7857@github.com> On Fri, 16 May 2025 23:04:28 GMT, Phil Race wrote: > Update the some code examples and accompanying images to no longer mention or display as applets. src/java.desktop/share/classes/java/awt/BorderLayout.java line 103: > 101: * > 102: *
> 103:  * import java.awt.BorderLayout;

Should we replace `
` with `{@snippet}` instead?

So, the sample could look like this:


 * {@snippet lang='java':
 * import java.awt.BorderLayout;
 * // all the other code
 *     });
 *   }
 * }
 * }

The last `}` closes the `{@snippet}`, the previous `}` closes `BorderLayoutExample` class.

I used `{@snippet}` in [`PassFailJFrame` javadocs](https://github.com/openjdk/jdk/blob/972f2ebe978280d22531a70116e79837632f6ebc/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java#L166-L185), and it looks like this in [the generated javadoc](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#sampleManualTestCode) with a *Copy* button embedded.

[Programmer's Guide to Snippets](https://docs.oracle.com/en/java/javase/21/javadoc/snippets.html) explains how to use this new javadoc feature available since Java 18 ([JDK-8201533](https://bugs.openjdk.org/browse/JDK-8201533)).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098758600

From aivanov at openjdk.org  Tue May 20 20:08:52 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Tue, 20 May 2025 20:08:52 GMT
Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in
 Toolkit.removeAWTEventListener
In-Reply-To: <9Lzt5tfT0nBGGv-3Bv2DEUil_hT4hV_sJZ4iXi8L5RU=.465ecb13-f771-482e-b085-bb704fa26e61@github.com>
References: 
 
 
 <95g0weiARkYC01wgCQbJNJD1iwc_RpCUS3sH1i1K_-A=.333d4836-3718-41c3-a998-4e2bccad3c1b@github.com>
 <9Lzt5tfT0nBGGv-3Bv2DEUil_hT4hV_sJZ4iXi8L5RU=.465ecb13-f771-482e-b085-bb704fa26e61@github.com>
Message-ID: 

On Tue, 20 May 2025 18:59:33 GMT, Sergey Bylokhov  wrote:

>> It doesn't matter, it looks? `localL` is `null` if and only if listener is `null`.
>> 
>> However, I'd put the null-check above the call to `deProxyAWTEventListener` to avoid any confusion.
>
> listener and proxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So this method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. so it is just a code clarification.

You're right!

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24692#discussion_r2098766802

From aivanov at openjdk.org  Tue May 20 20:19:53 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Tue, 20 May 2025 20:19:53 GMT
Subject: RFR: 8356061: [macos]
 com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on
 macosx-aarch64 machine [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Tue, 20 May 2025 11:17:39 GMT, Jayathirth D V  wrote:

> I think the original issue of getting same RGB color for both default and non-default button is happening because when we move mouse pointer to a location and pick the color from the same location using robot, sometimes it picks the color of mouse pointer and not UI component(this issue is observed only in macOS aarch64 machines).
> 
> Since we have completely removed usage of robot in this test case, we should not see same color for default and non-default buttons anymore. LGTM.

Is it possible that the button hovered by mouse looks the same way as the default one?

Did the original test move the mouse before getting pixel color of a button?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2895724466

From prr at openjdk.org  Tue May 20 20:30:21 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 20:30:21 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v2]
In-Reply-To: 
References: 
Message-ID: 

> Update the some code examples and accompanying images to no longer mention or display as applets.

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

  8357176

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25278/files
  - new: https://git.openjdk.org/jdk/pull/25278/files/d3d8a1cc..9bfba377

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=00-01

  Stats: 41 lines in 8 files changed: 0 ins; 0 del; 41 mod
  Patch: https://git.openjdk.org/jdk/pull/25278.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25278/head:pull/25278

PR: https://git.openjdk.org/jdk/pull/25278

From prr at openjdk.org  Tue May 20 20:30:21 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 20:30:21 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
In-Reply-To: 
References: 
Message-ID: 

On Fri, 16 May 2025 23:04:28 GMT, Phil Race  wrote:

> Update the some code examples and accompanying images to no longer mention or display as applets.

> > It seems the new screenshots could be improved by capturing them on a HiDPI (Retina) display, as the current images appear blurry. And to eliminate background elements in the corners, it might be better to capture screenshots of undecorated windows as was done in the old images.
> 
> To make the screenshots look good on High DPI displays, we need several images (preferably at 100%, 150% and 200% as the most common scales) and use the [**`srcset` attribute**](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#srcset) of the `` element to provide different resolutions.
> 
> If you just create a screenshot on (Retina at 200% scale), the screenshots will be _too large_ and still blurry as browsers will still scale up the screenshots to the scale of the display because the [`src` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/img#src) is treated as 100%-scale candidate only.
> 
> If we agree to go this way, I can create screenshots on Windows 10 (which still uses square window borders) in different resolutions.

Re-doing the images was necessary because they were obviously applets and extremely dated, so they are better (IMO) and good enough. I just figured out how to do the screen capture without the corners.  macOS screen capture included a massive shadow that doubled the size. There's a trick (or two)
(1) Cmd-Shift-4 to enable screen capture
(2) Space to say you want to capture a specific window
(3) Option-Enter or Option-Left-Click will capture WITHOUT the shadow  (phew)

I'll upload new images

If you want to do more in a follow-up fix, that's fine, although I am not sure about Windows 10 .. as its already on the way out.
I'm also not sure about any scaling of Windows 10 rendering as it will have LCD text which is notoriously bad when scaled.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2895747242

From serb at openjdk.org  Tue May 20 21:19:51 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Tue, 20 May 2025 21:19:51 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 20 May 2025 20:30:21 GMT, Phil Race  wrote:

>> Update the some code examples and accompanying images to no longer mention or display as applets.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8357176

src/java.desktop/share/classes/java/awt/GridLayout.java line 50:

> 48:  *
> 49:  *     EventQueue.invokeAndWait(() -> {
> 50:  *        Frame frame = new Frame("GridLayout");

I would like to bring this to the discussion not necessarily suggesting any changes. I noticed that the example uses a "frame", while the description above refers to a "window" it might be worth unification. Also, regarding invokeAndWait: it?s not strictly necessary here since this is AWT but it does not break anything. However, I wonder if it?s worth discussing the use of invokeAndWait vs invokeLater. In tests, we usually prefer invokeAndWait because we need to wait for the action to complete, but in applications invokeLater should work fine.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098892219

From prr at openjdk.org  Tue May 20 21:58:52 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 21:58:52 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v2]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Tue, 20 May 2025 21:17:22 GMT, Sergey Bylokhov  wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8357176
>
> src/java.desktop/share/classes/java/awt/GridLayout.java line 50:
> 
>> 48:  *
>> 49:  *     EventQueue.invokeAndWait(() -> {
>> 50:  *        Frame frame = new Frame("GridLayout");
> 
> I would like to bring this to the discussion not necessarily suggesting any changes. I noticed that the example uses a "frame", while the description above refers to a "window" it might be worth unification. Also, regarding invokeAndWait: it?s not strictly necessary here since this is AWT but it does not break anything. However, I wonder if it?s worth discussing the use of invokeAndWait vs invokeLater. In tests, we usually prefer invokeAndWait because we need to wait for the action to complete, but in applications invokeLater should work fine.

A Frame (the java class) creates a window (the desktop concept). I would not want to promote the java type Frame to mean the concept.
Regarding invokeAndWait vs invokeLater, either is fine in this case and main has nothing else to do whilst waiting and is the safest default.
I pondered whether to do either in this simple case, but we do generally these days recommend this pattern even for AWT as Swing classes may be used to implement AWT .. and if I did not I guarantee someone would have said I should use it ! Whether or not it matters in this case.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098939094

From prr at openjdk.org  Tue May 20 22:09:37 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 22:09:37 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v3]
In-Reply-To: 
References: 
Message-ID: 

> Update the some code examples and accompanying images to no longer mention or display as applets.

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

  8357176

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25278/files
  - new: https://git.openjdk.org/jdk/pull/25278/files/9bfba377..21f4cba1

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=01-02

  Stats: 15 lines in 5 files changed: 5 ins; 0 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/25278.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25278/head:pull/25278

PR: https://git.openjdk.org/jdk/pull/25278

From prr at openjdk.org  Tue May 20 22:09:37 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 22:09:37 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v3]
In-Reply-To: <-fB8yPUWis2KHIf76x2T6MX_orW3Ys4SKLzhAPYbwsA=.d3c81c1c-80e8-4e45-921f-d878a7fb7857@github.com>
References: 
 <-fB8yPUWis2KHIf76x2T6MX_orW3Ys4SKLzhAPYbwsA=.d3c81c1c-80e8-4e45-921f-d878a7fb7857@github.com>
Message-ID: 

On Tue, 20 May 2025 20:00:16 GMT, Alexey Ivanov  wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8357176
>
> src/java.desktop/share/classes/java/awt/BorderLayout.java line 103:
> 
>> 101:  *
>> 102:  * 
>> 103:  * import java.awt.BorderLayout;
> 
> Should we replace `
` with `{@snippet}` instead?
> 
> So, the sample could look like this:
> 
> 
>  * {@snippet lang='java':
>  * import java.awt.BorderLayout;
>  * // all the other code
>  *     });
>  *   }
>  * }
>  * }
> 
> The last `}` closes the `{@snippet}`, the previous `}` closes `BorderLayoutExample` class.
> 
> I used `{@snippet}` in [`PassFailJFrame` javadocs](https://github.com/openjdk/jdk/blob/972f2ebe978280d22531a70116e79837632f6ebc/test/jdk/java/awt/regtesthelpers/PassFailJFrame.java#L166-L185), and it looks like this in [the generated javadoc](https://cr.openjdk.org/~aivanov/PassFailJFrame/api/PassFailJFrame.html#sampleManualTestCode) with a *Copy* button embedded.
> 
> [Programmer's Guide to Snippets](https://docs.oracle.com/en/java/javase/21/javadoc/snippets.html) explains how to use this new javadoc feature available since Java 18 ([JDK-8201533](https://bugs.openjdk.org/browse/JDK-8201533)).

updated to use snippets.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2098948465

From serb at openjdk.org  Tue May 20 22:27:55 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Tue, 20 May 2025 22:27:55 GMT
Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6]
In-Reply-To: 
References: 
 
Message-ID: <3Cmz0u3qtiLRz6Dl-9SKjyQo3gvWGsz7eSn4sP2rzFM=.04b58489-d2a9-44ab-95c9-1f1e53a62703@github.com>

On Tue, 13 May 2025 21:28:24 GMT, Phil Race  wrote:

>> A simple API to replace java.applet.AudioClip
>> 
>> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8356049

btw why not mark this as an incubator/preview feature and look at the reviews?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2895969770

From prr at openjdk.org  Tue May 20 22:36:56 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 22:36:56 GMT
Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6]
In-Reply-To: <3Cmz0u3qtiLRz6Dl-9SKjyQo3gvWGsz7eSn4sP2rzFM=.04b58489-d2a9-44ab-95c9-1f1e53a62703@github.com>
References: 
 
 <3Cmz0u3qtiLRz6Dl-9SKjyQo3gvWGsz7eSn4sP2rzFM=.04b58489-d2a9-44ab-95c9-1f1e53a62703@github.com>
Message-ID: 

On Tue, 20 May 2025 22:25:12 GMT, Sergey Bylokhov  wrote:

> btw why not mark this as an incubator/preview feature and look at the reviews?

I don't think that necessary for this case.

> I wonder about the limitation to `java.io.File` as source for sound clips. Allowing playback from an `InputStream` allows developers to use their own packaging, compression, bundling, or use dynamically generated sound clips, and to work around missing file access permissions. How about this additional factory method:
> 
> ```
>  public static SoundClip createSoundClip(InputStream file) throws IOException;
> ```
> 
> The implementation is simple, because it boils down to an InputStream internally anyway, and testing is equally simple.

InputStreams can be from anywhere - including a network. This isn't intended for that so it deliberately makes you supply a file.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2895981120

From prr at openjdk.org  Tue May 20 22:43:53 2025
From: prr at openjdk.org (Phil Race)
Date: Tue, 20 May 2025 22:43:53 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 20 May 2025 22:09:37 GMT, Phil Race  wrote:

>> Update the some code examples and accompanying images to no longer mention or display as applets.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8357176

Ok .. here's uploaded javadoc to view
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/BorderLayout.html
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/FlowLayout.html
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/GridBagLayout.html
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/GridLayout.html
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/MediaTracker.html

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2895990587

From serb at openjdk.org  Tue May 20 23:12:53 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Tue, 20 May 2025 23:12:53 GMT
Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API
 [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 20 May 2025 22:09:37 GMT, Phil Race  wrote:

>> Update the some code examples and accompanying images to no longer mention or display as applets.
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8357176

> Ok .. here's uploaded javadoc to view

>      // The background image fills the frame so we
>      // don't need to clear the applet on repaints.
>      // Just call the paint method.
>      public void update(Graphics g) {
>          paint(g);
>      }
https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/MediaTracker.html

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2896031531

From serb at openjdk.org  Tue May 20 23:15:58 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Tue, 20 May 2025 23:15:58 GMT
Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6]
In-Reply-To: 
References: 
 
 <3Cmz0u3qtiLRz6Dl-9SKjyQo3gvWGsz7eSn4sP2rzFM=.04b58489-d2a9-44ab-95c9-1f1e53a62703@github.com>
 
Message-ID: 

On Tue, 20 May 2025 22:33:57 GMT, Phil Race  wrote:

> I don't think that necessary for this case.

But it is possible and will not freeze this change in stone forever.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2896035156

From honkar at openjdk.org  Tue May 20 23:55:53 2025
From: honkar at openjdk.org (Harshitha Onkar)
Date: Tue, 20 May 2025 23:55:53 GMT
Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to
 wrong place [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 19 May 2025 23:06:39 GMT, Alexander Zvegintsev  wrote:

>> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available.
>> It is a JCK conformance failure. 
>> 
>> ---
>> 
>> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol.
>> 
>> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html):
>> 
>> 1.
>> 
>> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc.
>> 
>> However, our robot implementation is mostly uses XTEST, but there is an exception:
>> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server.
>> 
>> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events,
>> on mouse press we call XTestFakeButtonEvent and it is handled by libei,
>> so the click happens where is the actual mouse cursor is in the system. That is why the test fails.
>> 
>> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case.
>> 
>> It would be a simple solution, but
>> 
>> 
>> 2.
>> 
>> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity.
>> 
>> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case.
>> 
>> ---
>> 
>> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html).
>> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots.
>> Most of the code can be reused, and it has everything we need.
>> 
>> 
>> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead.
>> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default.
>> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142)
>> * Since w...
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   call OpenPipeWireRemote even for remote desktop session calls

Tested on Ubuntu 24.04 (Gnome 46) and Ubuntu 25.04 (Gnome 48) (x11 & wayland sessions). Did not notice any regressions with the fix.

@azvegint  I have couple of inline questions.

src/java.desktop/unix/classes/sun/awt/screencast/XdgDesktopPortal.java line 65:

> 63:         }
> 64: 
> 65:         String m = System.getProperty("awt.robot.screenshotMethod", defaultMethod);

Do we allow user to change `awt.robot.screenshotMethod` to dbusScreencast/dbusRemoteDesktop on x11 sessions and to `x11` on wayland session?

Although all 3 methods work on both x11 & wayland sessions in Ubuntu.

-------------

Marked as reviewed by honkar (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25265#pullrequestreview-2855817880
PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2099030982

From honkar at openjdk.org  Tue May 20 23:55:54 2025
From: honkar at openjdk.org (Harshitha Onkar)
Date: Tue, 20 May 2025 23:55:54 GMT
Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to
 wrong place [v2]
In-Reply-To: 
References: 
 
 
 
 
 
Message-ID: <0pLA7FZoYexqFKgWVXx666ZQ7tiQJMRajg5RxLweZOE=.cebd8a94-53b2-41a3-858d-fea292718083@github.com>

On Tue, 20 May 2025 10:33:21 GMT, Alexander Zvegintsev  wrote:

>>> I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage.
>> 
>> Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)?
>
>> > I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage.
>> 
>> Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)?
> 
> Sure, [updated](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements#AutomatedclientGUItestingsystemsetuprequirements-Wayland).

@azvegint
Generic question: While reading about libei, came across [Oeffis](https://libinput.pages.freedesktop.org/libei/api/index.html#sec-oeffis)- a wrapper for XDG portal.
Is the reason to connect to Remote Desktop XDG portal directly because of session length and token alive time?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2896082061

From duke at openjdk.org  Wed May 21 00:24:53 2025
From: duke at openjdk.org (Jeremy Wood)
Date: Wed, 21 May 2025 00:24:53 GMT
Subject: RFR: 8356061: [macos]
 com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on
 macosx-aarch64 machine [v3]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Tue, 20 May 2025 20:16:46 GMT, Alexey Ivanov  wrote:

> Is it possible that the button hovered by mouse looks the same way as the default one?

That's the big question this unit test is trying to answer. (So: I'm not sure.)

> Did the original test move the mouse before getting pixel color of a button?

Yes.

image

If that was the problem: all we needed to do is delete this call to `robot.mouseMove`.

(But even so: I think the cursor on Mac is black -- so why would we detect a gray 0x373737 ?)

It may also be worth pointing out: this test has never failed. It was added as an extra precaution, but not because it demonstrated a fix for anything. I would not miss it if we delete it; I don't think it deserves the time spent discussing/refactoring it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2896118497

From serb at openjdk.org  Wed May 21 01:49:55 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 01:49:55 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 20 May 2025 07:53:30 GMT, Abhishek Kumar  wrote:

>> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails.
>> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test.
>> 
>> Verified the updated test in CI on macOS 14.7 machine and there is no failure.
>
> Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
> 
>  - File merge
>  - Review comment fix, latch and other changes
>  - Test Stabilization

Did you have a chance to reproduce this bug and see how it works?
When I run it on my laptop I can see the mouse moving out and in of the list and clicking inside of it, but for some reason the events are not sent.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25299#issuecomment-2896232431

From serb at openjdk.org  Wed May 21 02:33:52 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 02:33:52 GMT
Subject: RFR: 8356594: JSplitPane loses divider location when reopened via
 JOptionPane.createDialog() [v2]
In-Reply-To: 
References: 
 
Message-ID: <8ZpGicPyjB6ryJPd7uMP_25MeO3q7C34t_T-QPV5Q0E=.3d1b27d4-1a2d-4df6-b492-b2d68f5420d3@github.com>

On Tue, 20 May 2025 04:34:36 GMT, Prasanta Sadhukhan  wrote:

>> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. 
>> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user.
>> Fixed by setting the divider location before rendering the left and right components..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Click position fixed..L&F iteration

> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user.

It seems a bit inconsistent: on one hand the bug description says that the initial value is used and the value set by the user is ignored but on the other hand, the fix just resets the same value to itself. Could you clarify how this change addresses the issue:
`+ this.setDividerLocation(this.getDividerLocation());`

I have found that for some reason an incorrect value is being set from `BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer`. Could it be that this class incorrectly initializes the dividerLocation to the initial value instead of using the one set by the user?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2896302804

From mvs at openjdk.org  Wed May 21 03:00:15 2025
From: mvs at openjdk.org (Manukumar V S)
Date: Wed, 21 May 2025 03:00:15 GMT
Subject: RFR: 8357305: Compilation failure in
 javax/swing/JMenuItem/bug6197830.java [v4]
In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com>
References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com>
Message-ID: 

> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java.
> 
> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame().

Manukumar V S has updated the pull request incrementally with one additional commit since the last revision:

  Review comments fixed : Formatting changes,cosmetic changes,PassFailJFrame changes, etc

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25319/files
  - new: https://git.openjdk.org/jdk/pull/25319/files/098ea0de..22b05bbd

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=02-03

  Stats: 27 lines in 2 files changed: 6 ins; 6 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/25319.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319

PR: https://git.openjdk.org/jdk/pull/25319

From serb at openjdk.org  Wed May 21 03:04:36 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 03:04:36 GMT
Subject: RFR: 8357287: Unify usage of ICC profile "header size" constants in
 CMM-related code
Message-ID: 

Small unification of "header size" constants, as of now the CMM code uses:
1. sun.java2d.cmm.ProfileDataVerifier.HEADER_SIZE introduced in JDK-8013430
2. java.awt.color.ICC_Profile.HEADER_SIZE introduced in [JDK-8347377](https://bugs.openjdk.org/browse/JDK-8347377)
3. Hardcoded literal 128

-------------

Commit messages:
 - 8357287: Unify usage of ICC profile "header size" constants in CMM-related code

Changes: https://git.openjdk.org/jdk/pull/25313/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25313&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357287
  Stats: 10 lines in 2 files changed: 2 ins; 2 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/25313.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25313/head:pull/25313

PR: https://git.openjdk.org/jdk/pull/25313

From psadhukhan at openjdk.org  Wed May 21 03:22:22 2025
From: psadhukhan at openjdk.org (Prasanta Sadhukhan)
Date: Wed, 21 May 2025 03:22:22 GMT
Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is
 overflow
Message-ID: 

Graphics copyArea overflow check bails out of copying pixels if there is overflow.
The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels"

which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds
but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. 
So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored.

-------------

Commit messages:
 - 8357299: Graphics copyArea doesn't copy any pixels when there is overflow

Changes: https://git.openjdk.org/jdk/pull/25340/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25340&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357299
  Stats: 74 lines in 2 files changed: 62 ins; 5 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/25340.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25340/head:pull/25340

PR: https://git.openjdk.org/jdk/pull/25340

From psadhukhan at openjdk.org  Wed May 21 03:54:51 2025
From: psadhukhan at openjdk.org (Prasanta Sadhukhan)
Date: Wed, 21 May 2025 03:54:51 GMT
Subject: RFR: 8356594: JSplitPane loses divider location when reopened via
 JOptionPane.createDialog() [v2]
In-Reply-To: <8ZpGicPyjB6ryJPd7uMP_25MeO3q7C34t_T-QPV5Q0E=.3d1b27d4-1a2d-4df6-b492-b2d68f5420d3@github.com>
References: 
 
 <8ZpGicPyjB6ryJPd7uMP_25MeO3q7C34t_T-QPV5Q0E=.3d1b27d4-1a2d-4df6-b492-b2d68f5420d3@github.com>
Message-ID: 

On Wed, 21 May 2025 02:30:50 GMT, Sergey Bylokhov  wrote:

> > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user.
> 
> It seems a bit inconsistent: on one hand the bug description says that the initial value is used and the value set by the user is ignored but on the other hand, the fix just resets the same value to itself. Could you clarify how this change addresses the issue: `+ this.setDividerLocation(this.getDividerLocation());`
> 
> I have found that for some reason an incorrect value is being set from `BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer`. Could it be that this class incorrectly initializes the dividerLocation to the initial value instead of using the one set by the user?

Since it is regression of 4265389: JSplitPane does not support ComponentOrientation where setComponentOrientation method is added, it made sense to me to set the divider location in that method explicitly as it was working before that fix..
If `BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer` had a problem it would have affected before the fix also as that method was not changed in 4265389 fix..

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2896478225

From abhiscxk at openjdk.org  Wed May 21 04:36:38 2025
From: abhiscxk at openjdk.org (Abhishek Kumar)
Date: Wed, 21 May 2025 04:36:38 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v4]
In-Reply-To: 
References: 
Message-ID: 

> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails.
> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test.
> 
> Verified the updated test in CI on macOS 14.7 machine and there is no failure.

Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:

  Review comment fix

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25299/files
  - new: https://git.openjdk.org/jdk/pull/25299/files/eaac4364..4275fd95

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=02-03

  Stats: 10 lines in 1 file changed: 1 ins; 3 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/25299.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25299/head:pull/25299

PR: https://git.openjdk.org/jdk/pull/25299

From abhiscxk at openjdk.org  Wed May 21 04:36:42 2025
From: abhiscxk at openjdk.org (Abhishek Kumar)
Date: Wed, 21 May 2025 04:36:42 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3]
In-Reply-To: <0UXVLm0ygz9yjB3TznU-sRYTvk4wIjzDZxwOSnL2YwM=.17c929b3-5d96-44a3-9ca5-06f012bc0cdc@github.com>
References: 
 
 <0UXVLm0ygz9yjB3TznU-sRYTvk4wIjzDZxwOSnL2YwM=.17c929b3-5d96-44a3-9ca5-06f012bc0cdc@github.com>
Message-ID: 

On Tue, 20 May 2025 19:40:04 GMT, Alexey Ivanov  wrote:

>> Abhishek Kumar has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
>> 
>>  - File merge
>>  - Review comment fix, latch and other changes
>>  - Test Stabilization
>
> test/jdk/java/awt/List/ListEnterExitTest.java line 40:
> 
>> 38: 
>> 39: import java.awt.event.InputEvent;
>> 40: import java.awt.event.MouseAdapter;
> 
> `InputEvent` isn't used in the class.

Updated.

> test/jdk/java/awt/List/ListEnterExitTest.java line 97:
> 
>> 95: 
>> 96:             if (!mouseEnterLatch.await(LATCH_TIMEOUT, TimeUnit.SECONDS)) {
>> 97:                 System.out.println("mouseEnterLatch count is : " + mouseEnterLatch.getCount());
> 
> This print is redundant: if `mouseEnterLatch` isn't released yet, its count is 1 ? it can't have any other value. At the same, the count could change right after the timeout occurred which would lead to a very confusing output.
> 
> Thus, I recommend removing printing the count of a latch.

Updated.

> test/jdk/java/awt/List/ListEnterExitTest.java line 114:
> 
>> 112:     }
>> 113: 
>> 114:     static class MouseEnterExitListener extends MouseAdapter {
> 
> Suggestion:
> 
>     private class MouseEnterExitListener extends MouseAdapter {
> 
> Removing `static` allows removing `static` modifier from the latches.
> 
> In fact, the `MouseEnterExitListener` class can be eliminated altogether? Yet the code could be clearer this way.

I thought of removing the class but then found it ok to have.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282323
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282467
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2099282739

From abhiscxk at openjdk.org  Wed May 21 04:39:01 2025
From: abhiscxk at openjdk.org (Abhishek Kumar)
Date: Wed, 21 May 2025 04:39:01 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Wed, 21 May 2025 01:45:46 GMT, Sergey Bylokhov  wrote:

> Did you have a chance to reproduce this bug and see how it works? When I run it on my laptop I can see the mouse moving out and in of the list and clicking inside of it, but for some reason the events are not sent.

I couldn't reproduce it on my system (macOS 15.4.1).
@jayathirthrao was able to reproduce it on macOS14.6 (probably) and the behaviour was same i.e. mouse is moving in and out and clicking inside but **mouse exit event is not triggered**.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25299#issuecomment-2896538631

From serb at openjdk.org  Wed May 21 04:41:55 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 04:41:55 GMT
Subject: RFR: 8356594: JSplitPane loses divider location when reopened via
 JOptionPane.createDialog() [v2]
In-Reply-To: 
References: 
 
 <8ZpGicPyjB6ryJPd7uMP_25MeO3q7C34t_T-QPV5Q0E=.3d1b27d4-1a2d-4df6-b492-b2d68f5420d3@github.com>
 
Message-ID: <9bBMGDdEf5NfTc_zAZbCPoaKpFlbZZh1bQcGP8sQkOg=.99975d0e-d7b2-4ff6-a201-c1c97fdfe30a@github.com>

On Wed, 21 May 2025 03:51:53 GMT, Prasanta Sadhukhan  wrote:

>Since it is regression of 4265389: JSplitPane does not support ComponentOrientation where setComponentOrientation method is added, it made sense to me to set the divider location in that method before rendering the left and right components explicitly as it was working before that fix.

But it sets the same value that is already applied to the split pane:
>this.setDividerLocation(this.getDividerLocation());

It seems this call is required to refresh the UI of the component, which ends up with an incorrect divider location for some reason. But it is unclear whether this is actually caused by the setComponentOrientation method, since the component orientations are not changed in the test.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2896544587

From jdv at openjdk.org  Wed May 21 06:17:27 2025
From: jdv at openjdk.org (Jayathirth D V)
Date: Wed, 21 May 2025 06:17:27 GMT
Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after
 display sleep
Message-ID: 

In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink.

So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue).

I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green.

While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same.

-------------

Commit messages:
 - 8312198: [macos] metal pipeline - window rendering stops after display sleep

Changes: https://git.openjdk.org/jdk/pull/25342/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25342&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8312198
  Stats: 22 lines in 2 files changed: 19 ins; 0 del; 3 mod
  Patch: https://git.openjdk.org/jdk/pull/25342.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25342/head:pull/25342

PR: https://git.openjdk.org/jdk/pull/25342

From psadhukhan at openjdk.org  Wed May 21 06:38:52 2025
From: psadhukhan at openjdk.org (Prasanta Sadhukhan)
Date: Wed, 21 May 2025 06:38:52 GMT
Subject: RFR: 8356594: JSplitPane loses divider location when reopened via
 JOptionPane.createDialog() [v2]
In-Reply-To: <9bBMGDdEf5NfTc_zAZbCPoaKpFlbZZh1bQcGP8sQkOg=.99975d0e-d7b2-4ff6-a201-c1c97fdfe30a@github.com>
References: 
 
 <8ZpGicPyjB6ryJPd7uMP_25MeO3q7C34t_T-QPV5Q0E=.3d1b27d4-1a2d-4df6-b492-b2d68f5420d3@github.com>
 
 <9bBMGDdEf5NfTc_zAZbCPoaKpFlbZZh1bQcGP8sQkOg=.99975d0e-d7b2-4ff6-a201-c1c97fdfe30a@github.com>
Message-ID: 

On Wed, 21 May 2025 04:39:33 GMT, Sergey Bylokhov  wrote:

> > Since it is regression of 4265389: JSplitPane does not support ComponentOrientation where setComponentOrientation method is added, it made sense to me to set the divider location in that method before rendering the left and right components explicitly as it was working before that fix.
> 
> But it sets the same value that is already applied to the split pane:
> 
> > this.setDividerLocation(this.getDividerLocation());
> 
> It seems this call is required to refresh the UI of the component, which ends up with an incorrect divider location for some reason. But it is unclear whether this is actually caused by the setComponentOrientation method, since the component orientations are not changed in the test.

componentOrientation is set in `BasicOptionPaneUI.installComponent` when it calls `applyComponentOrientation` test called by JOptionPane constructor in the test...
I presume since this solves the issue (even if it means it refreshes the UI indirectly) and is localised to the method which causes this issue and there is no further issue in CI, it should be good to go..

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2896767507

From tr at openjdk.org  Wed May 21 06:42:53 2025
From: tr at openjdk.org (Tejesh R)
Date: Wed, 21 May 2025 06:42:53 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
Message-ID: 

On Tue, 20 May 2025 18:18:51 GMT, Alexey Ivanov  wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review fix
>
> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 59:
> 
>> 57:                          ComboBox remains in HTML format string, then test PASS.
>> 58:                          If it appears to be in plain text, then test FAILS.
>> 59:                          (Verify for all Look and Feel).
> 
> How do I verify for all Look and Feels?
> 
> The test has to iterate over all L&F, and repeat the same thing for each L&F.
> 
> Ideally, it should be an automated test. However, I'm fine with postponing any efforts to automate the test but I'd like to try to automate it.

`        for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
            System.out.println("Test for LookAndFeel " + laf.getClassName());
            UIManager.setLookAndFeel(laf.getClassName());
            PassFailJFrame.builder()
                    .instructions(INSTRUCTIONS)
                    .columns(45)
                    .testUI(HTMLFileName::initialize)
                    .positionTestUIBottomRowCentered()
                    .build()
                    .awaitAndCheck();
            System.out.println("Test passed for LookAndFeel " + laf.getClassName());
        }`
When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2099478001

From jdv at openjdk.org  Wed May 21 06:55:54 2025
From: jdv at openjdk.org (Jayathirth D V)
Date: Wed, 21 May 2025 06:55:54 GMT
Subject: RFR: 8356061: [macos]
 com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on
 macosx-aarch64 machine [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood  wrote:

>> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR.
>> 
>> I added a little bit of logging that might also help identify what's happening.
>> 
>> Does anyone have any more suggestions?
>
> Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8356061: removing robot
>   
>   This is in response to:
>   https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453

I understand that this is not a regression test. Mouse pointer color can be changed from default color. Just deleting `robot.mouseMove(x, y)` might also resolve the issue seen in our test environment.

But the current refactoring using BufferedImage is better than using Robot and deleting mouseMove() call.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2896806185

From serb at openjdk.org  Wed May 21 07:07:55 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 07:07:55 GMT
Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there
 is overflow
In-Reply-To: 
References: 
Message-ID: <9i8bgPuEvIgu_6bnHdDVaGkRIDzycUd3Dwj4uBw0lyU=.98be11bf-e80c-48b7-9a7b-0704b3de60c1@github.com>

On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan  wrote:

> Graphics copyArea overflow check bails out of copying pixels if there is overflow.
> The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels"
> 
> which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds
> but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. 
> So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored.

src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 77:

> 75:     srcInfo.bounds.x1 = srcx;
> 76:     srcInfo.bounds.y1 = srcy;
> 77:     if (UNSAFE_TO_ADD(srcx, width) ||

isn't the MaskBlit_MaskBlit use the same pattern?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2099524421

From psadhukhan at openjdk.org  Wed May 21 07:25:52 2025
From: psadhukhan at openjdk.org (Prasanta Sadhukhan)
Date: Wed, 21 May 2025 07:25:52 GMT
Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there
 is overflow
In-Reply-To: <9i8bgPuEvIgu_6bnHdDVaGkRIDzycUd3Dwj4uBw0lyU=.98be11bf-e80c-48b7-9a7b-0704b3de60c1@github.com>
References: 
 <9i8bgPuEvIgu_6bnHdDVaGkRIDzycUd3Dwj4uBw0lyU=.98be11bf-e80c-48b7-9a7b-0704b3de60c1@github.com>
Message-ID: 

On Wed, 21 May 2025 07:05:26 GMT, Sergey Bylokhov  wrote:

>> Graphics copyArea overflow check bails out of copying pixels if there is overflow.
>> The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels"
>> 
>> which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds
>> but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. 
>> So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored.
>
> src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 77:
> 
>> 75:     srcInfo.bounds.x1 = srcx;
>> 76:     srcInfo.bounds.y1 = srcy;
>> 77:     if (UNSAFE_TO_ADD(srcx, width) ||
> 
> isn't the MaskBlit_MaskBlit use the same pattern?

But that doesn't cause any issue to the testcase given and existing testcase..Do you have any testcase which doesnt work because of MaskBlit pattern?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2099557371

From serb at openjdk.org  Wed May 21 07:35:01 2025
From: serb at openjdk.org (Sergey Bylokhov)
Date: Wed, 21 May 2025 07:35:01 GMT
Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there
 is overflow
In-Reply-To: 
References: 
 <9i8bgPuEvIgu_6bnHdDVaGkRIDzycUd3Dwj4uBw0lyU=.98be11bf-e80c-48b7-9a7b-0704b3de60c1@github.com>
 
Message-ID: 

On Wed, 21 May 2025 07:23:28 GMT, Prasanta Sadhukhan  wrote:

>> src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 77:
>> 
>>> 75:     srcInfo.bounds.x1 = srcx;
>>> 76:     srcInfo.bounds.y1 = srcy;
>>> 77:     if (UNSAFE_TO_ADD(srcx, width) ||
>> 
>> isn't the MaskBlit_MaskBlit use the same pattern?
>
> But that doesn't cause any issue to the testcase given and existing testcase..Do you have any testcase which doesnt work because of MaskBlit pattern?

I have not tried to create a test for MaskBlit, only for a simple Blit. I will take a look at the possibility of reproducing it.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2099573773

From psadhukhan at openjdk.org  Wed May 21 08:35:58 2025
From: psadhukhan at openjdk.org (Prasanta Sadhukhan)
Date: Wed, 21 May 2025 08:35:58 GMT
Subject: RFR: 8356594: JSplitPane loses divider location when reopened via
 JOptionPane.createDialog() [v2]
In-Reply-To: 
References: 
 
Message-ID: <4E77iDP7SuXUkZWoGilK72r3FJevFbABugEyzd9ZDGU=.6d0e3b19-0c82-43e6-a17c-2fc91137a9eb@github.com>

On Tue, 20 May 2025 04:34:36 GMT, Prasanta Sadhukhan  wrote:

>> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. 
>> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user.
>> Fixed by setting the divider location before rendering the left and right components..
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Click position fixed..L&F iteration

setDividerLocation call is needed as when `BasicSplitPaneUI$BasicHorizontalLayoutManager.layoutContainer` is called to layout, it checks [`doReset ` and `dividerLocationIsSet` ](https://github.com/openjdk/jdk/blob/91194517c75a96fe7bcc2dcf5e9c42af9cf5975a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#L1423-L1437)

Now, when `JSplitPane.setComponentOrientation `calls `setLeftComponent `it sets `doReset `to true (in `BasicSplitPaneUI.addLayoutComponent`) so `resetToPreferredSizes` is called when we open the dialog the 2nd time. so it causes this issue

Now if we call setDividerLocation it will set [dividerLocationIsSet](https://github.com/openjdk/jdk/blob/91194517c75a96fe7bcc2dcf5e9c42af9cf5975a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#L1029) so even if `doReset `is true, it will not call `resetToPreferredSizes` but sets correct [divider location](https://github.com/openjdk/jdk/blob/91194517c75a96fe7bcc2dcf5e9c42af9cf5975a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#L1436)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2897083731

From aturbanov at openjdk.org  Wed May 21 08:43:03 2025
From: aturbanov at openjdk.org (Andrey Turbanov)
Date: Wed, 21 May 2025 08:43:03 GMT
Subject: RFR: 8357224: Avoid redundant WeakHashMap.get in
 Toolkit.removeAWTEventListener
In-Reply-To: 
References: 
Message-ID: 

On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov  wrote:

> Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null`

Thank you for review.
Feel free to create a separate cleanup ticket to clarify code.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24692#issuecomment-2897100252

From aturbanov at openjdk.org  Wed May 21 08:43:03 2025
From: aturbanov at openjdk.org (Andrey Turbanov)
Date: Wed, 21 May 2025 08:43:03 GMT
Subject: Integrated: 8357224: Avoid redundant WeakHashMap.get in
 Toolkit.removeAWTEventListener
In-Reply-To: 
References: 
Message-ID: 

On Wed, 16 Apr 2025 15:07:36 GMT, Andrey Turbanov  wrote:

> Instead of separate `.get`+`.remove` calls we can call `.remove` and then compare result with `null`

This pull request has now been integrated.

Changeset: a0cdf36b
Author:    Andrey Turbanov 
URL:       https://git.openjdk.org/jdk/commit/a0cdf36bdfeca9cd8b669859700d63d5ee627458
Stats:     3 lines in 1 file changed: 0 ins; 1 del; 2 mod

8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener

Reviewed-by: liach, aivanov, serb

-------------

PR: https://git.openjdk.org/jdk/pull/24692

From azvegint at openjdk.org  Wed May 21 08:55:52 2025
From: azvegint at openjdk.org (Alexander Zvegintsev)
Date: Wed, 21 May 2025 08:55:52 GMT
Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to
 wrong place [v2]
In-Reply-To: 
References: 
 
 
 
 
 
Message-ID: 

On Tue, 20 May 2025 10:33:21 GMT, Alexander Zvegintsev  wrote:

>>> I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage.
>> 
>> Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)?
>
>> > I'm not sure if it's really needed, since many tests already depend on the `java.awt.Robot` itself, CI has a one-time manual task to set up all the required permissions for the `java.awt.Robot`, so automated tests provide sufficient coverage.
>> 
>> Can this be documented in [GUI testing](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements)?
> 
> Sure, [updated](https://wiki.openjdk.org/display/ClientLibs/Automated+client+GUI+testing+system+set+up+requirements#AutomatedclientGUItestingsystemsetuprequirements-Wayland).

> @azvegint Generic question: While reading about libei, came across [Oeffis](https://libinput.pages.freedesktop.org/libei/api/index.html#sec-oeffis)- a wrapper for XDG portal. Is the reason to connect to Remote Desktop XDG portal directly because of session length and token alive time?

It is one of the points, the [current implementation](https://gitlab.freedesktop.org/libinput/libei/-/blob/main/src/liboeffis.c?ref_type=heads#L570) doesn't use `persist_mode` and `restore_token`. 

We are also using a single Remote Desktop session to also work with Screencast(the `SelectSources` call) to also get screenshots. However the oeffis dbus API wrapper doesn't allow that. 

In addition to adding the oeffis dependency to the JDK, we will also need to add  a [libei](https://libinput.pages.freedesktop.org/libei/api/group__libei-sender.html)  to make it work. We may want to add libei support at some point, but not now.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25265#issuecomment-2897146020

From duke at openjdk.org  Wed May 21 10:13:00 2025
From: duke at openjdk.org (duke)
Date: Wed, 21 May 2025 10:13:00 GMT
Subject: RFR: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x
In-Reply-To: 
References: 
Message-ID: <5PU95Jawqz8NGYz2NPZkvTrQjHVzu8nCiJAdhbwKiGk=.95ae4db0-c920-4ca8-ade6-f91ae49068ec@github.com>

On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky  wrote:

> This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`)
> 
> Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened.
> 
> I was not able to get response from original author for this issue, so I am creating PR myself.
> 
> **Testing:**
> I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. 
> 
> Without fix:
> 
>    TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>>> jtreg:test/jdk:jdk_awt                             2171  1063   415     6   687 <<
> 
> 
> With fix
> 
>    TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>>> jtreg:test/jdk:jdk_awt                             2171  1162   316     6   687 <<
> 
> 
> Many tests are no longer crashing the VM:
> 
> -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java                                                      Failed. Unexpected exit from test [exit code: 134]
> +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java                                                      Passed. Execution successful
> 
> There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix)
> 
> I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.)

@zzambers 
Your change (at version 21cf68276ed60c6b7c2a4f50ac448299db54d283) is now ready to be sponsored by a Committer.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/24197#issuecomment-2897393789

From ngubarkov at openjdk.org  Wed May 21 11:16:46 2025
From: ngubarkov at openjdk.org (Nikita Gubarkov)
Date: Wed, 21 May 2025 11:16:46 GMT
Subject: RFR: 8355904: Use variadic macros for J2dTrace [v3]
In-Reply-To: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
Message-ID: 

> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead.
> 
> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style.

Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision:

  Apply suggestions from code review
  
  Co-authored-by: Alexey Ivanov 

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24949/files
  - new: https://git.openjdk.org/jdk/pull/24949/files/867aee60..ad71f014

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=01-02

  Stats: 19 lines in 9 files changed: 2 ins; 0 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/24949.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24949/head:pull/24949

PR: https://git.openjdk.org/jdk/pull/24949

From aivanov at openjdk.org  Wed May 21 11:31:05 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 11:31:05 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: 
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
 
Message-ID: 

On Wed, 21 May 2025 06:39:47 GMT, Tejesh R  wrote:

> When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?

Indeed, `PassFailJFrame` doesn't support repeating tests. It never was a scenario that we thought of. There are lots of static fields, including the latch that's used to wait for the test result. The instruction frame and list of windows are also static fields.

Supporting repeating tests such as in this scenario would require a substantial redesign of the internal structures? Everything should be an instance field instead, that instance could be stored in a static variable to support all the static methods provided. Redesigning the `PassFailJFrame` framework this way would take significant amount of time.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100038079

From aivanov at openjdk.org  Wed May 21 11:49:55 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 11:49:55 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: 
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
 
 
Message-ID: <8std4x81X6gh2QeRqA41O0ww5Q1X6RC-IS8lyWxNm8g=.42c576aa-b904-430e-87a9-a2351e8b3e60@github.com>

On Wed, 21 May 2025 11:27:57 GMT, Alexey Ivanov  wrote:

> > When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?
> 
> Indeed, `PassFailJFrame` doesn't support repeating tests. It never was a scenario that we thought of. There are lots of static fields, including the latch that's used to wait for the test result. The instruction frame and list of windows are also static fields.
> 
> Supporting repeating tests such as in this scenario would require a substantial redesign of the internal structures? Everything should be an instance field instead, that instance could be stored in a static variable to support all the static methods provided. Redesigning the `PassFailJFrame` framework this way would take significant amount of time.

I submitted the following enhancements:

* [JDK-8357455](https://bugs.openjdk.org/browse/JDK-8357455): Support running multiple PassFailJFrame test cases in one process;
* [JDK-8357456](https://bugs.openjdk.org/browse/JDK-8357456): Ensure JFileChooser doesn't render file names as HTML in all L&Fs support.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100074287

From aivanov at openjdk.org  Wed May 21 12:03:56 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:03:56 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: <8std4x81X6gh2QeRqA41O0ww5Q1X6RC-IS8lyWxNm8g=.42c576aa-b904-430e-87a9-a2351e8b3e60@github.com>
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
 
 
 <8std4x81X6gh2QeRqA41O0ww5Q1X6RC-IS8lyWxNm8g=.42c576aa-b904-430e-87a9-a2351e8b3e60@github.com>
Message-ID: 

On Wed, 21 May 2025 11:46:50 GMT, Alexey Ivanov  wrote:

>>> When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?
>> 
>> Indeed, `PassFailJFrame` doesn't support repeating tests. It never was a scenario that we thought of. There are lots of static fields, including the latch that's used to wait for the test result. The instruction frame and list of windows are also static fields.
>> 
>> Supporting repeating tests such as in this scenario would require a substantial redesign of the internal structures? Everything should be an instance field instead, that instance could be stored in a static variable to support all the static methods provided. Redesigning the `PassFailJFrame` framework this way would take significant amount of time.
>
>> > When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?
>> 
>> Indeed, `PassFailJFrame` doesn't support repeating tests. It never was a scenario that we thought of. There are lots of static fields, including the latch that's used to wait for the test result. The instruction frame and list of windows are also static fields.
>> 
>> Supporting repeating tests such as in this scenario would require a substantial redesign of the internal structures? Everything should be an instance field instead, that instance could be stored in a static variable to support all the static methods provided. Redesigning the `PassFailJFrame` framework this way would take significant amount of time.
> 
> I submitted the following enhancements:
> 
> * [JDK-8357455](https://bugs.openjdk.org/browse/JDK-8357455): Support running multiple PassFailJFrame test cases in one process;
> * [JDK-8357456](https://bugs.openjdk.org/browse/JDK-8357456): Ensure JFileChooser doesn't render file names as HTML in all L&Fs support.

As a workaround, I suggest testing Metal, the default L&F, and the system L&F on the platforms.

This can be achieved by having two sets of jtreg test tags:


/*
 * @test id=metal
 * @bug 8139228
 * @summary JFileChooser should not render Directory names in HTML format
 * @library /java/awt/regtesthelpers
 * @build PassFailJFrame
 * @run main/manual HTMLFileName metal
 */

/*
 * @test id=system
 * @bug 8139228
 * @summary JFileChooser should not render Directory names in HTML format
 * @library /java/awt/regtesthelpers
 * @build PassFailJFrame
 * @run main/manual HTMLFileName system
 */


Then add the following to your `main` method:


    public static void main(String[] args) throws Exception {
        if (args.length < 1) {
            throw new IllegalArgumentException("Look-and-Feel keyword is required");
        }

        final String lafClassName;
        switch (args[0]) {
            case "metal" -> lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
            case "system" -> lafClassName = UIManager.getSystemLookAndFeelClassName();
            default -> throw new IllegalArgumentException("Unsupported Look-and-Feel keyword: " + args[0]);
        }

        SwingUtilities.invokeAndWait(() -> {
            try {
                UIManager.setLookAndFeel(lafClassName);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });

        PassFailJFrame.builder()
                // other configuration
                .awaitAndCheck();


I tested it, and it works perfectly on Windows.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100110185

From ngubarkov at openjdk.org  Wed May 21 12:06:42 2025
From: ngubarkov at openjdk.org (Nikita Gubarkov)
Date: Wed, 21 May 2025 12:06:42 GMT
Subject: RFR: 8355904: Use variadic macros for J2dTrace [v4]
In-Reply-To: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
Message-ID: <8P-UBCr62SByYXXXOZon1xrUILk7D5SQIE7JLDu4Gqc=.4249bf75-3942-4ba2-8488-38c7e8f9131d@github.com>

> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead.
> 
> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style.

Nikita Gubarkov has updated the pull request incrementally with two additional commits since the last revision:

 - fixup! 8355904: Use variadic macros for J2dTrace
 - fixup! 8355904: Use variadic macros for J2dTrace

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24949/files
  - new: https://git.openjdk.org/jdk/pull/24949/files/ad71f014..df5781f7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=02-03

  Stats: 670 lines in 64 files changed: 63 ins; 4 del; 603 mod
  Patch: https://git.openjdk.org/jdk/pull/24949.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24949/head:pull/24949

PR: https://git.openjdk.org/jdk/pull/24949

From aivanov at openjdk.org  Wed May 21 12:08:59 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:08:59 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 19 May 2025 13:52:16 GMT, Tejesh R  wrote:

>> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified.
>> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name.
>
> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review fix

test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 43:

> 41: 
> 42:     public static void main(String[] args) throws Exception {
> 43:         String INSTRUCTIONS = """

Please make `INSTRUCTIONS` a `private static final` field at the top of the class. This is the most common way in tests, and it'll make the `main` method cleaner especially after adding additional logic for switching Look-and-Feels as I [suggested in a discussion thread](https://github.com/openjdk/jdk/pull/24439#discussion_r2100110185).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100116456

From aivanov at openjdk.org  Wed May 21 12:09:02 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:09:02 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
Message-ID: 

On Tue, 20 May 2025 18:48:56 GMT, Alexey Ivanov  wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review fix
>
> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 51:
> 
>> 49:                          ComboBox remains in plain text, then test PASS.
>> 50:                          If it appears to be in HTML format with Pink color,
>> 51:                          then test FAILS.
> 
> Suggestion:
> 
>                          ComboBox remains in plain text, then test passes.
>                          If it appears to be in HTML format with Pink color,
>                          then test fails.
> 
> You could be more specific: _?click **Fail**?_ if a condition isn't met. (Otherwise, continue with the test.) End the instructions with _?click **Pass**?_.
> 
> Anyway, the instructions are pretty clear as they are, so real change is required.

You may want to switch to HTML-formatted instructions to alleviate differences in the default fonts in different L&Fs.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100119989

From aivanov at openjdk.org  Wed May 21 12:13:55 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:13:55 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Wed, 21 May 2025 04:36:38 GMT, Abhishek Kumar  wrote:

>> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails.
>> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test.
>> 
>> Verified the updated test in CI on macOS 14.7 machine and there is no failure.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comment fix

Looks good to me except for a few nits.

test/jdk/java/awt/List/ListEnterExitTest.java line 49:

> 47:     Frame frame;
> 48:     volatile Point p;
> 49:     private static final int X_OFFSET = 30;

Suggestion:

    volatile Point p;

    private static final int X_OFFSET = 30;

I'd add a blank line between these two blocks.

test/jdk/java/awt/List/ListEnterExitTest.java line 113:

> 111: 
> 112:     private class MouseEnterExitListener extends MouseAdapter {
> 113:         public void mouseEntered(MouseEvent e) {

Suggestion:

    private class MouseEnterExitListener extends MouseAdapter {
        @Override
        public void mouseEntered(MouseEvent e) {

test/jdk/java/awt/List/ListEnterExitTest.java line 118:

> 116:         }
> 117: 
> 118:         public void mouseExited(MouseEvent e) {

Suggestion:

        @Override
        public void mouseExited(MouseEvent e) {

-------------

Marked as reviewed by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2857464612
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2100129084
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2100125431
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2100127395

From abhiscxk at openjdk.org  Wed May 21 12:21:32 2025
From: abhiscxk at openjdk.org (Abhishek Kumar)
Date: Wed, 21 May 2025 12:21:32 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v5]
In-Reply-To: 
References: 
Message-ID: 

> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails.
> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test.
> 
> Verified the updated test in CI on macOS 14.7 machine and there is no failure.

Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:

  minor fix

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/25299/files
  - new: https://git.openjdk.org/jdk/pull/25299/files/4275fd95..2ea05dfe

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25299&range=03-04

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

PR: https://git.openjdk.org/jdk/pull/25299

From aivanov at openjdk.org  Wed May 21 12:21:32 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:21:32 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3]
In-Reply-To: 
References: 
 
 
 
Message-ID: 

On Wed, 21 May 2025 04:36:11 GMT, Abhishek Kumar  wrote:

> > Did you have a chance to reproduce this bug and see how it works? When I run it on my laptop I can see the mouse moving out and in of the list and clicking inside of it, but for some reason the events are not sent.
> 
> I couldn't reproduce it on my system (macOS 15.4.1). @jayathirthrao was able to reproduce it on macOS 14.7.5 and the behaviour was same i.e. mouse is moving in and out and clicking inside but **mouse exit event is not triggered**.

I wonder if this system reproduces other bugs where expected events aren't received? such as `java/awt/event/KeyEvent/FunctionKeyTest.java` ([JDK-8343104](https://bugs.openjdk.org/browse/JDK-8343104)) and `java/awt/List/ItemEventTest/ItemEventTest.java` ([JDK-8204221](https://bugs.openjdk.org/browse/JDK-8204221)).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25299#issuecomment-2897737976

From abhiscxk at openjdk.org  Wed May 21 12:21:32 2025
From: abhiscxk at openjdk.org (Abhishek Kumar)
Date: Wed, 21 May 2025 12:21:32 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v4]
In-Reply-To: 
References: 
 
 
Message-ID: <6q4HsgHsPntpKgYoaqBo3syw--wrsBGaLpgbY_lvgTw=.ede6cd2e-8e68-45be-8fde-ce46bfba9724@github.com>

On Wed, 21 May 2025 12:09:30 GMT, Alexey Ivanov  wrote:

>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comment fix
>
> test/jdk/java/awt/List/ListEnterExitTest.java line 113:
> 
>> 111: 
>> 112:     private class MouseEnterExitListener extends MouseAdapter {
>> 113:         public void mouseEntered(MouseEvent e) {
> 
> Suggestion:
> 
>     private class MouseEnterExitListener extends MouseAdapter {
>         @Override
>         public void mouseEntered(MouseEvent e) {

Updated

> test/jdk/java/awt/List/ListEnterExitTest.java line 118:
> 
>> 116:         }
>> 117: 
>> 118:         public void mouseExited(MouseEvent e) {
> 
> Suggestion:
> 
>         @Override
>         public void mouseExited(MouseEvent e) {

Updated

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2100143184
PR Review Comment: https://git.openjdk.org/jdk/pull/25299#discussion_r2100143048

From aivanov at openjdk.org  Wed May 21 12:26:51 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:26:51 GMT
Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Wed, 21 May 2025 12:21:32 GMT, Abhishek Kumar  wrote:

>> Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails.
>> Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test.
>> 
>> Verified the updated test in CI on macOS 14.7 machine and there is no failure.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   minor fix

Marked as reviewed by aivanov (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/25299#pullrequestreview-2857509857

From ngubarkov at openjdk.org  Wed May 21 12:33:40 2025
From: ngubarkov at openjdk.org (Nikita Gubarkov)
Date: Wed, 21 May 2025 12:33:40 GMT
Subject: RFR: 8355904: Use variadic macros for J2dTrace [v5]
In-Reply-To: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com>
Message-ID: 

> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead.
> 
> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style.

Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision:

  fixup! 8355904: Use variadic macros for J2dTrace

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24949/files
  - new: https://git.openjdk.org/jdk/pull/24949/files/df5781f7..98ec5087

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=03-04

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/24949.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24949/head:pull/24949

PR: https://git.openjdk.org/jdk/pull/24949

From aivanov at openjdk.org  Wed May 21 12:41:57 2025
From: aivanov at openjdk.org (Alexey Ivanov)
Date: Wed, 21 May 2025 12:41:57 GMT
Subject: RFR: 8356061: [macos]
 com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on
 macosx-aarch64 machine [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood  wrote:

>> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR.
>> 
>> I added a little bit of logging that might also help identify what's happening.
>> 
>> Does anyone have any more suggestions?
>
> Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8356061: removing robot
>   
>   This is in response to:
>   https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453

> > Is it possible that the button hovered by mouse looks the same way as the default one?
> 
> That's the big question this unit test is trying to answer. (So: I'm not sure.)
> 
> > Did the original test move the mouse before getting pixel color of a button?
> 
> Yes.
>
> If that was the problem: all we needed to do is delete this call to `robot.mouseMove`.

So, the mouse cursor hovered over the button? which could essentially make a non-default button look the same way as the default button? because it's hovered.

I don't have a Mac to test it right away, but on Windows the default button has a brighter border and a slightly bluish background; hovering over any button gives it the same border and a blue background.

> (But even so: I think the cursor on Mac is black -- so why would we detect a gray 0x373737 ?)

The cursor isn't always captured?

---

> > It may also be worth pointing out: this test has never failed. It was added as an extra precaution, but not because it demonstrated a fix for anything. I would not miss it if we delete it; I don't think it deserves the time spent discussing/refactoring it.
>
> Just deleting robot.mouseMove(x, y) might also resolve the issue seen in our test environment.

Yeah, likely removing `mouseMove` would resolve the failure.

> But the current refactoring using BufferedImage is better than using Robot and deleting mouseMove() call.

It's always better, in my opinion? I just wonder whether this test has any value. But I haven't looked thoroughly enough into either of the fixes.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2897823434

From mvs at openjdk.org  Wed May 21 13:20:28 2025
From: mvs at openjdk.org (Manukumar V S)
Date: Wed, 21 May 2025 13:20:28 GMT
Subject: RFR: 8341370: Test
 java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails
 intermittently on macOS-aarch64
Message-ID: 

ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64
Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied.

Fix:
The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test.
Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds).

Testing:
After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate .

-------------

Commit messages:
 - 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64

Changes: https://git.openjdk.org/jdk/pull/25354/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25354&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341370
  Stats: 14 lines in 2 files changed: 3 ins; 5 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/25354.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25354/head:pull/25354

PR: https://git.openjdk.org/jdk/pull/25354

From prr at openjdk.org  Wed May 21 15:30:52 2025
From: prr at openjdk.org (Phil Race)
Date: Wed, 21 May 2025 15:30:52 GMT
Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to
 wrong place [v3]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 19 May 2025 23:06:39 GMT, Alexander Zvegintsev  wrote:

>> The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available.
>> It is a JCK conformance failure. 
>> 
>> ---
>> 
>> In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol.
>> 
>> The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html):
>> 
>> 1.
>> 
>> It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc.
>> 
>> However, our robot implementation is mostly uses XTEST, but there is an exception:
>> for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server.
>> 
>> So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events,
>> on mouse press we call XTestFakeButtonEvent and it is handled by libei,
>> so the click happens where is the actual mouse cursor is in the system. That is why the test fails.
>> 
>> To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case.
>> 
>> It would be a simple solution, but
>> 
>> 
>> 2.
>> 
>> This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity.
>> 
>> It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case.
>> 
>> ---
>> 
>> So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html).
>> It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots.
>> Most of the code can be reused, and it has everything we need.
>> 
>> 
>> * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead.
>> * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default.
>> * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142)
>> * Since w...
>
> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   call OpenPipeWireRemote even for remote desktop session calls

Marked as reviewed by prr (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/25265#pullrequestreview-2858213254

From tr at openjdk.org  Wed May 21 16:00:12 2025
From: tr at openjdk.org (Tejesh R)
Date: Wed, 21 May 2025 16:00:12 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v4]
In-Reply-To: 
References: 
Message-ID: 

> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified.
> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name.

Tejesh R has updated the pull request incrementally with one additional commit since the last revision:

  Updated review comments

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/24439/files
  - new: https://git.openjdk.org/jdk/pull/24439/files/d4660c75..4f8c759a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=02-03

  Stats: 72 lines in 1 file changed: 42 ins; 11 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/24439.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24439/head:pull/24439

PR: https://git.openjdk.org/jdk/pull/24439

From tr at openjdk.org  Wed May 21 16:00:13 2025
From: tr at openjdk.org (Tejesh R)
Date: Wed, 21 May 2025 16:00:13 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: 
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
 
Message-ID: 

On Wed, 21 May 2025 12:06:22 GMT, Alexey Ivanov  wrote:

>> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 51:
>> 
>>> 49:                          ComboBox remains in plain text, then test PASS.
>>> 50:                          If it appears to be in HTML format with Pink color,
>>> 51:                          then test FAILS.
>> 
>> Suggestion:
>> 
>>                          ComboBox remains in plain text, then test passes.
>>                          If it appears to be in HTML format with Pink color,
>>                          then test fails.
>> 
>> You could be more specific: _?click **Fail**?_ if a condition isn't met. (Otherwise, continue with the test.) End the instructions with _?click **Pass**?_.
>> 
>> Anyway, the instructions are pretty clear as they are, so real change is required.
>
> You may want to switch to HTML-formatted instructions to alleviate differences in the default fonts in different L&Fs.

Why would we need HTML-formatted instructions btw ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100649064

From tr at openjdk.org  Wed May 21 16:00:14 2025
From: tr at openjdk.org (Tejesh R)
Date: Wed, 21 May 2025 16:00:14 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: 
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
 
 
 <8std4x81X6gh2QeRqA41O0ww5Q1X6RC-IS8lyWxNm8g=.42c576aa-b904-430e-87a9-a2351e8b3e60@github.com>
 
Message-ID: 

On Wed, 21 May 2025 12:00:51 GMT, Alexey Ivanov  wrote:

>>> > When I try to iterate the test for all L&F, the test result of first L&F is explicitly taken for other L&F too. Any idea why ?
>>> 
>>> Indeed, `PassFailJFrame` doesn't support repeating tests. It never was a scenario that we thought of. There are lots of static fields, including the latch that's used to wait for the test result. The instruction frame and list of windows are also static fields.
>>> 
>>> Supporting repeating tests such as in this scenario would require a substantial redesign of the internal structures? Everything should be an instance field instead, that instance could be stored in a static variable to support all the static methods provided. Redesigning the `PassFailJFrame` framework this way would take significant amount of time.
>> 
>> I submitted the following enhancements:
>> 
>> * [JDK-8357455](https://bugs.openjdk.org/browse/JDK-8357455): Support running multiple PassFailJFrame test cases in one process;
>> * [JDK-8357456](https://bugs.openjdk.org/browse/JDK-8357456): Ensure JFileChooser doesn't render file names as HTML in all L&Fs support.
>
> As a workaround, I suggest testing Metal, the default L&F, and the system L&F on the platforms.
> 
> This can be achieved by having two sets of jtreg test tags:
> 
> 
> /*
>  * @test id=metal
>  * @bug 8139228
>  * @summary JFileChooser should not render Directory names in HTML format
>  * @library /java/awt/regtesthelpers
>  * @build PassFailJFrame
>  * @run main/manual HTMLFileName metal
>  */
> 
> /*
>  * @test id=system
>  * @bug 8139228
>  * @summary JFileChooser should not render Directory names in HTML format
>  * @library /java/awt/regtesthelpers
>  * @build PassFailJFrame
>  * @run main/manual HTMLFileName system
>  */
> 
> 
> Then add the following to your `main` method:
> 
> 
>     public static void main(String[] args) throws Exception {
>         if (args.length < 1) {
>             throw new IllegalArgumentException("Look-and-Feel keyword is required");
>         }
> 
>         final String lafClassName;
>         switch (args[0]) {
>             case "metal" -> lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
>             case "system" -> lafClassName = UIManager.getSystemLookAndFeelClassName();
>             default -> throw new IllegalArgumentException("Unsupported Look-and-Feel keyword: " + args[0]);
>         }
> 
>         SwingUtilities.invokeAndWait(() -> {
>             try {
>                 UIManager.setLookAndFeel(lafClassName);
>             } catch (Exception e) {
>                 throw new RuntimeException(e);
>             }
>         });
> 
>         PassFailJFrame.builder()
>                 // other configuration
>                 .awaitAndCheck();
> 
> 
> I tested it, and it works perfectly on Windows.

Yes, its working on windows too. Thank you. I have updated the test.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100646531

From tr at openjdk.org  Wed May 21 16:00:13 2025
From: tr at openjdk.org (Tejesh R)
Date: Wed, 21 May 2025 16:00:13 GMT
Subject: RFR: 8139228: JFileChooser renders file names as HTML document
 [v3]
In-Reply-To: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
References: 
 
 <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com>
Message-ID: 

On Tue, 20 May 2025 18:40:29 GMT, Alexey Ivanov  wrote:

>> Tejesh R has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review fix
>
> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 29:
> 
>> 27: import javax.swing.filechooser.FileSystemView;
>> 28: import java.io.File;
>> 29: import java.util.List;
> 
> Suggestion:
> 
> import java.io.File;
> import java.util.List;
> import javax.swing.Icon;
> import javax.swing.JFileChooser;
> import javax.swing.JFrame;
> import javax.swing.filechooser.FileSystemView;
> 
> We haven't reached an agreement, yet `java.*` packages usually go before `javax.*` packages in the list of imports.

Updated.

> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 43:
> 
>> 41: 
>> 42:     public static void main(String[] args) throws Exception {
>> 43:         String INSTRUCTIONS = """
> 
> Please make `INSTRUCTIONS` a `private static final` field at the top of the class. This is the most common way in tests, and it'll make the `main` method cleaner especially after adding additional logic for switching Look-and-Feels as I [suggested in a discussion thread](https://github.com/openjdk/jdk/pull/24439#discussion_r2100110185).

Updated.

> test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 45:
> 
>> 43:         String INSTRUCTIONS = """
>> 44:                 1. FileChooser shows up a virtual directory and file with name
>> 45:                    "

Testing Name". > > The file name is now `Swing Rocks!` Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 60: > >> 58: If it appears to be in plain text, then test FAILS. >> 59: (Verify for all Look and Feel). >> 60: """; > > Suggestion: > > """; > > Avoid trailing space, it's not needed. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 85: > >> 83: frame.pack(); >> 84: return frame; >> 85: } > > Suggestion: > > private static JFrame createFileChooser(boolean htmlEnabled) { > JFileChooser jfc = new JFileChooser(new VirtualFileSystemView()); > jfc.putClientProperty("html.disable", htmlEnabled); > jfc.setControlButtonsAreShown(false); > > JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); > frame.add(jfc); > frame.pack(); > return frame; > } > > I think this way is cleaner: create the file chooser, configure it?; then create the frame, put the file chooser into the frame. > > `html_enabled` ? `htmlEnabled`, which aligns to the Java style. > > ? I added `jfc.setControlButtonsAreShown(false)` to hide the *Open* and *Cancel* buttons. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 96: > >> 94: public File[] getRoots() { >> 95: return new File[]{ >> 96: new File("/", "

SWING ROCKS!!!111"), > > Suggestion: > > new File("/", "

Swing Rocks!"), > > Use title case? Updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100650539 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100649554 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100653203 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100644786 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100652050 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100646865 From aivanov at openjdk.org Wed May 21 16:18:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:18:53 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v4] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Wed, 21 May 2025 03:00:15 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fixed : Formatting changes,cosmetic changes,PassFailJFrame changes, etc Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JMenuItem/MenuItemTest/bug4729669.java line 34: > 32: > 33: import javax.swing.JFrame; > 34: import java.util.List; Suggestion: import java.util.List; import javax.swing.JFrame; Be consistent at least in a single changeset. Although it wasn't agreed upon, the most common style is `java.*` packages go first followed by `javax.*` packages. test/jdk/javax/swing/JMenuItem/MenuItemTest/bug4729669.java line 60: > 58: JFrame f2 = MenuItemTestHelper.getMenuItemTestFrame(false); > 59: f2.setLocation(500, 300); > 60: return List.of(f1, f2); Suggestion: JFrame f1 = MenuItemTestHelper.getMenuItemTestFrame(true); JFrame f2 = MenuItemTestHelper.getMenuItemTestFrame(false); return List.of(f1, f2); Remove `setLocation`, the `PassFailJFrame` framework fully handles the positioning of the windows. ------------- PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2858062350 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2100519744 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2100515611 From aivanov at openjdk.org Wed May 21 16:18:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:18:56 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> Message-ID: <9v_f6HbDb95d3TAqSNPF_14KDXoxJhmQi_cdlheIsf0=.8e9553e8-3f66-44a4-bbc4-55129b6ee394@github.com> On Tue, 20 May 2025 17:07:59 GMT, Alexey Ivanov wrote: >> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: >> >> Review comments fixed : Rearranged and reused code by creating a new Helper MenuItemTestHelper.java > > test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 53: > >> 51: } catch (Exception e) { >> 52: e.printStackTrace(); >> 53: } > > I wonder if we should actually wrap the exception into `RuntimeException` and let it propagate to fail the test. I think we should; if Look and Feel wasn't set as expected, the test won't test that part of the functionality. I'm for propagating the exception if setting L&F fails. > test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 100: > >> 98: frame.setSize(300, 300); >> 99: frame.setLocation(isLeft ? 0 : 600, frameY); >> 100: frame.setVisible(true); > > `setLocation` shouldn't be need if you use `PassFailJFrame` layouts for positioning. Then `frameY` becomes redundant. > > `setVisible(true)` isn't need either. Drop `setLocation` and `setVisible` as well as `frameY` parameter. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2100508682 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2100510915 From aivanov at openjdk.org Wed May 21 16:31:58 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:31:58 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v3] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 22:09:37 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 I still have some minor nits. src/java.desktop/share/classes/java/awt/BorderLayout.java line 102: > 100: * The code for this program is as follows: > 101: * > 102: *
Suggestion: Drop the horizontal line. It separates the code from the paragraph that introduces it. src/java.desktop/share/classes/java/awt/BorderLayout.java line 115: > 113: * EventQueue.invokeAndWait(() -> { > 114: * Frame frame = new Frame("BorderLayout"); > 115: * frame.setLayout(new BorderLayout()); Suggestion: * public class BorderLayoutExample { * * public static void main(String[] args) throws Exception { * EventQueue.invokeAndWait(() -> { * Frame frame = new Frame("BorderLayout"); * frame.setLayout(new BorderLayout()); I suggest following the standard indentation of 4 spaces to align with the recommended Java code style and dropping the blank line inside the `main` method. Is there any particular reason for using `invokeAndWait` instead of `invokeLater`? Most Java UI tutorials use `invokeLater`. (In the tests, we have to use `invokeAndWait`.) src/java.desktop/share/classes/java/awt/FlowLayout.java line 63: > 61: * Here is the code for this program: > 62: * > 63: *
Suggestion: I suggest dropping the horizontal line from all the sample code. src/java.desktop/share/classes/java/awt/FlowLayout.java line 64: > 62: * > 63: *
> 64: * {@snippet lang='java': Suggestion: * {@snippet lang='java': Not really an issue, however, other instances have just one space. src/java.desktop/share/classes/java/awt/FlowLayout.java line 75: > 73: * > 74: * EventQueue.invokeAndWait(() -> { > 75: * Frame frame = new Frame("FlowLayout"); The same comment: let's follow the standard Java code style and indent blocks by 4 spaces. Here, the `main` method declaration and `EventQueue.invokeAndWait` are indented by 2 spaces, but the body of the lambda expression is indented by 4 spaces. This is inconsistent. src/java.desktop/share/classes/java/awt/GridBagLayout.java line 279: > 277: * Here is the code that implements the example shown above: > 278: * > 279: *
Suggestion: src/java.desktop/share/classes/java/awt/GridBagLayout.java line 287: > 285: * import java.awt.GridBagLayout; > 286: * > 287: * public class GridBagLayoutExample { This sample indents each code block by 4 spaces, which is good. src/java.desktop/share/classes/java/awt/GridLayout.java line 40: > 38: *
> 39: * {@snippet lang='java': > 40: *

Suggestion:

 * {@snippet lang='java':

`
` is inside the sample code.

src/java.desktop/share/classes/java/awt/GridLayout.java line 51:

> 49:  *
> 50:  *     EventQueue.invokeAndWait(() -> {
> 51:  *        Frame frame = new Frame("GridLayout");

Let's indent the code by 4 spaces.

I'm also for removing the blank line that starts the `main` method.

src/java.desktop/share/classes/java/awt/MediaTracker.java line 70:

> 68:  * Here is an example of using {@code MediaTracker}:
> 69:  *
> 70:  * 
Suggestion: src/java.desktop/share/classes/java/awt/MediaTracker.java line 117: > 115: * animator = new Thread(this); > 116: * animator.start(); > 117: * } Suggestion: * } Correct the indentation. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25278#pullrequestreview-2858047334 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100501264 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100498882 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100697034 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100714553 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100701896 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100705020 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100707123 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100683735 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100712282 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100712613 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100718917 From aivanov at openjdk.org Wed May 21 16:31:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:31:59 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v2] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 21:56:28 GMT, Phil Race wrote: >> src/java.desktop/share/classes/java/awt/GridLayout.java line 50: >> >>> 48: * >>> 49: * EventQueue.invokeAndWait(() -> { >>> 50: * Frame frame = new Frame("GridLayout"); >> >> I would like to bring this to the discussion not necessarily suggesting any changes. I noticed that the example uses a "frame", while the description above refers to a "window" it might be worth unification. Also, regarding invokeAndWait: it?s not strictly necessary here since this is AWT but it does not break anything. However, I wonder if it?s worth discussing the use of invokeAndWait vs invokeLater. In tests, we usually prefer invokeAndWait because we need to wait for the action to complete, but in applications invokeLater should work fine. > > A Frame (the java class) creates a window (the desktop concept). I would not want to promote the java type Frame to mean the concept. > Regarding invokeAndWait vs invokeLater, either is fine in this case and main has nothing else to do whilst waiting and is the safest default. > I pondered whether to do either in this simple case, but we do generally these days recommend this pattern even for AWT as Swing classes may be used to implement AWT .. and if I did not I guarantee someone would have said I should use it ! Whether or not it matters in this case. I'm in favour of using `invokeLater` (or `invokeAndWait`) even for AWT components. AWT doesn't explicitly declares its threading model. It's safer to create UI on EDT either way?it'll work for both AWT and Swing. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100689626 From aivanov at openjdk.org Wed May 21 16:41:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:41:55 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v3] In-Reply-To: References: Message-ID: <1Bh6NPTX85YzDUj_R6mvUesZRor88gGcmbnwgKiid3A=.dd93b454-9ee0-4b8a-874b-8be24829a590@github.com> On Tue, 20 May 2025 22:09:37 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 src/java.desktop/share/classes/java/awt/BorderLayout.java line 98: > 96: * demonstrating BorderLayout. Each section of the BorderLayout contains a > 97: * Button corresponding to its position in the layout, one of: North, West, > 98: * Center, East, or South." style="margin: 7px 10px;"> I'd drop this `style` attribute, too. src/java.desktop/share/classes/java/awt/FlowLayout.java line 59: > 57: * 58: * ALT="Graphic of Layout for Three Buttons" > 59: * style="margin: 7px 10px;"> I'd drop this `style` attribute. It indents the image by 10 pixels to the right so that it doesn't align to the left edge of the surrounding text. I see no value in increasing the vertical margins by 7px. Each paragraph has already 14px top/bottom margins. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100738012 PR Review Comment: https://git.openjdk.org/jdk/pull/25278#discussion_r2100737154 From aivanov at openjdk.org Wed May 21 16:50:01 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 16:50:01 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 16:00:12 GMT, Tejesh R wrote: >> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. >> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated review comments Marked as reviewed by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 61: > 59: If it appears to be in HTML format with Pink color, > 60: then test fails. > 61: (Verify for all Look and Feel). There's no way for the tester to verify all Look and Feels, unless they go out of their way and launch the test manually with different look and feels. For this reason, I'd remove this line altogether. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 110: > 108: jfc.putClientProperty("html.disable", htmlEnabled); > 109: jfc.setControlButtonsAreShown(false); > 110: JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); Suggestion: jfc.setControlButtonsAreShown(false); JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); It's better with a blank line that separates the two blocks of code. test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 126: > 124: return new File[]{ > 125: new File("/", "

126: "face=\"Comic Sans MS\">Swing Rocks!!!!111"), Suggestion: "face="Comic Sans MS">Swing Rocks!"), Update this too. ------------- PR Review: https://git.openjdk.org/jdk/pull/24439#pullrequestreview-2858481116 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100751517 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100748073 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2100748940 From honkar at openjdk.org Wed May 21 17:09:53 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 21 May 2025 17:09:53 GMT Subject: RFR: 8357287: Unify usage of ICC profile "header size" constants in CMM-related code In-Reply-To: References: Message-ID: On Tue, 20 May 2025 00:37:15 GMT, Sergey Bylokhov wrote: > Small unification of "header size" constants, as of now the CMM code uses: > 1. sun.java2d.cmm.ProfileDataVerifier.HEADER_SIZE introduced in JDK-8013430 > 2. java.awt.color.ICC_Profile.HEADER_SIZE introduced in [JDK-8347377](https://bugs.openjdk.org/browse/JDK-8347377) > 3. Hardcoded literal 128 LGTM src/java.desktop/share/classes/sun/java2d/cmm/ProfileDataVerifier.java line 111: > 109: public static final int HEADER_SIZE = 128; > 110: private static final int TOC_OFFSET = HEADER_SIZE + 4; > 111: private static final int TOC_RECORD_SIZE = 12; Minor: All the constants are defined at the end of file, is it better to move them to the beginning ? ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25313#pullrequestreview-2858535241 PR Review Comment: https://git.openjdk.org/jdk/pull/25313#discussion_r2100782673 From mvs at openjdk.org Wed May 21 17:16:18 2025 From: mvs at openjdk.org (Manukumar V S) Date: Wed, 21 May 2025 17:16:18 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v5] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: <7QIJEGqmDtHo-IfhvZoFs-EgVbBiER8lBxMCwlh29UE=.684a8d37-0227-4808-ac9e-a40374126210@github.com> > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Review comments fixed : Removed unwanted code, location of imports ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/22b05bbd..996bc9e3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=03-04 Stats: 17 lines in 3 files changed: 1 ins; 9 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From mvs at openjdk.org Wed May 21 17:23:18 2025 From: mvs at openjdk.org (Manukumar V S) Date: Wed, 21 May 2025 17:23:18 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v2] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> <8raDo3FpSvhKD-OA21EHbKEYVEejYB4qtUipeGVNvJw=.b6f7a74f-392a-4541-82d1-b9301123f03b@github.com> Message-ID: On Tue, 20 May 2025 19:18:06 GMT, Alexey Ivanov wrote: >> test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 43: >> >>> 41: import javax.swing.UIManager; >>> 42: >>> 43: class MenuItemTestHelper { >> >> I would've kept `MenuItemTest` as the name of the class. It's fine either way. >> >> I'd also mark this class as `final`. It may be `public` or be left with the default access. > > However, `-Helper` could be better ? the name of the class clearly indicates that this class is not _a test_ but a helper class. Added final modifier ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2100806967 From mvs at openjdk.org Wed May 21 17:23:17 2025 From: mvs at openjdk.org (Manukumar V S) Date: Wed, 21 May 2025 17:23:17 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v6] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Added final modifier to the class MenuItemTestHelper ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/996bc9e3..b04155cd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=04-05 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From azvegint at openjdk.org Wed May 21 17:24:08 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Wed, 21 May 2025 17:24:08 GMT Subject: RFR: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place [v3] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 23:35:27 GMT, Harshitha Onkar wrote: >> Alexander Zvegintsev has updated the pull request incrementally with one additional commit since the last revision: >> >> call OpenPipeWireRemote even for remote desktop session calls > > src/java.desktop/unix/classes/sun/awt/screencast/XdgDesktopPortal.java line 65: > >> 63: } >> 64: >> 65: String m = System.getProperty("awt.robot.screenshotMethod", defaultMethod); > > Do we allow user to set `awt.robot.screenshotMethod` to `dbusScreencast/dbusRemoteDesktop` on x11 sessions and to `x11` on wayland session? > > Although all 3 methods work on both x11 & wayland sessions in Ubuntu. We don't say anything about it. If the user wants to, why not? However, it won't be a priority if there are issues. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25265#discussion_r2100807570 From azvegint at openjdk.org Wed May 21 17:24:10 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Wed, 21 May 2025 17:24:10 GMT Subject: Integrated: 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place In-Reply-To: References: Message-ID: On Fri, 16 May 2025 10:40:22 GMT, Alexander Zvegintsev wrote: > The issue is the inability to move the mouse cursor using `java.awt.Robot` on Oracle Linux 10 (which has not yet been released). FIY, the OL10 is no longer provides an Xorg session, so only Wayland is available. > It is a JCK conformance failure. > > --- > > In our robot implementation, we emulate mouse/keyboard actions using the XTEST extension protocol. > > The XTEST calls are now wired to [libEI](https://libinput.pages.freedesktop.org/libei/api/index.html): > > 1. > > It now asks for a user confirmation to allow interaction, so we should now be able to click on native applications, window titles, etc. > > However, our robot implementation is mostly uses XTEST, but there is an exception: > for mouse move we use XWarpPointer, which is not part of the XTEST, thus it is not propagated outside of Xwayland server. > > So we have a situation where mouse is moving only inside Xwayland server, and we see the mouse enter/exit events, > on mouse press we call XTestFakeButtonEvent and it is handled by libei, > so the click happens where is the actual mouse cursor is in the system. That is why the test fails. > > To avoid this situation we should use XTestFakeMotionEvent for mouseMove in Xwayland case. > > It would be a simple solution, but > > > 2. > > This permission granted by a user doesn't persist across reboots, it timeouts after a period of inactivity. > > It still seems to conform to the specifications, but we will not be able to conveniently run automated tests in this case. > > --- > > So as a solution we can switch the [Remote Desktop XDG portal](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.RemoteDesktop.html). > It has session and `restore_token` functionality to keep permissions granted by a user, similar to what we use in a [Screencast](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.ScreenCast.html) for taking screenshots. > Most of the code can be reused, and it has everything we need. > > > * It is only enabled by default on Wayland and Gnome Shell 47 and higher due to XTEST API complications that first arose in this version. For earlier versions, Screencast is used instead. > * A new value has been introduced for the `awt.robot.screenshotMethod` system property - `dbusRemoteDesktop`. It works on Ubuntu 24.04 with Gnome 46, but is not enabled by default. > * extra mouse buttons are not supported yet, [JDK-8357142](https://bugs.openjdk.org/browse/JDK-8357142) > * Since we are now moving the mouse using a non-X11 API and `MouseInfo.getPointerInfo().getLo... This pull request has now been integrated. Changeset: 2dfbf41d Author: Alexander Zvegintsev URL: https://git.openjdk.org/jdk/commit/2dfbf41d2a3dbcd44f9ed9a58a1b0932d7536977 Stats: 938 lines in 13 files changed: 801 ins; 51 del; 86 mod 8351907: [XWayland] [OL10] Robot.mousePress() is delivered to wrong place Reviewed-by: honkar, prr ------------- PR: https://git.openjdk.org/jdk/pull/25265 From prr at openjdk.org Wed May 21 17:34:22 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 17:34:22 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: > Update the some code examples and accompanying images to no longer mention or display as applets. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8357176 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25278/files - new: https://git.openjdk.org/jdk/pull/25278/files/21f4cba1..42242c34 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=02-03 Stats: 52 lines in 5 files changed: 0 ins; 10 del; 42 mod Patch: https://git.openjdk.org/jdk/pull/25278.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25278/head:pull/25278 PR: https://git.openjdk.org/jdk/pull/25278 From prr at openjdk.org Wed May 21 17:34:22 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 17:34:22 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v3] In-Reply-To: References: Message-ID: <5wO4R1vro09BN4I-6vszV0wUlYrq-k1MTdboSRCwW1Y=.2925c88f-86fe-4889-9ba7-a9abd073551b@github.com> On Tue, 20 May 2025 22:09:37 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 I think I have addressed all the "nits" ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2898724994 From serb at openjdk.org Wed May 21 19:01:03 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 19:01:03 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v3] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 23:09:53 GMT, Sergey Bylokhov wrote: > > Ok .. here's uploaded javadoc to view > > > ``` > > // The background image fills the frame so we > > // don't need to clear the applet on repaints. > > // Just call the paint method. > > public void update(Graphics g) { > > paint(g); > > } > > ``` > > https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/MediaTracker.html this reference to applet still exists. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2898930522 From serb at openjdk.org Wed May 21 19:01:04 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 19:01:04 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 17:34:22 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 btw maybe it is better to present these layouts using swing(and its components)? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2898934515 From aivanov at openjdk.org Wed May 21 19:30:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 19:30:53 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: <9vnDwgAYAetNOy8Tp3JbQ0R4yWT8b4flHo7rB5MKpBQ=.99e80ffc-f68c-4c10-ad08-c8fdfa6b4ae9@github.com> On Wed, 21 May 2025 17:34:22 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 It looks good to me. Sergey's comment hasn't been resolved: `MediaTracker.java` still references *applets* in the code sample at line 148: https://github.com/openjdk/jdk/blob/42242c34ddc0aeb7f97954e956bb2644f83beac2/src/java.desktop/share/classes/java/awt/MediaTracker.java#L147-L150 ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25278#pullrequestreview-2858894330 From aivanov at openjdk.org Wed May 21 19:46:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 19:46:55 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v3] In-Reply-To: References: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com> Message-ID: On Wed, 21 May 2025 15:56:49 GMT, Tejesh R wrote: > Why would we need HTML-formatted instructions btw ? Because the instructions are really hard to read in Windows L&F (because of the monospace font): ![HTMLFileName Instructions in Windows L&F: the text doesn't fit nicely in the window and gets wrapped](https://github.com/user-attachments/assets/ecd39482-e448-4436-96e5-8d6b96c888d9) The image isn't clear, but you get the idea: all the text gets wrapped, so it's hard to keep track of the instructions. Anyway, I'm fine with it. Harshitha had [a similar problem](https://github.com/openjdk/jdk/pull/24456#discussion_r2054468745), and she switched to [using HTML formatting](https://github.com/openjdk/jdk/pull/24456#discussion_r2054516242) which works reliably across different OS. You can check [`JFileChooser/bug4943900.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/javax/swing/JFileChooser/bug4943900.java) on how it looks and works in different OS. https://github.com/openjdk/jdk/blob/81536830ed096005c4f09ab446238ce50989cea9/test/jdk/javax/swing/JFileChooser/bug4943900.java#L40-L47 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2101040424 From prr at openjdk.org Wed May 21 20:21:54 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 20:21:54 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v5] In-Reply-To: References: Message-ID: > Update the some code examples and accompanying images to no longer mention or display as applets. Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8357176 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25278/files - new: https://git.openjdk.org/jdk/pull/25278/files/42242c34..9104493a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25278&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25278.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25278/head:pull/25278 PR: https://git.openjdk.org/jdk/pull/25278 From aivanov at openjdk.org Wed May 21 20:21:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 21 May 2025 20:21:54 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v5] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:18:13 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25278#pullrequestreview-2859003270 From prr at openjdk.org Wed May 21 20:21:56 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 20:21:56 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v3] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 18:56:51 GMT, Sergey Bylokhov wrote: > > > Ok .. here's uploaded javadoc to view > > > > > > > ``` > > > // The background image fills the frame so we > > > // don't need to clear the applet on repaints. > > > // Just call the paint method. > > > public void update(Graphics g) { > > > paint(g); > > > } > > > ``` > > > > > > https://cr.openjdk.org/~prr/8357176/api/java.desktop/java/awt/MediaTracker.html > > this reference to applet still exists. oops. I missed what that comment was about ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2899120305 From prr at openjdk.org Wed May 21 20:21:57 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 20:21:57 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 17:34:22 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 > btw maybe it is better to present these layouts using swing(and its components)? > btw maybe it is better to present these layouts using swing(and its components)? This is in the AWT package so I think AWT components is better. And the goal is just to get rid of the applet mentions and I've now done that (after the last one) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2899125757 From serb at openjdk.org Wed May 21 20:23:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 20:23:56 GMT Subject: RFR: 8357287: Unify usage of ICC profile "header size" constants in CMM-related code In-Reply-To: References: Message-ID: On Wed, 21 May 2025 17:06:00 GMT, Harshitha Onkar wrote: >> Small unification of "header size" constants, as of now the CMM code uses: >> 1. sun.java2d.cmm.ProfileDataVerifier.HEADER_SIZE introduced in JDK-8013430 >> 2. java.awt.color.ICC_Profile.HEADER_SIZE introduced in [JDK-8347377](https://bugs.openjdk.org/browse/JDK-8347377) >> 3. Hardcoded literal 128 > > src/java.desktop/share/classes/sun/java2d/cmm/ProfileDataVerifier.java line 111: > >> 109: public static final int HEADER_SIZE = 128; >> 110: private static final int TOC_OFFSET = HEADER_SIZE + 4; >> 111: private static final int TOC_RECORD_SIZE = 12; > > Minor: All the constants are defined at the end of file, is it better to move them to the beginning ? Perhaps someday when we go for this kind of unification ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25313#discussion_r2101096420 From serb at openjdk.org Wed May 21 20:55:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 20:55:52 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:15:43 GMT, Phil Race wrote: > This is in the AWT package so I think AWT components is better. > And the goal is just to get rid of the applet mentions and I've now done that (after the last one) But these layout classes are used for both awt and swing libraries. And since we modernize the example and drop outdated applets we may change them to jframe instead+jbutton, on mac the images will be the same as for awt. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2899206760 From prr at openjdk.org Wed May 21 21:00:54 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 21:00:54 GMT Subject: RFR: 8357287: Unify usage of ICC profile "header size" constants in CMM-related code In-Reply-To: References: Message-ID: On Tue, 20 May 2025 00:37:15 GMT, Sergey Bylokhov wrote: > Small unification of "header size" constants, as of now the CMM code uses: > 1. sun.java2d.cmm.ProfileDataVerifier.HEADER_SIZE introduced in JDK-8013430 > 2. java.awt.color.ICC_Profile.HEADER_SIZE introduced in [JDK-8347377](https://bugs.openjdk.org/browse/JDK-8347377) > 3. Hardcoded literal 128 Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25313#pullrequestreview-2859099087 From vyazici at openjdk.org Wed May 21 21:02:04 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Wed, 21 May 2025 21:02:04 GMT Subject: RFR: 8356893: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner Message-ID: There are several locations in the JDK source where `System.in` and `FileDescriptor.in` is read with `InputStreamReader` and `Scanner` using the default charset. As recommended by the recently merged [JDK-8356420](https://bugs.openjdk.org/browse/JDK-8356420), this PR replaces the default charset with the one provided by the `stdin.encoding` system property. ### Fixing strategy * Where it is obvious that `System.in` is passed to `InputStreamReader`/`Scanner` ctors, `stdin.encoding` is employed fixed. * Where the `InputStream` passed to `InputStreamReader`/`Scanner` ctors is difficult to determine if it can ever be `System.in`, `assert` expressions are placed. * Where the odds of receiving `System.in` are low, yet it is technically possible (e.g., `Process::getInputStream`, `URL::openConnection`, `Class::getResourceAsStream`), nothing is done. @naotoj was kind enough to guide me in this PR, and stated `assert` expressions can be skipped, since they are many ways one can circumvent those checks; wrapping `System.in`, usage of `System::setIn`, etc. Yet we decided to leave them as is to collect feedback from other reviewers too. ### Scanning strategy The following ~alien technology~ advanced static analysis tools are used to scan the code for potentially affected places: # Perl is used for multi-line matching find . -name "*.java" -exec perl -0777 -ne 'my $r = (/(InputStreamReader|Scanner)(\s*System.in)/) ? 0 : 1; exit $r' {} ; -print git grep -H 'FileDescriptor.in' "*.java" All calls to `InputStreamReader::new` and `Scanner::new` are checked too. ### Problems encountered 1. Due to either irregular, or non-existent license header, could not update the copyright year for following classes: ``` DOMImplementationRegistry InputRC ListingErrorHandler PandocFilter ``` 2. Could not employ `stdin.encoding` in `PandocFilter`, since the bootstrap VM running that class returns empty for that system property ------------- Commit messages: - Use `stdin.encoding` in `InputStreamReader` and `Scanner` instantiations Changes: https://git.openjdk.org/jdk/pull/25368/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25368&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356893 Stats: 244 lines in 58 files changed: 111 ins; 20 del; 113 mod Patch: https://git.openjdk.org/jdk/pull/25368.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25368/head:pull/25368 PR: https://git.openjdk.org/jdk/pull/25368 From prr at openjdk.org Wed May 21 21:02:58 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 21 May 2025 21:02:58 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:53:32 GMT, Sergey Bylokhov wrote: > > This is in the AWT package so I think AWT components is better. > > And the goal is just to get rid of the applet mentions and I've now done that (after the last one) > > But these layout classes are used for both awt and swing libraries. And since we modernize the example and drop outdated applets we may change them to jframe instead+jbutton, on mac the images will be the same as for awt. I really don't see that as being the right thing to do here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2899220414 From rriggs at openjdk.org Wed May 21 21:39:53 2025 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 21 May 2025 21:39:53 GMT Subject: RFR: 8356893: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:56:31 GMT, Volkan Yazici wrote: > There are several locations in the JDK source where `System.in` and `FileDescriptor.in` is read with `InputStreamReader` and `Scanner` using the default charset. As recommended by the recently merged [JDK-8356420](https://bugs.openjdk.org/browse/JDK-8356420), this PR replaces the default charset with the one provided by the `stdin.encoding` system property. > > ### Fixing strategy > > * Where it is obvious that `System.in` is passed to `InputStreamReader`/`Scanner` ctors, `stdin.encoding` is employed fixed. > * Where the `InputStream` passed to `InputStreamReader`/`Scanner` ctors is difficult to determine if it can ever be `System.in`, `assert` expressions are placed. > * Where the odds of receiving `System.in` are low, yet it is technically possible (e.g., `Process::getInputStream`, `URL::openConnection`, `Class::getResourceAsStream`), nothing is done. > > @naotoj was kind enough to guide me in this PR, and stated `assert` expressions can be skipped, since they are many ways one can circumvent those checks; wrapping `System.in`, usage of `System::setIn`, etc. Yet we decided to leave them as is to collect feedback from other reviewers too. > > ### Scanning strategy > > The following ~alien technology~ advanced static analysis tools are used to scan the code for potentially affected places: > > > # Perl is used for multi-line matching > find . -name "*.java" -exec perl -0777 -ne 'my $r = (/(InputStreamReader|Scanner)(\s*System.in)/) ? 0 : 1; exit $r' {} ; -print > git grep -H 'FileDescriptor.in' "*.java" > > > All calls to `InputStreamReader::new` and `Scanner::new` are checked too. > > ### Problems encountered > > 1. Due to either irregular, or non-existent license header, could not update the copyright year for following classes: > > ``` > DOMImplementationRegistry > InputRC > ListingErrorHandler > PandocFilter > ``` > 2. Could not employ `stdin.encoding` in `PandocFilter`, since the bootstrap VM running that class returns empty for that system property There too many changes in too many different areas to be in a single PR. Please break it down by review areas. Client, core libs, tools, etc. ------------- PR Review: https://git.openjdk.org/jdk/pull/25368#pullrequestreview-2859185030 From serb at openjdk.org Wed May 21 21:54:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 21:54:54 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v5] In-Reply-To: References: Message-ID: <7c528mbl1GQsxEIke_7dmPXixVki0Vfx7o7MZvc1YmQ=.d06fd881-a946-43c7-9db9-b3bc1b2ce1d7@github.com> On Wed, 21 May 2025 20:21:54 GMT, Phil Race wrote: >> Update the some code examples and accompanying images to no longer mention or display as applets. > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8357176 Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25278#pullrequestreview-2859213283 From serb at openjdk.org Wed May 21 21:58:00 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 21 May 2025 21:58:00 GMT Subject: RFR: 8357176: java.awt javadoc code examples still use Applet API [v4] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 21:00:24 GMT, Phil Race wrote: > I really don't see that as being the right thing to do here. The goal of this change is to delete the usage of applet, but as a replacement the change uses the awt frame, while i think the right thing to use in our examples are "modern" swing components ------------- PR Comment: https://git.openjdk.org/jdk/pull/25278#issuecomment-2899340978 From serb at openjdk.org Thu May 22 03:06:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 03:06:50 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V wrote: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. Is it possible that it is somehow related to 8304825? could be the layer created "during display sleep" and that might be in "sleep" more that 5 seconds? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25342#issuecomment-2899764689 From zzambers at openjdk.org Thu May 22 03:42:58 2025 From: zzambers at openjdk.org (Zdenek Zambersky) Date: Thu, 22 May 2025 03:42:58 GMT Subject: Integrated: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x In-Reply-To: References: Message-ID: On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky wrote: > This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`) > > Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened. > > I was not able to get response from original author for this issue, so I am creating PR myself. > > **Testing:** > I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. > > Without fix: > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1063 415 6 687 << > > > With fix > > TEST TOTAL PASS FAIL ERROR SKIP >>> jtreg:test/jdk:jdk_awt 2171 1162 316 6 687 << > > > Many tests are no longer crashing the VM: > > -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Failed. Unexpected exit from test [exit code: 134] > +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java Passed. Execution successful > > There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix) > > I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.) This pull request has now been integrated. Changeset: ee689145 Author: Zdenek Zambersky Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/ee6891456ed672305d9b48846b5a7977373e1284 Stats: 20 lines in 1 file changed: 10 ins; 10 del; 0 mod 8343618: Stack smashing in awt_InputMethod.c on Linux s390x Co-authored-by: Ichiroh Takiguchi Reviewed-by: prr, aph, amitkumar ------------- PR: https://git.openjdk.org/jdk/pull/24197 From serb at openjdk.org Thu May 22 04:34:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 04:34:56 GMT Subject: Integrated: 8357287: Unify usage of ICC profile "header size" constants in CMM-related code In-Reply-To: References: Message-ID: On Tue, 20 May 2025 00:37:15 GMT, Sergey Bylokhov wrote: > Small unification of "header size" constants, as of now the CMM code uses: > 1. sun.java2d.cmm.ProfileDataVerifier.HEADER_SIZE introduced in JDK-8013430 > 2. java.awt.color.ICC_Profile.HEADER_SIZE introduced in [JDK-8347377](https://bugs.openjdk.org/browse/JDK-8347377) > 3. Hardcoded literal 128 This pull request has now been integrated. Changeset: 68c1d305 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/68c1d305e726f3f4d7209b857f58cc10de5c0132 Stats: 10 lines in 2 files changed: 2 ins; 2 del; 6 mod 8357287: Unify usage of ICC profile "header size" constants in CMM-related code Reviewed-by: honkar, prr ------------- PR: https://git.openjdk.org/jdk/pull/25313 From alanb at openjdk.org Thu May 22 05:54:52 2025 From: alanb at openjdk.org (Alan Bateman) Date: Thu, 22 May 2025 05:54:52 GMT Subject: RFR: 8356893: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:56:31 GMT, Volkan Yazici wrote: > There are several locations in the JDK source where `System.in` and `FileDescriptor.in` is read with `InputStreamReader` and `Scanner` using the default charset. As recommended by the recently merged [JDK-8356420](https://bugs.openjdk.org/browse/JDK-8356420), this PR replaces the default charset with the one provided by the `stdin.encoding` system property. > > ### Fixing strategy > > * Where it is obvious that `System.in` is passed to `InputStreamReader`/`Scanner` ctors, `stdin.encoding` is employed fixed. > * Where the `InputStream` passed to `InputStreamReader`/`Scanner` ctors is difficult to determine if it can ever be `System.in`, `assert` expressions are placed. > * Where the odds of receiving `System.in` are low, yet it is technically possible (e.g., `Process::getInputStream`, `URL::openConnection`, `Class::getResourceAsStream`), nothing is done. > > @naotoj was kind enough to guide me in this PR, and stated `assert` expressions can be skipped, since they are many ways one can circumvent those checks; wrapping `System.in`, usage of `System::setIn`, etc. Yet we decided to leave them as is to collect feedback from other reviewers too. > > ### Scanning strategy > > The following ~alien technology~ advanced static analysis tools are used to scan the code for potentially affected places: > > > # Perl is used for multi-line matching > find . -name "*.java" -exec perl -0777 -ne 'my $r = (/(InputStreamReader|Scanner)(\s*System.in)/) ? 0 : 1; exit $r' {} ; -print > git grep -H 'FileDescriptor.in' "*.java" > > > All calls to `InputStreamReader::new` and `Scanner::new` are checked too. > > ### Problems encountered > > 1. Due to either irregular, or non-existent license header, could not update the copyright year for following classes: > > ``` > DOMImplementationRegistry > InputRC > ListingErrorHandler > PandocFilter > ``` > 2. Could not employ `stdin.encoding` in `PandocFilter`, since the bootstrap VM running that class returns empty for that system property javax.swing.text.DefaultEditorKit.read(InputStream ...) is one example changed in the PR. If that is changed to special case System.in then it will require a spec change. It also means that `read(System.in)` will behave differently to say `new BufferedInputStream(System.in)`. From a quick scan, I suspect changes that impact the APIs will need to dropped from the PR, maybe replaced with spec clarification to document the charset that is actually used. In the DefaultEditorKit.read example it might direct folks to the read(Reader ..) method so that code can control which charset to use. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25368#issuecomment-2899998753 From syan at openjdk.org Thu May 22 06:30:58 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 22 May 2025 06:30:58 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Duplicated to https://bugs.openjdk.org/browse/JDK-8346103 ------------- PR Comment: https://git.openjdk.org/jdk/pull/25217#issuecomment-2900065310 From tr at openjdk.org Thu May 22 06:57:38 2025 From: tr at openjdk.org (Tejesh R) Date: Thu, 22 May 2025 06:57:38 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v5] In-Reply-To: References: Message-ID: > The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. > The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24439/files - new: https://git.openjdk.org/jdk/pull/24439/files/4f8c759a..5157249b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24439&range=03-04 Stats: 25 lines in 1 file changed: 8 ins; 0 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/24439.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24439/head:pull/24439 PR: https://git.openjdk.org/jdk/pull/24439 From tr at openjdk.org Thu May 22 06:57:38 2025 From: tr at openjdk.org (Tejesh R) Date: Thu, 22 May 2025 06:57:38 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v3] In-Reply-To: References: <8icaCzTbIOcszrNmqCYdzqI4telSGl3bM-9afdXEWbE=.7c5be52b-eb9e-41e0-b655-5148f135d72c@github.com> Message-ID: On Wed, 21 May 2025 19:44:01 GMT, Alexey Ivanov wrote: >> Why would we need HTML-formatted instructions btw ? > >> Why would we need HTML-formatted instructions btw ? > > Because the instructions are really hard to read in Windows L&F (because of the monospace font): > > ![HTMLFileName Instructions in Windows L&F: the text doesn't fit nicely in the window and gets wrapped](https://github.com/user-attachments/assets/ecd39482-e448-4436-96e5-8d6b96c888d9) > > The image isn't clear, but you get the idea: all the text gets wrapped, so it's hard to keep track of the instructions. Anyway, I'm fine with it. > > Harshitha had [a similar problem](https://github.com/openjdk/jdk/pull/24456#discussion_r2054468745), and she switched to [using HTML formatting](https://github.com/openjdk/jdk/pull/24456#discussion_r2054516242) which works reliably across different OS. > > You can check [`JFileChooser/bug4943900.java`](https://github.com/openjdk/jdk/blob/master/test/jdk/javax/swing/JFileChooser/bug4943900.java) on how it looks and works in different OS. > > https://github.com/openjdk/jdk/blob/81536830ed096005c4f09ab446238ce50989cea9/test/jdk/javax/swing/JFileChooser/bug4943900.java#L40-L47 Yup got it. I've update the test instructions to HTML-formatted. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2101780723 From tr at openjdk.org Thu May 22 06:57:38 2025 From: tr at openjdk.org (Tejesh R) Date: Thu, 22 May 2025 06:57:38 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v4] In-Reply-To: References: Message-ID: <6UEOlSjAROoDC18-Y-m0kN_YQ6GLIHZV3j5Kxmp_61w=.dcd7a30d-5659-4b9c-acd9-b3fe5b4200bd@github.com> On Wed, 21 May 2025 16:47:29 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated review comments > > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 61: > >> 59: If it appears to be in HTML format with Pink color, >> 60: then test fails. >> 61: (Verify for all Look and Feel). > > There's no way for the tester to verify all Look and Feels, unless they go out of their way and launch the test manually with different look and feels. > > For this reason, I'd remove this line altogether. Removed. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 110: > >> 108: jfc.putClientProperty("html.disable", htmlEnabled); >> 109: jfc.setControlButtonsAreShown(false); >> 110: JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); > > Suggestion: > > jfc.setControlButtonsAreShown(false); > > JFrame frame = new JFrame((htmlEnabled) ? "HTML enabled" : "HTML disabled"); > > It's better with a blank line that separates the two blocks of code. Updated. > test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 126: > >> 124: return new File[]{ >> 125: new File("/", "

> 126: "face=\"Comic Sans MS\">Swing Rocks!!!!111"), > > Suggestion: > > "face="Comic Sans MS">Swing Rocks!"), > > Update this too. Updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2101781284 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2101780937 PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2101781523 From vyazici at openjdk.org Thu May 22 07:59:09 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 22 May 2025 07:59:09 GMT Subject: RFR: 8356893: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner In-Reply-To: References: Message-ID: On Wed, 21 May 2025 21:37:07 GMT, Roger Riggs wrote: >> There are several locations in the JDK source where `System.in` and `FileDescriptor.in` is read with `InputStreamReader` and `Scanner` using the default charset. As recommended by the recently merged [JDK-8356420](https://bugs.openjdk.org/browse/JDK-8356420), this PR replaces the default charset with the one provided by the `stdin.encoding` system property. >> >> ### Fixing strategy >> >> * Where it is obvious that `System.in` is passed to `InputStreamReader`/`Scanner` ctors, `stdin.encoding` is employed fixed. >> * Where the `InputStream` passed to `InputStreamReader`/`Scanner` ctors is difficult to determine if it can ever be `System.in`, `assert` expressions are placed. >> * Where the odds of receiving `System.in` are low, yet it is technically possible (e.g., `Process::getInputStream`, `URL::openConnection`, `Class::getResourceAsStream`), nothing is done. >> >> @naotoj was kind enough to guide me in this PR, and stated `assert` expressions can be skipped, since they are many ways one can circumvent those checks; wrapping `System.in`, usage of `System::setIn`, etc. Yet we decided to leave them as is to collect feedback from other reviewers too. >> >> ### Scanning strategy >> >> The following ~alien technology~ advanced static analysis tools are used to scan the code for potentially affected places: >> >> >> # Perl is used for multi-line matching >> find . -name "*.java" -exec perl -0777 -ne 'my $r = (/(InputStreamReader|Scanner)(\s*System.in)/) ? 0 : 1; exit $r' {} ; -print >> git grep -H 'FileDescriptor.in' "*.java" >> >> >> All calls to `InputStreamReader::new` and `Scanner::new` are checked too. >> >> ### Problems encountered >> >> 1. Due to either irregular, or non-existent license header, could not update the copyright year for following classes: >> >> ``` >> DOMImplementationRegistry >> InputRC >> ListingErrorHandler >> PandocFilter >> ``` >> 2. Could not employ `stdin.encoding` in `PandocFilter`, since the bootstrap VM running that class returns empty for that system property > > There too many changes in too many different areas to be in a single PR. > Please break it down by review areas. Client, core libs, tools, etc. @RogerRiggs, @AlanBateman, thanks so much for the quick review. I see your points. I will 1. withdraw this PR, 2. convert certain changes to spec clarifications, 3. and break it down to multiple PRs. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25368#issuecomment-2900262422 From vyazici at openjdk.org Thu May 22 07:59:10 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Thu, 22 May 2025 07:59:10 GMT Subject: Withdrawn: 8356893: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner In-Reply-To: References: Message-ID: On Wed, 21 May 2025 20:56:31 GMT, Volkan Yazici wrote: > There are several locations in the JDK source where `System.in` and `FileDescriptor.in` is read with `InputStreamReader` and `Scanner` using the default charset. As recommended by the recently merged [JDK-8356420](https://bugs.openjdk.org/browse/JDK-8356420), this PR replaces the default charset with the one provided by the `stdin.encoding` system property. > > ### Fixing strategy > > * Where it is obvious that `System.in` is passed to `InputStreamReader`/`Scanner` ctors, `stdin.encoding` is employed fixed. > * Where the `InputStream` passed to `InputStreamReader`/`Scanner` ctors is difficult to determine if it can ever be `System.in`, `assert` expressions are placed. > * Where the odds of receiving `System.in` are low, yet it is technically possible (e.g., `Process::getInputStream`, `URL::openConnection`, `Class::getResourceAsStream`), nothing is done. > > @naotoj was kind enough to guide me in this PR, and stated `assert` expressions can be skipped, since they are many ways one can circumvent those checks; wrapping `System.in`, usage of `System::setIn`, etc. Yet we decided to leave them as is to collect feedback from other reviewers too. > > ### Scanning strategy > > The following ~alien technology~ advanced static analysis tools are used to scan the code for potentially affected places: > > > # Perl is used for multi-line matching > find . -name "*.java" -exec perl -0777 -ne 'my $r = (/(InputStreamReader|Scanner)(\s*System.in)/) ? 0 : 1; exit $r' {} ; -print > git grep -H 'FileDescriptor.in' "*.java" > > > All calls to `InputStreamReader::new` and `Scanner::new` are checked too. > > ### Problems encountered > > 1. Due to either irregular, or non-existent license header, could not update the copyright year for following classes: > > ``` > DOMImplementationRegistry > InputRC > ListingErrorHandler > PandocFilter > ``` > 2. Could not employ `stdin.encoding` in `PandocFilter`, since the bootstrap VM running that class returns empty for that system property This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25368 From aivanov at openjdk.org Thu May 22 10:37:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 10:37:59 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v5] In-Reply-To: References: Message-ID: On Wed, 9 Apr 2025 09:27:38 GMT, Mikhail Yankelevich wrote: >> This **builder** is for PassFailJFrame (user instruction window). > > @Renjithkannath apologies, I meant the constructor, line 64 ? > Minor: Don't you think It's a bit unusual to have the test be executed with the builder of the class? Seems a bit odd to me, but if you prefer it, it's fine as is Maybe? There are other tests that use this code style. > I understand, but this is a string value which is always set to null. Wouldn't it be easier to read if it was `null` straight in the method call? Something like this: `g2d.drawString((String) null, 20, 40);` > > If you prefer it as is, it's fine too @myankelev It's not a new test. Explicit `null` requires cast to either `String` or `AttributedCharacterIterator`. The name of the variable have a type associated with it. In addition to that, it keeps the code consistent where null values are tested and where non-null values are tested, and it's clear from the parameter name what is tested. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2102222223 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2102231520 From aivanov at openjdk.org Thu May 22 10:37:59 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 10:37:59 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v5] In-Reply-To: References: Message-ID: <0mHuo9tjO5jTGrXp9dTyRZqZRywPGopOxKy83WW9evw=.a9d7a996-6312-49ed-bac1-653103bac763@github.com> On Wed, 14 May 2025 04:07:08 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Moved main fuction to top Looks good to me except for a minor nit. test/jdk/java/awt/print/PrinterJob/PrintNullString.java line 56: > 54: throw new RuntimeException("Printer not configured or available."); > 55: } > 56: new PrintNullString(); Suggestion: new PrintNullString(); Leave a blank line between the skipped condition and the real test code. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2860700039 PR Review Comment: https://git.openjdk.org/jdk/pull/24501#discussion_r2102225612 From aivanov at openjdk.org Thu May 22 10:47:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 10:47:54 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v6] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Wed, 21 May 2025 17:23:17 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Added final modifier to the class MenuItemTestHelper Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 52: > 50: } > 51: } > 52: Icon myIcon = new ColoredIcon(Color.RED, 10, 10); The blank here was in its own place. It separated the code that sets L&F from creating icons. I think there should be a blank line after the icons are created, too. ------------- PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2860741769 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2102249558 From aivanov at openjdk.org Thu May 22 10:53:08 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 10:53:08 GMT Subject: RFR: 8346436: Compilation with clang fails [v2] In-Reply-To: References: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> Message-ID: On Fri, 3 Jan 2025 09:19:34 GMT, Jan Kratochvil wrote: >> clang-18.1.8-1.fc40.x86_64 >> Fedora 40 x86_64 >> fbd76ca8edd756ff2ebbc9f6477cc1a827df67b0 >> >> >> src/java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c:375:9: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 375 | write(splash->controlpipe[1], &code, 1); >> | ^~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c:713:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 713 | pipe(splash->controlpipe); >> | ^~~~ ~~~~~~~~~~~~~~~~~~~ >> src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.h:45:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined] >> 45 | #define dprintf(s) >> | ^ >> /usr/include/bits/stdio2.h:121:12: note: previous definition is here >> 121 | # define dprintf(fd, ...) \ >> | ^ >> src/java.smartcardio/share/native/libj2pcsc/pcsc.c:48:9: error: 'dprintf' macro redefined [-Werror,-Wmacro-redefined] >> 48 | #define dprintf(s) >> | ^ >> /usr/include/bits/stdio2.h:121:12: note: previous definition is here >> 121 | # define dprintf(fd, ...) \ >> | ^ > > Jan Kratochvil has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision: > > - Use only (void) casts > - Merge branch 'master' into clangbuild > - 8346436: Compilation with clang fails @jankratochvil Seemingly, the same problem is being addressed in #25217 for [JDK-8354316](https://bugs.openjdk.org/browse/JDK-8354316). ------------- PR Comment: https://git.openjdk.org/jdk/pull/22794#issuecomment-2900771105 From aivanov at openjdk.org Thu May 22 10:55:02 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 10:55:02 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Thu, 22 May 2025 06:28:07 GMT, SendaoYan wrote: > Duplicated to https://bugs.openjdk.org/browse/JDK-8346103 So, [JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103) is closed as duplicate of [JDK-8346436](https://bugs.openjdk.org/browse/JDK-8346436). The latter has a closed code review #22794. I like this approach better because it doesn't simply ignore the return value but prints a trace if `write` returns the unexpected value. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25217#issuecomment-2900778127 From rkannathpari at openjdk.org Thu May 22 11:24:34 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Thu, 22 May 2025 11:24:34 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v6] In-Reply-To: References: Message-ID: > Hi Reviewers, > > I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. > > Please review and let me know your suggestions. Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: Update test/jdk/java/awt/print/PrinterJob/PrintNullString.java Co-authored-by: Alexey Ivanov ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24501/files - new: https://git.openjdk.org/jdk/pull/24501/files/2c9f9901..01041aa3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24501&range=04-05 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24501.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24501/head:pull/24501 PR: https://git.openjdk.org/jdk/pull/24501 From syan at openjdk.org Thu May 22 12:34:57 2025 From: syan at openjdk.org (SendaoYan) Date: Thu, 22 May 2025 12:34:57 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added LGTM ------------- Marked as reviewed by syan (Committer). PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2861046664 From mvs at openjdk.org Thu May 22 13:07:14 2025 From: mvs at openjdk.org (Manukumar V S) Date: Thu, 22 May 2025 13:07:14 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v7] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Added blank lines to seperate logic code pieces ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/b04155cd..db537cb8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=05-06 Stats: 2 lines in 1 file changed: 2 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From mvs at openjdk.org Thu May 22 13:07:15 2025 From: mvs at openjdk.org (Manukumar V S) Date: Thu, 22 May 2025 13:07:15 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v6] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Thu, 22 May 2025 10:44:48 GMT, Alexey Ivanov wrote: >> Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: >> >> Added final modifier to the class MenuItemTestHelper > > test/jdk/javax/swing/JMenuItem/MenuItemTest/MenuItemTestHelper.java line 52: > >> 50: } >> 51: } >> 52: Icon myIcon = new ColoredIcon(Color.RED, 10, 10); > > The blank here was in its own place. It separated the code that sets L&F from creating icons. > > I think there should be a blank line after the icons are created, too. Done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2102510295 From mvs at openjdk.org Thu May 22 13:19:43 2025 From: mvs at openjdk.org (Manukumar V S) Date: Thu, 22 May 2025 13:19:43 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v8] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Removed trailing whitespace ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/db537cb8..64134a5e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=06-07 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From aivanov at openjdk.org Thu May 22 13:57:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 13:57:55 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v6] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 11:24:34 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/print/PrinterJob/PrintNullString.java > > Co-authored-by: Alexey Ivanov Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24501#pullrequestreview-2861349517 From aivanov at openjdk.org Thu May 22 14:12:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 14:12:55 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v8] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Thu, 22 May 2025 13:19:43 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Removed trailing whitespace Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JMenuItem/MenuItemTest/bug6197830.java line 52: > 50: .testUI(bug6197830::createTestUI) > 51: .position(PassFailJFrame.Position.TOP_LEFT_CORNER) > 52: .positionTestUIBottomRowCentered() Suggestion: .positionTestUIBottomRowCentered() ------------- PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2861403996 PR Review Comment: https://git.openjdk.org/jdk/pull/25319#discussion_r2102665677 From mvs at openjdk.org Thu May 22 14:31:43 2025 From: mvs at openjdk.org (Manukumar V S) Date: Thu, 22 May 2025 14:31:43 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v9] In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Removed unwanted code for positioning the UI ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25319/files - new: https://git.openjdk.org/jdk/pull/25319/files/64134a5e..36338cac Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25319&range=07-08 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25319/head:pull/25319 PR: https://git.openjdk.org/jdk/pull/25319 From aivanov at openjdk.org Thu May 22 14:31:43 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 22 May 2025 14:31:43 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v9] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Thu, 22 May 2025 14:28:37 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Removed unwanted code for positioning the UI Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25319#pullrequestreview-2861465239 From duke at openjdk.org Thu May 22 14:31:44 2025 From: duke at openjdk.org (duke) Date: Thu, 22 May 2025 14:31:44 GMT Subject: RFR: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java [v8] In-Reply-To: References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: On Thu, 22 May 2025 13:19:43 GMT, Manukumar V S wrote: >> There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. >> >> Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Removed trailing whitespace @manukumarvs Your change (at version 36338cac228a816a230ab707c1cb18ef9efe7f3d) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25319#issuecomment-2901447729 From jdv at openjdk.org Thu May 22 14:32:55 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Thu, 22 May 2025 14:32:55 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Thu, 22 May 2025 03:04:44 GMT, Sergey Bylokhov wrote: > Is it possible that it is somehow related to 8304825? could be the layer created "during display sleep" and that might be in "sleep" more that 5 seconds? This is follow-up fix for JDK-8304825. Basically we have a race condition because of timing issue when we are rendering many frame with animations. On screen wakeup CVDisplayLinkCreateWithActiveCGDisplays is failing because Active display list is still empty and we never create a displayLink and content to MTLLayer are never updated. By adding 5 retries with 1 secons gap after screen wakeup we are making sure that we are able to create displayLink for all active displays. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25342#issuecomment-2901453421 From serb at openjdk.org Thu May 22 16:05:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 16:05:50 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V wrote: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25342#pullrequestreview-2861806946 From kizune at openjdk.org Thu May 22 16:06:52 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 22 May 2025 16:06:52 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 04:34:36 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Click position fixed..L&F iteration test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 65: > 63: private static volatile int curLoc; > 64: > 65: private static void setLookAndFeel(UIManager.LookAndFeelInfo laf) { Cosmetic: invalid indentation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2102925156 From kizune at openjdk.org Thu May 22 16:13:55 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 22 May 2025 16:13:55 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: References: Message-ID: On Tue, 20 May 2025 04:34:36 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Click position fixed..L&F iteration test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 80: > 78: System.out.println("Testing LAF : " + laf.getClassName()); > 79: try { > 80: setLookAndFeel(laf); If setLookAndFeel encounters UnsupportedLookAndFeelException we will output the exception into stdout but we will do the entire test again with the previously installed LAF. Shall we do so? If we consider that exception as non-fatal for the test maybe we can make setLookAndFeel method boolean instead of void returning true only if it was successfully installed new LAF and skip test iteration if it returns false? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2102938557 From jdv at openjdk.org Thu May 22 16:15:54 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Thu, 22 May 2025 16:15:54 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: <62roKFLSK75XExM2OcIjmkKomf7XbbOGT5j52X3j93Y=.12eed2fc-f2ee-445d-8c3b-0157222306c4@github.com> On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood wrote: >> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. >> >> I added a little bit of logging that might also help identify what's happening. >> >> Does anyone have any more suggestions? > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8356061: removing robot > > This is in response to: > https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453 I think we can continue to keep this test case in its updated form of using BufferedImage as it is testing specific functional scenario. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2901819937 From psadhukhan at openjdk.org Thu May 22 16:27:10 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 22 May 2025 16:27:10 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v3] In-Reply-To: References: Message-ID: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Test fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25294/files - new: https://git.openjdk.org/jdk/pull/25294/files/d1671bdd..42c7c575 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=01-02 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25294.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294 PR: https://git.openjdk.org/jdk/pull/25294 From psadhukhan at openjdk.org Thu May 22 16:27:10 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 22 May 2025 16:27:10 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 16:11:12 GMT, Alexander Zuev wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Click position fixed..L&F iteration > > test/jdk/javax/swing/JSplitPane/TestSplitPaneResetDividerLoc.java line 80: > >> 78: System.out.println("Testing LAF : " + laf.getClassName()); >> 79: try { >> 80: setLookAndFeel(laf); > > If setLookAndFeel encounters UnsupportedLookAndFeelException we will output the exception into stdout but we will do the entire test again with the previously installed LAF. Shall we do so? If we consider that exception as non-fatal for the test maybe we can make setLookAndFeel method boolean instead of void returning true only if it was successfully installed new LAF and skip test iteration if it returns false? ok..modified.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2102961779 From honkar at openjdk.org Thu May 22 17:39:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 22 May 2025 17:39:54 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Mon, 19 May 2025 02:08:01 GMT, Sergey Bylokhov wrote: >> CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. >> >> Test failure is not reproducible when the test is run individually (multiple times) on CI. >> >> Rewritten the test and added debug logs that will be helpful to figure out the issue. >> >> - Added code to capture screenshot (entire screen as well as the frame) in case of failure. >> - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. > > test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 88: > >> 86: >> 87: private static void createTestUI() { >> 88: frame = new Frame(); > > You do not need to call all these methods on the EDT, these are AWT components that should handle multithreaded usage (main/EDT/toolkit threads). It is possible that the issue is only reproducible on macOS due to synchronization problems related to the metal pipeline? Recent AWT test updates have UI creation wrapped in EDT. I have seen many reviewers recommend using EDT even with AWT components. Recently came across another PR where EDT is recommended. https://github.com/openjdk/jdk/pull/25278#discussion_r2100689626 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2103088406 From serb at openjdk.org Thu May 22 19:03:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 19:03:53 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood wrote: >> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. >> >> I added a little bit of logging that might also help identify what's happening. >> >> Does anyone have any more suggestions? > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8356061: removing robot > > This is in response to: > https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453 It looks fine if mach5 is green ------------- Marked as reviewed by serb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25244#pullrequestreview-2862294785 From prr at openjdk.org Thu May 22 19:23:01 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 19:23:01 GMT Subject: Integrated: 8357176: java.awt javadoc code examples still use Applet API In-Reply-To: References: Message-ID: <145EscYp3RF-sYk1VOwrWLL-_pQQ_9CHsEnDKhSkNO0=.b84e053f-24fb-40b1-acc6-8ea520f6b420@github.com> On Fri, 16 May 2025 23:04:28 GMT, Phil Race wrote: > Update the some code examples and accompanying images to no longer mention or display as applets. This pull request has now been integrated. Changeset: 139a05d0 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/139a05d05959a84541a29dfae6151f92ce579ae6 Stats: 176 lines in 17 files changed: 50 ins; 28 del; 98 mod 8357176: java.awt javadoc code examples still use Applet API Reviewed-by: aivanov, serb ------------- PR: https://git.openjdk.org/jdk/pull/25278 From duke at openjdk.org Thu May 22 19:27:51 2025 From: duke at openjdk.org (duke) Date: Thu, 22 May 2025 19:27:51 GMT Subject: RFR: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine [v3] In-Reply-To: References: Message-ID: On Mon, 19 May 2025 05:37:05 GMT, Jeremy Wood wrote: >> Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. >> >> I added a little bit of logging that might also help identify what's happening. >> >> Does anyone have any more suggestions? > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8356061: removing robot > > This is in response to: > https://github.com/openjdk/jdk/pull/25244#issuecomment-2889420453 @mickleness Your change (at version 9f91249a424b190990fc3056644b5aac8caa0a5b) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25244#issuecomment-2902317257 From prr at openjdk.org Thu May 22 19:32:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 19:32:54 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v5] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 06:57:38 GMT, Tejesh R wrote: >> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. >> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated review comments Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24439#pullrequestreview-2862368075 From serb at openjdk.org Thu May 22 19:48:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 19:48:53 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v2] In-Reply-To: <4E77iDP7SuXUkZWoGilK72r3FJevFbABugEyzd9ZDGU=.6d0e3b19-0c82-43e6-a17c-2fc91137a9eb@github.com> References: <4E77iDP7SuXUkZWoGilK72r3FJevFbABugEyzd9ZDGU=.6d0e3b19-0c82-43e6-a17c-2fc91137a9eb@github.com> Message-ID: On Wed, 21 May 2025 08:32:46 GMT, Prasanta Sadhukhan wrote: > Now if we call setDividerLocation it will set [dividerLocationIsSet](https://github.com/openjdk/jdk/blob/91194517c75a96fe7bcc2dcf5e9c42af9cf5975a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#L1029) so even if `doReset `is true, it will not call `resetToPreferredSizes` but sets correct [divider location](https://github.com/openjdk/jdk/blob/91194517c75a96fe7bcc2dcf5e9c42af9cf5975a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java#L1436) I am looking into this. Just one unrelated question, why did we implemented in a way so we add and delete the left/right comps even if the orientation is not changed? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2902381713 From serb at openjdk.org Thu May 22 19:57:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 19:57:53 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Thu, 22 May 2025 17:37:42 GMT, Harshitha Onkar wrote: >> test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 88: >> >>> 86: >>> 87: private static void createTestUI() { >>> 88: frame = new Frame(); >> >> You do not need to call all these methods on the EDT, these are AWT components that should handle multithreaded usage (main/EDT/toolkit threads). It is possible that the issue is only reproducible on macOS due to synchronization problems related to the metal pipeline? > > Recent AWT test updates have UI creation wrapped in EDT. I have seen many reviewers recommend using EDT even with AWT components. > > Recently came across another PR where EDT is recommended. > https://github.com/openjdk/jdk/pull/25278#discussion_r2098939094 > https://github.com/openjdk/jdk/pull/25278#discussion_r2100689626 For external use in apps we can recommend it so it will be unified for swing and awt, but for internal use we cannot simply switch to EDT as a cleanup or a bug fix. The code related to awt/2d runs in various threads and must be properly synchronized. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2103303179 From serb at openjdk.org Thu May 22 20:01:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 20:01:54 GMT Subject: RFR: 8139228: JFileChooser renders file names as HTML document [v5] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 06:57:38 GMT, Tejesh R wrote: >> The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. >> The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated review comments Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24439#pullrequestreview-2862429352 From serb at openjdk.org Thu May 22 20:11:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 20:11:53 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v5] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Wed, 21 May 2025 12:33:40 GMT, Nikita Gubarkov wrote: >> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. >> >> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > fixup! 8355904: Use variadic macros for J2dTrace src/java.desktop/windows/native/libawt/java2d/d3d/D3DShaderGen.c line 59: > 57: // REMIND > 58: //#define J2dTraceLn(a, b) fprintf(stderr, "%s\n", b); > 59: //#define J2dTraceLn(a, b, c) fprintf(stderr, b, c); It looks like the above commented J2dTraceLn for arguments 0 and 1 now conflicts? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2103321639 From dnguyen at openjdk.org Thu May 22 20:21:49 2025 From: dnguyen at openjdk.org (Damon Nguyen) Date: Thu, 22 May 2025 20:21:49 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } The conditions for the case where we'd return "as-is" makes sense to me. I tested these with & without the changes as well and saw some reductions to the total elapsed runtime. Although some are small, there's some variance and I never saw an increase to the runtime total. Change LGTM. ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/25193#pullrequestreview-2862472099 From duke at openjdk.org Thu May 22 20:26:51 2025 From: duke at openjdk.org (duke) Date: Thu, 22 May 2025 20:26:51 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } @gredler Your change (at version b0f194a43769d3d5a6b4d2befe03d96a5b01ef8a) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25193#issuecomment-2902464077 From honkar at openjdk.org Thu May 22 20:35:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 22 May 2025 20:35:52 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 19 May 2025 12:26:54 GMT, Daniel Gredler wrote: >> `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. >> >> `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. >> >> However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. >> >> I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. >> >> In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). >> >> The following three existing test classes provide good regression test coverage for this change: >> - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto >> - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub >> - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest >> >> >> public class LineBreakMeasurerPerfTest { >> >> public static void main(String[] args) { >> >> float advance = 0; >> long start = System.currentTimeMillis(); >> AttributedString string = new AttributedString("This is a test."); >> FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); >> >> for (int i = 0; i < 100_000; i++) { >> LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); >> TextLayout layout = measurer.nextLayout(999); // large enough to not require break >> advance = Math.max(advance, layout.getAdvance()); >> } >> >> long end = System.currentTimeMillis(); >> System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); >> } >> >> } > > If any reviewers have some extra cycles, I'd appreciate a second review on this one. Thanks! @gredler I'm in the process of reviewing it. I can sponsor the PR once done with testing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25193#issuecomment-2902500432 From ngubarkov at openjdk.org Thu May 22 20:44:30 2025 From: ngubarkov at openjdk.org (Nikita Gubarkov) Date: Thu, 22 May 2025 20:44:30 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v6] In-Reply-To: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: > J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. > > Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: Update D3DShaderGen.c ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24949/files - new: https://git.openjdk.org/jdk/pull/24949/files/98ec5087..41ce75f2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24949&range=04-05 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24949.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24949/head:pull/24949 PR: https://git.openjdk.org/jdk/pull/24949 From ngubarkov at openjdk.org Thu May 22 20:44:30 2025 From: ngubarkov at openjdk.org (Nikita Gubarkov) Date: Thu, 22 May 2025 20:44:30 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v5] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Thu, 22 May 2025 20:09:19 GMT, Sergey Bylokhov wrote: >> Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: >> >> fixup! 8355904: Use variadic macros for J2dTrace > > src/java.desktop/windows/native/libawt/java2d/d3d/D3DShaderGen.c line 59: > >> 57: // REMIND >> 58: //#define J2dTraceLn(a, b) fprintf(stderr, "%s\n", b); >> 59: //#define J2dTraceLn(a, b, c) fprintf(stderr, b, c); > > It looks like the above commented J2dTraceLn for arguments 0 and 1 now conflicts? Should be better now ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24949#discussion_r2103367518 From prr at openjdk.org Thu May 22 21:11:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 21:11:54 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Tue, 13 May 2025 03:42:27 GMT, Sergey Bylokhov wrote: > > Moreover, it looks like as part of the "unification" the fix dropped clamping code in Robot (!) > > https://cr.openjdk.org/%7Epchelko/9/8035568/webrev.02/src/macosx/native/sun/awt/CRobot.m.udiff.html > > That code executed only if the current mouse position is unknown or outside of the mainscreen, that native code was moved to the java level into the CRobot class by the patch: https://cr.openjdk.org/~pchelko/9/8035568/webrev.02/src/macosx/classes/sun/lwawt/macosx/CRobot.java.sdiff.html ah, that's the code that executes only once, first time when robot doesn't yet "know" where it believes the pointer is. interesting that it clamps in this case. But it isn't multi-display capable. The native reproducer shows the same behaviour as the JDK. We can send it to Apple but the code in this PR should be pushed ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2902578649 From honkar at openjdk.org Thu May 22 21:22:51 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 22 May 2025 21:22:51 GMT Subject: RFR: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } LGTM. Ran LineBreakMeasurer tests, in particular the manual test LineBreakWithTracking.java to see if there was an effect of tracking + manual window resize on the line break lengths. There were multiple instances when the same object was returned so the fix looks beneficial in those case. Did not observe any regressions. With the POC, noticed ~1000ms difference without and with fix on some runs. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25193#pullrequestreview-2862595417 From dgredler at openjdk.org Thu May 22 21:27:55 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 22 May 2025 21:27:55 GMT Subject: Integrated: 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed In-Reply-To: References: Message-ID: On Mon, 12 May 2025 20:35:52 GMT, Daniel Gredler wrote: > `LineBreakMeasurer.nextLayout()` calls `nextOffset()` internally to calculate the layout limit. When this happens, a `GlyphVector` is created and the layout engine is invoked to shape the text. The `GlyphVector` is cached in the relevant `ExtendedTextSourceLabel` component. > > `LineBreakMeasurer.nextLayout()` then calls `TextMeasurer.getLayout()` which eventually asks that same `ExtendedTextSourceLabel` component for a subset component. This triggers the creation of a fresh `ExtendedTextSourceLabel` without the cached `GlyphVector`. > > However, this fresh `ExtendedTextSourceLabel` is not necessary if the subset requested perfectly matches the already-existing `ExtendedTextSourceLabel` component. This happens when the text is short enough that no line break is needed. > > I think we should change `ExtendedTextSourceLabel.getSubset()` to return `this` if the requested subset is identical to the existing instance. This will allow us to use the existing cached `GlyphVector`, and the call to `LineBreakMeasurer.nextLayout()` will trigger text shaping once, rather than twice. > > In local testing, the test program below ran in ~1250 ms before this optimization, and ran in ~960 ms after the change (a 23% reduction in run time). > > The following three existing test classes provide good regression test coverage for this change: > - test/jdk/java/awt/font/LineBreakMeasurer/LineBreakWithTrackingAuto > - test/jdk/java/awt/font/LineBreakMeasurer/TestLineBreakWithFontSub > - test/jdk/java/awt/font/LineBreakMeasurer/FRCTest > > > public class LineBreakMeasurerPerfTest { > > public static void main(String[] args) { > > float advance = 0; > long start = System.currentTimeMillis(); > AttributedString string = new AttributedString("This is a test."); > FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true); > > for (int i = 0; i < 100_000; i++) { > LineBreakMeasurer measurer = new LineBreakMeasurer(string.getIterator(), frc); > TextLayout layout = measurer.nextLayout(999); // large enough to not require break > advance = Math.max(advance, layout.getAdvance()); > } > > long end = System.currentTimeMillis(); > System.out.println((end - start) + " ms elapsed (advance: " + advance + ")"); > } > > } This pull request has now been integrated. Changeset: fdda7661 Author: Daniel Gredler Committer: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/fdda7661906eab63d939e9f482449e21cc143c8f Stats: 8 lines in 1 file changed: 7 ins; 0 del; 1 mod 8356814: LineBreakMeasurer.nextLayout() slower than necessary when no break needed Reviewed-by: prr, dnguyen, honkar ------------- PR: https://git.openjdk.org/jdk/pull/25193 From prr at openjdk.org Thu May 22 21:28:53 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 21:28:53 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: <1Z5g-LlFwSPrcqtTBmrDetQQL7_hF0j73n-37JRCpug=.3a763994-156c-44fb-8945-f02b1994e620@github.com> References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> <1Z5g-LlFwSPrcqtTBmrDetQQL7_hF0j73n-37JRCpug=.3a763994-156c-44fb-8945-f02b1994e620@github.com> Message-ID: <2QcYZvy5pjx8J6Fi6j59uiHSfnqkp1yUHakx2qsxzKw=.d5720f94-adb8-4f86-aeed-e403c8e43066@github.com> On Thu, 15 May 2025 12:33:06 GMT, Raffaello Giulietti wrote: >>> maybe this is just a translation error and a simple space can be used instead, like in all the other properties in these files? >> >> That seems unlikely. The pattern is used consistently in the French translations, where `Foo:` in the original is replaced with `Foo :` with a non-breaking space. I guess it is a French orthographic rule to have a space before the colon, and I understand why it really must be non-breaking in that case. > > FYI, the style guide for France [recommends](https://fr.wikipedia.org/wiki/Espace_ins%C3%A9cable#En_France): > > - U+202F (Narrow No-Break Space NNBSP) preceding semicolon, question mark, and exclamation mark. > - U+00A0 (No-Break Space NBSP) preceding colon. > > Similar conventions are used in other French speaking countries. > No, it doesn't. I still agree with that fix -- the overwhelming majority of characters should indeed be UTF-8 instead of unicode sequences. > This is about a very specific character, that is impossible to visually tell the difference on screen from ordinary space. I didn't say it reversed that entire changeset. I am saying that the previous changeset for L10N changed the Java unicode escape to UTF-8 for the localised message string. You propose restoring it to Java escape. I wouldn't be surprised if the next message drop reverses what you reversed. I don't know what tools the L10N team use but there's a chance it doesn't handle Java escapes since that is very much a Java thing. So you are probably making the translation job harder. So I am suggesting you leave all of the translation files as is. Which might mean withdrawing this PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2103421828 From prr at openjdk.org Thu May 22 21:34:50 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 21:34:50 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 14:29:23 GMT, Magnus Ihse Bursie wrote: > After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. Just speaking for the one client demo. Someone else will need to review the other 98% of this PR ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25229#pullrequestreview-2862613813 From serb at openjdk.org Thu May 22 21:35:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 21:35:55 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Thu, 22 May 2025 21:09:33 GMT, Phil Race wrote: > The native reproducer shows the same behaviour as the JDK. > We can send it to Apple but the code in this PR should be pushed So Java works like any other native apps that emits native events, let's see what the response will be. This is not a regression and is not reported by some customers, it is not even clear if this is a bug and not an OS feature, no need to rush w/o Apple's response. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2902622708 From prr at openjdk.org Thu May 22 21:45:52 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 21:45:52 GMT Subject: RFR: 8356977: UTF-8 cleanups In-Reply-To: References: Message-ID: On Wed, 14 May 2025 14:23:31 GMT, Magnus Ihse Bursie wrote: > I found a few other places in the code that can be cleaned up after the conversion to UTF-8. src/java.desktop/share/classes/java/awt/MenuShortcut.java line 49: > 47: * For example, a menu shortcut for "Ctrl+cyrillic ef" is created by > 48: *

> 49: * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('?'), false); This is javadoc inJava SE specification. As is the Action case below. I can't think of any actual harm from this change, so OK, but I am not seeing why it is needed. test/jdk/java/awt/font/TextLayout/RotFontBoundsTest.java line 63: > 61: > 62: private static final String INSTRUCTIONS = > 63: "A string \u201C" + TEXT + "\u201D is drawn at eight different " I really don't like these tests being changed. It isn't part of the JDK build. People compile these in all sorts of locales. Please revert all the changes in the client tests. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2103439338 PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2103431874 From prr at openjdk.org Thu May 22 21:51:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 21:51:54 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: <6B_XF-1U3nX2mJ6lQbA4XDgCAOV_CowpksH2OcY1QVw=.79131b1b-d2bc-4d00-aaf1-6c3e3a65bdc8@github.com> On Thu, 22 May 2025 21:33:22 GMT, Sergey Bylokhov wrote: > > The native reproducer shows the same behaviour as the JDK. > > We can send it to Apple but the code in this PR should be pushed > > So Java works like any other native apps that emits native events, let's see what the response will be. This is not a regression and is not reported by some customers, it is not even clear if this is a bug and not an OS feature, no need to rush w/o Apple's response. Let's look at the outcomes - No answer from Apple - Apple say its a feature - Apple say it is a bug but they won't fix it - Apple say its a bug and will be fixed in a future macOS even in the last case a fix in JDK would help all existing OSes. So I don't follow the reasoning of waiting for any of the above answers - likely for many months but most likely (the 90% case) forever. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2902650268 From achung at openjdk.org Thu May 22 22:02:55 2025 From: achung at openjdk.org (Alisen Chung) Date: Thu, 22 May 2025 22:02:55 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. Tested locally on macOS and test fails before the change and passes after the change. ------------- Marked as reviewed by achung (Committer). PR Review: https://git.openjdk.org/jdk/pull/25340#pullrequestreview-2862659052 From kizune at openjdk.org Thu May 22 22:25:52 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 22 May 2025 22:25:52 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v3] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 16:27:10 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25294#pullrequestreview-2862701456 From prr at openjdk.org Thu May 22 22:33:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 22:33:54 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 21:28:24 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 This API is not so different than the Applet AudioClip because it is a simple replacement for that which is intended to be used by desktop apps - not browsers any more. In that sense the preview of it has been there since 1995 so I think we are good. In the future, like any class, new methods can be added but the ones it has now are the ones that it needs to start with. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2902750767 From prr at openjdk.org Thu May 22 22:38:53 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 22 May 2025 22:38:53 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V wrote: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. I build and tested this on x64 - subjecting it to abuse running SwingSet .. unplugging and plugging back the external monitor, sleeping .. plugging in a monitor while asleep etc etc. No bad behaviour. ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25342#pullrequestreview-2862716745 From serb at openjdk.org Thu May 22 22:44:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 22:44:57 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <6B_XF-1U3nX2mJ6lQbA4XDgCAOV_CowpksH2OcY1QVw=.79131b1b-d2bc-4d00-aaf1-6c3e3a65bdc8@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> <6B_XF-1U3nX2mJ6lQbA4XDgCAOV_CowpksH2OcY1QVw=.79131b1b-d2bc-4d00-aaf1-6c3e3a65bdc8@github.com> Message-ID: <2n9mu-N3o0vaLwsOFRq6vhXzYU3MZSiShd-JAffaPGs=.cb1dd1ec-c0b7-4668-8e9c-e09d2f9cd75d@github.com> On Thu, 22 May 2025 21:48:48 GMT, Phil Race wrote: > So I don't follow the reasoning of waiting for any of the above answers - likely for many months but most likely (the 90% case) forever. We won?t wait forever of course, and will review the proposal carefully soon. But it would be great if macOS gets updated and we can skip the change on our side. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2902765444 From serb at openjdk.org Thu May 22 23:35:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 22 May 2025 23:35:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: <1e7XIETciaopHgtZIUEcjZ6pfOoj3PrvtXJLr3xZyFk=.0d55067f-af6d-4aef-8653-9e501e938c5f@github.com> On Thu, 22 May 2025 22:31:33 GMT, Phil Race wrote: >This API is not so different than the Applet AudioClip because it is a simple replacement for that which is intended to be used by desktop apps - not browsers any more. Sure the implementation here is identical to the decades old Applet.AudioClip (deprecated for 9 years!), but is that really a good thing? Shouldn?t we take this opportunity to improve the API or at the very least, document its limitations and intended use more clearly? JavaFX, for example, is better documented. There may also be other patterns or audio playback features "in the wild" Java that would be worth considering as part of a more modern solution. Regarding the current patch, I still have a few questions and suggestions: - Why is IllegalArgumentException used instead of NullPointerException? The entire sound/media stack consistently uses NPE for null checks, and most recent JavaSE APIs (e.g., FFM, StableValue, ScopedValue, etc.) follow this pattern. NPE is just better. what are the pros for IAE? - Why we do not document that the application will not exit if a clip is playing (and will never exit if loop() was called)? This is an important behavioral detail, similar to what is documented in [AWT threading issues](https://github.com/openjdk/jdk/blob/fdda7661906eab63d939e9f482449e21cc143c8f/src/java.desktop/share/classes/java/awt/doc-files/AWTThreadIssues.html#L108). - The synchronized keyword appears unnecessary in the current implementation. It can be dropped now and reconsidered later - possibly with another concurrency primitives. - The multithreaded behavior and asynchronous nature of the API are not described. - There?s no mention of preloading behavior. For example, JavaFX explicitly documents this. - The tests don't cover the next part of the spec: > ?If the implementation does not find a suitable output device for the data, playing the clip will be a no-op.? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2902853177 From dnguyen at openjdk.org Thu May 22 23:37:53 2025 From: dnguyen at openjdk.org (Damon Nguyen) Date: Thu, 22 May 2025 23:37:53 GMT Subject: RFR: 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 In-Reply-To: References: Message-ID: On Wed, 21 May 2025 13:13:46 GMT, Manukumar V S wrote: > ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64 > Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied. > > Fix: > The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test. > Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds). > > Testing: > After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate . I tested the changes locally and through CI. The test now passes seemingly consistently when removed from the problem list. I ran it with 50 repeats on all OS's with no failures. In addition to testing the changes as shown in this PR, I also tested with just adding the timeout (without the screen capture change), and it still passes (which might hint at the timeout being related to the primary issue here). However, I still prefer the changes made. test/jdk/java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java line 175: > 173: } > 174: > 175: private void colorCheck(int x, int y, Color expectedColor, boolean mustBeExpectedColor,BufferedImage screenCapture) { Suggestion: private void colorCheck(int x, int y, Color expectedColor, boolean mustBeExpectedColor, BufferedImage screenCapture) { ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/25354#pullrequestreview-2862625754 PR Review Comment: https://git.openjdk.org/jdk/pull/25354#discussion_r2103436161 From kbarrett at openjdk.org Thu May 22 23:53:52 2025 From: kbarrett at openjdk.org (Kim Barrett) Date: Thu, 22 May 2025 23:53:52 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Change builds without warning with clang 19. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25217#issuecomment-2902873876 From honkar at openjdk.org Fri May 23 00:35:02 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 23 May 2025 00:35:02 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 Tested the fix on macOS it works as expected and the native reproducer (attached to JBS) highlights the offscreen point issue and the need for clamping. The fix looks good to me, I may require some time to catch up on the previous review comments before approving (there has been a lot of update since I last reviewed). src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java line 102: > 100: private Point calcClosestPoint(int x, int y, Rectangle screenBounds) { > 101: return new Point(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width-1), > 102: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height-1)); Suggestion: return new Point(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width - 1), Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height - 1)); test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 80: > 78: } > 79: return p; > 80: } I believe validateOffScreen() was added to prevent edge or boundary case rounding error as observed here - https://github.com/openjdk/jdk/pull/22781/files#r1926210713 ------------- PR Review: https://git.openjdk.org/jdk/pull/22781#pullrequestreview-2862874069 PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2103597214 PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2103598862 From mvs at openjdk.org Fri May 23 02:27:04 2025 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 23 May 2025 02:27:04 GMT Subject: Integrated: 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java In-Reply-To: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> References: <8kFcDBl8MwgKZR_8NNwnkyH7wfe5gUyjTIc9tKNAVL8=.c02ed18e-d7ac-4b30-9f00-9c460db4c0ee@github.com> Message-ID: <3sSf2YyVM6upNng2YNSq273bMBsoLHSEKN0r4XTIqf4=.a40e0c41-86cc-4e08-a94d-7d09647ed54b@github.com> On Tue, 20 May 2025 07:32:41 GMT, Manukumar V S wrote: > There are some compilation failures noticed in the recently open sourced test javax/swing/JMenuItem/bug6197830.java. The compilation failures are due to missing import statements and a missing dependency file MenuItemTest.java. > > Fix: I have added the required import statements and added the code-piece from MenuItemTest.java as a method getMenuItemTestFrame(). This pull request has now been integrated. Changeset: a94d1a04 Author: Manukumar V S Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/a94d1a04076c64f983e508c4da2e59a8aab5e4c5 Stats: 551 lines in 5 files changed: 291 ins; 260 del; 0 mod 8357305: Compilation failure in javax/swing/JMenuItem/bug6197830.java Reviewed-by: aivanov ------------- PR: https://git.openjdk.org/jdk/pull/25319 From duke at openjdk.org Fri May 23 02:27:59 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 23 May 2025 02:27:59 GMT Subject: Integrated: 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine In-Reply-To: References: Message-ID: On Thu, 15 May 2025 04:05:38 GMT, Jeremy Wood wrote: > Unfortunately I'm unable to reproduce this failure. I slowed the test down; it passes on my machine before and after this PR. > > I added a little bit of logging that might also help identify what's happening. > > Does anyone have any more suggestions? This pull request has now been integrated. Changeset: 4193d052 Author: jeremy Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/4193d052c0ae2336d816d0e76dec5420aa386465 Stats: 225 lines in 1 file changed: 58 ins; 98 del; 69 mod 8356061: [macos] com/apple/laf/RootPane/RootPaneDefaultButtonTest.java test fails on macosx-aarch64 machine Reviewed-by: jdv, serb ------------- PR: https://git.openjdk.org/jdk/pull/25244 From mvs at openjdk.org Fri May 23 02:53:51 2025 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 23 May 2025 02:53:51 GMT Subject: RFR: 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 [v2] In-Reply-To: References: Message-ID: > ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64 > Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied. > > Fix: > The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test. > Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds). > > Testing: > After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate . Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: Formatting changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25354/files - new: https://git.openjdk.org/jdk/pull/25354/files/7512d0e2..9beabcbb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25354&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25354&range=00-01 Stats: 8 lines in 1 file changed: 4 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25354.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25354/head:pull/25354 PR: https://git.openjdk.org/jdk/pull/25354 From abhiscxk at openjdk.org Fri May 23 04:38:07 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 23 May 2025 04:38:07 GMT Subject: Integrated: 8356145: ListEnterExitTest.java fails on macos In-Reply-To: References: Message-ID: <3N4ke7kqMG-Z0XFCoNsQePl5DEcGGODm00RaPoD1rgs=.0dc42407-c3f9-498f-82dd-6b9b12d1258f@github.com> On Mon, 19 May 2025 08:15:29 GMT, Abhishek Kumar wrote: > Test was failing on macOS 14.7.1 system in CI pipeline. Logged output suggests that the mouse exit event is not triggered and thus the test fails. > Increased number of list items and adjusted the X and Y offset for mouse move events, so the mouse pointer will be within the frame and added robot delay to stabilize the test. > > Verified the updated test in CI on macOS 14.7 machine and there is no failure. This pull request has now been integrated. Changeset: 99e01301 Author: Abhishek Kumar URL: https://git.openjdk.org/jdk/commit/99e01301cd7f063f167db107d31468b1d3f901aa Stats: 64 lines in 1 file changed: 22 ins; 26 del; 16 mod 8356145: ListEnterExitTest.java fails on macos Reviewed-by: aivanov, jdv, kizune ------------- PR: https://git.openjdk.org/jdk/pull/25299 From serb at openjdk.org Fri May 23 05:45:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 23 May 2025 05:45:56 GMT Subject: RFR: 8356145: ListEnterExitTest.java fails on macos [v3] In-Reply-To: References: Message-ID: On Wed, 21 May 2025 12:15:59 GMT, Alexey Ivanov wrote: >I wonder if this system reproduces other bugs where expected events aren't received? such as java/awt/event/KeyEvent/FunctionKeyTest.java ([JDK-8343104](https://bugs.openjdk.org/browse/JDK-8343104)) and java/awt/List/ItemEventTest/ItemEventTest.java ([JDK-8204221](https://bugs.openjdk.org/browse/JDK-8204221)). Was it actually a testbug? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25299#issuecomment-2903328952 From psadhukhan at openjdk.org Fri May 23 08:05:38 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 23 May 2025 08:05:38 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Set orientation only if changed...add headful in test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25294/files - new: https://git.openjdk.org/jdk/pull/25294/files/42c7c575..32fe70f5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=02-03 Stats: 19 lines in 2 files changed: 2 ins; 0 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/25294.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294 PR: https://git.openjdk.org/jdk/pull/25294 From psadhukhan at openjdk.org Fri May 23 08:05:38 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 23 May 2025 08:05:38 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v3] In-Reply-To: References: Message-ID: <4lP3w55MV3fs3q8skCPRzfiUk5MguC9rXzBUVTvTIjY=.e9e2c269-de66-4e55-8369-7b44459ddcd3@github.com> On Thu, 22 May 2025 16:27:10 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix OK..Modified PR so SpliPane components orientation set newly only if orientation is changed.. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25294#issuecomment-2903616419 From kizune at openjdk.org Fri May 23 08:57:54 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Fri, 23 May 2025 08:57:54 GMT Subject: RFR: 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 [v2] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 02:53:51 GMT, Manukumar V S wrote: >> ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64 >> Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied. >> >> Fix: >> The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test. >> Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds). >> >> Testing: >> After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate . > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Formatting changes Looks fine. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25354#pullrequestreview-2863722947 From kizune at openjdk.org Fri May 23 08:58:51 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Fri, 23 May 2025 08:58:51 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 08:05:38 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Set orientation only if changed...add headful in test Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25294#pullrequestreview-2863725229 From duke at openjdk.org Fri May 23 09:06:52 2025 From: duke at openjdk.org (duke) Date: Fri, 23 May 2025 09:06:52 GMT Subject: RFR: 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 [v2] In-Reply-To: References: Message-ID: <1HQZdyfRYMn9t0wFD32n0047AisfhkzKAfoHUihkwUM=.48a974ab-2474-4a9e-9077-7d96dd29ff78@github.com> On Fri, 23 May 2025 02:53:51 GMT, Manukumar V S wrote: >> ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64 >> Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied. >> >> Fix: >> The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test. >> Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds). >> >> Testing: >> After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate . > > Manukumar V S has updated the pull request incrementally with one additional commit since the last revision: > > Formatting changes @manukumarvs Your change (at version 9beabcbb5a55298c46db897b85ee7d9031599bf2) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25354#issuecomment-2903778221 From avu at openjdk.org Fri May 23 10:23:53 2025 From: avu at openjdk.org (Alexey Ushakov) Date: Fri, 23 May 2025 10:23:53 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V wrote: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. Changes requested by avu (Committer). src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 52: > 50: - (void) createDisplayLink { > 51: CVReturn r = CVDisplayLinkCreateWithActiveCGDisplays(&displayLink); > 52: if (r != kCVReturnSuccess) { We may still miss an update of the window for a noticeable time (depending on the application code) because DisplayLink will not work during the retry period. src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 54: > 52: if (r != kCVReturnSuccess) { > 53: if (self.displayLinkFailCount == 5) { > 54: // We have tried for 5 seconds to create CVDisplayLink It would be better to move this magic number to the beginning of the file as a verbose constant. Also, for reliability reasons, I would prefer the `>=` check here. ------------- PR Review: https://git.openjdk.org/jdk/pull/25342#pullrequestreview-2860218856 PR Review Comment: https://git.openjdk.org/jdk/pull/25342#discussion_r2101917612 PR Review Comment: https://git.openjdk.org/jdk/pull/25342#discussion_r2101924670 From avu at openjdk.org Fri May 23 10:23:54 2025 From: avu at openjdk.org (Alexey Ushakov) Date: Fri, 23 May 2025 10:23:54 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Thu, 22 May 2025 14:30:13 GMT, Jayathirth D V wrote: >> Is it possible that it is somehow related to 8304825? could be the layer created "during display sleep" and that might be in "sleep" more that 5 seconds? > >> Is it possible that it is somehow related to 8304825? could be the layer created "during display sleep" and that might be in "sleep" more that 5 seconds? > > This is a follow-up fix for JDK-8304825. Basically we have a race condition because of timing issue when we are rendering many frame with animations. On screen wakeup CVDisplayLinkCreateWithActiveCGDisplays is failing because Active display list is still empty and we never create a displayLink and content to MTLLayer are never updated. By adding 5 retries with 1 second gap after screen wakeup we are making sure that we are able to create displayLink for all active displays. @jayathirthrao What is about my comments? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25342#issuecomment-2903974626 From duke at openjdk.org Fri May 23 10:26:54 2025 From: duke at openjdk.org (duke) Date: Fri, 23 May 2025 10:26:54 GMT Subject: RFR: 8334016: Make PrintNullString.java automatic [v6] In-Reply-To: References: Message-ID: <1EQYX0DTHBjACg3iUPnuvp4cY8S3ldV22a6Cicc4gl4=.6f05b241-17c4-478d-ae5d-2ceea598bb62@github.com> On Thu, 22 May 2025 11:24:34 GMT, Renjith Kannath Pariyangad wrote: >> Hi Reviewers, >> >> I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. >> >> Please review and let me know your suggestions. > > Renjith Kannath Pariyangad has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/print/PrinterJob/PrintNullString.java > > Co-authored-by: Alexey Ivanov @Renjithkannath Your change (at version 01041aa340e75fac16d8addef4270476552e9a92) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24501#issuecomment-2903985497 From jdv at openjdk.org Fri May 23 11:38:32 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Fri, 23 May 2025 11:38:32 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep [v2] In-Reply-To: References: Message-ID: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: Add macro ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25342/files - new: https://git.openjdk.org/jdk/pull/25342/files/1e193339..549f825f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25342&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25342&range=00-01 Stats: 5 lines in 2 files changed: 1 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/25342.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25342/head:pull/25342 PR: https://git.openjdk.org/jdk/pull/25342 From rmarchenko at openjdk.org Fri May 23 11:48:38 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 23 May 2025 11:48:38 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v13] In-Reply-To: References: Message-ID: > Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. > > Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. > > --------- > `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. > > When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: > > - In case of a clash with a class method, the class version will take precedence rather than interface's one. > - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. > - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. > > `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: > > * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. > * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). > * Gettters/setters declared and not implemented are not considered. Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: Restored the original order processing ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23443/files - new: https://git.openjdk.org/jdk/pull/23443/files/980ebde5..431705a0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=11-12 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/23443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23443/head:pull/23443 PR: https://git.openjdk.org/jdk/pull/23443 From rmarchenko at openjdk.org Fri May 23 11:48:39 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 23 May 2025 11:48:39 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v12] In-Reply-To: References: <0645YLoDLjcLbjQxBs3QFCFVvenQjAeJlZANZ0hay_8=.e50b8551-4a2f-4cc5-b910-5f5544beb1f7@github.com> Message-ID: <-76yVSjHyZOGJGVcySdiBScPH6Si-zEztJ1rMNhG_OE=.5809f733-8a59-49d4-bf38-b7b7041ce9e3@github.com> On Wed, 30 Apr 2025 12:25:50 GMT, Alexey Ivanov wrote: >> src/java.desktop/share/classes/java/beans/Introspector.java line 1060: >> >>> 1058: MethodDescriptor composite = new MethodDescriptor(old, md); >>> 1059: methods.put(name, composite); >>> 1060: } >> >> FYI, one of the JCK introspector tests fails because of this change. >> The test is quite complicated, so I am not able to provide a simple reproducer right away. But I'll post it later. > >> FYI, one of the JCK introspector tests fails because of this change. The test is quite complicated, so I am not able to provide a simple reproducer right away. But I'll post it later. > > Indeed, there are some failures of JCK Introspector tests. I restored the original order processing, now seems OK for me locally. Could you review, please? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23443#discussion_r2104418535 From rmarchenko at openjdk.org Fri May 23 11:48:38 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 23 May 2025 11:48:38 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v12] In-Reply-To: <0645YLoDLjcLbjQxBs3QFCFVvenQjAeJlZANZ0hay_8=.e50b8551-4a2f-4cc5-b910-5f5544beb1f7@github.com> References: <0645YLoDLjcLbjQxBs3QFCFVvenQjAeJlZANZ0hay_8=.e50b8551-4a2f-4cc5-b910-5f5544beb1f7@github.com> Message-ID: <8QULiCj0kBzOqwNOKeb5uhPgtZ-5ni_q6akOEufB3_w=.796c48f8-2e1a-45c3-af33-2abb318beec7@github.com> On Thu, 3 Apr 2025 09:21:38 GMT, Roman Marchenko wrote: >> Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. >> >> Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. >> >> --------- >> `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. >> >> When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: >> >> - In case of a clash with a class method, the class version will take precedence rather than interface's one. >> - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. >> - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. >> >> `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: >> >> * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. >> * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). >> * Gettters/setters declared and not implemented are not considered. > > Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: > > Fixing review comments Could you review, please? @aivanov-jdk @mrserb @azvegint ------------- PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2904162661 From jdv at openjdk.org Fri May 23 11:48:51 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Fri, 23 May 2025 11:48:51 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep [v2] In-Reply-To: References: Message-ID: On Thu, 22 May 2025 08:07:34 GMT, Alexey Ushakov wrote: >> Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: >> >> Add macro > > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 52: > >> 50: - (void) createDisplayLink { >> 51: CVReturn r = CVDisplayLinkCreateWithActiveCGDisplays(&displayLink); >> 52: if (r != kCVReturnSuccess) { > > We may still miss an update of the window for a noticeable time (depending on the application code) because DisplayLink will not work during the retry period. This timing issue is happening is very rare stress based scenario and we don't want to continuously query for active displays to create DisplayLink. Having a delay of 1 sec is to make sure we can create DisplayLink reliably. It's okay if there are no updates to UI in such scenario right after we wake up the screen from sleep. > src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLLayer.m line 54: > >> 52: if (r != kCVReturnSuccess) { >> 53: if (self.displayLinkFailCount == 5) { >> 54: // We have tried for 5 seconds to create CVDisplayLink > > It would be better to move this magic number to the beginning of the file as a verbose constant. Also, for reliability reasons, I would prefer the `>=` check here. I added comment to explain 5 seconds count, but its better to use constant i have added the same. All selectors will be queued into same thread run loops, i don't see any way where we will skip 5th count. To be extra cautious i have updated the check to `>=`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25342#discussion_r2104420999 PR Review Comment: https://git.openjdk.org/jdk/pull/25342#discussion_r2104421094 From mvs at openjdk.org Fri May 23 11:58:56 2025 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 23 May 2025 11:58:56 GMT Subject: Integrated: 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 In-Reply-To: References: Message-ID: <3ukjAwjiG2X27glC8w5f7OsXy6NCTX5h3qC_EsTZ-FY=.2146b111-5bc4-4904-bc45-1cd4cc54c13b@github.com> On Wed, 21 May 2025 13:13:46 GMT, Manukumar V S wrote: > ShapeNotSetSometimes.java fails intermittently with a RuntimeException on macOS-aarch64 > Test threw exception: java.lang.RuntimeException: Test failed. The shape has not been applied. > > Fix: > The test has been modified to take a screenshot of the area and then analyse the pixel color in the screenshot rather than getting individual pixels from the screen for each test. > Also the timeout of the test has been increased to 5 minutes(300 seconds) as sometimes it times out with the default timeout of 2 minutes(120 seconds). > > Testing: > After fixing the test, it has been run 40 times per platform(Windows, Linux, MacOS x64 and MacOS aarch64) using Mach5 and got 100% pass rate . This pull request has now been integrated. Changeset: 84a67e83 Author: Manukumar V S Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/84a67e83e3f4fcb6be6802d12b0788850a3845b5 Stats: 18 lines in 2 files changed: 7 ins; 5 del; 6 mod 8341370: Test java/awt/Frame/ShapeNotSetSometimes/ShapeNotSetSometimes.java fails intermittently on macOS-aarch64 Reviewed-by: kizune, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/25354 From rkannathpari at openjdk.org Fri May 23 12:00:01 2025 From: rkannathpari at openjdk.org (Renjith Kannath Pariyangad) Date: Fri, 23 May 2025 12:00:01 GMT Subject: Integrated: 8334016: Make PrintNullString.java automatic In-Reply-To: References: Message-ID: <39BIalxhf_wvNilAyWr-AD7phOMyefjofx-kSSExFjo=.211d7be5-c273-47b4-ac70-b1e50f7a5c07@github.com> On Tue, 8 Apr 2025 08:58:45 GMT, Renjith Kannath Pariyangad wrote: > Hi Reviewers, > > I have updated the test and made it semi-automatic (need to click "Print") . Test will initiate a print and result will be generated automatic. > > Please review and let me know your suggestions. This pull request has now been integrated. Changeset: f5e6d2c9 Author: Renjith Kannath Pariyangad Committer: SendaoYan URL: https://git.openjdk.org/jdk/commit/f5e6d2c93c3274e465c42709b7634463899fdf2e Stats: 163 lines in 1 file changed: 37 ins; 88 del; 38 mod 8334016: Make PrintNullString.java automatic Reviewed-by: aivanov, prr, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/24501 From erikj at openjdk.org Fri May 23 13:13:03 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 23 May 2025 13:13:03 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> References: <7-rIMrKvXN94Gem4dGXcebX4ncbfWfkwtRcKNmusGfU=.b57df64c-d2ee-4172-aa30-c1d6b6f59202@github.com> Message-ID: <1o9tnuwmzueQpfYaQv_aBRS59u-YQJH2Mo6SUFEL--w=.22557300-24f2-4c52-aec0-3d5581cf331a@github.com> On Wed, 14 May 2025 21:28:37 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > DTRACE added Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2864360229 From erikj at openjdk.org Fri May 23 13:13:04 2025 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 23 May 2025 13:13:04 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v2] In-Reply-To: References: Message-ID: <0Etgi_kK2tLB7ENsbgdH8vlRnHmVyd-VgYcAqmEMw-8=.0721912a-0d89-4118-9456-f5dcb633d9a8@github.com> On Tue, 13 May 2025 18:33:40 GMT, Alexey Ivanov wrote: >> make/modules/java.desktop/lib/AwtLibraries.gmk line 281: >> >>> 279: DISABLED_WARNINGS_gcc_XlibWrapper.c := type-limits pointer-to-int-cast, \ >>> 280: DISABLED_WARNINGS_gcc_XRBackendNative.c := maybe-uninitialized, \ >>> 281: DISABLED_WARNINGS_gcc_XToolkit.c := unused-result, \ >> >> Probably a question for build team - >> One thing to be noted here is that: With unused-result line removed and WITHOUT the if block changes in XToolkit.c, I expected the build to fail due to unused-result on linux/gcc but it did not. >> So is there any chance that this disabled warning is being added from else where for gcc ? > > Maybe gcc doesn't detect this specific case. > > There could've been other cases which triggered the warning in gcc. It could be that not all versions of GCC trigger this warning in this particular case. We don't track disabling of warnings on a per version granularity, as that would be incredibly tedious, so it's hard to know. It could also be that this disabling of `unused-result` was added for a different case that has since disappeared. Regardless, since you are fixing such an issue in the code and no longer see this warning with a reasonably new GCC, it should be safe to remove this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25217#discussion_r2104557140 From honkar at openjdk.org Fri May 23 16:36:23 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 23 May 2025 16:36:23 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v3] In-Reply-To: References: Message-ID: <7UXyNl4k25yf_QXDsWbTwNydMieQS6Hrv2lq7C8O9QM=.12f497be-0849-476b-8ce7-0fa223b18065@github.com> > The following line results in unused-result warning on linux/clang. > > > /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function > declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] > 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); > > > There are two ways to handle it > > 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. > > > There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html > > > 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. > > NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25217/files - new: https://git.openjdk.org/jdk/pull/25217/files/91f3d409..ef89c987 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25217&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25217&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25217.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25217/head:pull/25217 PR: https://git.openjdk.org/jdk/pull/25217 From aivanov at openjdk.org Fri May 23 16:40:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 23 May 2025 16:40:53 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v3] In-Reply-To: <7UXyNl4k25yf_QXDsWbTwNydMieQS6Hrv2lq7C8O9QM=.12f497be-0849-476b-8ce7-0fa223b18065@github.com> References: <7UXyNl4k25yf_QXDsWbTwNydMieQS6Hrv2lq7C8O9QM=.12f497be-0849-476b-8ce7-0fa223b18065@github.com> Message-ID: On Fri, 23 May 2025 16:36:23 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > copyright year Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2865037159 From tr at openjdk.org Fri May 23 17:02:29 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 23 May 2025 17:02:29 GMT Subject: Integrated: 8139228: JFileChooser renders file names as HTML document In-Reply-To: References: Message-ID: On Fri, 4 Apr 2025 07:21:35 GMT, Tejesh R wrote: > The rendering of the directory names are handled as JLabel w.r.t Look and feel and also either Details/List view. Though FilePane creates basic rendering for these two few Look and Feel define their own renderers and also ComboBox Directory directory name view. Since HTML filtering is not taken care in any of these renderers, JLabel renders them as HTML document if nothing is set or specified. > The fix is to get "html.disable" property from JFileChooser and set the same to JLabel component which renders and set Directory name. Hence applications can either enable/disable this property and control HTML rendering of directory name. This pull request has now been integrated. Changeset: 917c1546 Author: Tejesh R URL: https://git.openjdk.org/jdk/commit/917c1546f353c2814de8465d1dfad66b01561f12 Stats: 189 lines in 8 files changed: 189 ins; 0 del; 0 mod 8139228: JFileChooser renders file names as HTML document Reviewed-by: prr, serb, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/24439 From ihse at openjdk.org Fri May 23 17:38:54 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 23 May 2025 17:38:54 GMT Subject: RFR: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 [v3] In-Reply-To: <7UXyNl4k25yf_QXDsWbTwNydMieQS6Hrv2lq7C8O9QM=.12f497be-0849-476b-8ce7-0fa223b18065@github.com> References: <7UXyNl4k25yf_QXDsWbTwNydMieQS6Hrv2lq7C8O9QM=.12f497be-0849-476b-8ce7-0fa223b18065@github.com> Message-ID: On Fri, 23 May 2025 16:36:23 GMT, Harshitha Onkar wrote: >> The following line results in unused-result warning on linux/clang. >> >> >> /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function >> declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] >> 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); >> >> >> There are two ways to handle it >> >> 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. >> >> >> There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html >> >> >> 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. >> >> NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > copyright year Marked as reviewed by ihse (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25217#pullrequestreview-2865224400 From honkar at openjdk.org Fri May 23 18:05:57 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 23 May 2025 18:05:57 GMT Subject: Integrated: JDK-8354316 : clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 In-Reply-To: References: Message-ID: On Tue, 13 May 2025 18:19:37 GMT, Harshitha Onkar wrote: > The following line results in unused-result warning on linux/clang. > > > /java.desktop/unix/native/libawt_xawt/xawt/XToolkit.c:695:9: error: ignoring return value of function > declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] > 695 | write ( AWT_WRITEPIPE, &wakeUp_char, 1 ); > > > There are two ways to handle it > > 1) Make changes to XToolkit.c such that the warning is no longer thrown. But throwing an error based on the result of `write ( AWT_WRITEPIPE, &wakeUp_char, 1 );` will result in unexpected behavioral changes and the best way to handle it is to have an empty if block with an appropriate comment. > > > There was a discussion about the same line long ago and the reason the result of `write()` was not handled and it was left unchanged was not to introduce behavioral change - https://mail.openjdk.org/pipermail/awt-dev/2016-July/011626.html > > > 2) Add unused-result to disabled warning section for clang similar to gcc - https://github.com/openjdk/jdk/blob/d1543429ff29ca0d761b8473b3fb8621abcd226d/make/modules/java.desktop/lib/AwtLibraries.gmk#L281. The 1st approach was picked over the 2nd since the usual recommendation is not to add to disabled warning section unless there is no other option. > > NOTE: the fix has been tested on linux/gcc , it does need to be tested on linux/clang. This pull request has now been integrated. Changeset: 85ca0813 Author: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/85ca0813f1624141993b20b3d8e404f86da2cef3 Stats: 5 lines in 2 files changed: 2 ins; 1 del; 2 mod 8354316: clang/linux build fails with -Wunused-result warning at XToolkit.c:695:9 Reviewed-by: aivanov, ihse, serb, kizune, syan, erikj ------------- PR: https://git.openjdk.org/jdk/pull/25217 From kizune at openjdk.org Fri May 23 19:57:55 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Fri, 23 May 2025 19:57:55 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. Looks good. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25340#pullrequestreview-2865565717 From prr at openjdk.org Fri May 23 21:01:52 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 23 May 2025 21:01:52 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 85: > 83: dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) > 84: ? clipInfo.bounds.x2 : (dstx + width); > 85: dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height) why wouldn't you always want to limit it to the clip ? I mean shouldn't it be like this ? dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) ? clipInfo.bounds.x2 : (((dstx + width) > clipInfo.bounds.x2) ? clipInfo.bounds.x2 : (dstx + width)); or maybe a bit more readable as dstInfo.bounds.x2 = ((UNSAFE_TO_ADD(dstx, width) || ((dstx + width) > clipInfo.bounds.x2)) ? clipInfo.bounds.x2 : (dstx + width); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2105414616 From avu at openjdk.org Fri May 23 22:14:51 2025 From: avu at openjdk.org (Alexey Ushakov) Date: Fri, 23 May 2025 22:14:51 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep [v2] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 11:38:32 GMT, Jayathirth D V wrote: >> In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. >> >> So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). >> >> I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. >> >> While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. > > Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: > > Add macro LGTM ------------- Marked as reviewed by avu (Committer). PR Review: https://git.openjdk.org/jdk/pull/25342#pullrequestreview-2865818213 From prr at openjdk.org Fri May 23 22:37:41 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 23 May 2025 22:37:41 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v7] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/b3cda856..040e8ddd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=05-06 Stats: 24 lines in 1 file changed: 17 ins; 0 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Fri May 23 22:39:57 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 23 May 2025 22:39:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Tue, 13 May 2025 21:28:24 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 OK. I don't agree with some of the above, but not enough to repeat previous points. So I've made most of the doc changes you ask for. Take a look ASAP, and I have a question I added text about potentially "not exiting" but I don't actually see any such problem. Maybe its some platform thing that you've seen ? For me, once the end of "main()" is reached the VM exits. Even if a sound is playing and looping. And even then, are you suggesting this would block System.exit() ? Where have you actually seen this problem or why are you sure it is a problem ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2905954203 From serb at openjdk.org Sat May 24 02:59:00 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 02:59:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 22:37:35 GMT, Phil Race wrote: > Take a look ASAP, and I have a question Looking into that. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2906329383 From serb at openjdk.org Sat May 24 03:25:07 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 03:25:07 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 22:37:35 GMT, Phil Race wrote: >For me, once the end of "main()" is reached the VM exits. Even if a sound is playing and looping. >And even then, are you suggesting this would block System.exit() ? >Where have you actually seen this problem or why are you sure it is a problem ? It does not prevent the application from exiting via `System.exit()`, but it does prevent it from exiting naturally when the main method completes. This is consistent with how AWT behaves (as [documented here](https://github.com/openjdk/jdk/blob/fdda7661906eab63d939e9f482449e21cc143c8f/src/java.desktop/share/classes/java/awt/doc-files/AWTThreadIssues.html#L108)): the application should dispose of all Windows/Frames to be shutdown. Similarly, this new API appears to follow the same logic: all playable clips must be stopped, otherwise the application will keep running indefinitely. I tested this behavior on macOS using [this MIDI file](https://en.wikipedia.org/wiki/File:MIDI_sample.mid?oldformat=true). import java.io.File; import javax.sound.SoundClip; public final class TestClip { public static void main(String[] args) throws Exception { SoundClip soundClip = SoundClip.createSoundClip(new File("MIDI_sample.mid")); soundClip.loop(); System.out.println("end main"); } } ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2906346048 From serb at openjdk.org Sat May 24 03:36:01 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 03:36:01 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 08:05:38 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Set orientation only if changed...add headful in test src/java.desktop/share/classes/javax/swing/JSplitPane.java line 373: > 371: public void setComponentOrientation(ComponentOrientation orientation) { > 372: if (!orientation.equals(this.getComponentOrientation())) { > 373: super.setComponentOrientation(orientation); I would like to bring up for discussion whether we should move this line outside the if block. From what I can tell, it was always executed before the initial fix, so this change might affect the original behavior. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2105687915 From serb at openjdk.org Sat May 24 10:45:57 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 10:45:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v7] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 22:37:41 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2866256512 From aturbanov at openjdk.org Sat May 24 16:36:04 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sat, 24 May 2025 16:36:04 GMT Subject: RFR: 8357686: Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer Message-ID: Instead of separate `.get(Key)`+`.remove(Key)` calls we can call `.remove(Key, Value)`. `peerMap` is an `IdentityHashMap`. IdentityHashMap.remove compares values with == since Java 20 ([JDK-8178355](https://bugs.openjdk.org/browse/JDK-8178355)) ------------- Commit messages: - [PATCH] Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer Changes: https://git.openjdk.org/jdk/pull/24858/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24858&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357686 Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24858.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24858/head:pull/24858 PR: https://git.openjdk.org/jdk/pull/24858 From serb at openjdk.org Sat May 24 16:36:04 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 16:36:04 GMT Subject: RFR: 8357686: Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer In-Reply-To: References: Message-ID: <9iAV69pP620sOtr4J53qkvqJWUnauvO_iTevk6hBzQs=.22f5de1d-ee92-4d2e-ae5b-dc811b91d5c5@github.com> On Thu, 24 Apr 2025 20:18:01 GMT, Andrey Turbanov wrote: > Instead of separate `.get(Key)`+`.remove(Key)` calls we can call `.remove(Key, Value)`. > `peerMap` is an `IdentityHashMap`. IdentityHashMap.remove compares values with == since Java 20 ([JDK-8178355](https://bugs.openjdk.org/browse/JDK-8178355)) looks fine ------------- PR Comment: https://git.openjdk.org/jdk/pull/24858#issuecomment-2882061238 From aturbanov at openjdk.org Sat May 24 16:42:28 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sat, 24 May 2025 16:42:28 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations Message-ID: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> `devices` contains only non-null values. It means instead of separate `containsKey` call we can just call `HashMap.get` and then compare result with `null`. ------------- Commit messages: - [PATCH] Remove unnecessary Map.containsKey from CGraphicsEnvironment.initDevices - [PATCH] Remove unnecessary Map.containsKey from X11GraphicsEnvironment.initDevices Changes: https://git.openjdk.org/jdk/pull/24907/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24907&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357687 Stats: 6 lines in 2 files changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/24907.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24907/head:pull/24907 PR: https://git.openjdk.org/jdk/pull/24907 From serb at openjdk.org Sat May 24 16:42:29 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 16:42:29 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> Message-ID: On Sun, 27 Apr 2025 21:04:34 GMT, Andrey Turbanov wrote: > `devices` contains only non-null values. It means instead of separate `containsKey` call we can just call `HashMap.get` and then compare result with `null`. src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java line 236: > 234: for (int id = 0; id < numScreens; ++id) { > 235: X11GraphicsDevice d = old.remove(id); > 236: devices.put(id, d != null ? d : new X11GraphicsDevice(id)); same can be done in CGraphicsEnvironment.java ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24907#discussion_r2067795484 From aturbanov at openjdk.org Sat May 24 16:42:29 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sat, 24 May 2025 16:42:29 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> Message-ID: <8KI3_JdatrKQHuZTvFg8R4XB3qML-kX2Rg3Qv97zxRA=.ed55db62-f96f-4637-b3c6-42a7e87d2941@github.com> On Wed, 30 Apr 2025 03:26:01 GMT, Sergey Bylokhov wrote: >> `devices` contains only non-null values. It means instead of separate `containsKey` call we can just call `HashMap.get` and then compare result with `null`. > > src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java line 236: > >> 234: for (int id = 0; id < numScreens; ++id) { >> 235: X11GraphicsDevice d = old.remove(id); >> 236: devices.put(id, d != null ? d : new X11GraphicsDevice(id)); > > same can be done in CGraphicsEnvironment.java Do you suggest to update it in this PR? Or file a separate issue? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24907#discussion_r2074196187 From serb at openjdk.org Sat May 24 16:42:29 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 16:42:29 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: <8KI3_JdatrKQHuZTvFg8R4XB3qML-kX2Rg3Qv97zxRA=.ed55db62-f96f-4637-b3c6-42a7e87d2941@github.com> References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> <8KI3_JdatrKQHuZTvFg8R4XB3qML-kX2Rg3Qv97zxRA=.ed55db62-f96f-4637-b3c6-42a7e87d2941@github.com> Message-ID: On Mon, 5 May 2025 21:00:37 GMT, Andrey Turbanov wrote: >> src/java.desktop/unix/classes/sun/awt/X11GraphicsEnvironment.java line 236: >> >>> 234: for (int id = 0; id < numScreens; ++id) { >>> 235: X11GraphicsDevice d = old.remove(id); >>> 236: devices.put(id, d != null ? d : new X11GraphicsDevice(id)); >> >> same can be done in CGraphicsEnvironment.java > > Do you suggest to update it in this PR? Or file a separate issue? same PR, code in x11 was copied from macOS ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24907#discussion_r2085733953 From aturbanov at openjdk.org Sat May 24 16:44:28 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sat, 24 May 2025 16:44:28 GMT Subject: RFR: 8357688: Remove unnecessary List.get before remove in PopupFactory Message-ID: <3fcUgHLShP5HamE2sRaXGbXg2gJzO9xOu28IQ_eVZyo=.1de88e4f-9519-4160-97b8-41072221fc07@github.com> Instead of separate List.get+List.remove calls we can use single `removeFirst`. It's clearer. ------------- Commit messages: - [PATCH] Remove unnecessary List.get before remove in PopupFactory Changes: https://git.openjdk.org/jdk/pull/25283/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25283&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357688 Stats: 13 lines in 1 file changed: 0 ins; 6 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/25283.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25283/head:pull/25283 PR: https://git.openjdk.org/jdk/pull/25283 From serb at openjdk.org Sat May 24 16:44:28 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 16:44:28 GMT Subject: RFR: 8357688: Remove unnecessary List.get before remove in PopupFactory In-Reply-To: <3fcUgHLShP5HamE2sRaXGbXg2gJzO9xOu28IQ_eVZyo=.1de88e4f-9519-4160-97b8-41072221fc07@github.com> References: <3fcUgHLShP5HamE2sRaXGbXg2gJzO9xOu28IQ_eVZyo=.1de88e4f-9519-4160-97b8-41072221fc07@github.com> Message-ID: On Sat, 17 May 2025 07:42:59 GMT, Andrey Turbanov wrote: > Instead of separate List.get+List.remove calls we can use single `removeFirst`. It's clearer. loos fine ------------- PR Comment: https://git.openjdk.org/jdk/pull/25283#issuecomment-2889282702 From prr at openjdk.org Sat May 24 17:59:47 2025 From: prr at openjdk.org (Phil Race) Date: Sat, 24 May 2025 17:59:47 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v8] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/040e8ddd..f31ce649 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=06-07 Stats: 13 lines in 2 files changed: 8 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Sat May 24 17:59:48 2025 From: prr at openjdk.org (Phil Race) Date: Sat, 24 May 2025 17:59:48 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 03:22:41 GMT, Sergey Bylokhov wrote: > > For me, once the end of "main()" is reached the VM exits. Even if a sound is playing and looping. > > And even then, are you suggesting this would block System.exit() ? > > Where have you actually seen this problem or why are you sure it is a problem ? > > It does not prevent the application from exiting via `System.exit()`, but it does prevent it from exiting naturally when the main method completes. This is consistent with how AWT behaves (as [documented here](https://github.com/openjdk/jdk/blob/fdda7661906eab63d939e9f482449e21cc143c8f/src/java.desktop/share/classes/java/awt/doc-files/AWTThreadIssues.html#L108)): the application should dispose of all Windows/Frames to be shutdown. > > Similarly, this new API appears to follow the same logic: all playable clips must be stopped, otherwise the application will keep running indefinitely. > > I tested this behavior on macOS using [this MIDI file](https://en.wikipedia.org/wiki/File:MIDI_sample.mid?oldformat=true). > > ``` > import java.io.File; > > import javax.sound.SoundClip; > > public final class TestClip { > public static void main(String[] args) throws Exception { > SoundClip soundClip = SoundClip.createSoundClip(new File("MIDI_sample.mid")); > soundClip.loop(); > System.out.println("end main"); > } > } > ``` So it seems it varies depending on content-type. This midi case creates a DataPusher which creates a non-daemon thread. pushThread = JSSecurityManager.createThread(this, "DataPusher", // name false, // daemon <<<<<<<<<<<<<< -1, // priority true); // doStart DataPusher is only used by JavaAudioSoundClip although that is used by a few content handlers as well as the *Clip APIs. Other than this only MidiInDevice creates a non-daemon thread and that won't be used by SoundClip So I am sure it is possible to pass in a parameter to tell DataPusher it should use a daemon thread for this case - leaving other cases unaffected - and then we'd consistently terminate and can remove all the words in the javadoc about this. Take a look at the commit I am pushing now - updates the implementation but not (yet) revising the javadoc. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2906952672 From prr at openjdk.org Sat May 24 18:35:20 2025 From: prr at openjdk.org (Phil Race) Date: Sat, 24 May 2025 18:35:20 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v9] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/f31ce649..88202603 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=07-08 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Sat May 24 18:35:20 2025 From: prr at openjdk.org (Phil Race) Date: Sat, 24 May 2025 18:35:20 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 17:54:08 GMT, Phil Race wrote: > Take a look at the commit I am pushing now - updates the implementation but not (yet) revising the javadoc. that commit wasn't all of it - one more commit just pushed to restrict it to SoundClip ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2906967775 From serb at openjdk.org Sat May 24 23:29:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 24 May 2025 23:29:56 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 18:32:09 GMT, Phil Race wrote: > that commit wasn't all of it - one more commit just pushed to restrict it to SoundClip How is the new implementation supposed to implement applications that will simply play audio, such as `./bin/play audio.mid`, looping at the end? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2907396294 From prr at openjdk.org Sun May 25 00:24:57 2025 From: prr at openjdk.org (Phil Race) Date: Sun, 25 May 2025 00:24:57 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 23:26:57 GMT, Sergey Bylokhov wrote: > > that commit wasn't all of it - one more commit just pushed to restrict it to SoundClip > > How is the new implementation supposed to implement applications that will simply play audio, such as `./bin/play audio.mid`, looping at the end? Do mean, "oh now it doesn't block exit, but what if I want it to?" It already didn't block exit for many cases, maybe almost all typical cases, so this last change just makes it consistent. And that would be the typical case for Applet.AudioClip today. I don't think I want to flip the other way and make all the cases non-daemon. So the answer would have to be, you don't let main exit, and so perhaps the docs "advice" would be partially the other way around, like "Play back is managed in a background thread, which may be a daemon thread. Applications therefore need to ensure at least one application thread (such as the "main" thread) remains alive to prevent the VM from exiting. Conversely calling stop() is recommended to ensure the play back thread is terminated." That advice as written is true of Applet.AudioClip today and might be prudent for an application to follow but I do think it would be best if it is as consistent as possible - in the daemon mode. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2907521415 From serb at openjdk.org Sun May 25 04:59:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 25 May 2025 04:59:02 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v6] In-Reply-To: References: Message-ID: On Sun, 25 May 2025 00:22:40 GMT, Phil Race wrote: >"Play back is managed in a background thread, which may be a daemon thread. Applications therefore need to ensure at least one application thread (such as the "main" thread) remains alive to prevent the VM from exiting. Conversely calling stop() is recommended to ensure the play back thread is terminated." But how applications can do that? How to check that the sound is playing w/o busy loop at the end? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2907609192 From serb at openjdk.org Sun May 25 04:59:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 25 May 2025 04:59:02 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v9] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 18:35:20 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 possibly we can extend this by two group of methods `asyncPlay/play` and `asyncLoop/loop` to make it easy to use in a different situations? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2907609826 From serb at openjdk.org Sun May 25 07:55:38 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 25 May 2025 07:55:38 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy Message-ID: The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. One of the test is updated just to touch that codepath. ------------- Commit messages: - Merge branch 'openjdk:master' into JDK-8357598 - Update AWTEventListenerProxyTest.java - Update AWTEventListenerProxyTest.java - 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy Changes: https://git.openjdk.org/jdk/pull/25401/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25401&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357598 Stats: 48 lines in 2 files changed: 28 ins; 15 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/25401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25401/head:pull/25401 PR: https://git.openjdk.org/jdk/pull/25401 From serb at openjdk.org Sun May 25 07:55:39 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sun, 25 May 2025 07:55:39 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy In-Reply-To: References: Message-ID: On Thu, 22 May 2025 21:21:30 GMT, Sergey Bylokhov wrote: > The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 > > AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. > > One of the test is updated just to touch that codepath. test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 41: > 39: EventQueue.invokeAndWait(() -> { > 40: Toolkit tk = Toolkit.getDefaultToolkit(); > 41: I do not know why it was disabled on XToolkit, seems to work fine. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2106117597 From prr at openjdk.org Sun May 25 16:42:55 2025 From: prr at openjdk.org (Phil Race) Date: Sun, 25 May 2025 16:42:55 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v9] In-Reply-To: References: Message-ID: On Sun, 25 May 2025 04:56:14 GMT, Sergey Bylokhov wrote: > possibly we can extend this by two group of methods `asyncPlay/play` and `asyncLoop/loop` to make it easy to use in a different situations? There are probably going to be zero to a handful of apps anywhere that use this API without a UI. And such an app which is quite focused on the sound playing is quite capable of managing the lifecycle as part of that. The needs/uses I see for this API are in UI apps - which aren't about to exit because a clip ends. For example an audible alert, or effect, reading out tooltip messages (like an AT would do). Perhaps occasionally a longer clip. So in almost all such cases apps just want to call play() and have it not block and let it end naturally, and there's no need to worry about any effect on app termination. Playing in a loop is likely be much less common that just playing once. And if you use loop() and it blocks the thread then you've either got to spin up another thread for when you want to stop it, or more likely call it in a different thread to begin with, so that's harder to program and you might as well not use the synchronous version and probably won't. The sole use case is that single thread main program without a UI and that's not enough reason to do it. Also migrating could be a bit harder if it was exactly the way round you suggested. playAsync() is what play() does today .. so you'd not want to do change that And a blocking play() means it couldn't be called on the EDT - might well make migrating to this API harder, so I think few cases would want to block. So in summary, I don't see any need to add variants that block by any name. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2907933747 From prr at openjdk.org Sun May 25 17:06:49 2025 From: prr at openjdk.org (Phil Race) Date: Sun, 25 May 2025 17:06:49 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v10] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/88202603..c92a8ba9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=08-09 Stats: 26 lines in 1 file changed: 18 ins; 0 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From psadhukhan at openjdk.org Mon May 26 02:41:10 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 26 May 2025 02:41:10 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: On Sat, 24 May 2025 03:32:50 GMT, Sergey Bylokhov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Set orientation only if changed...add headful in test > > src/java.desktop/share/classes/javax/swing/JSplitPane.java line 373: > >> 371: public void setComponentOrientation(ComponentOrientation orientation) { >> 372: if (!orientation.equals(this.getComponentOrientation())) { >> 373: super.setComponentOrientation(orientation); > > I would like to bring up for discussion whether we should move this line outside the if block. From what I can tell, it was always executed before the initial fix, so this change might affect the original behavior. If we call setComponentOrientation in test (like in TestSplitPaneOrientationTest.java which was added for JDK-4265389) then this check would fail as ComponentOrientation object would change if we call super.setComponentOrientation outside the if block and so left/right component would not be set.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2106421423 From psadhukhan at openjdk.org Mon May 26 02:49:58 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 26 May 2025 02:49:58 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Fri, 23 May 2025 20:59:41 GMT, Phil Race wrote: >> Graphics copyArea overflow check bails out of copying pixels if there is overflow. >> The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" >> >> which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds >> but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. >> So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. > > src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 85: > >> 83: dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) >> 84: ? clipInfo.bounds.x2 : (dstx + width); >> 85: dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height) > > why wouldn't you always want to limit it to the clip ? > I mean shouldn't it be like this ? > dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) ? clipInfo.bounds.x2 : (((dstx + width) > clipInfo.bounds.x2) ? clipInfo.bounds.x2 : (dstx + width)); > or maybe a bit more readable as > dstInfo.bounds.x2 = ((UNSAFE_TO_ADD(dstx, width) || ((dstx + width) > clipInfo.bounds.x2)) ? clipInfo.bounds.x2 : (dstx + width); That is because down below it anyway calls `SurfaceData_IntersectBounds(&dstInfo.bounds, &clipInfo.bounds); ` so it should clip to clipInfo.bounds there I presume.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2106426836 From duke at openjdk.org Mon May 26 05:02:20 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:02:20 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v5] In-Reply-To: References: Message-ID: <0b4c7bMrktRPr3uiDEiRgvIVQG2HndqAKo5yJg61qhY=.4850c18f-19ac-4f08-81d6-ee3c3d6d5bf3@github.com> > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. Jeremy Wood has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 28 additional commits since the last revision: - 8356320: trivial whitespace and comment changes - Merge branch 'master' into JDK-8356137 - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - 8356137: readding transparency check at (20, 20) - GifComparison: fixing error message - GifComparison: code cleanup - 8356137: change package to access GifComparison - GifComparison: adding common helper class for gif bugs - 8356120: updating (c) year - ... and 18 more: https://git.openjdk.org/jdk/compare/aba76ce9...6caefc11 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/cfa679a8..6caefc11 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=03-04 Stats: 125129 lines in 2773 files changed: 76967 ins; 33009 del; 15153 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Mon May 26 05:13:50 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:13:50 GMT Subject: RFR: 8351913: ToolkitImage renders some gifs wrong [v5] In-Reply-To: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> References: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> Message-ID: > I do not have much background in LZW compression or in C, but I'm reasonably confident this resolves the problem I'm observing. It looks like the GifImageDecoder was not always correctly handling compression codes after the table reached its limit of ~4096. If anyone has suggestions for improvements I'm happy to make adjustments. > > Luckily while debugging this: I was able to compare the flawed implementation (GifImageDecoder) with ImageIO's implementation (GIFImageReader) to help identify how the suffix/prefix tables are supposed to work. > > ImageIO's implementation may have suffered a similar bug (maybe https://bugs.openjdk.org/browse/JDK-7131823 ?), and that appears to have been backported. > > I have dozens of additional test cases for this problem, but unfortunately I don't have the rights to commit them to the OpenJDK repo. Feel free to email me for additional context/test cases. Jeremy Wood has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 29 additional commits since the last revision: - 8356320: trivial whitespace and comment changes - Merge branch 'master' into JDK-8351913 - Merge branch 'master' of https://github.com/mickleness/jdk - 8351913: renaming class, rewording comment There's a cluster of 4 related gif tickets I intend to put in this /gif/ directory. I want to better clarify exactly what this test focuses on. - GifComparison: fixing error message - GifComparison: code cleanup - 8351913: change package to access GifComparison - GifComparison: adding common helper class for gif bugs - Merge branch 'master' into JDK-8351913 - Merge branch 'master' of https://github.com/mickleness/jdk - ... and 19 more: https://git.openjdk.org/jdk/compare/088fc5f5...e5dbed64 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24271/files - new: https://git.openjdk.org/jdk/pull/24271/files/1733a85e..e5dbed64 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=03-04 Stats: 125812 lines in 2777 files changed: 77417 ins; 33246 del; 15149 mod Patch: https://git.openjdk.org/jdk/pull/24271.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24271/head:pull/24271 PR: https://git.openjdk.org/jdk/pull/24271 From duke at openjdk.org Mon May 26 05:23:36 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:23:36 GMT Subject: RFR: 8357034: GifImageDecoder can produce wrong transparent pixels [v2] In-Reply-To: References: Message-ID: > If there are two consecutive frames that use DISPOSAL_SAVE, but the transparent pixel index changed: we might accidentally send the wrong data to the ImageConsumer. > > We already had logic that submits info "the hard way" (see comment in code); this PR just makes sure we trigger that block. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) (this one) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) Jeremy Wood has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 21 additional commits since the last revision: - 8357034: fixing classname - 8356320: trivial whitespace and comment changes - Merge branch 'master' into JDK-8357034 - Merge branch 'master' of https://github.com/mickleness/jdk - 8357034: fixing ticket number - GifComparison: fixing error message - Incident 9078482: fix when new trans index is in saved images This bug hasn't made it out of triage yet; it's incident report # is 9078482 - GifComparison: code cleanup - GifComparison: adding common helper class for gif bugs - Merge branch 'master' of https://github.com/mickleness/jdk - ... and 11 more: https://git.openjdk.org/jdk/compare/adb906b3...b1a1d7ec ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25264/files - new: https://git.openjdk.org/jdk/pull/25264/files/5b982b12..b1a1d7ec Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25264&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25264&range=00-01 Stats: 63230 lines in 984 files changed: 37170 ins; 21012 del; 5048 mod Patch: https://git.openjdk.org/jdk/pull/25264.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25264/head:pull/25264 PR: https://git.openjdk.org/jdk/pull/25264 From duke at openjdk.org Mon May 26 05:29:45 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:29:45 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v6] In-Reply-To: References: Message-ID: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) (this one) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8356137: Adding copyright to GifComparison ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/6caefc11..19804549 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=04-05 Stats: 22 lines in 1 file changed: 22 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Mon May 26 05:30:44 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:30:44 GMT Subject: RFR: 8357034: GifImageDecoder can produce wrong transparent pixels [v3] In-Reply-To: References: Message-ID: > If there are two consecutive frames that use DISPOSAL_SAVE, but the transparent pixel index changed: we might accidentally send the wrong data to the ImageConsumer. > > We already had logic that submits info "the hard way" (see comment in code); this PR just makes sure we trigger that block. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) (this one) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8356137: Adding copyright to GifComparison ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25264/files - new: https://git.openjdk.org/jdk/pull/25264/files/b1a1d7ec..3d94c434 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25264&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25264&range=01-02 Stats: 22 lines in 1 file changed: 22 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25264.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25264/head:pull/25264 PR: https://git.openjdk.org/jdk/pull/25264 From duke at openjdk.org Mon May 26 05:30:55 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 05:30:55 GMT Subject: RFR: 8351913: ToolkitImage renders some gifs wrong [v6] In-Reply-To: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> References: <74IJiA4t9MAOiGPCGuls0-KbIfGg9D2bNUXPapOx0Zs=.4cdf9b89-4007-4727-a07e-ac4eae84134e@github.com> Message-ID: > I do not have much background in LZW compression or in C, but I'm reasonably confident this resolves the problem I'm observing. It looks like the GifImageDecoder was not always correctly handling compression codes after the table reached its limit of ~4096. If anyone has suggestions for improvements I'm happy to make adjustments. > > Luckily while debugging this: I was able to compare the flawed implementation (GifImageDecoder) with ImageIO's implementation (GIFImageReader) to help identify how the suffix/prefix tables are supposed to work. > > ImageIO's implementation may have suffered a similar bug (maybe https://bugs.openjdk.org/browse/JDK-7131823 ?), and that appears to have been backported. > > I have dozens of additional test cases for this problem, but unfortunately I don't have the rights to commit them to the OpenJDK repo. Feel free to email me for additional context/test cases. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) (this one) Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8356137: Adding copyright to GifComparison ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24271/files - new: https://git.openjdk.org/jdk/pull/24271/files/e5dbed64..7c45a736 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24271&range=04-05 Stats: 22 lines in 1 file changed: 22 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24271.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24271/head:pull/24271 PR: https://git.openjdk.org/jdk/pull/24271 From serb at openjdk.org Mon May 26 05:49:51 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 26 May 2025 05:49:51 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep [v2] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 11:38:32 GMT, Jayathirth D V wrote: >> In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. >> >> So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). >> >> I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. >> >> While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. > > Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: > > Add macro Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25342#pullrequestreview-2867286353 From jdv at openjdk.org Mon May 26 06:06:03 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 26 May 2025 06:06:03 GMT Subject: RFR: 8312198: [macos] metal pipeline - window rendering stops after display sleep [v2] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 11:38:32 GMT, Jayathirth D V wrote: >> In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. >> >> So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). >> >> I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. >> >> While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. > > Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: > > Add macro With updated changes also I have again tested SwingSet2(multi monitor & sleep/wakeup scenarios) and full clientlibs CI test run and there are no issues seen. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25342#issuecomment-2908629578 From jdv at openjdk.org Mon May 26 06:06:03 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 26 May 2025 06:06:03 GMT Subject: Integrated: 8312198: [macos] metal pipeline - window rendering stops after display sleep In-Reply-To: References: Message-ID: On Wed, 21 May 2025 06:11:18 GMT, Jayathirth D V wrote: > In stress based scenarios it is observed that nothing is drawn in UI content when display wakes up from sleep in Metal pipeline of macOS. Unfortunately i am not able to reproduce it, but based on details in the bug it looks like we are hitting a race condition. Call to CVDisplayLinkCreateWithActiveCGDisplays is becoming a no-op as there are no active displays right after NSWorkspaceScreensDidWakeNotification. Looks like if we continue to call CVDisplayLinkCreateWithActiveCGDisplays after screen wakeup we are able to get the list of ActiveDisplays and then able to create displayLink. > > So now the code is modified to check whether CVDisplayLinkCreateWithActiveCGDisplays is successful or not. If not we will try to call CVDisplayLinkCreateWithActiveCGDisplays for 5 instances each with 1 second delay. There is no regression test for this change because it needs a stress based test with display wakeup/sleep(As captured in JBS, i am not able to reproduce this issue). > > I have tested this change for sanity by running animation examples from SwingSet2 and continuously connecting/disconnecting external display. Also by multiple display sleep and wakeup scenarios, i don't see any regressions. Also whole clientlibs CI run is done with this patch and it is also green. > > While working on this bug also noticed that many functions of CVDisplayLink is deprecated from macOS 14 and going forward we need to use CADisplayLink/CAMetalDisplayLink. I have raised [JDK-8357418](https://bugs.openjdk.org/browse/JDK-8357418) for the same. This pull request has now been integrated. Changeset: a50d3bee Author: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/a50d3bee12cd2f528067bc15b404cf2289977af5 Stats: 24 lines in 2 files changed: 19 ins; 0 del; 5 mod 8312198: [macos] metal pipeline - window rendering stops after display sleep Reviewed-by: serb, avu, prr ------------- PR: https://git.openjdk.org/jdk/pull/25342 From ihse at openjdk.org Mon May 26 07:47:02 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 07:47:02 GMT Subject: RFR: 8356977: UTF-8 cleanups In-Reply-To: <5oMrogxJyi1_OsPAGntbPTiR5aCIFOTuDSUTKOv7wyo=.b715c9d2-0cdd-4585-a262-bdbe5a72a5fa@github.com> References: <5oMrogxJyi1_OsPAGntbPTiR5aCIFOTuDSUTKOv7wyo=.b715c9d2-0cdd-4585-a262-bdbe5a72a5fa@github.com> Message-ID: On Thu, 15 May 2025 18:30:28 GMT, Naoto Sato wrote: >> I found a few other places in the code that can be cleaned up after the conversion to UTF-8. > > test/jdk/sun/text/resources/LocaleDataTest.java line 106: > >> 104: * FormatData/fr_FR/MonthNames/0=janvier >> 105: * FormatData/fr_FR/MonthNames/1=f?vrier >> 106: * LocaleNames/fr_FR/US=?tats-Unis > > This test data (LocaleData.cldr) is explicitly encoded in ISO-8859-1 with unicode escapes for characters outside of it. So only changing these ones in comment does not seem correct. ISO-8859-1 does not sound good, and got me worried. But in fact it seems like the file is pure ASCII, and that is fine. However, if the file should ever be changed to include actual ISO-8859-1 encoding, this might break if tools assume it is UTF-8-encoding, since not all ISO-8859-1 encodings are valid UTF-8. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2106755160 From ihse at openjdk.org Mon May 26 08:20:19 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:20:19 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: References: Message-ID: > I found a few other places in the code that can be cleaned up after the conversion to UTF-8. Magnus Ihse Bursie has updated the pull request incrementally with two additional commits since the last revision: - Restore MenuShortcut.java - Restore LocaleDataTest.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25228/files - new: https://git.openjdk.org/jdk/pull/25228/files/9c904992..7184e685 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25228&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25228&range=00-01 Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25228.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25228/head:pull/25228 PR: https://git.openjdk.org/jdk/pull/25228 From ihse at openjdk.org Mon May 26 08:20:46 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:20:46 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: References: Message-ID: <7ThvxIdX5OQ98gW8wZwPjX00teKmjP1qm1DT8olo-30=.64a982f0-92fc-46da-af79-8c3696e99258@github.com> On Thu, 22 May 2025 21:43:20 GMT, Phil Race wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with two additional commits since the last revision: >> >> - Restore MenuShortcut.java >> - Restore LocaleDataTest.java > > src/java.desktop/share/classes/java/awt/MenuShortcut.java line 49: > >> 47: * For example, a menu shortcut for "Ctrl+cyrillic ef" is created by >> 48: *

>> 49: * MenuShortcut ms = new MenuShortcut(KeyEvent.getExtendedKeyCodeForChar('?'), false); > > This is javadoc inJava SE specification. As is the Action case below. > I can't think of any actual harm from this change, so OK, but I am not seeing why it is needed. The resulting Javadoc html files will contain the same character before and after this fix, so there is no specification change. I did this since I thought it increased readability of the source code, but I can just as well revert it. > test/jdk/java/awt/font/TextLayout/RotFontBoundsTest.java line 63: > >> 61: >> 62: private static final String INSTRUCTIONS = >> 63: "A string \u201C" + TEXT + "\u201D is drawn at eight different " > > I really don't like these tests being changed. It isn't part of the JDK build. > People compile these in all sorts of locales. > Please revert all the changes in the client tests. Just a clarification. What I did was convert curly quotes and an em dash to normal ASCII quotes and an ASCII hyphen, just as it is in all other `INSTRUCTIONS` in the tests. This is similar to what was done in JDK-8354273 and JDK-8354213, and should have been made as part of those PRs if I only had noticed this place by then. The user's locale should not really matter. When have stringent locale requirements for building, and automatically setup the correct locale while building. I don't think the locale will matter at runtime either, but it n the rare case that it should matter, then pure ASCII would be prefer, wouldn't it? Let me know if you still want me to revert it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2106769659 PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2106791184 From ihse at openjdk.org Mon May 26 08:21:16 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:21:16 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: References: Message-ID: <_lcOdATdXG3Y_jW5Tl0xJkrVZ-hoWs-2U7Cp3NvQtqk=.eea31f34-72c6-4acd-bce9-38ab18c41509@github.com> On Mon, 26 May 2025 08:10:19 GMT, Magnus Ihse Bursie wrote: >> I found a few other places in the code that can be cleaned up after the conversion to UTF-8. > > Magnus Ihse Bursie has updated the pull request incrementally with two additional commits since the last revision: > > - Restore MenuShortcut.java > - Restore LocaleDataTest.java test/jdk/java/awt/event/KeyEvent/KeyTyped/EscapeKeyTyped.java line 90: > 88: printKey(e); > 89: int keychar = e.getKeyChar(); > 90: if (keychar == 27) { // Escape character is 27 or \u001b @prrace I think this is an actual bug. `\u0021` codes to `!`, and I don't think that is what was meant. Do you still want me to revert it? test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java line 188: > 186: + "\"After\" lists.\n" > 187: + " Added printers are highlighted with " > 188: + "green color, removed ones \u2014 with " @prrace This too seems like a bug, or rather a typo. The text currently reads `Added printers are highlighted with green color, removed ones ? with red color.`. The Em dash does not make any sense to me, and seems to be a copy paste error. Do you still want me to revert it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2106774492 PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2106778974 From ihse at openjdk.org Mon May 26 08:24:36 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:24:36 GMT Subject: RFR: 8356980: Better handling of non-breaking space In-Reply-To: <2QcYZvy5pjx8J6Fi6j59uiHSfnqkp1yUHakx2qsxzKw=.d5720f94-adb8-4f86-aeed-e403c8e43066@github.com> References: <9SKadVNS-siQPAG2VPshPmaKn0t4KbWMBEz6uUCJrg8=.3c10d375-1a0c-4b9d-adec-da5dc590931b@github.com> <1Z5g-LlFwSPrcqtTBmrDetQQL7_hF0j73n-37JRCpug=.3a763994-156c-44fb-8945-f02b1994e620@github.com> <2QcYZvy5pjx8J6Fi6j59uiHSfnqkp1yUHakx2qsxzKw=.d5720f94-adb8-4f86-aeed-e403c8e43066@github.com> Message-ID: On Thu, 22 May 2025 21:26:08 GMT, Phil Race wrote: >> FYI, the style guide for France [recommends](https://fr.wikipedia.org/wiki/Espace_ins%C3%A9cable#En_France): >> >> - U+202F (Narrow No-Break Space NNBSP) preceding semicolon, question mark, and exclamation mark. >> - U+00A0 (No-Break Space NBSP) preceding colon. >> >> Similar conventions are used in other French speaking countries. > >> No, it doesn't. I still agree with that fix -- the overwhelming majority of characters should indeed be UTF-8 instead of unicode sequences. > >> This is about a very specific character, that is impossible to visually tell the difference on screen from ordinary space. > > > I didn't say it reversed that entire changeset. I am saying that the previous changeset for L10N changed > > the Java unicode escape to UTF-8 for the localised message string. > > You propose restoring it to Java escape. > > > I wouldn't be surprised if the next message drop reverses what you reversed. > > I don't know what tools the L10N team use but there's a chance it doesn't handle Java escapes > > since that is very much a Java thing. So you are probably making the translation job harder. > > > So I am suggesting you leave all of the translation files as is. > Which might mean withdrawing this PR. Fair enough. This was meant to be an improvement in readability, not a hindrance for working efficiently. I'll withdraw this PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25234#discussion_r2106804794 From ihse at openjdk.org Mon May 26 08:24:38 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:24:38 GMT Subject: Withdrawn: 8356980: Better handling of non-breaking space In-Reply-To: References: Message-ID: On Wed, 14 May 2025 15:11:24 GMT, Magnus Ihse Bursie wrote: > Non-breaking space characters are problematic. They look identical to the normal space character, but is not. For that reason, it should never be typed as an UTF-8 literal, but only by using unicode sequences. > > I have checked: > * U+00A0 NO-BREAK SPACE (NBSP) > * U+202F NARROW NO-BREAK SPACE (NNBSP) > * U+2007 FIGURE SPACE > * U+2060 WORD JOINER > > In some places, these character were used when an ordinary space should have been used. I replaced those with normal space. In other places, they were correct, but as literals instead of unicode sequences. I replaced those instances with sequences. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/25234 From ihse at openjdk.org Mon May 26 08:25:07 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:25:07 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: <-HdnkBjrOxo3jUA8jSYhmElKM55oIcSRYYgu70KPR8M=.24dfddf4-6890-4a61-9cef-85f1a2c1238a@github.com> On Wed, 14 May 2025 14:29:23 GMT, Magnus Ihse Bursie wrote: > After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. @JoeWang-Java @naotoj Can you help review this PR? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25229#issuecomment-2908936863 From ihse at openjdk.org Mon May 26 08:27:45 2025 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 26 May 2025 08:27:45 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 14:29:23 GMT, Magnus Ihse Bursie wrote: > After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. @justin-curtis-lu Are these files handled by the translation team? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25229#issuecomment-2908942083 From duke at openjdk.org Mon May 26 08:39:25 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 08:39:25 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text Message-ID: Make sure AquaTextPasswordFieldUI can't use selectWordAction. The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. So the problem is partially about multiple inheritance. My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. ------------- Commit messages: - 8354646: Make sure AquaTextPasswordFieldUI can't use selectWordAction - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'master' of https://github.com/mickleness/jdk - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge branch 'openjdk:master' into master - Merge pull request #5 from openjdk/master - ... and 4 more: https://git.openjdk.org/jdk/compare/4a4209ff...ccf24d73 Changes: https://git.openjdk.org/jdk/pull/25443/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8354646 Stats: 100 lines in 3 files changed: 81 ins; 19 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443 PR: https://git.openjdk.org/jdk/pull/25443 From psadhukhan at openjdk.org Mon May 26 09:38:33 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 26 May 2025 09:38:33 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v24] In-Reply-To: References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: On Wed, 12 Mar 2025 11:00:30 GMT, Prasanta Sadhukhan wrote: >> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. >> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fix I checked rbma.cpp output where I think we can only support the 4th item in the list (which is this) ![image](https://github.com/user-attachments/assets/32067d1a-8ab2-444c-8db3-265f0e64f6ec) This is because we have [JRadioButtonMenuItem](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/JRadioButtonMenuItem.html#%3Cinit%3E(java.lang.String,javax.swing.Icon,boolean))([String](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html) text, [Icon](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/Icon.html) icon, boolean selected) API which only supports one icon image (so checked/unchecked icon image **in addition** to item icon as below image is not possible in my opinion in Java swing) ![image](https://github.com/user-attachments/assets/581f4e36-6b55-4a1c-8a5a-465741e43858) The current state of PR supports this 4th item. Only thing different is when there is no imageicon and menuitem is selected, then the text seems to be in same vertical line as the other items (in native rbma output) ![image](https://github.com/user-attachments/assets/897f3277-df2e-4827-8381-e51ad8007251) but current PR the text is shifted to left (when there is no imageicon ie 3rd item in list) and occupies icon space, as below ![image](https://github.com/user-attachments/assets/43fb1ccc-b475-4147-8131-22f2fc918375) This is because in most cases (and in SwingSet2) the radiomenu items are drawn without imageicon and there is no extra space between radio bullet and menu text ![image](https://github.com/user-attachments/assets/c5cd5840-d58e-4456-8217-cf7f3ba9bb4e) so if we cater to text shifting to same vertical line, there will be difference in behavior w.r.t existing one and user will notice a shift in text to accomodate non-existing image icon) but it is fixable, so if we are in consensus about supporting the 4th item in rbma.cpp output in Java swing with text in same vertical offset, then let mw know..Anything else in addition needs discussion whether we can support... ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2909069636 From abaya at openjdk.org Mon May 26 09:50:58 2025 From: abaya at openjdk.org (Anass Baya) Date: Mon, 26 May 2025 09:50:58 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v3] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with one additional commit since the last revision: Reduce delay to 500 Invoke isvisble() method under EDT ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/0e234a54..31472930 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=01-02 Stats: 13 lines in 1 file changed: 7 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From aivanov at openjdk.org Mon May 26 16:43:28 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 16:43:28 GMT Subject: RFR: 8357675: Amend headless message Message-ID: Currently, the default headless message ends with a comma instead of full stop and has an additional line break. Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, or no headful library support was found, but this program performed an operation which requires it, at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) at java.desktop/java.awt.Window.(Window.java:518) at java.desktop/java.awt.Frame.(Frame.java:428) at java.desktop/javax.swing.JFrame.(JFrame.java:224) **Fix:** Amend the message so that it ends with a full stop and remove the line break. Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: No X11 DISPLAY variable was set, or no headful library support was found, but this program performed an operation which requires it. at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) at java.desktop/java.awt.Window.(Window.java:518) at java.desktop/java.awt.Frame.(Frame.java:428) at java.desktop/javax.swing.JFrame.(JFrame.java:224) **Testing:** Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. ------------- Commit messages: - 8357675: Amend headless message Changes: https://git.openjdk.org/jdk/pull/25453/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25453&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357675 Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25453.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25453/head:pull/25453 PR: https://git.openjdk.org/jdk/pull/25453 From duke at openjdk.org Mon May 26 16:51:11 2025 From: duke at openjdk.org (Jeremy Wood) Date: Mon, 26 May 2025 16:51:11 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v2] In-Reply-To: References: Message-ID: > Make sure AquaTextPasswordFieldUI can't use selectWordAction. > > The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. > > So the problem is partially about multiple inheritance. > > My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. > > There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8354646: Update copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25443/files - new: https://git.openjdk.org/jdk/pull/25443/files/ccf24d73..bdbd51b0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=00-01 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443 PR: https://git.openjdk.org/jdk/pull/25443 From aivanov at openjdk.org Mon May 26 17:05:26 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 17:05:26 GMT Subject: RFR: 8357799: Improve instructions for JFileChooser/HTMLFileName.java Message-ID: The instructions for the `javax/swing/JFileChooser/HTMLFileName.java` test are still not as clear. The file name in the instructions is rendered as HTML, which, I believe, is unexpected. It should be displayed as the plain text. The instructions also say about file and directory which have HTML in their name; this was true in the initial version of the test in #24439 that created files and directories on the real file system. The final version of test uses a virtual file system that displays *three files*, there's no way to navigate. I also clarified the instructions: look at how the file name of the first file is rendered in _the file pane_ and _the navigation combo box_ (**Look in** in Metal L&F). In the `VirtualFileSystemView` class, I changed the name of the third file from `virtualFolder` to `virtualFile2.log`, and made the file array a field which ensures `getRoots` and `getFiles` return the same list. In addition to this, I reduced the number of rows allocated for the instructions. Since the instructions are in HTML format, the number of lines of HTML code makes no sense for determining the size. ------------- Commit messages: - Improve instructions for HTMLFileName.java Changes: https://git.openjdk.org/jdk/pull/25455/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25455&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357799 Stats: 43 lines in 1 file changed: 17 ins; 10 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/25455.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25455/head:pull/25455 PR: https://git.openjdk.org/jdk/pull/25455 From prr at openjdk.org Mon May 26 17:13:51 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 26 May 2025 17:13:51 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. The existing message is fine. The comma is because it isn't done. It introduces the exception text and the blank line adds some clarity. So nothing to change here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2910292746 From aivanov at openjdk.org Mon May 26 17:18:06 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 17:18:06 GMT Subject: RFR: 8357799: Improve instructions for JFileChooser/HTMLFileName.java [v2] In-Reply-To: References: Message-ID: > The instructions for the `javax/swing/JFileChooser/HTMLFileName.java` test are still not as clear. > > The file name in the instructions is rendered as HTML, which, I believe, is unexpected. It should be displayed as the plain text. > > The instructions also say about file and directory which have HTML in their name; this was true in the initial version of the test in #24439 that created files and directories on the real file system. > > The final version of test uses a virtual file system that displays *three files*, there's no way to navigate. > > I also clarified the instructions: look at how the file name of the first file is rendered in _the file pane_ and _the navigation combo box_ (**Look in** in Metal L&F). > > In the `VirtualFileSystemView` class, I changed the name of the third file from `virtualFolder` to `virtualFile2.log`, and made the file array a field which ensures `getRoots` and `getFiles` return the same list. > > > In addition to this, I reduced the number of rows allocated for the instructions. Since the instructions are in HTML format, the number of lines of HTML code makes no sense for determining the size. Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: Correct the title of the test frames ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25455/files - new: https://git.openjdk.org/jdk/pull/25455/files/d6cebfd0..f0633abd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25455&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25455&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25455.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25455/head:pull/25455 PR: https://git.openjdk.org/jdk/pull/25455 From aivanov at openjdk.org Mon May 26 17:51:50 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 17:51:50 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 17:11:03 GMT, Phil Race wrote: > The existing message is fine. The comma is because it isn't done. How is it not done? > It introduces the exception text and the blank line adds some clarity. So nothing to change here. Nothing goes after the comma, the exception message ends here, and the stack trace follows. The blank line between the message and the stack trace is very uncommon. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2910351416 From prr at openjdk.org Mon May 26 18:27:49 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 26 May 2025 18:27:49 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 17:49:15 GMT, Alexey Ivanov wrote: > > The existing message is fine. The comma is because it isn't done. > > How is it not done? > > > It introduces the exception text and the blank line adds some clarity. So nothing to change here. > > Nothing goes after the comma, the exception message ends here, and the stack trace follows. stack trace is what I mean by exception text. The full text in the bug report reads better with a comma than a full stop. Is this text ever displayed without the stack trace following ? I can't remember. > > The blank line between the message and the stack trace is very uncommon. It looks OK to me, but its obviously a matter of preference. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2910406690 From aivanov at openjdk.org Mon May 26 18:33:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 18:33:54 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 18:25:36 GMT, Phil Race wrote: > > > The existing message is fine. The comma is because it isn't done. > > > > How is it not done? > > > It introduces the exception text and the blank line adds some clarity. So nothing to change here. > > > > > > Nothing goes after the comma, the exception message ends here, and the stack trace follows. > > stack trace is what I mean by exception text.\ > The full text in the bug report reads better with a comma than a full stop. Is this text ever displayed without the stack trace following ? I can't remember. The message can be extracted by [`Throwable.getMessage()`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Throwable.html#getMessage()), then it can be displayed without the stack trace. The stack trace is optional. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2910416396 From dgredler at openjdk.org Mon May 26 18:55:31 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 26 May 2025 18:55:31 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v2] In-Reply-To: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: <60kmeJC9Cx6cT2nhfVlBmHL1S79b8alMeS7WpXIK4MQ=.09712512-e558-4da9-b214-6e29cf8ce177@github.com> > It looks like this regression actually fits into a longer series of fixes / regressions in this area: > > - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions > - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics > - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions > - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display > > We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. > > It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). > > The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). > > In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. > > Note two intricacies related to `CompositeGlyphMapper`: > 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. > 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. > > The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. > > Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for HarfBuzz integration. (Is there a plan to remove... Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: - Merge branch 'master' into JDK-8353230 - Finish macOS implementation - Differentiate CharToGlyphMapper users who want raw vs normalized glyph info ------------- Changes: https://git.openjdk.org/jdk/pull/24412/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24412&range=01 Stats: 305 lines in 10 files changed: 229 ins; 27 del; 49 mod Patch: https://git.openjdk.org/jdk/pull/24412.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24412/head:pull/24412 PR: https://git.openjdk.org/jdk/pull/24412 From aivanov at openjdk.org Mon May 26 20:13:50 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 26 May 2025 20:13:50 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: <5_1q6Wy_Jd2A8LPetIvKBE-MrUWQYSDNDtFwKRi0u8M=.3e0285d5-b3b3-456a-90ad-978875a9fc2b@github.com> On Mon, 26 May 2025 18:25:36 GMT, Phil Race wrote: > > The blank line between the message and the stack trace is very uncommon. > > It looks OK to me, but its obviously a matter of preference. It could be a matter of preference, but it's also a matter of _consistency_, and I can't remember if I've ever seen an exception message which had a line break as its last character. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2910565870 From prr at openjdk.org Mon May 26 20:28:54 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 26 May 2025 20:28:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v2] In-Reply-To: <60kmeJC9Cx6cT2nhfVlBmHL1S79b8alMeS7WpXIK4MQ=.09712512-e558-4da9-b214-6e29cf8ce177@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <60kmeJC9Cx6cT2nhfVlBmHL1S79b8alMeS7WpXIK4MQ=.09712512-e558-4da9-b214-6e29cf8ce177@github.com> Message-ID: On Mon, 26 May 2025 18:55:31 GMT, Daniel Gredler wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: > > - Merge branch 'master' into JDK-8353230 > - Finish macOS implementation > - Differentiate CharToGlyphMapper users who want raw vs normalized glyph info Sorry, this one fell off the radar. I see my testing - a long time ago now - passed. The code changes make sense, so I'm ready to approve. But its been so long I think I should re-test with the latest version on the latest repo. ------------- PR Review: https://git.openjdk.org/jdk/pull/24412#pullrequestreview-2869124733 From prr at openjdk.org Mon May 26 20:41:51 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 26 May 2025 20:41:51 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. ok ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25453#pullrequestreview-2869136372 From dgredler at openjdk.org Mon May 26 21:37:51 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Mon, 26 May 2025 21:37:51 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> Message-ID: On Thu, 24 Apr 2025 03:04:36 GMT, Phil Race wrote: >> We had similar emoji-related regressions at JetBrains. Although our font-related code diverged from OpenJDK a bit, porting this patch seems to resolve them too. I am not an OpenJDK reviewer, but LGTM nevertheless. > >> @YaaZ Thanks for the information! >> >> @prrace Have you had a chance to look at this PR? > > It passed all the testing I did. I still need to look hard at the changes. @prrace Please don't approve yet. I was able to fix the code conflicts caused by PR #23665, but it looks like the logic does not layer nicely as there is now a test failure on macOS after the merge. I'm having a look and will let you know what I find. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2910660492 From prr at openjdk.org Mon May 26 23:46:51 2025 From: prr at openjdk.org (Phil Race) Date: Mon, 26 May 2025 23:46:51 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> Message-ID: On Thu, 24 Apr 2025 03:04:36 GMT, Phil Race wrote: >> We had similar emoji-related regressions at JetBrains. Although our font-related code diverged from OpenJDK a bit, porting this patch seems to resolve them too. I am not an OpenJDK reviewer, but LGTM nevertheless. > >> @YaaZ Thanks for the information! >> >> @prrace Have you had a chance to look at this PR? > > It passed all the testing I did. I still need to look hard at the changes. > @prrace Please don't approve yet. I was able to fix the code conflicts caused by PR #23665, but it looks like the logic does not layer nicely as there is now a test failure on macOS after the merge. I'm having a look and will let you know what I find. And indeed the tests just finished and a test (not the new one, a previous one : IgnoredWhitespaceTest.java) failed on macOS x64 and ARM .. java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] at IgnoredWhitespaceTest.assertEqual(IgnoredWhitespaceTest.java:127) at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:103) at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:69) at IgnoredWhitespaceTest.main(IgnoredWhitespaceTest.java:49) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:565) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1447) JavaTest Message: Test threw exception: java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] JavaTest Message: shutting down test ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2910773893 From dgredler at openjdk.org Tue May 27 00:39:55 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 27 May 2025 00:39:55 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v2] In-Reply-To: <60kmeJC9Cx6cT2nhfVlBmHL1S79b8alMeS7WpXIK4MQ=.09712512-e558-4da9-b214-6e29cf8ce177@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <60kmeJC9Cx6cT2nhfVlBmHL1S79b8alMeS7WpXIK4MQ=.09712512-e558-4da9-b214-6e29cf8ce177@github.com> Message-ID: On Mon, 26 May 2025 18:55:31 GMT, Daniel Gredler wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > Daniel Gredler has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: > > - Merge branch 'master' into JDK-8353230 > - Finish macOS implementation > - Differentiate CharToGlyphMapper users who want raw vs normalized glyph info Yep, that's the test added in PR #23665 (with which this PR had a conflict). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2910819637 From aturbanov at openjdk.org Tue May 27 08:13:53 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 27 May 2025 08:13:53 GMT Subject: RFR: 8354944: Remove unnecessary PartiallyOrderedSet.nodes In-Reply-To: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> References: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> Message-ID: <-wbPMxP9hryZU9vd4Ju420iIdZ9gaUDJ5D8rPQczAwA=.27d50609-74bc-4ca7-bf09-c49769cf7d79@github.com> On Wed, 16 Apr 2025 20:50:24 GMT, Andrey Turbanov wrote: > We can use `javax.imageio.spi.PartiallyOrderedSet#poNodes` directly @aivanov-jdk @TejeshR13 can you please review and put the second approve? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24699#issuecomment-2911589976 From shade at openjdk.org Tue May 27 09:53:57 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 27 May 2025 09:53:57 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. Looks reasonable. FWIW, the period matches the format for `getDefaultHeadlessMessage()` in other platforms. I would probably even collapse first two lines into one, up to you: No X11 DISPLAY variable was set, or no headful library support was found, but this program performed an operation which requires it. ------------- Marked as reviewed by shade (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25453#pullrequestreview-2870428082 From aivanov at openjdk.org Tue May 27 11:02:58 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 27 May 2025 11:02:58 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Tue, 27 May 2025 09:51:23 GMT, Aleksey Shipilev wrote: > Looks reasonable. FWIW, the period matches the format for `getDefaultHeadlessMessage()` in other platforms. Yes, it does. > I would probably even collapse first two lines into one, up to you: > > ``` > No X11 DISPLAY variable was set, or no headful library support was found, > but this program performed an operation which requires it. > ``` @shipilev That's also a possibility? The message will still fit into 80 columns, however, I think the message is easier to read when the two reasons are on their own lines, so I'll keep it this way unless someone else is also for joining the first two lines. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2912093596 From shade at openjdk.org Tue May 27 12:03:53 2025 From: shade at openjdk.org (Aleksey Shipilev) Date: Tue, 27 May 2025 12:03:53 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. Yeah, that's fine. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2912251413 From jdv at openjdk.org Tue May 27 14:21:57 2025 From: jdv at openjdk.org (Jayathirth D V) Date: Tue, 27 May 2025 14:21:57 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v6] In-Reply-To: References: Message-ID: On Mon, 26 May 2025 05:29:45 GMT, Jeremy Wood wrote: >> This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: >> >> 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") >> 2. The transparent pixel is non-zero >> 3. There's more than one such consecutive frame >> >> Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. >> >> I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: >> >> 1. [8357034](https://github.com/openjdk/jdk/pull/25264) >> 2. [8356137](https://github.com/openjdk/jdk/pull/25044) (this one) >> 3. [8356320](https://github.com/openjdk/jdk/pull/25076) >> 4. [8351913](https://github.com/openjdk/jdk/pull/24271) > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8356137: Adding copyright to GifComparison I think we a need a gif with only 2 frames having transpixel>0 and disposal method save to reproduce this scenario. Also its better if we can actually create test gif file using ImageIO(There are examples in test/jdk/javax/imageio/plugins/gif/) programatically and use it instead of external GIF files for testing. > For reference, the commented out lines here are my first approach at resolving this problem. > image > > This works, and it may be more readable/intuitive than this current PR. When we initialize saved_image we should flood fill it with transparent pixels. > > I chose the approach in this PR though because it's lazier. (That is: it should be a little bit less work, CPU-wise.) > > If anyone wants we can switch to this approach. I think this is better then current approach of having check multiple times. src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java line 419: > 417: // are NOT the transparent pixel: we need to replace it > 418: // with the appropriate transparent pixel. > 419: boolean replaceTransPixelsInSavedImage = save && We can move this check to the place where we actually create and initialize saved image. src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java line 436: > 434: } > 435: runstart = -1; > 436: if (replaceTransPixelsInSavedImage) { We are hitting this check for each transparent pixel for all frames with transparent pixel index > 0 and not initial frame until saved_image is not null. In the .gif present in this PR we are checking this condition for each transparent pixel of 2nd and 3rd frame. If GIF contains many frames and disposal method save comes in later part of animation we will hit this check many times. I think its better to just initialize saved_image with proper transparent pixel index when it is getting created. Then we can completely remove state management of `replaceTransPixelsInSavedImage` and this check. test/jdk/sun/awt/image/gif/GifComparison.java line 117: > 115: * conditions are met. > 116: */ > 117: public static BufferedImage run(URL srcURL) throws Throwable { If we can actually update this helper to check a specific frame is GIF and not run throw all the frame its better. In this PR we just need the info of 4th frame. Is this way of checking all frames useful in any other PR's which you have raised? test/jdk/sun/awt/image/gif/GifEmptyBackgroundTest.java line 40: > 38: BufferedImage bi = GifComparison.run(srcURL); > 39: > 40: if (new Color(bi.getRGB(20, 20), true).getAlpha() != 0) { Without the product fix this test fails while checking opacity of (0,0) itself and we don't hit this check. `Exception in thread "main" java.lang.Error: pixels at (0, 0) have different opacities: 0 vs ff000000` ------------- PR Review: https://git.openjdk.org/jdk/pull/25044#pullrequestreview-2871107750 PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2912699099 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109208157 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109288435 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109298270 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109318427 From joehw at openjdk.org Tue May 27 16:27:56 2025 From: joehw at openjdk.org (Joe Wang) Date: Tue, 27 May 2025 16:27:56 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 14:29:23 GMT, Magnus Ihse Bursie wrote: > After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. java.xml changes look good to me. But as you already asked, the translation team owns most of these files. ------------- Marked as reviewed by joehw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25229#pullrequestreview-2871771071 From jlu at openjdk.org Tue May 27 16:34:52 2025 From: jlu at openjdk.org (Justin Lu) Date: Tue, 27 May 2025 16:34:52 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: On Mon, 26 May 2025 08:25:30 GMT, Magnus Ihse Bursie wrote: >> After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. > > @justin-curtis-lu Are these files handled by the translation team? @magicus The ones under java.xml and jdk.jdi are updated by the translation team, I think it'd be best to remove those files from this change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25229#issuecomment-2913234396 From naoto at openjdk.org Tue May 27 16:37:56 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 27 May 2025 16:37:56 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: References: <5oMrogxJyi1_OsPAGntbPTiR5aCIFOTuDSUTKOv7wyo=.b715c9d2-0cdd-4585-a262-bdbe5a72a5fa@github.com> Message-ID: On Mon, 26 May 2025 07:44:30 GMT, Magnus Ihse Bursie wrote: >> test/jdk/sun/text/resources/LocaleDataTest.java line 106: >> >>> 104: * FormatData/fr_FR/MonthNames/0=janvier >>> 105: * FormatData/fr_FR/MonthNames/1=f?vrier >>> 106: * LocaleNames/fr_FR/US=?tats-Unis >> >> This test data (LocaleData.cldr) is explicitly encoded in ISO-8859-1 with unicode escapes for characters outside of it. So only changing these ones in comment does not seem correct. > > ISO-8859-1 does not sound good, and got me worried. But in fact it seems like the file is pure ASCII, and that is fine. > > However, if the file should ever be changed to include actual ISO-8859-1 encoding, this might break if tools assume it is UTF-8-encoding, since not all ISO-8859-1 encodings are valid UTF-8. Thanks. Filed an issue to change the encoding in the test to UTF-8: https://bugs.openjdk.org/browse/JDK-8357882 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2109668481 From naoto at openjdk.org Tue May 27 17:03:53 2025 From: naoto at openjdk.org (Naoto Sato) Date: Tue, 27 May 2025 17:03:53 GMT Subject: RFR: 8356978: Convert unicode sequences in Java source code to UTF-8 In-Reply-To: References: Message-ID: On Wed, 14 May 2025 14:29:23 GMT, Magnus Ihse Bursie wrote: > After we converted the source base to be fully UTF-8, we do not need to use unicode sequences (like \u0123) in string literals. Sometimes, that might still make sense, as for control characters, non-breaking space, etc. But for strings that is supposed to be a coherent text in a language that needs non-ASCII parts of Unicode, this is not so. Instead, having the sequences makes the text just harder to read and edit. We have already removed several such sequences before, but some remains. Those TimeZoneNames* resource bundles are in fact leftovers from COMPAT locale provider removal. I am going to remove those files later so you can exclude them. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25229#issuecomment-2913310841 From aivanov at openjdk.org Tue May 27 17:12:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 27 May 2025 17:12:53 GMT Subject: RFR: 8354944: Remove unnecessary PartiallyOrderedSet.nodes In-Reply-To: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> References: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> Message-ID: On Wed, 16 Apr 2025 20:50:24 GMT, Andrey Turbanov wrote: > We can use `javax.imageio.spi.PartiallyOrderedSet#poNodes` directly Looks reasonable. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24699#pullrequestreview-2871902920 From aivanov at openjdk.org Tue May 27 17:19:07 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 27 May 2025 17:19:07 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy In-Reply-To: References: Message-ID: <_jvr0WzcP-UyJuR_N75_POTFnJNkKaV8gk1r1oI3PkE=.d35f882a-dc77-47a9-b4ec-e8bbd3983f33@github.com> On Thu, 22 May 2025 21:21:30 GMT, Sergey Bylokhov wrote: > The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 > > AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. > > One of the test is updated just to touch that codepath. Looks good. I'll submit a test job. test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 171: > 169: System.out.println("[Simple test failed!!]"); > 170: throw new RuntimeException( > 171: "Test failed didn't return " + expected + "-sized array"); Suggestion: "Test didn't return " + expected + "-sized array"); ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25401#pullrequestreview-2871915591 PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2109746291 From honkar at openjdk.org Tue May 27 17:23:04 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 17:23:04 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: <7env98PduHPZ06t99_jkG0988p4Ri1pE5O2l-ddORgA=.43c48f8a-4552-45c9-a29f-a28917f3d654@github.com> References: <7env98PduHPZ06t99_jkG0988p4Ri1pE5O2l-ddORgA=.43c48f8a-4552-45c9-a29f-a28917f3d654@github.com> Message-ID: On Thu, 23 Jan 2025 01:00:00 GMT, Harshitha Onkar wrote: >> Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? > > @alisenchung > >> I also tested windows and found different behavior from what Harshitha found - robot.mouseMove was already clamping on my primary screen, would not move to the second monitor, and did not throw any NPEs. > > Tested it on windows again on different scales and found a possible rounding error that might be the cause for NPE on windows. [Corner case] > > To save time you can run the test with multiple `@run` and different uiScales and do not have to change it manually in settings. > > > * @run main/othervm -Dsun.java2d.uiScale=1 MouseMoveOffScreen > * @run main/othervm -Dsun.java2d.uiScale=1.25 MouseMoveOffScreen > * @run main/othervm -Dsun.java2d.uiScale=1.75 MouseMoveOffScreen > * @run main/othervm -Dsun.java2d.uiScale=2 MouseMoveOffScreen > * @run main/othervm -Dsun.java2d.uiScale=1.5 MouseMoveOffScreen > > > Following are the logs. > Observe the width of the primary screen and the point returned from fillPointWithCoords() in getPointerInfo(). > > uiScale: 1 - Passes > Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1920,height=1080] > Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=0,y=0,**width=3440**,height=1440] > Point: java.awt.Point[**x=3439**,y=200] > > uiScale: 1.25 - Passes > Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1536,height=864] > Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=0,y=0,**width=2752**,height=1152] > Point: java.awt.Point[**x=2751**,y=200] > > **uiScale: 1.5 - Fails** > Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1280,height=720] > Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=0,y=0,**width=2293**,height=960] > Point: java.awt.Point[**x=2293**,y=200] => **Since x coordinate = width, bounds.contains(point) returns false for point on the edge/bounds of the screen.** > > uiScale: 1.75 - Passes > Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1097,height=617] > Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=0,y=0,width=1966,height=823] > Point: java.awt.Point[x=0,y=200] => clamps to zero once coordinates are past the width of the screen. > > We probably need to look into `fillPointWithCoords()` too and check if is implemented differently on different platforms. MouseMoveOffScreen.java still fails on windows on uiScale =1.5, 2.5 for reasons mentioned above. Since the fix is macOS specific: To handle this corner case either the test can be made macOS specific OR another way is to set uiScale=1 and run on all platforms. Maybe we can see what other reviewers suggest. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2109750018 From honkar at openjdk.org Tue May 27 17:23:03 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 17:23:03 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 Changes requested by honkar (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22781#pullrequestreview-2871921531 From honkar at openjdk.org Tue May 27 17:31:05 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 17:31:05 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Wed, 30 Apr 2025 21:13:12 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 > - move clamping code into macos > - use absolute distance to choose correct screen for offscreen clamping > - helper function > - grab screen data on mouseMove > - fix bounds > - peer.mouseMove > - fix implementation > - robot update > - Revert "robot multimonitor fix" > > This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. > - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 52: > 50: for (int i = 0; i < gs.length; i++) { > 51: r[i] = gs[i].getDefaultConfiguration().getBounds(); > 52: } @alisenchung I would suggest logging screen bounds (provides better debug info for anyone running the test) Suggestion: for (int i = 0; i < gs.length; i++) { r[i] = gs[i].getDefaultConfiguration().getBounds(); System.out.println("Screen: "+ gs[i].getIDstring() + " Bounds: " + r[i]); } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2109774604 From achung at openjdk.org Tue May 27 17:31:05 2025 From: achung at openjdk.org (Alisen Chung) Date: Tue, 27 May 2025 17:31:05 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13] In-Reply-To: References: <9AGmijUihfKByG0s85OTZWydgd_Njke32gzQ4CgYI_g=.343e3960-d0c5-419a-9baa-2e031da66665@github.com> Message-ID: On Fri, 23 May 2025 00:24:17 GMT, Harshitha Onkar wrote: >> Alisen Chung has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 17 commits: >> >> - Merge branch 'master' of https://github.com/openjdk/jdk into 8345538 >> - move clamping code into macos >> - use absolute distance to choose correct screen for offscreen clamping >> - helper function >> - grab screen data on mouseMove >> - fix bounds >> - peer.mouseMove >> - fix implementation >> - robot update >> - Revert "robot multimonitor fix" >> >> This reverts commit 5734165881a66dc48d5a9f19e02bf63fac57cdc9. >> - ... and 7 more: https://git.openjdk.org/jdk/compare/8b16897b...e0a5c872 > > test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 80: > >> 78: } >> 79: return p; >> 80: } > > I believe validateOffScreen() was added to prevent edge or boundary case rounding error as observed here - https://github.com/openjdk/jdk/pull/22781/files#r1926210713 This check was added to ensure that the offscreen point chosen was indeed offscreen. https://github.com/openjdk/jdk/pull/22781#discussion_r1929111847 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2109775306 From duke at openjdk.org Tue May 27 17:32:22 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 27 May 2025 17:32:22 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v7] In-Reply-To: References: Message-ID: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) (this one) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: - 8356137: remove the redundant transparency check This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2109318427 - 8356137: flood fill saved_image at initialization This is in response to: https://github.com/openjdk/jdk/pull/25044#issuecomment-2912699099 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/19804549..62c2bf0d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=05-06 Stats: 20 lines in 2 files changed: 4 ins; 16 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Tue May 27 17:32:23 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 27 May 2025 17:32:23 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v6] In-Reply-To: References: Message-ID: <2PRW76xBqSJF6YSpfP3A-NdD8W16S8ucJMwKY1vTFGc=.36f686f7-c4fa-4d92-baaa-e25a5d139258@github.com> On Tue, 27 May 2025 14:19:23 GMT, Jayathirth D V wrote: > I think this is better then current approach of having check multiple times. OK. I switched back to this approach. (The downside being: now we'll invoke Arrays.fill(..) for *all* gifs with that disposal method. I assume (?) gifs with this architecture/problem are a small subset of that group; but it's impossible to quantify that hunch.) > test/jdk/sun/awt/image/gif/GifEmptyBackgroundTest.java line 40: > >> 38: BufferedImage bi = GifComparison.run(srcURL); >> 39: >> 40: if (new Color(bi.getRGB(20, 20), true).getAlpha() != 0) { > > Without the product fix this test fails while checking opacity of (0,0) itself and we don't hit this check. > > `Exception in thread "main" java.lang.Error: pixels at (0, 0) have different opacities: 0 vs ff000000` OK, this is removed. That was a redundant check intended to: A. Reinforce what inspired this test B. Double-check that ImageIO also did the right thing. (That is: the new GifComparison makes sure ImageIO and ToolkitImage are identical. But if they happened to *both* be wrong then GifComparison would be satisfied, so this confirmed the test gif file really was parsed correctly.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25044#issuecomment-2913381669 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109776140 From achung at openjdk.org Tue May 27 17:35:17 2025 From: achung at openjdk.org (Alisen Chung) Date: Tue, 27 May 2025 17:35:17 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v14] In-Reply-To: References: Message-ID: <-wufduQaG7bNR6MZksflsgCitkejQfKDFxXKNhB-2bQ=.998703db-0369-4d4c-98fc-1036e0479ed8@github.com> > Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. > > Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. > > This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: - add logging to test - test require macos, spacing in crobot ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22781/files - new: https://git.openjdk.org/jdk/pull/22781/files/e0a5c872..01a31976 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=12-13 Stats: 4 lines in 2 files changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22781.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22781/head:pull/22781 PR: https://git.openjdk.org/jdk/pull/22781 From serb at openjdk.org Tue May 27 17:38:32 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 27 May 2025 17:38:32 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: References: Message-ID: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> > The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 > > AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. > > One of the test is updated just to touch that codepath. Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java Co-authored-by: Alexey Ivanov ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25401/files - new: https://git.openjdk.org/jdk/pull/25401/files/36560145..afb10b6d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25401&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25401&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25401.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25401/head:pull/25401 PR: https://git.openjdk.org/jdk/pull/25401 From abhiscxk at openjdk.org Tue May 27 17:58:31 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 27 May 2025 17:58:31 GMT Subject: RFR: 8341311: [Accessibility,macOS,VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu Message-ID: VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. Issue: Problem is with the a11y subsystem method call to get the accessible children details. Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. ------------- Commit messages: - Popupmenu child count fix Changes: https://git.openjdk.org/jdk/pull/25470/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25470&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8341311 Stats: 178 lines in 3 files changed: 176 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25470.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25470/head:pull/25470 PR: https://git.openjdk.org/jdk/pull/25470 From abhiscxk at openjdk.org Tue May 27 17:58:31 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 27 May 2025 17:58:31 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu In-Reply-To: References: Message-ID: On Tue, 27 May 2025 17:01:16 GMT, Abhishek Kumar wrote: > VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. > > Issue: Problem is with the a11y subsystem method call to get the accessible children details. > > Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. > > Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. > > Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. > > `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` > > **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. @azuev-java Please review the proposed fix. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25470#issuecomment-2913335444 From duke at openjdk.org Tue May 27 18:21:40 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 27 May 2025 18:21:40 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v8] In-Reply-To: References: Message-ID: > This resolves a gif parsing bug where an unwanted opaque rectangle could appear under these conditions: > > 1. The disposal method for frames is 1 (meaning "do not dispose", aka "DISPOSAL_SAVE") > 2. The transparent pixel is non-zero > 3. There's more than one such consecutive frame > > Previously: the GifImageDecoder would leave the saved_image pixels as zero when they were supposed to be transparent. This works great if the transparent pixel index is zero, but it flood fills the background of your frame with the zeroeth color otherwise. > > I wrote four PRs that share the GifComparison class in this PR. Once any of them clear code review the other PRs will be much simpler: > > 1. [8357034](https://github.com/openjdk/jdk/pull/25264) > 2. [8356137](https://github.com/openjdk/jdk/pull/25044) (this one) > 3. [8356320](https://github.com/openjdk/jdk/pull/25076) > 4. [8351913](https://github.com/openjdk/jdk/pull/24271) Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: - 8356137: trivial javadoc update - 8356137: only inspect last frame of gif This makes the main() method much less useful, so I removed it too. (I originally used this class to explore a folder of hundreds of gifs to look for discrepancies. But the discrepancies were rarely only on the last frame.) This is in response to: https://github.com/openjdk/jdk/pull/25044#discussion_r2109298270 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25044/files - new: https://git.openjdk.org/jdk/pull/25044/files/62c2bf0d..e0546b1a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25044&range=06-07 Stats: 92 lines in 1 file changed: 0 ins; 53 del; 39 mod Patch: https://git.openjdk.org/jdk/pull/25044.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25044/head:pull/25044 PR: https://git.openjdk.org/jdk/pull/25044 From duke at openjdk.org Tue May 27 18:21:41 2025 From: duke at openjdk.org (Jeremy Wood) Date: Tue, 27 May 2025 18:21:41 GMT Subject: RFR: 8356137: GifImageDecode can produce opaque image when disposal method changes [v6] In-Reply-To: References: Message-ID: <9J0uONYi0i2h5am63nTXe-uFszJsi0jzstPvzRJ5Ngg=.22c64492-71e7-4a35-9455-62698f78752e@github.com> On Tue, 27 May 2025 13:32:33 GMT, Jayathirth D V wrote: >> Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: >> >> 8356137: Adding copyright to GifComparison > > src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java line 419: > >> 417: // are NOT the transparent pixel: we need to replace it >> 418: // with the appropriate transparent pixel. >> 419: boolean replaceTransPixelsInSavedImage = save && > > We can move this check to the place where we actually create and initialize saved image. I think this thread is moot having addressed https://github.com/openjdk/jdk/pull/25044#issuecomment-2912699099 . > src/java.desktop/share/classes/sun/awt/image/GifImageDecoder.java line 436: > >> 434: } >> 435: runstart = -1; >> 436: if (replaceTransPixelsInSavedImage) { > > We are hitting this check for each transparent pixel for all frames with transparent pixel index > 0 and not initial frame until saved_image is not null. In the .gif present in this PR we are checking this condition for each transparent pixel of 2nd and 3rd frame. If GIF contains many frames and disposal method save comes in later part of animation we will hit this check many times. > > I think its better to just initialize saved_image with proper transparent pixel index when it is getting created. Then we can completely remove state management of `replaceTransPixelsInSavedImage` and this check. OK; I think this thread is moot having addressed https://github.com/openjdk/jdk/pull/25044#issuecomment-2912699099 . > Is this way of checking all frames useful in any other PR's which you have raised? No, I don't think so. (I liked the assurance that every frame was identical, but technically that is beyond the scope of each individual unit test.) I changed this method to only inspect the last frame. This made the GifComparison's main() class much less useful, so I removed it. So now the GifComparison class is more limited in scope to unit tests -- and it's no longer a generic tool to identify new problems. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109860678 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109860766 PR Review Comment: https://git.openjdk.org/jdk/pull/25044#discussion_r2109856464 From azvegint at openjdk.org Tue May 27 18:23:01 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 27 May 2025 18:23:01 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v12] In-Reply-To: <-76yVSjHyZOGJGVcySdiBScPH6Si-zEztJ1rMNhG_OE=.5809f733-8a59-49d4-bf38-b7b7041ce9e3@github.com> References: <0645YLoDLjcLbjQxBs3QFCFVvenQjAeJlZANZ0hay_8=.e50b8551-4a2f-4cc5-b910-5f5544beb1f7@github.com> <-76yVSjHyZOGJGVcySdiBScPH6Si-zEztJ1rMNhG_OE=.5809f733-8a59-49d4-bf38-b7b7041ce9e3@github.com> Message-ID: On Fri, 23 May 2025 11:44:13 GMT, Roman Marchenko wrote: >>> FYI, one of the JCK introspector tests fails because of this change. The test is quite complicated, so I am not able to provide a simple reproducer right away. But I'll post it later. >> >> Indeed, there are some failures of JCK Introspector tests. > > I restored the original order processing, now seems OK for me locally. > Could you review, please? Everything seems to be fine now. Thank you. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23443#discussion_r2109864011 From azvegint at openjdk.org Tue May 27 18:23:00 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 27 May 2025 18:23:00 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v13] In-Reply-To: References: Message-ID: <2HBylkhP8syMAMr_zclzuwNzlD7YPlPp137fSQXJ_Pw=.e5391b4b-d3f9-4d8f-ae78-11a88ca2176b@github.com> On Fri, 23 May 2025 11:48:38 GMT, Roman Marchenko wrote: >> Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. >> >> Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. >> >> --------- >> `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. >> >> When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: >> >> - In case of a clash with a class method, the class version will take precedence rather than interface's one. >> - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. >> - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. >> >> `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: >> >> * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. >> * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). >> * Gettters/setters declared and not implemented are not considered. > > Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: > > Restored the original order processing Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/23443#pullrequestreview-2872097632 From serb at openjdk.org Tue May 27 18:27:00 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 27 May 2025 18:27:00 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v10] In-Reply-To: References: Message-ID: <9Oco8sXX2wF_26udEZoISllR58JH5Qs1m22_UDdXK78=.465a992c-4304-4f23-944e-ca67203393d3@github.com> On Sun, 25 May 2025 17:06:49 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Is it possible to cover the latest change(for the hang) by the test? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2913523700 From serb at openjdk.org Tue May 27 18:31:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 27 May 2025 18:31:55 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v9] In-Reply-To: References: Message-ID: On Mon, 14 Apr 2025 13:28:09 GMT, Alexey Ivanov wrote: >> I ran this changes through CI testing, and the results are good. > >> I do not have any other comments, @aivanov-jdk please take a look. >> >> @aivanov-jdk ?\ >> Could you review the PR, please? > > I'm currently busy, I'll get to look at this PR as soon as I can. > > Does it make sense to expand tests to cover cases that @mrserb brought up? With module system and exported vs non-exported classes and interfaces? > Could you review, please? @aivanov-jdk @mrserb @azvegint Please update the test to cover the latest change. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2913536248 From myankelevich at openjdk.org Tue May 27 18:59:56 2025 From: myankelevich at openjdk.org (Mikhail Yankelevich) Date: Tue, 27 May 2025 18:59:56 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu In-Reply-To: References: Message-ID: <_sXctfl4hH0eURjW3o_R0DLJp03F6VPioRzxcJ93xRQ=.263c5f31-f5ed-4975-865f-11721a0bdc1a@github.com> On Tue, 27 May 2025 17:01:16 GMT, Abhishek Kumar wrote: > VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. > > Issue: Problem is with the a11y subsystem method call to get the accessible children details. > > Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. > > Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. > > Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. > > `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` > > **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. test/jdk/javax/accessibility/TestPopupMenuChildCount.java line 42: > 40: */ > 41: > 42: public class TestPopupMenuChildCount { Nitpick: as far as I understand, this is for macOS only. Do you think it would make more sense to have a name mention that the test is Mac only? The same for test description. Seems to me a bit confusing otherwise It's fine with me if you leave it as it is though. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2109947825 From honkar at openjdk.org Tue May 27 19:03:00 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 19:03:00 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v14] In-Reply-To: <-wufduQaG7bNR6MZksflsgCitkejQfKDFxXKNhB-2bQ=.998703db-0369-4d4c-98fc-1036e0479ed8@github.com> References: <-wufduQaG7bNR6MZksflsgCitkejQfKDFxXKNhB-2bQ=.998703db-0369-4d4c-98fc-1036e0479ed8@github.com> Message-ID: <_MbhPx0hjMYzsivvzGyhbsufrngTpK3cikZzS6CWfM8=.36f30463-35da-46b3-a29c-26cf820e0f6e@github.com> On Tue, 27 May 2025 17:35:17 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: > > - add logging to test > - test require macos, spacing in crobot Latest changes LGTM on macOS (single and dual-monitor setup). Please ensure to sync mainline and run CI for sanity check. src/java.desktop/macosx/classes/sun/lwawt/macosx/CRobot.java line 85: > 83: int currXDiff = Math.abs(x - cP.x); > 84: int currYDiff = Math.abs(y - cP.y); > 85: int currDiff = (int) Math.round(Math.hypot(currXDiff, currYDiff)); Since `Math.hypot(currXDiff, currYDiff)` translates to `sqrt(currXDiff^2, currYDiff^2)`, ideally Math.abs in redundant on previous lines. But no harm in keeping it. Suggestion: int currXDiff = x - cP.x; int currYDiff = y - cP.y; int currDiff = (int) Math.round(Math.hypot(currXDiff, currYDiff)); ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22781#pullrequestreview-2872218256 PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r2109944370 From prr at openjdk.org Tue May 27 19:04:50 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 27 May 2025 19:04:50 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v11] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/c92a8ba9..e04dd106 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=09-10 Stats: 5 lines in 1 file changed: 2 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Tue May 27 19:04:50 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 27 May 2025 19:04:50 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v10] In-Reply-To: <9Oco8sXX2wF_26udEZoISllR58JH5Qs1m22_UDdXK78=.465a992c-4304-4f23-944e-ca67203393d3@github.com> References: <9Oco8sXX2wF_26udEZoISllR58JH5Qs1m22_UDdXK78=.465a992c-4304-4f23-944e-ca67203393d3@github.com> Message-ID: On Tue, 27 May 2025 18:24:43 GMT, Sergey Bylokhov wrote: > Is it possible to cover the latest change(for the hang) by the test? Do you mean show that calling loop() doesn't prevent exit ? I can just add a call to loop() at the end of the test. If it doesn't terminate the test will fail with a timeout. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2913617031 From aturbanov at openjdk.org Tue May 27 20:46:03 2025 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 27 May 2025 20:46:03 GMT Subject: Integrated: 8354944: Remove unnecessary PartiallyOrderedSet.nodes In-Reply-To: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> References: <11dR4gRM1RWgmx8FloFzy3dfZOwn3zIPjiD0690ZdEw=.2662d35c-e7bf-400f-a224-df53967202eb@github.com> Message-ID: On Wed, 16 Apr 2025 20:50:24 GMT, Andrey Turbanov wrote: > We can use `javax.imageio.spi.PartiallyOrderedSet#poNodes` directly This pull request has now been integrated. Changeset: 11ad1733 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/11ad1733f8db3d8e868383fc9826963b9ffd620f Stats: 9 lines in 1 file changed: 0 ins; 4 del; 5 mod 8354944: Remove unnecessary PartiallyOrderedSet.nodes Reviewed-by: serb, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/24699 From prr at openjdk.org Tue May 27 21:31:22 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 27 May 2025 21:31:22 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v12] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/e04dd106..9a282d2a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=10-11 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Tue May 27 22:17:20 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 27 May 2025 22:17:20 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v13] In-Reply-To: References: Message-ID: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/9a282d2a..58649f22 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=11-12 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From serb at openjdk.org Tue May 27 22:27:56 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 27 May 2025 22:27:56 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v10] In-Reply-To: References: <9Oco8sXX2wF_26udEZoISllR58JH5Qs1m22_UDdXK78=.465a992c-4304-4f23-944e-ca67203393d3@github.com> Message-ID: On Tue, 27 May 2025 19:00:18 GMT, Phil Race wrote: > Do you mean show that calling loop() doesn't prevent exit ? I can just add a call to loop() at the end of the test. If it doesn't terminate the test will fail with a timeout. jtreg terminates all threads and the test vm after the main method completes, so I believe the updated test would pass even before this change (when a non-daemon thread was used). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2914318955 From prr at openjdk.org Tue May 27 23:13:00 2025 From: prr at openjdk.org (Phil Race) Date: Tue, 27 May 2025 23:13:00 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v24] In-Reply-To: References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: <8nB0Stxw9Qbs2FRElahZWOK5AVkSpOftlgcKuSFnPsI=.edda5259-7541-421d-a8af-2aa6605ae4bf@github.com> On Wed, 12 Mar 2025 11:00:30 GMT, Prasanta Sadhukhan wrote: >> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. >> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review comments fix > I checked rbma.cpp output where I think we can only support the 4th item in the list (which is this) ![image](https://private-user-images.githubusercontent.com/43534309/447489844-32067d1a-8ab2-444c-8db3-265f0e64f6ec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgzODU5OTgsIm5iZiI6MTc0ODM4NTY5OCwicGF0aCI6Ii80MzUzNDMwOS80NDc0ODk4NDQtMzIwNjdkMWEtOGFiMi00NDRjLThkYjMtMjY1ZjBlNjRmNmVjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI3VDIyNDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWVmN2Q3MTJmMGNhNWM5YzE4MWI5YjMxNDYwYmQ1MWJiNmJjY2VjMzI4M2I2YTQwNTI5ZDUwYWE4MDNlMzA0N2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IKs2UKVCkF23JhYXnMGG5D78UdFV8o974fA74X6zelk) > > This is because we have [JRadioButtonMenuItem](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/JRadioButtonMenuItem.html#%3Cinit%3E(java.lang.String,javax.swing.Icon,boolean))([String](https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/String.html) text, [Icon](https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/Icon.html) icon, boolean selected) API which only supports one icon image (so checked/unchecked icon image **in addition** to item icon as below image is not possible in my opinion in Java swing) Not sure I know what you mean by 4th item, but clearly we aren't going to add an API to supply checked/unchecked images. But we should support *rendering* like you show above. - app supplies icon image and text, WE supply the radio button. - > > ![image](https://private-user-images.githubusercontent.com/43534309/447492462-581f4e36-6b55-4a1c-8a5a-465741e43858.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgzODU5OTgsIm5iZiI6MTc0ODM4NTY5OCwicGF0aCI6Ii80MzUzNDMwOS80NDc0OTI0NjItNTgxZjRlMzYtNmI1NS00YTFjLThhNWEtNDY1NzQxZTQzODU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI3VDIyNDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU5ZmFiYmZmYzUyN2NlYTQyMTg2NTZkYjM3YjI5YmU5OTViOTllY2E0YTRkOWFhM2U5ZDhjNGNmZGU5NTNiZjAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HndjszTSwBDh3V39rS-aoDZI8G6JEsxOAxn95BSpFIA) > > The current state of PR supports this 4th item. What is "this 4th item" ? You mean the case of image + text from app, and WE display a radio button checked ? Only thing different is when there is no imageicon and menuitem is selected, then the text seems to be in same vertical line as the other items (in native rbma output) ![image](https://private-user-images.githubusercontent.com/43534309/447490318-897f3277-df2e-4827-8381-e51ad8007251.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgzODU5OTgsIm5iZiI6MTc0ODM4NTY5OCwicGF0aCI6Ii80MzUzNDMwOS80NDc0OTAzMTgtODk3ZjMyNzctZGYyZS00ODI3LTgzODEtZTUxYWQ4MDA3MjUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI3VDIyNDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNhNjM1MTU5OTg1Njc0ZTNlOGI3NmQ1MDU0Y2EzYjUyNzM0ZTQ5ZjI2NmQyYzFmMWM1OTViNjEwZGY2MmExY2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NJqfKGrADw05FVzfOtTbNoHLr8w3WsUNv98kf8GaHaM) > > but current PR the text is shifted to left (when there is no imageicon ie 3rd item in list) and occupies icon space, as below ! If you mean windows always lines up the start of the text, that seems to be true. So we should do the same. [image](https://private-user-images.githubusercontent.com/43534309/447504446-43fb1ccc-b475-4147-8131-22f2fc918375.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgzODU5OTgsIm5iZiI6MTc0ODM4NTY5OCwicGF0aCI6Ii80MzUzNDMwOS80NDc1MDQ0NDYtNDNmYjFjY2MtYjQ3NS00MTQ3LTgxMzEtMjJmMmZjOTE4Mzc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI3VDIyNDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg3NTVkZmM3OWM4NTI1Zjg3ZTI4NTg1MmNlMTc2NDZkYmM4YmQ4MTk4MWFkMDkwYTQyYjMwZDNhNWIyNDQ5NjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vyGdZfku-sAx05JjUijTBsjXg9BWoIjjwUe3x6CMxcM) > > This is because in most cases (and in SwingSet2) the radiomenu items are drawn without imageicon and there is no extra space between radio bullet and menu text it seems to me that if there's an image in ANY menu item, Windows reserves the space in all items, hence getting the text aligned. It just does the funky thing of moving where it displays the item image if there's no checked image. > > ![image](https://private-user-images.githubusercontent.com/43534309/447499626-c5cd5840-d58e-4456-8217-cf7f3ba9bb4e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDgzODU5OTgsIm5iZiI6MTc0ODM4NTY5OCwicGF0aCI6Ii80MzUzNDMwOS80NDc0OTk2MjYtYzVjZDU4NDAtZDU4ZS00NDU2LTgyMTctY2Y3ZjNiYTliYjRlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTA1MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwNTI3VDIyNDEzOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjOTNiZDc3YWY5ZDZlMjZhOTFmODg1NjkxZGFlMDk2YzE2OGY3ODdhOGY2MjQxNzU5MDNkNWFmYjY0Y2QxNjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.yDEGF7-fRybLIyfHX1AnEqL-76nHD-b17g3p-9xmShg) > > so if we cater to text shifting to same vertical line, there will be difference in behavior w.r.t existing one and user will notice a shift in text to accomodate non-existing image icon) You mean user will notice text is now aligned ? I think that's fine. > > but it is fixable, so if we are in consensus about supporting the 4th item in rbma.cpp output in Java swing with text in same vertical offset, then let mw know..Anything else in addition needs discussion whether we can support... I hope (!) we are on the same page. Let me try and say it so we are .. - WE will always draw a check (tick) or radio button to show the selected item - WE will always reserve space for that tick - WE will never over-write the check/tick with the icon image. - Icon images will never move (unlike the funky windows case which is the root of all of this) because we will always reserve space for it. - If ANY item has an icon image, ALL items reserve the space, even if not used, this is needed for the next item : - Text strings will all align. Always ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2914400828 From honkar at openjdk.org Tue May 27 23:36:50 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 23:36:50 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Thu, 22 May 2025 19:55:34 GMT, Sergey Bylokhov wrote: >> Recent AWT test updates have UI creation wrapped in EDT. I have seen many reviewers recommend using EDT even with AWT components. >> >> Recently came across another PR where EDT is recommended. >> https://github.com/openjdk/jdk/pull/25278#discussion_r2098939094 >> https://github.com/openjdk/jdk/pull/25278#discussion_r2100689626 > > For external use in apps we can recommend it so it will be unified for swing and awt, but for internal use we cannot simply switch to EDT as a cleanup or a bug fix. The code related to awt/2d runs in various threads and must be properly synchronized. @mrserb I can remove the EDT but I do think retaining them will stabilize this test based on the context of test failure. - Test does NOT fail when it is run multiple times on macos-aarch64 but only when entire test suite is run. Can it still be synchronization issue if it is not reproducible when test is run multiple times? - The test repeated fails on macos-aarch64 only when the entire test suite is run so I suspect this could be the effect of couple of Graphics tests that was recently open-sourced and indeed this matches with the timeline that this test started to fail repeatedly on macos-aarch64. - I didn't see any recent source code changesets that has direct relation to this test failure. There was one recent change to copyArea and ongoing subsequent change https://github.com/openjdk/jdk/pull/25340 but the test does not hit the code path in Blit.c or MaskBlit.c so that eliminates these changes as the cause. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2110529825 From honkar at openjdk.org Tue May 27 23:53:51 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 27 May 2025 23:53:51 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Tue, 27 May 2025 23:34:32 GMT, Harshitha Onkar wrote: >> For external use in apps we can recommend it so it will be unified for swing and awt, but for internal use we cannot simply switch to EDT as a cleanup or a bug fix. The code related to awt/2d runs in various threads and must be properly synchronized. > > @mrserb > > I can remove the EDT but I do think retaining them will stabilize this test based on the context of test failure. > > - Test does NOT fail when it is run multiple times on macos-aarch64 but only when entire test suite is run. Can it still be synchronization issue if it is not reproducible when test is run multiple times? > > - The test repeated fails on macos-aarch64 only when the entire test suite is run so I suspect this could be the effect of couple of Graphics tests that was recently open-sourced and indeed this matches with the timeline that this test started to fail repeatedly on macos-aarch64. > > - I didn't see any recent source code changesets that has direct relation to this test failure. There was one recent change to copyArea and ongoing subsequent change https://github.com/openjdk/jdk/pull/25340 but the test does not hit the code path in Blit.c or MaskBlit.c so that eliminates these changes as the cause. At the very least test requires to be de-problemlisted to obtain the screenshots at the time of failure to see the state of the Frame. This test repeatedly fails due to the same error at the same point (at x=267 y=212) which is about mid-way of the frame where the color is expected to be black but the actual is white. java.lang.RuntimeException: Test failed for background region at x=267 y=212 (expected=ff000000 actual=ffffffff) at CopyAreaOOB.testRegion(CopyAreaOOB.java:97) at CopyAreaOOB.paint(CopyAreaOOB.java:77) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2110553753 From serb at openjdk.org Wed May 28 01:10:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 01:10:02 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Tue, 27 May 2025 23:51:05 GMT, Harshitha Onkar wrote: >> @mrserb >> >> I can remove the EDT but I do think retaining them will stabilize this test based on the context of test failure. >> >> - Test does NOT fail when it is run multiple times on macos-aarch64 but only when entire test suite is run. Can it still be synchronization issue if it is not reproducible when test is run multiple times? >> >> - The test repeated fails on macos-aarch64 only when the entire test suite is run so I suspect this could be the effect of couple of Graphics tests that was recently open-sourced and indeed this matches with the timeline that this test started to fail repeatedly on macos-aarch64. >> >> - I didn't see any recent source code changesets that has direct relation to this test failure. There was one recent change to copyArea and ongoing subsequent change https://github.com/openjdk/jdk/pull/25340 but the test does not hit the code path in Blit.c or MaskBlit.c so that eliminates these changes as the cause. > > At the very least this test requires to be de-problemlisted to obtain the screenshots at the time of failure to see the state of the Frame. > > This test repeatedly fails due to the same error at the same point (at x=267 y=212) which is about mid-way of the frame where the color is expected to be black but the actual is white. > > > java.lang.RuntimeException: Test failed for background region at x=267 y=212 (expected=ff000000 actual=ffffffff) > at CopyAreaOOB.testRegion(CopyAreaOOB.java:97) > at CopyAreaOOB.paint(CopyAreaOOB.java:77) > > > **Expected Frame** > > background So it does not seems to be a test bug? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2110640053 From abhiscxk at openjdk.org Wed May 28 02:24:02 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 28 May 2025 02:24:02 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu In-Reply-To: <_sXctfl4hH0eURjW3o_R0DLJp03F6VPioRzxcJ93xRQ=.263c5f31-f5ed-4975-865f-11721a0bdc1a@github.com> References: <_sXctfl4hH0eURjW3o_R0DLJp03F6VPioRzxcJ93xRQ=.263c5f31-f5ed-4975-865f-11721a0bdc1a@github.com> Message-ID: <-ik2Ehk-SMPAQCfVkToxWLiqC_3a7-LqJtkIRGfBaSc=.16a8a6c8-7d79-45ed-97cd-47ceb9853f9b@github.com> On Tue, 27 May 2025 18:57:32 GMT, Mikhail Yankelevich wrote: >> VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. >> >> Issue: Problem is with the a11y subsystem method call to get the accessible children details. >> >> Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. >> >> Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. >> >> Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. >> >> `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` >> >> **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. > > test/jdk/javax/accessibility/TestPopupMenuChildCount.java line 42: > >> 40: */ >> 41: >> 42: public class TestPopupMenuChildCount { > > Nitpick: as far as I understand, this is for macOS only. Do you think it would make more sense to have a name mention that the test is Mac only? The same for test description. Seems to me a bit confusing otherwise > > It's fine with me if you leave it as it is though. This test is only for macOS and that is conveyed through the jtreg tag [here](https://github.com/openjdk/jdk/blob/a225bf4bbe75aefffa63d54d2dff5577b3268339/test/jdk/javax/accessibility/TestPopupMenuChildCount.java#L36). I don't think test name needs to be changed. Although it is not essentially required but will update the test summary and instruction. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2110743375 From abhiscxk at openjdk.org Wed May 28 02:28:40 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 28 May 2025 02:28:40 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: References: Message-ID: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> > VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. > > Issue: Problem is with the a11y subsystem method call to get the accessible children details. > > Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. > > Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. > > Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. > > `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` > > **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Minor update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25470/files - new: https://git.openjdk.org/jdk/pull/25470/files/a225bf4b..6cebdff4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25470&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25470&range=00-01 Stats: 4 lines in 1 file changed: 2 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25470.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25470/head:pull/25470 PR: https://git.openjdk.org/jdk/pull/25470 From serb at openjdk.org Wed May 28 02:33:04 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 02:33:04 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v13] In-Reply-To: References: Message-ID: On Fri, 23 May 2025 11:48:38 GMT, Roman Marchenko wrote: >> Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. >> >> Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. >> >> --------- >> `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. >> >> When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: >> >> - In case of a clash with a class method, the class version will take precedence rather than interface's one. >> - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. >> - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. >> >> `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: >> >> * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. >> * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). >> * Gettters/setters declared and not implemented are not considered. > > Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: > > Restored the original order processing It would be nice to merge the master, the branch is quite outdated ------------- PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2914701595 From serb at openjdk.org Wed May 28 02:40:58 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 02:40:58 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: On Mon, 26 May 2025 02:38:43 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/share/classes/javax/swing/JSplitPane.java line 373: >> >>> 371: public void setComponentOrientation(ComponentOrientation orientation) { >>> 372: if (!orientation.equals(this.getComponentOrientation())) { >>> 373: super.setComponentOrientation(orientation); >> >> I would like to bring up for discussion whether we should move this line outside the if block. From what I can tell, it was always executed before the initial fix, so this change might affect the original behavior. > > If we call setComponentOrientation in test (like in TestSplitPaneOrientationTest.java which was added for JDK-4265389) then this check would fail as ComponentOrientation object would change if we call super.setComponentOrientation outside the if block (that is because `setComponentOrientation `stores the passed orientation so `this.getComponentOrientation` would always be same as `orientation `after `super.setComponentOrientation `call) and so left/right component would not be set.. > Also, the initial fix didn't have the ComponentOrientation support so that code is anyway redundant.. But we can read/save orientation, then call super, then make a check? I am not sure how important to always call super.setComponentOrientation(orientation); can we miss some notification fired from that method? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2110762409 From serb at openjdk.org Wed May 28 02:44:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 02:44:52 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v6] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Thu, 22 May 2025 20:44:30 GMT, Nikita Gubarkov wrote: >> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. >> >> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > Update D3DShaderGen.c Please confirm that you have built the debug versions on all platforms and checked the output for at least some of these methods. ------------- Marked as reviewed by serb (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24949#pullrequestreview-2873376948 From psadhukhan at openjdk.org Wed May 28 03:21:45 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 03:21:45 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v5] In-Reply-To: References: Message-ID: > The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. > This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. > Fixed by setting the divider location before rendering the left and right components.. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Store current orientation for check ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25294/files - new: https://git.openjdk.org/jdk/pull/25294/files/32fe70f5..f721cedc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25294&range=03-04 Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/25294.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25294/head:pull/25294 PR: https://git.openjdk.org/jdk/pull/25294 From psadhukhan at openjdk.org Wed May 28 03:23:51 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 03:23:51 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: References: Message-ID: <61tykjKijk-xkAT398xNxGXuqaSEBw88B4begSzHndo=.2a5c38cf-cef0-473d-bd86-516d7e21c47c@github.com> On Wed, 28 May 2025 02:38:07 GMT, Sergey Bylokhov wrote: >> If we call setComponentOrientation in test (like in TestSplitPaneOrientationTest.java which was added for JDK-4265389) then this check would fail as ComponentOrientation object would change if we call super.setComponentOrientation outside the if block (that is because `setComponentOrientation `stores the passed orientation so `this.getComponentOrientation` would always be same as `orientation `after `super.setComponentOrientation `call) and so left/right component would not be set.. >> Also, the initial fix didn't have the ComponentOrientation support so that code is anyway redundant.. > > But we can read/save orientation, then call super, then make a check? > I am not sure how important to always call super.setComponentOrientation(orientation); > can we miss some notification fired from that method? OK. Current orientation is stored and then checked and super.setComponentOrientation is called before check. I guess that method fires PropertyChangeEvent for orientation set and now it will be fired always like before.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2110805437 From psadhukhan at openjdk.org Wed May 28 03:31:53 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 03:31:53 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Fri, 23 May 2025 20:59:41 GMT, Phil Race wrote: >> Graphics copyArea overflow check bails out of copying pixels if there is overflow. >> The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" >> >> which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds >> but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. >> So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. > > src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 85: > >> 83: dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) >> 84: ? clipInfo.bounds.x2 : (dstx + width); >> 85: dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height) > > why wouldn't you always want to limit it to the clip ? > I mean shouldn't it be like this ? > dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) ? clipInfo.bounds.x2 : (((dstx + width) > clipInfo.bounds.x2) ? clipInfo.bounds.x2 : (dstx + width)); > or maybe a bit more readable as > dstInfo.bounds.x2 = ((UNSAFE_TO_ADD(dstx, width) || ((dstx + width) > clipInfo.bounds.x2)) ? clipInfo.bounds.x2 : (dstx + width); @prrace Since it is going to clip dstInfo.bounds to clipInfo.bounds in SurfaceData_IntersectBounds, I believe is not necessary to do the duplicate clip here. Let me know if you think otherwise.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2110814256 From psadhukhan at openjdk.org Wed May 28 03:41:06 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 03:41:06 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v24] In-Reply-To: <8nB0Stxw9Qbs2FRElahZWOK5AVkSpOftlgcKuSFnPsI=.edda5259-7541-421d-a8af-2aa6605ae4bf@github.com> References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> <8nB0Stxw9Qbs2FRElahZWOK5AVkSpOftlgcKuSFnPsI=.edda5259-7541-421d-a8af-2aa6605ae4bf@github.com> Message-ID: On Tue, 27 May 2025 23:10:11 GMT, Phil Race wrote: > I hope (!) we are on the same page. Let me try and say it so we are .. > > * WE will always draw a check (tick) or radio button to show the selected item > Yes, current PR does this.. > * WE will always reserve space for that tick > Yes, current PR does this. > * WE will never over-write the check/tick with the icon image. > Yes, current PR does this. > * Icon images will never move (unlike the funky windows case which is the root of all of this) because we will always reserve space for it. > Yes, icon image has its own space in current PR > * If ANY item has an icon image, ALL items reserve the space, even if not used, this is needed for the next item : > > * Text strings will all align. Always Current PR doesnt have this..Text string is not aligned for item that doesn't have iconimage with item that does have iconimage. I will fix this. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2914795445 From psadhukhan at openjdk.org Wed May 28 03:48:03 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 03:48:03 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v25] In-Reply-To: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: > When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. > If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. Prasanta Sadhukhan has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 29 additional commits since the last revision: - Merge branch 'master' of https://git.openjdk.java.net/jdk into JDK-8348760 - Review comments fix - Expand wildcard imports - Remove unneeded methods - Merge branch 'master' of https://git.openjdk.java.net/jdk into JDK-8348760 - Code duplication removed - Remove Windows L&F check from BasicMenuItemUI - Review comment fix - Test rename - Revert to non-CSR needed fix - ... and 19 more: https://git.openjdk.org/jdk/compare/fad5797e...ba7ecae3 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23324/files - new: https://git.openjdk.org/jdk/pull/23324/files/e20cfc05..ba7ecae3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23324&range=24 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23324&range=23-24 Stats: 505436 lines in 6900 files changed: 196150 ins; 275956 del; 33330 mod Patch: https://git.openjdk.org/jdk/pull/23324.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23324/head:pull/23324 PR: https://git.openjdk.org/jdk/pull/23324 From psadhukhan at openjdk.org Wed May 28 05:38:17 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 05:38:17 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v26] In-Reply-To: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: > When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. > If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Text alignment fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23324/files - new: https://git.openjdk.org/jdk/pull/23324/files/ba7ecae3..bfc108e3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23324&range=25 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23324&range=24-25 Stats: 8 lines in 1 file changed: 0 ins; 7 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/23324.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23324/head:pull/23324 PR: https://git.openjdk.org/jdk/pull/23324 From rmarchenko at openjdk.org Wed May 28 05:45:56 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Wed, 28 May 2025 05:45:56 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v14] In-Reply-To: References: Message-ID: > Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. > > Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. > > --------- > `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. > > When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: > > - In case of a clash with a class method, the class version will take precedence rather than interface's one. > - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. > - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. > > `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: > > * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. > * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). > * Gettters/setters declared and not implemented are not considered. Roman Marchenko has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 18 additional commits since the last revision: - Merge branch 'openjdk:master' into jdk-8347826 - Restored the original order processing - Fixing review comments - Implementing new requirements - Merge branch 'master' into jdk-8347826 - Fixing review comments - Fixing review comments 2 - Symmetric fix - minor fix - minor fix - ... and 8 more: https://git.openjdk.org/jdk/compare/b63c9c9a...779194f1 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23443/files - new: https://git.openjdk.org/jdk/pull/23443/files/431705a0..779194f1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=12-13 Stats: 436893 lines in 5240 files changed: 174030 ins; 237687 del; 25176 mod Patch: https://git.openjdk.org/jdk/pull/23443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23443/head:pull/23443 PR: https://git.openjdk.org/jdk/pull/23443 From psadhukhan at openjdk.org Wed May 28 05:49:59 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 28 May 2025 05:49:59 GMT Subject: RFR: 8348760: RadioButton is not shown if JRadioButtonMenuItem is rendered with ImageIcon in WindowsLookAndFeel [v26] In-Reply-To: References: <_OqONGmbeH9KtcJvhT_kMpl5xZ8hTN-VvOat7vWFjsI=.c0bb8661-5c33-433c-a722-a39153f63df2@github.com> Message-ID: On Wed, 28 May 2025 05:38:17 GMT, Prasanta Sadhukhan wrote: >> When JRadioButtonMenuItem is called with imageIcon, then only imageIcon is shown without radiobutton in WIndowsLookAndFeel as there was no provision of drawing the radiobutton alongside icon. >> If icon is not there, the radiobutton is drawn. Added provision of drawing the radiobutton windows Skin even when imageIcon is present. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Text alignment fix Text alignment fixed .. Current PR now looks like this ![image](https://github.com/user-attachments/assets/9dff3831-7216-434a-b809-ed95dcf9c598) In SwingSet2, now there will be gap between bullet and text to accomodate non-existing imageicon ![image](https://github.com/user-attachments/assets/f305fdc4-47e2-48ad-a28f-a578d7a4aeff) ------------- PR Comment: https://git.openjdk.org/jdk/pull/23324#issuecomment-2915019457 From serb at openjdk.org Wed May 28 06:57:32 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 06:57:32 GMT Subject: RFR: 8357696: Enhance code consistency: java.desktop/unix:sun Message-ID: This is a request to update the remaining parts of the java.desktop/unix package. The sun.awt subpackage under java.desktop/unix was previously addressed by https://github.com/openjdk/jdk/pull/24941. ==================================================== The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. The public API was not affected so there is no need to worry about a CSR Note: I will submit additional patches in this area later because: 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) 2. I skipped adding `@Override` for anonymous classes Any feedback or suggestions are welcome! Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/25439.diff) to a simple diff file, it might be more convenient for reviewing the changes. To download the diff file and filter only the modified lines you can use the following script: curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/25439.diff -o d.txt && grep -E '^+|^-' d.txt The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. ------------- Commit messages: - Merge branch 'openjdk:master' into over_all_unix - final in java.desktop/unix - override in java.desktop/unix Changes: https://git.openjdk.org/jdk/pull/25439/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25439&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357696 Stats: 390 lines in 64 files changed: 294 ins; 0 del; 96 mod Patch: https://git.openjdk.org/jdk/pull/25439.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25439/head:pull/25439 PR: https://git.openjdk.org/jdk/pull/25439 From serb at openjdk.org Wed May 28 09:01:55 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 09:01:55 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> Message-ID: On Sun, 27 Apr 2025 21:04:34 GMT, Andrey Turbanov wrote: > `devices` contains only non-null values. It means instead of separate `containsKey` call we can just call `HashMap.get` and then compare result with `null`. Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24907#pullrequestreview-2874193509 From duke at openjdk.org Wed May 28 10:34:41 2025 From: duke at openjdk.org (GennadiyKrivoshein) Date: Wed, 28 May 2025 10:34:41 GMT Subject: RFR: 8251928: [macos] the printer DPI always be 72, cause some content lost when print out Message-ID: The fix for the https://bugs.openjdk.org/browse/JDK-8251928. **Description**. This PR contains changes to be able to print with DPI higher than 72 on macOS, set default CPrinterJob DPI is 300 like in the PSPrinterJob. As described in the macOS drawing guide, the following steps are required to draw with high DPI (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-BCICIJAJ): 1. Convert the user-space point, size, or rectangle value to device space coordinates; 2. Normalize the value in device space so that it is aligned to the appropriate pixel boundary; 3. Convert the normalized value back to user space; 4. Draw your content using the adjusted value. The 1-st step is now implemented in the CPrinterJob, a Graphics provided to the print method adjusted to a printer's DPI. The 2-nd step is a drawing process in the java code (without changes). The 3-rd step is now implemented in the PrinterView.m, the drawing scaled back to the 72 DPI. The 4-th step is a drawing process in the native code (without changes). **Tests**. I run all tests from javax.print package and there is no any regression. New test covers macOS and Linux only because we know its default DPI - 300. ------------- Commit messages: - [macos] the printer DPI always be 72 Changes: https://git.openjdk.org/jdk/pull/25489/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25489&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8251928 Stats: 311 lines in 5 files changed: 284 ins; 8 del; 19 mod Patch: https://git.openjdk.org/jdk/pull/25489.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25489/head:pull/25489 PR: https://git.openjdk.org/jdk/pull/25489 From dgredler at openjdk.org Wed May 28 11:21:53 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 28 May 2025 11:21:53 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 1 May 2025 21:55:00 GMT, Nikita Gubarkov wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > I was talking about the explosion because there is a scenario in my mind, which I didn't make clear for everybody else. There is a change which I didn't have time to contribute, but would like to: it's related to composite fonts and variation selectors. We may need 2 variants for retrieving a glyph with a variation selector - one strictly matching a variation selector and another with a fallback to the base glyph, multiplied by raw/transformed versions, which adds 2 more methods. Not like it's a big problem, but given that they all end up calling a single method anyway... You get the point. > >> there may be other scenarios in the future, e.g. \r, \n and \t which currently are handled elsewhere). > > Are those scenarios specific to a patricular mapper/font type? I was thinking that those transformations are generic. > >> Any ideas for what this refactoring might look like? > > I was thinking about moving this default-ignorable or any potential generic transformation into base `CharToGlyphMapper` or even `Font2D`. For example, make default implementation of `CharToGlyphMapper.charToGlyph` check ignorable characters and then call `charToGlyphRaw` - then other implementations would only need to override `charToGlyphRaw`. @YaaZ I had a look at your suggestion to push up the `raw` checks into the `CharToGlyphMapper` superclass and the complicating factor are the three `charsToGlyphs` methods which take arrays. These are handled differently in each subclass, and even if we were able to refactor all subclass implementations to ensure that they all call into the public single-char superclass methods (where we would add the `raw` checks), it would be relatively brittle (not obvious to future maintainers that the call to the superclass method cannot be removed). The current approach does require each subclass to handle the `raw` boolean, but it also allows each subclass to internally do that in a unified, simplified way. Please feel free to prototype something on your end -- I'm open to helping with future improvements in this area, if feasible. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2915937125 From aivanov at openjdk.org Wed May 28 12:37:51 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 28 May 2025 12:37:51 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Tue, 27 May 2025 23:51:05 GMT, Harshitha Onkar wrote: >> @mrserb >> >> I can remove the EDT but I do think retaining them will stabilize this test based on the context of test failure. >> >> - Test does NOT fail when it is run multiple times on macos-aarch64 but only when entire test suite is run. Can it still be synchronization issue if it is not reproducible when test is run multiple times? >> >> - The test repeated fails on macos-aarch64 only when the entire test suite is run so I suspect this could be the effect of couple of Graphics tests that was recently open-sourced and indeed this matches with the timeline that this test started to fail repeatedly on macos-aarch64. >> >> - I didn't see any recent source code changesets that has direct relation to this test failure. There was one recent change to copyArea and ongoing subsequent change https://github.com/openjdk/jdk/pull/25340 but the test does not hit the code path in Blit.c or MaskBlit.c so that eliminates these changes as the cause. > > At the very least this test requires to be de-problemlisted to obtain the screenshots at the time of failure to see the state of the Frame. > > This test repeatedly fails due to the same error at the same point (at x=267 y=212) which is about mid-way of the frame where the color is expected to be black but the actual is white. > > > java.lang.RuntimeException: Test failed for background region at x=267 y=212 (expected=ff000000 actual=ffffffff) > at CopyAreaOOB.testRegion(CopyAreaOOB.java:97) > at CopyAreaOOB.paint(CopyAreaOOB.java:77) > > > **Expected Frame** > > background @honkar-jdk This does seem weird? Since the test is _headful_, it starts a new JVM for each execution and the JVM is shut down after the `main` method exits. I don't think the test runs long enough for synchronisation issues to manifest themselves, especially during the initial startup. At the same time, aarch64 is usually more sensitive to the lack of proper synchronisation than x86_64. If the test test fails only when it's run together with other tests in CI, could it be that the test frame is covered by anything? Re: `expected=ff000000 actual=ffffffff` ? I can't see a while pixel on the screenshot. Does the test save both images: the expected and the actual one? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2111744123 From dgredler at openjdk.org Wed May 28 13:10:08 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 28 May 2025 13:10:08 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v3] In-Reply-To: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: > It looks like this regression actually fits into a longer series of fixes / regressions in this area: > > - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions > - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics > - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions > - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display > > We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. > > It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). > > The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). > > In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. > > Note two intricacies related to `CompositeGlyphMapper`: > 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. > 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. > > The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. > > Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for HarfBuzz integration. (Is there a plan to remove... Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Fix conflict with whitespace logic handling updates ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24412/files - new: https://git.openjdk.org/jdk/pull/24412/files/fb272367..c68240b2 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24412&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24412&range=01-02 Stats: 77 lines in 7 files changed: 28 ins; 32 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/24412.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24412/head:pull/24412 PR: https://git.openjdk.org/jdk/pull/24412 From abaya at openjdk.org Wed May 28 13:40:45 2025 From: abaya at openjdk.org (Anass Baya) Date: Wed, 28 May 2025 13:40:45 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v4] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with two additional commits since the last revision: - add DoubleActionESCWithGtkDisabled - Tests that FileDialog can be closed by ESC any time when GtkFileDialog is disabled ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/31472930..2b0cf0ac Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=02-03 Stats: 39 lines in 2 files changed: 37 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From abaya at openjdk.org Wed May 28 13:49:40 2025 From: abaya at openjdk.org (Anass Baya) Date: Wed, 28 May 2025 13:49:40 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v5] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with two additional commits since the last revision: - Remove whitespace - Update test/jdk/java/awt/FileDialog/DoubleActionESC.java Alexey's proposed changes Co-authored-by: Alexey Ivanov ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/2b0cf0ac..c5718772 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=03-04 Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From abaya at openjdk.org Wed May 28 13:49:40 2025 From: abaya at openjdk.org (Anass Baya) Date: Wed, 28 May 2025 13:49:40 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v2] In-Reply-To: References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: On Thu, 15 May 2025 16:23:34 GMT, Alexey Ivanov wrote: >> Anass Baya has updated the pull request incrementally with one additional commit since the last revision: >> >> Update test/jdk/ProblemList.txt >> >> Co-authored-by: Abhishek Kumar > > test/jdk/java/awt/FileDialog/DoubleActionESC.java line 81: > >> 79: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); >> 80: robot.waitForIdle(); >> 81: robot.delay(1000); > > Can the delay be reduced to `500`? Yes, it can be reduced to 500 without impacting the behavior or changing the failure frequency > test/jdk/java/awt/FileDialog/DoubleActionESC.java line 90: > >> 88: >> 89: latch.await(LATCH_TIMEOUT, SECONDS); >> 90: if (fd.isVisible()) { > > I'm on the fence here? Calling `fd.isVisible()` on EDT is more reliable; but it's not strictly required for AWT components. I have added it. However, as you assumed, it's not required for AWT components, so the test is still failing ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2111958642 PR Review Comment: https://git.openjdk.org/jdk/pull/25184#discussion_r2111954795 From abaya at openjdk.org Wed May 28 13:56:13 2025 From: abaya at openjdk.org (Anass Baya) Date: Wed, 28 May 2025 13:56:13 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v6] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with one additional commit since the last revision: Remove latch count assignment from the main ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/c5718772..d686cda8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=04-05 Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From abaya at openjdk.org Wed May 28 14:01:37 2025 From: abaya at openjdk.org (Anass Baya) Date: Wed, 28 May 2025 14:01:37 GMT Subject: RFR: 8355478: DoubleActionESC.java fails intermittently [v7] In-Reply-To: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> References: <5JxVLty1Tt73J8ZkcUIwJUd05YhDMXSwDyKJpXEn4eo=.a56fed94-aec9-491f-a045-97728bb37a06@github.com> Message-ID: > **Analysis :** > > Whether the test passes on the main line or fails, the behavior is still incorrect. > This test is meant to ensure that pressing ESC a second time while the file dialog is open behaves correctly. > > However, the CountDownLatch is currently set to 1, which means the test only waits for the first open/close interaction to complete. As a result, it does not wait for the second attempt (opening the dialog again and pressing ESC to close it), because the latch reaches zero after the first attempt. > > This causes the test to proceed immediately to the validation step: > > if (fd.isVisible()) { > throw new RuntimeException("File Dialog is not closed"); > } > > At this point, whether the test passes or fails becomes unreliable and undefined, as it depends on the state of the second attempt (whether the file dialog is in the process of opening, being closed, or hasn't even started yet) > > To ensure the test behaves correctly, the CountDownLatch should be set to 2, so it waits for the two attempt of open-close interactions to be completed before moving on to validation. > > **Proposed fix:** > > set the CountDownLatch to 2 > > **Proposed enhancements :** > > Remove unnecessary threads (Thread and Thread-2) > Properly handle delays and robot.waitForIdle() > Avoid indefinite blocking on latch.await() > > With these enhancements, the test execution time is reduced from around 3 minutes to approximately 1 minute 30 seconds > > The adapted test uncovered a new bug in GTKFileDialog on Linux, which is being tracked under [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981). As a result, it has been added to the ProblemList. See [JDK-8356981](https://bugs.openjdk.org/browse/JDK-8356981) for more details Anass Baya has updated the pull request incrementally with one additional commit since the last revision: Throw exception if the Latch timeout is reached ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25184/files - new: https://git.openjdk.org/jdk/pull/25184/files/d686cda8..5d7644b4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25184&range=05-06 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25184.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25184/head:pull/25184 PR: https://git.openjdk.org/jdk/pull/25184 From asemenov at openjdk.org Wed May 28 15:28:58 2025 From: asemenov at openjdk.org (Artem Semenov) Date: Wed, 28 May 2025 15:28:58 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> References: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> Message-ID: On Wed, 28 May 2025 02:28:40 GMT, Abhishek Kumar wrote: >> VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. >> >> Issue: Problem is with the a11y subsystem method call to get the accessible children details. >> >> Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. >> >> Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. >> >> Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. >> >> `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` >> >> **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Minor update src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 877: > 875: if (ac != null) { > 876: Accessible aComp = null; > 877: for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) { I suggest replacing for with while. If the desired submenu is at the beginning of the list, there?s no need to traverse it further. src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m line 65: > 63: GET_CACCESSIBILITY_CLASS_RETURN(nil); > 64: DECLARE_STATIC_METHOD_RETURN(sjm_getCurrentAccessiblePopupMenu, sjc_CAccessibility, > 65: "getCurrentAccessiblePopupMenu", Won?t it be possible to get the correct object like this, as it?s done in ```outlineRowAccessibility.m```? jobject currentAccessible = [self currentAccessibleWithENV:env]; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2112139362 PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2112188590 From asemenov at openjdk.org Wed May 28 15:33:51 2025 From: asemenov at openjdk.org (Artem Semenov) Date: Wed, 28 May 2025 15:33:51 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: <-ik2Ehk-SMPAQCfVkToxWLiqC_3a7-LqJtkIRGfBaSc=.16a8a6c8-7d79-45ed-97cd-47ceb9853f9b@github.com> References: <_sXctfl4hH0eURjW3o_R0DLJp03F6VPioRzxcJ93xRQ=.263c5f31-f5ed-4975-865f-11721a0bdc1a@github.com> <-ik2Ehk-SMPAQCfVkToxWLiqC_3a7-LqJtkIRGfBaSc=.16a8a6c8-7d79-45ed-97cd-47ceb9853f9b@github.com> Message-ID: On Wed, 28 May 2025 02:21:40 GMT, Abhishek Kumar wrote: > This test is only for macOS and that is conveyed through the jtreg tag [here](https://github.com/openjdk/jdk/blob/a225bf4bbe75aefffa63d54d2dff5577b3268339/test/jdk/javax/accessibility/TestPopupMenuChildCount.java#L36). I don't think test name needs to be changed. > > Although it is not essentially required but will update the test summary and instruction. It seems to me that this test should be generalized for all a11y platforms, since it is a regression test and can help identify regression of this functionality on other platforms. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2112200183 From honkar at openjdk.org Wed May 28 16:31:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 28 May 2025 16:31:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: On Wed, 28 May 2025 12:35:09 GMT, Alexey Ivanov wrote: > Re: expected=ff000000 actual=ffffffff ? I can't see a while pixel on the screenshot. This is screenshot of the frame when the test passes. Added it to show what the Frame looks like when the test passes. > Does the test save both images: the expected and the actual one? No it doesn't. The updated test saves the frame and the whole screen (I wanted to see if there are any stray windows overlapping the test frame). Since I haven't gotten the test to fail on personal CI job, I thought it might be a good idea to de-problemlist the test and see what is going on. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112309665 From aivanov at openjdk.org Wed May 28 16:52:52 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 28 May 2025 16:52:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: Message-ID: <007h3vC751kD1jOaYk_XAoK9SF3T-uolq0iDAPrfXbg=.9b1c60d9-14f1-460a-b0b8-b500501af278@github.com> On Sat, 17 May 2025 00:03:23 GMT, Harshitha Onkar wrote: > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 67: > 65: Point pt1 = frame.getLocationOnScreen(); > 66: Rectangle rect = new Rectangle(pt1.x, pt1.y, 400, 400); > 67: captureImg = robot.createScreenCapture(rect); ~~The captured image includes the frame decorations.~~ I see the frame is not decorated. Yet, the suggestion still applies. You can use the location and the size of the canvas itself as the area to capture. For simplicity, save the canvas instance into a static variable. I'd avoid hard-coding the width and height like this; constants would be serve the purpose, and if either width or height, or both, changes, all the code automatically updates to use the new values. test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 114: > 112: // destination surface > 113: g2d.copyArea(0, 10, 50, h - 10, 60, 10); > 114: g2d.dispose(); Why do you disposed of `g2d`? It's a parameter that's passed to you as argument to the `paint` method. test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 147: > 145: .getLocalGraphicsEnvironment().getDefaultScreenDevice() > 146: .getDefaultConfiguration(); > 147: BufferedImage screenCapture = robot.createScreenCapture(ge.getBounds()); Using a multi-resolution screen capture could shed some light on failures? If Mac uses a Retina-like display, the captured image is scaled down, which affects the colors on the image. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112341094 PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112326767 PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112330528 From aivanov at openjdk.org Wed May 28 16:52:54 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 28 May 2025 16:52:54 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> Message-ID: <8IxUcx9JeMootKUwgQgOxmi1Hd-G6YMUuIC3E94DPX0=.ab1abd09-5455-495a-a605-4a1990d86207@github.com> On Wed, 28 May 2025 16:29:35 GMT, Harshitha Onkar wrote: > > Does the test save both images: the expected and the actual one? > > No it doesn't. The updated test saves the frame and the whole screen (I wanted to see if there are any stray windows overlapping the test frame). Since I haven't gotten the test to fail on personal CI job, I thought it might be a good idea to de-problemlist the test and see what is going on. You can test it by submitting a test job without integrating these changes. You can do it with the test in its original form where the UI is created on the main thread rather than EDT. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112343628 From honkar at openjdk.org Wed May 28 18:08:53 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 28 May 2025 18:08:53 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java In-Reply-To: <8IxUcx9JeMootKUwgQgOxmi1Hd-G6YMUuIC3E94DPX0=.ab1abd09-5455-495a-a605-4a1990d86207@github.com> References: <45KN4daBBRbauQz-o9yzcmdYpZmQJTzRJOrT1axLf8U=.db20c011-ced6-41c1-ae49-cfd190373ca7@github.com> <8IxUcx9JeMootKUwgQgOxmi1Hd-G6YMUuIC3E94DPX0=.ab1abd09-5455-495a-a605-4a1990d86207@github.com> Message-ID: On Wed, 28 May 2025 16:47:55 GMT, Alexey Ivanov wrote: >>> Re: expected=ff000000 actual=ffffffff ? I can't see a while pixel on the screenshot. >> >> This is screenshot of the frame when the test passes. Added it to show what the Frame looks like when the test passes. >> >>> Does the test save both images: the expected and the actual one? >> >> No it doesn't. The updated test saves the frame and the whole screen (I wanted to see if there are any stray windows overlapping the test frame). Since I haven't gotten the test to fail on personal CI job, I thought it might be a good idea to de-problemlist the test and see what is going on. > >> > Does the test save both images: the expected and the actual one? >> >> No it doesn't. The updated test saves the frame and the whole screen (I wanted to see if there are any stray windows overlapping the test frame). Since I haven't gotten the test to fail on personal CI job, I thought it might be a good idea to de-problemlist the test and see what is going on. > > You can test it by submitting a test job without integrating these changes. > > You can do it with the test in its original form where the UI is created on the main thread rather than EDT. The personal CI job that was referring to was with the original test + screenshot capture. IIRC it did not fail during those runs. I have triggered another round of testing with original test + MultiResolution screen capture as suggested to see if the test failure is reproducible. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112475497 From prr at openjdk.org Wed May 28 20:07:33 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 28 May 2025 20:07:33 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v14] In-Reply-To: References: Message-ID: <-Tq2lspXz6bsSzTFYwvE2A9Hg1_e6o8ggKZ49JaFMOU=.92145686-50b0-49ed-aaef-6c8e4106019c@github.com> > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8356049 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24991/files - new: https://git.openjdk.org/jdk/pull/24991/files/58649f22..f654b89c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24991&range=12-13 Stats: 105 lines in 1 file changed: 105 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24991/head:pull/24991 PR: https://git.openjdk.org/jdk/pull/24991 From prr at openjdk.org Wed May 28 20:07:33 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 28 May 2025 20:07:33 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v10] In-Reply-To: References: <9Oco8sXX2wF_26udEZoISllR58JH5Qs1m22_UDdXK78=.465a992c-4304-4f23-944e-ca67203393d3@github.com> Message-ID: <5lFY0yxbxX5NRZBXZ2GoBjLd2tGRbmGhQaBJLxik_Wk=.8f07b625-f737-4e77-8926-44021e0c1f77@github.com> On Tue, 27 May 2025 22:25:13 GMT, Sergey Bylokhov wrote: > > Do you mean show that calling loop() doesn't prevent exit ? I can just add a call to loop() at the end of the test. If it doesn't terminate the test will fail with a timeout. > > jtreg terminates all threads and the test vm after the main method completes, so I believe the updated test would pass even before this change (when a non-daemon thread was used). That's difficult to do in this test. In fact it is a problem to do in any jtreg test. It needs another process. So I've added a new test that monitors a child VM that jtreg will not terminate in this way. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24991#issuecomment-2917474894 From prr at openjdk.org Wed May 28 20:24:03 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 28 May 2025 20:24:03 GMT Subject: RFR: 8357672: Extreme font sizes can cause font substitution Message-ID: Instrumenting the existing ExtremeFontSizeTest.java, it was noted that the freetype code, when encountering a null return from getting a scaler context, would over-interpret this as a bad font. The test was intended to check this wasn't happening by verifying metrics before and after using extreme sizes. But the scenaro was not being detected by the test because a replacement font was substituted and it did not have zero metrics. So the updated test checks that the metrics before and after are the same. This new version of the test failed on Linux before the JDK source updates and passes afterwards. ------------- Commit messages: - 8357672 - 8357672 Changes: https://git.openjdk.org/jdk/pull/25511/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25511&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357672 Stats: 104 lines in 3 files changed: 92 ins; 2 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/25511.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25511/head:pull/25511 PR: https://git.openjdk.org/jdk/pull/25511 From dgredler at openjdk.org Wed May 28 20:27:54 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 28 May 2025 20:27:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> Message-ID: On Mon, 26 May 2025 23:44:34 GMT, Phil Race wrote: >>> @YaaZ Thanks for the information! >>> >>> @prrace Have you had a chance to look at this PR? >> >> It passed all the testing I did. I still need to look hard at the changes. > >> @prrace Please don't approve yet. I was able to fix the code conflicts caused by PR #23665, but it looks like the logic does not layer nicely as there is now a test failure on macOS after the merge. I'm having a look and will let you know what I find. > > And indeed the tests just finished and a test (not the new one, a previous one : IgnoredWhitespaceTest.java) failed on macOS x64 and ARM .. > > java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] > at IgnoredWhitespaceTest.assertEqual(IgnoredWhitespaceTest.java:127) > at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:103) > at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:69) > at IgnoredWhitespaceTest.main(IgnoredWhitespaceTest.java:49) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) > at java.base/java.lang.reflect.Method.invoke(Method.java:565) > at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) > at java.base/java.lang.Thread.run(Thread.java:1447) > > JavaTest Message: Test threw exception: java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] > JavaTest Message: shutting down test @prrace This is ready for review again. I've updated the code to combine nicely with the recent whitespace fixes. The `test/jdk/java/awt/font`, `test/jdk/java/awt/print` and `test/jdk/java/awt/Graphics2D/DrawString` tests all pass for me locally on Windows, Linux and macOS. Once these changes are integrated it should be relatively simple to address JDK-8356803 ("Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance") and JDK-8356812 ("Create an automated version of TextLayout/TestControls"). ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2917521742 From prr at openjdk.org Wed May 28 20:55:03 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 28 May 2025 20:55:03 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: <_lcOdATdXG3Y_jW5Tl0xJkrVZ-hoWs-2U7Cp3NvQtqk=.eea31f34-72c6-4acd-bce9-38ab18c41509@github.com> References: <_lcOdATdXG3Y_jW5Tl0xJkrVZ-hoWs-2U7Cp3NvQtqk=.eea31f34-72c6-4acd-bce9-38ab18c41509@github.com> Message-ID: On Mon, 26 May 2025 07:55:52 GMT, Magnus Ihse Bursie wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with two additional commits since the last revision: >> >> - Restore MenuShortcut.java >> - Restore LocaleDataTest.java > > test/jdk/java/awt/event/KeyEvent/KeyTyped/EscapeKeyTyped.java line 90: > >> 88: printKey(e); >> 89: int keychar = e.getKeyChar(); >> 90: if (keychar == 27) { // Escape character is 27 or \u001b > > @prrace I think this is an actual bug. `\u0021` codes to `!`, and I don't think that is what was meant. Do you still want me to revert it? You are right, that's a typo. Keep your change. And I don't know why the code uses literal 27 instead of KeyEvent.VK_ESCAPE .. but that's not your problem. https://docs.oracle.com/en/java/javase/21/docs/api/constant-values.html#java.awt.event.KeyEvent.VK_ESCAPE > test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java line 188: > >> 186: + "\"After\" lists.\n" >> 187: + " Added printers are highlighted with " >> 188: + "green color, removed ones \u2014 with " > > @prrace This too seems like a bug, or rather a typo. The text currently reads `Added printers are highlighted with green color, removed ones ? with red color.`. The Em dash does not make any sense to me, and seems to be a copy paste error. > > Do you still want me to revert it? I agree. Keep your change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2112722311 PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2112731040 From prr at openjdk.org Wed May 28 20:55:04 2025 From: prr at openjdk.org (Phil Race) Date: Wed, 28 May 2025 20:55:04 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: <7ThvxIdX5OQ98gW8wZwPjX00teKmjP1qm1DT8olo-30=.64a982f0-92fc-46da-af79-8c3696e99258@github.com> References: <7ThvxIdX5OQ98gW8wZwPjX00teKmjP1qm1DT8olo-30=.64a982f0-92fc-46da-af79-8c3696e99258@github.com> Message-ID: On Mon, 26 May 2025 08:07:19 GMT, Magnus Ihse Bursie wrote: >> test/jdk/java/awt/font/TextLayout/RotFontBoundsTest.java line 63: >> >>> 61: >>> 62: private static final String INSTRUCTIONS = >>> 63: "A string \u201C" + TEXT + "\u201D is drawn at eight different " >> >> I really don't like these tests being changed. It isn't part of the JDK build. >> People compile these in all sorts of locales. >> Please revert all the changes in the client tests. > > Just a clarification. What I did was convert curly quotes and an em dash to normal ASCII quotes and an ASCII hyphen, just as it is in all other `INSTRUCTIONS` in the tests. This is similar to what was done in JDK-8354273 and JDK-8354213, and should have been made as part of those PRs if I only had noticed this place by then. > > The user's locale should not really matter. When have stringent locale requirements for building, and automatically setup the correct locale while building. I don't think the locale will matter at runtime either, but it n the rare case that it should matter, then pure ASCII would be prefer, wouldn't it? > > Let me know if you still want me to revert it. I'd like this reverted. People *build* these tests in their local repos using javac and whatever their locale is. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25228#discussion_r2112728971 From serb at openjdk.org Wed May 28 22:35:58 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 28 May 2025 22:35:58 GMT Subject: RFR: 8356049: Need a simple way to play back a sound clip [v14] In-Reply-To: <-Tq2lspXz6bsSzTFYwvE2A9Hg1_e6o8ggKZ49JaFMOU=.92145686-50b0-49ed-aaef-6c8e4106019c@github.com> References: <-Tq2lspXz6bsSzTFYwvE2A9Hg1_e6o8ggKZ49JaFMOU=.92145686-50b0-49ed-aaef-6c8e4106019c@github.com> Message-ID: On Wed, 28 May 2025 20:07:33 GMT, Phil Race wrote: >> A simple API to replace java.applet.AudioClip >> >> CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8356049 Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24991#pullrequestreview-2876621898 From honkar at openjdk.org Thu May 29 00:22:13 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 29 May 2025 00:22:13 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v2] In-Reply-To: References: Message-ID: > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: test update: Mouse move to off frame loc ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25279/files - new: https://git.openjdk.org/jdk/pull/25279/files/ee307064..8cc8fa24 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=00-01 Stats: 32 lines in 1 file changed: 20 ins; 1 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/25279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25279/head:pull/25279 PR: https://git.openjdk.org/jdk/pull/25279 From honkar at openjdk.org Thu May 29 00:37:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 29 May 2025 00:37:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v2] In-Reply-To: References: Message-ID: On Thu, 29 May 2025 00:22:13 GMT, Harshitha Onkar wrote: >> CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. >> >> Test failure is not reproducible when the test is run individually (multiple times) on CI. >> >> Rewritten the test and added debug logs that will be helpful to figure out the issue. >> >> - Added code to capture screenshot (entire screen as well as the frame) in case of failure. >> - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > test update: Mouse move to off frame loc @mrserb @aivanov-jdk I got the test to fail after some iterations. The issue is with the mouse pointer being at the place where robot.getRGB() is called as seen below. The fix is to move the mouse pointer to a location away from the test UI before taking a screenshot. This happens on macos-aarch64 and I think the mouse pointer remains at the location last moved to by previous test (It explains why it happens only when certain tests run before it during entire test suite run and not when the test is run individually). I'm still not sure as to why the mouse pointer is captured during screencapture on macos-aarch64 as I don't see it happening on macosx-x64. background ------------- PR Comment: https://git.openjdk.org/jdk/pull/25279#issuecomment-2917904917 From honkar at openjdk.org Thu May 29 00:37:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 29 May 2025 00:37:54 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v2] In-Reply-To: <007h3vC751kD1jOaYk_XAoK9SF3T-uolq0iDAPrfXbg=.9b1c60d9-14f1-460a-b0b8-b500501af278@github.com> References: <007h3vC751kD1jOaYk_XAoK9SF3T-uolq0iDAPrfXbg=.9b1c60d9-14f1-460a-b0b8-b500501af278@github.com> Message-ID: On Wed, 28 May 2025 16:46:17 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> test update: Mouse move to off frame loc > > test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 67: > >> 65: Point pt1 = frame.getLocationOnScreen(); >> 66: Rectangle rect = new Rectangle(pt1.x, pt1.y, 400, 400); >> 67: captureImg = robot.createScreenCapture(rect); > > ~~The captured image includes the frame decorations.~~ I see the frame is not decorated. Yet, the suggestion still applies. > > You can use the location and the size of the canvas itself as the area to capture. For simplicity, save the canvas instance into a static variable. > > I'd avoid hard-coding the width and height like this; constants would be serve the purpose, and if either width or height, or both, changes, all the code automatically updates to use the new values. Updated > test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 147: > >> 145: .getLocalGraphicsEnvironment().getDefaultScreenDevice() >> 146: .getDefaultConfiguration(); >> 147: BufferedImage screenCapture = robot.createScreenCapture(ge.getBounds()); > > Using a multi-resolution screen capture could shed some light on failures? If Mac uses a Retina-like display, the captured image is scaled down, which affects the colors on the image. Updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112965381 PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2112965528 From honkar at openjdk.org Thu May 29 01:47:47 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 29 May 2025 01:47:47 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v3] In-Reply-To: References: Message-ID: <-lBIVrQXyxII4hEx6bRTJaM9dtFYWTgu7ULBFS-5kOQ=.a653a92e-702d-48d2-b6fa-50d134d4996d@github.com> > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: minor update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25279/files - new: https://git.openjdk.org/jdk/pull/25279/files/8cc8fa24..707ed6df Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=01-02 Stats: 12 lines in 1 file changed: 6 ins; 6 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25279/head:pull/25279 PR: https://git.openjdk.org/jdk/pull/25279 From prr at openjdk.org Thu May 29 05:55:06 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 05:55:06 GMT Subject: Integrated: 8356049: Need a simple way to play back a sound clip In-Reply-To: References: Message-ID: On Thu, 1 May 2025 22:31:32 GMT, Phil Race wrote: > A simple API to replace java.applet.AudioClip > > CSR is now created : https://bugs.openjdk.org/browse/JDK-8356200 This pull request has now been integrated. Changeset: 04e0fe00 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/04e0fe00abcf1d7919a50e0c9dd44ce2856984ea Stats: 497 lines in 9 files changed: 486 ins; 1 del; 10 mod 8356049: Need a simple way to play back a sound clip Reviewed-by: serb, aivanov, kizune ------------- PR: https://git.openjdk.org/jdk/pull/24991 From abhiscxk at openjdk.org Thu May 29 06:19:51 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 29 May 2025 06:19:51 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: References: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> Message-ID: On Wed, 28 May 2025 15:25:40 GMT, Artem Semenov wrote: >> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor update > > src/java.desktop/macosx/native/libawt_lwawt/awt/a11y/MenuAccessibility.m line 65: > >> 63: GET_CACCESSIBILITY_CLASS_RETURN(nil); >> 64: DECLARE_STATIC_METHOD_RETURN(sjm_getCurrentAccessiblePopupMenu, sjc_CAccessibility, >> 65: "getCurrentAccessiblePopupMenu", > > Won?t it be possible to get the correct object like this, as it?s done in ```outlineRowAccessibility.m```? > > jobject currentAccessible = [self currentAccessibleWithENV:env]; I tried to utilize this method but `getCurrentAccessiblePopupMenu ` throws NPE. `java.lang.NullPointerException: Cannot invoke "sun.swing.SwingAccessor$AccessibleComponentAccessor.getCurrentAccessible(javax.accessibility.AccessibleContext)" because the return value of "sun.swing.SwingAccessor.getAccessibleComponentAccessor()" is null` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113286295 From abhiscxk at openjdk.org Thu May 29 06:35:51 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 29 May 2025 06:35:51 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: References: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> Message-ID: On Wed, 28 May 2025 15:01:47 GMT, Artem Semenov wrote: >> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: >> >> Minor update > > src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 877: > >> 875: if (ac != null) { >> 876: Accessible aComp = null; >> 877: for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) { > > I suggest replacing for with while. If the desired submenu is at the beginning of the list, there?s no need to traverse it further. I think even though the submenu is at the beginning but if it is not visible then we need to traverse further to check for other submenu if present. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113306623 From abhiscxk at openjdk.org Thu May 29 07:03:58 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 29 May 2025 07:03:58 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v3] In-Reply-To: References: Message-ID: > VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. > > Issue: Problem is with the a11y subsystem method call to get the accessible children details. > > Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. > > Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. > > Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. > > `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` > > **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: code optimization ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25470/files - new: https://git.openjdk.org/jdk/pull/25470/files/6cebdff4..0984d036 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25470&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25470&range=01-02 Stats: 10 lines in 1 file changed: 1 ins; 8 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25470.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25470/head:pull/25470 PR: https://git.openjdk.org/jdk/pull/25470 From abhiscxk at openjdk.org Thu May 29 07:03:59 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 29 May 2025 07:03:59 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: References: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> Message-ID: On Thu, 29 May 2025 06:33:37 GMT, Abhishek Kumar wrote: >> src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessibility.java line 877: >> >>> 875: if (ac != null) { >>> 876: Accessible aComp = null; >>> 877: for (int i = 0; i < ac.getAccessibleChildrenCount(); i++) { >> >> I suggest replacing for with while. If the desired submenu is at the beginning of the list, there?s no need to traverse it further. > > I think even though the submenu is at the beginning but if it is not visible then we need to traverse further to check for other submenu if present. Optimized the code to not traverse further if the desired submenu is fetched. Verified the recent change with the test code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113344471 From asemenov at openjdk.org Thu May 29 07:21:53 2025 From: asemenov at openjdk.org (Artem Semenov) Date: Thu, 29 May 2025 07:21:53 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v2] In-Reply-To: References: <4FutPE0d1Zw2D3INL_ZhNEmhv2F1I2cQ9ElGGvC1qq0=.9bcd49be-cbf2-4cb9-969a-6d73ee951a40@github.com> Message-ID: On Thu, 29 May 2025 07:00:34 GMT, Abhishek Kumar wrote: > Optimized the code to not traverse further if the desired submenu is fetched. Verified the recent change with the test code. You could, of course, put this in the while condition, but this way is also fine. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113370915 From asemenov at openjdk.org Thu May 29 07:24:51 2025 From: asemenov at openjdk.org (Artem Semenov) Date: Thu, 29 May 2025 07:24:51 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v3] In-Reply-To: References: Message-ID: On Thu, 29 May 2025 07:03:58 GMT, Abhishek Kumar wrote: >> VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. >> >> Issue: Problem is with the a11y subsystem method call to get the accessible children details. >> >> Analysis: When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. >> >> Proposed Fix: Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. >> >> Testing : Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. >> >> `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` >> >> **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > code optimization LGTM ------------- Marked as reviewed by asemenov (Committer). PR Review: https://git.openjdk.org/jdk/pull/25470#pullrequestreview-2877352903 From abhiscxk at openjdk.org Thu May 29 08:27:53 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 29 May 2025 08:27:53 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v3] In-Reply-To: References: <_sXctfl4hH0eURjW3o_R0DLJp03F6VPioRzxcJ93xRQ=.263c5f31-f5ed-4975-865f-11721a0bdc1a@github.com> <-ik2Ehk-SMPAQCfVkToxWLiqC_3a7-LqJtkIRGfBaSc=.16a8a6c8-7d79-45ed-97cd-47ceb9853f9b@github.com> Message-ID: <1-3uZy9W3whv_ah6Iwwn5qOGd5yj4j5gOk1_Is0ILIg=.84a16f1e-f2a5-411f-a907-e525e7c31a71@github.com> On Wed, 28 May 2025 15:31:15 GMT, Artem Semenov wrote: >> This test is only for macOS and that is conveyed through the jtreg tag [here](https://github.com/openjdk/jdk/blob/a225bf4bbe75aefffa63d54d2dff5577b3268339/test/jdk/javax/accessibility/TestPopupMenuChildCount.java#L36). I don't think test name needs to be changed. >> >> Although it is not essentially required but will update the test summary and instruction. > >> This test is only for macOS and that is conveyed through the jtreg tag [here](https://github.com/openjdk/jdk/blob/a225bf4bbe75aefffa63d54d2dff5577b3268339/test/jdk/javax/accessibility/TestPopupMenuChildCount.java#L36). I don't think test name needs to be changed. >> >> Although it is not essentially required but will update the test summary and instruction. > > It seems to me that this test should be generalized for all a11y platforms, since it is a regression test and can help identify regression of this functionality on other platforms. The behaviour on Windows with a11y clients (JAWS or NVDA) is different. They don't announce the child count for the menu and submenus for java application and it is similar to the native application (notepad++) too. So, the regression test restricted for macOS seems suitable for now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25470#discussion_r2113468220 From duke at openjdk.org Thu May 29 10:15:03 2025 From: duke at openjdk.org (ScientificWare) Date: Thu, 29 May 2025 10:15:03 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v10] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 09:56:15 GMT, ScientificWare wrote: >> This is referenced in Java Bug Database as >> - [JDK-8314731 : Adds support for the alt attribute in the image type input HTML tag.](https://bugs.java.com/bugdatabase/view_bug?bug_id=8314731) >> >> This is tracked in JBS as >> - [JDK-8314731 : Add support for the alt attribute in the image type input HTML tag](https://bugs.openjdk.java.net/browse/JDK-8314731) >> >> According [HTML 3.2 specification](https://www.w3.org/TR/2018/SPSD-html32-20180315/#input) >> >> `alt` is not an attribute of the `input` element. >> >> According [HTML 4.01 specifications](https://www.w3.org/TR/html4/interact/forms.html#h-17.4) : >> >>> ... For accessibility reasons, authors should provide [alternate text](https://www.w3.org/TR/html4/struct/objects.html#alternate-text) for the image via the [alt](https://www.w3.org/TR/html4/struct/objects.html#adef-alt) attribute. ... >> >> This feature is not implemented in `FormView.java`. >> >> ?? ~~This also affects the HTML 32 DTD~~ >> >> ![Screenshot_20230817_025316](https://github.com/openjdk/jdk/assets/19194678/8e580574-d842-4a65-884b-26e33cd12138) >> >> Left before the patch and right after the patch. >> >> >> import java.awt.BorderLayout; >> import java.awt.Dimension; >> import javax.swing.JEditorPane; >> import javax.swing.JFrame; >> import javax.swing.JScrollPane; >> import javax.swing.SwingUtilities; >> import javax.swing.text.Document; >> import javax.swing.text.html.HTMLEditorKit; >> import javax.swing.text.html.StyleSheet; >> >> public class HTMLAddsSupportAltInputTag { >> public static void main(String[] args) { >> new HTMLAddsSupportAltInputTag(); >> } >> >> public HTMLAddsSupportAltInputTag() { >> SwingUtilities.invokeLater(new Runnable(){ >> public void run(){ >> JEditorPane jEditorPane = new JEditorPane(); >> jEditorPane.setEditable(false); >> JScrollPane scrollPane = new JScrollPane(jEditorPane); >> HTMLEditorKit kit = new HTMLEditorKit(); >> jEditorPane.setEditorKit(kit); >> StyleSheet styleSheet = kit.getStyleSheet(); >> styleSheet.addRule(""" >> body { >> color: #000; >> font-family:times; >> margin: 4px; >> } >> """); >> String htmlString = """ >> >> >> >>

>> - Merge master > - Replaces this title with "alt attribute test in HTML image type input". > > Moves this test to /jdk/test/jdk/javax/swing/text/html. > - bug8314731.java : Corrects the CopyRight date. > - FormView.java : > Removes a whitespace > > bug8314731.java : > Adds a newline at end of file. > - getMaximumSpan(int axis) method > doc -> Not used > > mouseReleased(MouseEvent evt) method > elem and hdoc -> not used > return -> could be removed, method returns void > > loadElementDataIntoBuffer(Element elem, StringBuilder buffer) method > value != null -> name can't be null at this point > > getInputElementData(AttributeSet attr) method > value = null -> Already set at null > - ... and 15 more: https://git.openjdk.org/jdk/compare/69e664de...9b423808 Awaiting review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15319#issuecomment-2918939622 From dmarkov at openjdk.org Thu May 29 10:25:52 2025 From: dmarkov at openjdk.org (Dmitry Markov) Date: Thu, 29 May 2025 10:25:52 GMT Subject: RFR: 8357672: Extreme font sizes can cause font substitution In-Reply-To: References: Message-ID: <25yiMYq7efwejhVkwRA5O6YaugBQEOpIUajdtfSK62c=.643db0a5-6635-4276-8339-41facd50b809@github.com> On Wed, 28 May 2025 20:19:42 GMT, Phil Race wrote: > Instrumenting the existing ExtremeFontSizeTest.java, it was noted that the freetype code, when encountering a null return from getting a scaler context, would over-interpret this as a bad font. > The test was intended to check this wasn't happening by verifying metrics before and after using extreme sizes. > But the scenaro was not being detected by the test because a replacement font was substituted and it did not have zero metrics. > So the updated test checks that the metrics before and after are the same. > This new version of the test failed on Linux before the JDK source updates and passes afterwards. Marked as reviewed by dmarkov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25511#pullrequestreview-2877798577 From serb at openjdk.org Thu May 29 10:54:52 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 29 May 2025 10:54:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v3] In-Reply-To: <-lBIVrQXyxII4hEx6bRTJaM9dtFYWTgu7ULBFS-5kOQ=.a653a92e-702d-48d2-b6fa-50d134d4996d@github.com> References: <-lBIVrQXyxII4hEx6bRTJaM9dtFYWTgu7ULBFS-5kOQ=.a653a92e-702d-48d2-b6fa-50d134d4996d@github.com> Message-ID: On Thu, 29 May 2025 01:47:47 GMT, Harshitha Onkar wrote: >> CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. >> >> Test failure is not reproducible when the test is run individually (multiple times) on CI. >> >> Rewritten the test and added debug logs that will be helpful to figure out the issue. >> >> - Added code to capture screenshot (entire screen as well as the frame) in case of failure. >> - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > minor update test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 57: > 55: // copy the region such that part of it goes below the bottom of the > 56: // destination surface > 57: g2d.copyArea(0, 10, 50, h-10, 60, 10); The new version looks like a different test, previously we copyArea from the paint method for the awt frame, then call sync to flush all rendering, then check the rendering on screen, and all of that on "each render frame". Now it will draw everything in paint then sometime later(or even after a few repaints) we check the actual rendering(waitForIdle/delay(100)).... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2113703881 From dgredler at openjdk.org Thu May 29 11:10:38 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 29 May 2025 11:10:38 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: > It looks like this regression actually fits into a longer series of fixes / regressions in this area: > > - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions > - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics > - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions > - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display > > We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. > > It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). > > The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). > > In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. > > Note two intricacies related to `CompositeGlyphMapper`: > 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. > 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. > > The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. > > Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for HarfBuzz integration. (Is there a plan to remove... Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Remove one last now-unnecessary whitespace check inside CMap ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24412/files - new: https://git.openjdk.org/jdk/pull/24412/files/c68240b2..95652a11 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24412&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24412&range=02-03 Stats: 7 lines in 1 file changed: 0 ins; 7 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24412.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24412/head:pull/24412 PR: https://git.openjdk.org/jdk/pull/24412 From kizune at openjdk.org Thu May 29 15:34:52 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 29 May 2025 15:34:52 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v3] In-Reply-To: References: Message-ID: On Thu, 29 May 2025 07:03:58 GMT, Abhishek Kumar wrote: >> VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. >> >> **Issue:** Problem is with the a11y subsystem method call to get the accessible children details. >> >> **Analysis:** When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. >> >> **Proposed Fix:** Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. >> >> **Testing :** Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. >> >> `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` >> >> **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > code optimization Looks good. ------------- Marked as reviewed by kizune (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25470#pullrequestreview-2878711796 From mblaesing at openjdk.org Thu May 29 15:39:56 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 15:39:56 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v2] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: <2WRXCTX7XfUiOZzWFQAfIMRUzwn8Z63St1KDrmuO-lw=.b3dd6e99-4778-4083-b8d1-d3112512fdf3@github.com> On Tue, 13 May 2025 02:11:14 GMT, Sergey Bylokhov wrote: >> Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: >> >> Adress review comments: Update copyright years and fix whitespace in if condition > > is it possible to create a jtreg test for this issue? @mrserb would you mind having another look at this? ------------- PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2919785018 From kizune at openjdk.org Thu May 29 16:29:53 2025 From: kizune at openjdk.org (Alexander Zuev) Date: Thu, 29 May 2025 16:29:53 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v5] In-Reply-To: References: Message-ID: On Wed, 28 May 2025 03:21:45 GMT, Prasanta Sadhukhan wrote: >> The issue is when a JSplitPane is embedded inside a lazily-initialized panel, and this panel is displayed using a dialog created via JOptionPane.createDialog(), the divider location is not preserved when reopening the dialog. >> This is because when we added support for ComponentOrientation for JSplitPane, even though the left and right compoent is drawn the divider location is not set and was set to initial value and not to the value set by user. >> Fixed by setting the divider location before rendering the left and right components.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Store current orientation for check Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25294#pullrequestreview-2878886416 From dnguyen at openjdk.org Thu May 29 16:50:55 2025 From: dnguyen at openjdk.org (Damon Nguyen) Date: Thu, 29 May 2025 16:50:55 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v3] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> On Thu, 15 May 2025 16:48:47 GMT, Matthias Bl?sing wrote: >> - Introduce a lock into WClipboard that protects the code between >> openClipboard/closeClipboard invocations. >> The native side does not allow to open the clipboard multiple >> times or share the opened clipboard between multiple threads. >> >> - Remove of need to call openClipboard/closeClipboard from >> getClipboardFormats by using the win32 call >> GetUpdatedClipboardFormats >> >> - Prevent a race-condition by not registering the connection >> between java and native side of clipboard multiple time, but >> just at construction time. > > Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: > > Add crash reproducer as jtreg test src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java line 208: > 206: > 207: try { > 208: openClipboard(null); Can you help me understand why this is better? Seems odd that the try/finally block has `closeClipboard` in the finally block but the `openClipboard` was moved out of the try. src/java.desktop/windows/classes/sun/awt/windows/WClipboard.java line 189: > 187: checkChange(formats); > 188: } catch (Throwable ex) { > 189: System.getLogger(WClipboard.class.getName()).log(Level.WARNING, "Failed to process handleContentsChanged", ex); I'm not saying not to necessarily change this, but what are we hoping to see with logging this warning here? test/jdk/java/awt/Clipboard/ConcurrentClipboardAccessTest.java line 29: > 27: @summary tests that concurrent access to the clipboard does not crash the JVM > 28: @run main ConcurrentClipboardAccessTest > 29: */ It has been brought to my attention that this test needs to be headful since we're dealing with clipboard behavior. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114346429 PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114337249 PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114349984 From mblaesing at openjdk.org Thu May 29 17:11:12 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 17:11:12 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v4] In-Reply-To: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: > - Introduce a lock into WClipboard that protects the code between > openClipboard/closeClipboard invocations. > The native side does not allow to open the clipboard multiple > times or share the opened clipboard between multiple threads. > > - Remove of need to call openClipboard/closeClipboard from > getClipboardFormats by using the win32 call > GetUpdatedClipboardFormats > > - Prevent a race-condition by not registering the connection > between java and native side of clipboard multiple time, but > just at construction time. Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: Add headful key to the jtreg description ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24614/files - new: https://git.openjdk.org/jdk/pull/24614/files/e5ebf59f..bfa99a71 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24614&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24614&range=02-03 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/24614.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24614/head:pull/24614 PR: https://git.openjdk.org/jdk/pull/24614 From mblaesing at openjdk.org Thu May 29 17:11:12 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 17:11:12 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v3] In-Reply-To: <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> Message-ID: On Thu, 29 May 2025 16:44:48 GMT, Damon Nguyen wrote: >> Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: >> >> Add crash reproducer as jtreg test > > test/jdk/java/awt/Clipboard/ConcurrentClipboardAccessTest.java line 29: > >> 27: @summary tests that concurrent access to the clipboard does not crash the JVM >> 28: @run main ConcurrentClipboardAccessTest >> 29: */ > > It has been brought to my attention that this test needs to be headful since we're dealing with clipboard behavior. You are right, thanks for catching this. Pushed an updated version. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114389500 From mblaesing at openjdk.org Thu May 29 17:16:59 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 17:16:59 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v3] In-Reply-To: <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> Message-ID: On Thu, 29 May 2025 16:36:47 GMT, Damon Nguyen wrote: >> Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: >> >> Add crash reproducer as jtreg test > > src/java.desktop/windows/classes/sun/awt/windows/WClipboard.java line 189: > >> 187: checkChange(formats); >> 188: } catch (Throwable ex) { >> 189: System.getLogger(WClipboard.class.getName()).log(Level.WARNING, "Failed to process handleContentsChanged", ex); > > I'm not saying not to necessarily change this, but what are we hoping to see with logging this warning here? The idea here is to not silently swallow exceptions. This code is called from `AwtToolkit::WndProc`, which from my reading will not report exceptions/throwables. Pushing the exception to the system logger gives a chance to detect problems here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114399911 From mblaesing at openjdk.org Thu May 29 17:30:54 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 17:30:54 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v4] In-Reply-To: References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> Message-ID: On Thu, 29 May 2025 17:11:12 GMT, Matthias Bl?sing wrote: >> - Introduce a lock into WClipboard that protects the code between >> openClipboard/closeClipboard invocations. >> The native side does not allow to open the clipboard multiple >> times or share the opened clipboard between multiple threads. >> >> - Remove of need to call openClipboard/closeClipboard from >> getClipboardFormats by using the win32 call >> GetUpdatedClipboardFormats >> >> - Prevent a race-condition by not registering the connection >> between java and native side of clipboard multiple time, but >> just at construction time. > > Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: > > Add headful key to the jtreg description @DamonGuy thanks for your check. I updated the PR and added replies. If more changes/informations are required, I'm willing to help. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24614#issuecomment-2920085712 From mblaesing at openjdk.org Thu May 29 17:30:55 2025 From: mblaesing at openjdk.org (Matthias =?UTF-8?B?QmzDpHNpbmc=?=) Date: Thu, 29 May 2025 17:30:55 GMT Subject: RFR: 8353950: Clipboard interaction on Windows is unstable [v4] In-Reply-To: <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> References: <5TFAUj4XaWqfrY9eWepypDQlUoLp4UXrKf29neAYIc4=.03ccc530-b287-4496-af89-943d603e81b8@github.com> <4WgqjhL3ZIJAYKUp8CHG-mQDyvfp8wmWIaGqlkjpLOs=.914fd1b8-de37-4386-96a5-98cc0f8b2052@github.com> Message-ID: On Thu, 29 May 2025 16:42:29 GMT, Damon Nguyen wrote: >> Matthias Bl?sing has updated the pull request incrementally with one additional commit since the last revision: >> >> Add headful key to the jtreg description > > src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java line 208: > >> 206: >> 207: try { >> 208: openClipboard(null); > > Can you help me understand why this is better? Seems odd that the try/finally block has `closeClipboard` in the finally block but the `openClipboard` was moved out of the try. Before the change the call order was inconsistent: - `ClipboardTransferable`: one call, `openClipboard` is called before the `try`-block - `WClipboard`: one call with `openClipboard` before the `try`-block, one call with `openClipboard` as first statement in the `try`-block - `SunClipboard`: three calls with `openClipboard` as first statement inside the `try`-block I unified these so that in all cases `openClipboard` is called as the last statement before the try-block. The assumption is, that only if `openClipboard` succeeds (does not raise an exception), calling `closeClipboard` makes sense. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24614#discussion_r2114423928 From prr at openjdk.org Thu May 29 18:56:56 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 18:56:56 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. BTW there's a good reason for the newline. It's there on all platforms and has been there since at least 1.5 If its not there then when you do "System.out.println(new HeadlessException("foo").getMessage()); and there's a default message, you'll get fooNo X11 Display variable was set ... instead of the current more legible foo No X11 Display variable was set ... ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2920295348 From prr at openjdk.org Thu May 29 19:06:56 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 19:06:56 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25340#pullrequestreview-2879322755 From prr at openjdk.org Thu May 29 19:06:57 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 19:06:57 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 28 May 2025 03:29:16 GMT, Prasanta Sadhukhan wrote: >> src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 85: >> >>> 83: dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) >>> 84: ? clipInfo.bounds.x2 : (dstx + width); >>> 85: dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height) >> >> why wouldn't you always want to limit it to the clip ? >> I mean shouldn't it be like this ? >> dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) ? clipInfo.bounds.x2 : (((dstx + width) > clipInfo.bounds.x2) ? clipInfo.bounds.x2 : (dstx + width)); >> or maybe a bit more readable as >> dstInfo.bounds.x2 = ((UNSAFE_TO_ADD(dstx, width) || ((dstx + width) > clipInfo.bounds.x2)) ? clipInfo.bounds.x2 : (dstx + width); > > @prrace Since it is going to clip dstInfo.bounds to clipInfo.bounds in SurfaceData_IntersectBounds, I believe is not necessary to do the duplicate clip here. > Let me know if you think otherwise.. ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2114574302 From prr at openjdk.org Thu May 29 19:08:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 19:08:54 GMT Subject: RFR: 8356977: UTF-8 cleanups [v2] In-Reply-To: References: Message-ID: On Mon, 26 May 2025 08:20:19 GMT, Magnus Ihse Bursie wrote: >> I found a few other places in the code that can be cleaned up after the conversion to UTF-8. > > Magnus Ihse Bursie has updated the pull request incrementally with two additional commits since the last revision: > > - Restore MenuShortcut.java > - Restore LocaleDataTest.java Approving client changes ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25228#pullrequestreview-2879326497 From aivanov at openjdk.org Thu May 29 20:14:56 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 29 May 2025 20:14:56 GMT Subject: RFR: 8357675: Amend headless message In-Reply-To: References: Message-ID: <0FhBEOKrjGTcCUIbgEUsoIToSqVLleXC1ZH5Vdqg-zM=.337a9e1d-2720-4a38-a8a5-176c0d1289b2@github.com> On Thu, 29 May 2025 18:54:17 GMT, Phil Race wrote: > BTW there's a good reason for the newline. It's there on all platforms and has been there since at least 1.5\ > If its not there then when you do "System.out.println(new HeadlessException("foo").getMessage());\ > and there's a default message, you'll get\ > ``` > fooNo X11 Display variable was set ... > ``` > > instead of the current more legible > ``` > foo > No X11 Display variable was set ... > ``` @prrace This hasn't changed: the new line character at the start of the default headless message is preserved as it has always been there. What I remove is the new line character in the end of the message which wasn't there until [JDK-8286447](https://bugs.openjdk.org/browse/JDK-8286447) and which isn't there for macOS or Windows. In other words, currently you get foo No X11 Display variable was set ... and you'll get the same after applying the proposed patch too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25453#issuecomment-2920470181 From honkar at openjdk.org Thu May 29 21:29:53 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 29 May 2025 21:29:53 GMT Subject: RFR: 8357799: Improve instructions for JFileChooser/HTMLFileName.java [v2] In-Reply-To: References: Message-ID: On Mon, 26 May 2025 17:18:06 GMT, Alexey Ivanov wrote: >> The instructions for the `javax/swing/JFileChooser/HTMLFileName.java` test are still not as clear. >> >> The file name in the instructions is rendered as HTML, which, I believe, is unexpected. It should be displayed as the plain text. >> >> The instructions also say about file and directory which have HTML in their name; this was true in the initial version of the test in #24439 that created files and directories on the real file system. >> >> The final version of test uses a virtual file system that displays *three files*, there's no way to navigate. >> >> I also clarified the instructions: look at how the file name of the first file is rendered in _the file pane_ and _the navigation combo box_ (**Look in** in Metal L&F). >> >> In the `VirtualFileSystemView` class, I changed the name of the third file from `virtualFolder` to `virtualFile2.log`, and made the file array a field which ensures `getRoots` and `getFiles` return the same list. >> >> >> In addition to this, I reduced the number of rows allocated for the instructions. Since the instructions are in HTML format, the number of lines of HTML code makes no sense for determining the size. > > Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision: > > Correct the title of the test frames test/jdk/javax/swing/JFileChooser/HTMLFileName.java line 81: > 79: in the navigation combo box above is displayed > 80: as HTML, then press Pass.
> 81: If it is in plain text, then press Fail. According to test instructions it states that the file name in the **file pane** and navigation combo box must be displayed as HTML. When I'm testing with system (Aqua) LaF on macOS the file name in file pane shows up empty (with the original as well as updated test). HTML_Enabled ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25455#discussion_r2114776660 From prr at openjdk.org Thu May 29 22:01:54 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 22:01:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 29 May 2025 11:10:38 GMT, Daniel Gredler wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Remove one last now-unnecessary whitespace check inside CMap Took me a while, but I think the code looks OK. Automated testing passed, and I did some manual playing around in Font2DTest. src/java.desktop/share/classes/sun/print/RasterPrinterJob.java line 2485: > 2483: for (int i = 0; i < len; i++) { > 2484: char c = in_chars[i]; > 2485: if (c > '\r' || c < '\t' || c == '\u000b' || c == '\u000c') { hmm. looks like you are fixing a bug here. I think those == were supposed to be != ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24412#pullrequestreview-2879703562 PR Review Comment: https://git.openjdk.org/jdk/pull/24412#discussion_r2114809326 From prr at openjdk.org Thu May 29 22:19:50 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 22:19:50 GMT Subject: RFR: 8357696: Enhance code consistency: java.desktop/unix In-Reply-To: References: Message-ID: <9V6dXGFu7iwpjbJc7-Zi_Y-bVug3JoUQLPJVy-iB5pw=.1cbb72b8-34de-4a2b-9109-1a33893324e7@github.com> On Mon, 26 May 2025 03:10:07 GMT, Sergey Bylokhov wrote: > This is a request to update the remaining parts of the java.desktop/unix package. > The sun.awt subpackage under java.desktop/unix was previously addressed by https://github.com/openjdk/jdk/pull/24941. > > ==================================================== > > The `java.desktop` module currently lacks proper use of the `@Override` annotation for methods and the `final` modifier for classes. While similar changes were previously made in the [JavaSound](https://github.com/openjdk/jdk/commit/e0c7d59246cf36644d494eced76e4b9d96ff1ded#diff-ae3e5f9c40fe25ef03e7a89844de174ef5c15e6179d769e2a4bcb7e73688c9b5), [java.desktop/windows](https://github.com/openjdk/jdk/pull/24170) (and some of the classes on demand), these changes are not as critical now due to the new jdk "encapsulation", but they are still useful for improving code consistency. > > The public API was not affected so there is no need to worry about a CSR > > Note: I will submit additional patches in this area later because: > > 1. Only lines with `@Override` and `final` were modified to keep the diff clear - header dates were not updated (that could be covered by one patch similar to [this](https://bugs.openjdk.org/browse/JDK-8345797)) > 2. I skipped adding `@Override` for anonymous classes > > Any feedback or suggestions are welcome! > > Here is a [link](https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/25439.diff) to a simple diff file, it might be more convenient for reviewing the changes. > > To download the diff file and filter only the modified lines you can use the following script: > > > curl -s https://patch-diff.githubusercontent.com/raw/openjdk/jdk/pull/25439.diff -o d.txt && grep -E '^+|^-' d.txt > > > The build was successful, and I ran all the open jtreg tests without issues. But it's possible that some closed tests may be affected by these changes. It would be good to verify this by mach5 to ensure everything works as expected. Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25439#pullrequestreview-2879735349 From prr at openjdk.org Thu May 29 22:23:53 2025 From: prr at openjdk.org (Phil Race) Date: Thu, 29 May 2025 22:23:53 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> Message-ID: <1nYamt71cfy9hTc1IsaAjrMFQmP4EBMPW2pdHm4KHhk=.63abbeb6-6b90-4dfc-a166-e326c86cd228@github.com> On Sun, 27 Apr 2025 21:04:34 GMT, Andrey Turbanov wrote: > `devices` contains only non-null values. It means instead of separate `containsKey` call we can just call `HashMap.get` and then compare result with `null`. Myself, I like the existing code because - it is one succinct line - it is more readable (subjective) - there is nothing wrong with it - performance is not a concern for this code, and any improvement will be miniscule ------------- PR Review: https://git.openjdk.org/jdk/pull/24907#pullrequestreview-2879741097 From serb at openjdk.org Thu May 29 23:34:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 29 May 2025 23:34:53 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: <2AKd-LMlhNMKnrNUXmxwYyyfDGIvFOESfwSAK-hJRfw=.7de2e85d-8412-4d25-bff8-5d4f6c9d1854@github.com> On Thu, 29 May 2025 19:04:06 GMT, Phil Race wrote: >> @prrace Since it is going to clip dstInfo.bounds to clipInfo.bounds in SurfaceData_IntersectBounds, I believe is not necessary to do the duplicate clip here. >> Let me know if you think otherwise.. > > ok >That is because down below it anyway calls SurfaceData_IntersectBounds(&dstInfo.bounds, &clipInfo.bounds); so it should clip to clipInfo.bounds there. In addition to intersecting dst with clip, you're also intersecting src with clip, which seems incorrect. A better approach might be to compute the drawable width based on the non-overflowing range for both src and dst, and then proceed with the original logic. BTW I have not checked MaskBlit_MaskBlit yet it might require a similar update. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2114890068 From serb at openjdk.org Thu May 29 23:34:54 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 29 May 2025 23:34:54 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. src/java.desktop/share/native/libawt/java2d/loops/Blit.c line 88: > 86: ? clipInfo.bounds.y2 : (dsty + height); > 87: if (UNSAFE_TO_SUB(srcx, dstx) || > 88: UNSAFE_TO_SUB(srcy, dsty)) { we also should check this part of the code, is it correct to simply exit here, or should we instead calculate and use the maximum distance we can handle? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2114891163 From serb at openjdk.org Thu May 29 23:42:50 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Thu, 29 May 2025 23:42:50 GMT Subject: RFR: 8357687: Remove unnecessary Map.containsKey from GraphicsEnvironment implementations In-Reply-To: <1nYamt71cfy9hTc1IsaAjrMFQmP4EBMPW2pdHm4KHhk=.63abbeb6-6b90-4dfc-a166-e326c86cd228@github.com> References: <1uiKqIpG8uZ6YKrglYBxK7nMYaqioOirqfiRAp5z7Dw=.813063e1-e218-4794-8bc1-fd8f543c4a74@github.com> <1nYamt71cfy9hTc1IsaAjrMFQmP4EBMPW2pdHm4KHhk=.63abbeb6-6b90-4dfc-a166-e326c86cd228@github.com> Message-ID: On Thu, 29 May 2025 22:21:12 GMT, Phil Race wrote: > it is more readable (subjective) Funny... when I first wrote this code I thought that style was better, but now I see it differently. But yeah, it is subjective. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24907#issuecomment-2920818521 From serb at openjdk.org Fri May 30 00:06:04 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 30 May 2025 00:06:04 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data Message-ID: The [next PR](https://github.com/openjdk/jdk/pull/23044) introduces several new methods to the ICC_Profile class: - getProfileClass(byte[]) - getColorSpaceType(byte[]) - getPCSType(byte[]) - checkRenderingIntent(byte[]) These new methods extract data directly from the provided byte array rather than relying on the profile instance. The first three methods essentially duplicate the existing ones (getProfileClass(), getColorSpaceType(), getPCSType()). It is possible to update implementation: - The existing methods getColorSpaceType() and getPCSType() could delegate to the new getColorSpaceType(byte[]) and getPCSType(byte[]) methods. - The checkRenderingIntent(byte[]) method could be updated to report the actual invalid intent value when an error occurs Tests: - Old ValidateICCHeaderData test is update to verify the new output of the checkRenderingIntent - New RenderingIntentStressTest test is added to check the next part of the icc_spec: * ICC spec: only the least-significant 16 bits encode the rendering * intent. The most significant 16 bits must be zero and can be ignored. * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. @honkar-jdk please take a look. Note: There is currently an inconsistency in the usage of `getData(icSigHead)` vs `getData(cmmProfile(), icSigHead)` throughout the codebase. I plan to address this separately. ------------- Commit messages: - Create RenderingIntentStressTest.java - Update getColorSpaceType and getPCSType - Update checkRenderingIntent Changes: https://git.openjdk.org/jdk/pull/25519/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25519&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8358057 Stats: 141 lines in 3 files changed: 112 ins; 12 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/25519.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25519/head:pull/25519 PR: https://git.openjdk.org/jdk/pull/25519 From honkar at openjdk.org Fri May 30 00:23:10 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 00:23:10 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v4] In-Reply-To: References: Message-ID: > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: added back screencapture code to paint method ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25279/files - new: https://git.openjdk.org/jdk/pull/25279/files/707ed6df..73861a9c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=02-03 Stats: 29 lines in 1 file changed: 11 ins; 10 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/25279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25279/head:pull/25279 PR: https://git.openjdk.org/jdk/pull/25279 From honkar at openjdk.org Fri May 30 00:34:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 00:34:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v4] In-Reply-To: References: <-lBIVrQXyxII4hEx6bRTJaM9dtFYWTgu7ULBFS-5kOQ=.a653a92e-702d-48d2-b6fa-50d134d4996d@github.com> Message-ID: On Thu, 29 May 2025 10:52:16 GMT, Sergey Bylokhov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> added back screencapture code to paint method > > test/jdk/java/awt/Graphics2D/CopyAreaOOB.java line 57: > >> 55: // copy the region such that part of it goes below the bottom of the >> 56: // destination surface >> 57: g2d.copyArea(0, 10, 50, h-10, 60, 10); > > The new version looks like a different test, previously we copyArea from the paint method for the awt frame, then call sync to flush all rendering, then check the rendering on screen, and all of that on "each render frame". > > Now it will draw everything in paint then sometime later(or even after a few repaints) we check the actual rendering(waitForIdle/delay(100)).... @mrserb Added back Toolkit.sync() and canvas capture to paint method. I'm not sure if I understood _"each render frame"_. Can you please explain? BufferedImage capture = null; try { Thread.sleep(500); if (robot == null) robot = new Robot(); Point pt1 = getLocationOnScreen(); Rectangle rect = new Rectangle(pt1.x, pt1.y, 400, 400); capture = robot.createScreenCapture(rect); } catch (Exception e) { throw new RuntimeException("Problems handling Robot"); } // Test pixels testRegion(capture, "green", 0, 0, 400, 10, 0xff00ff00); testRegion(capture, "original red", 0, 10, 50, 400, 0xffff0000); testRegion(capture, "background", 50, 10, 60, 400, 0xff000000); testRegion(capture, "in-between", 60, 10, 110, 20, 0xff000000); testRegion(capture, "copied red", 60, 20, 110, 400, 0xffff0000); testRegion(capture, "background", 110, 10, 400, 400, 0xff000000); Isn't capture going to be the same image throughout? I'm not sure why it is passed as an extra argument to testRegion. It can be saved once as static BufferedImage var and the same can be used for testing or am I missing something? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2114942573 From honkar at openjdk.org Fri May 30 00:40:11 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 00:40:11 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v5] In-Reply-To: References: Message-ID: > CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. > > Test failure is not reproducible when the test is run individually (multiple times) on CI. > > Rewritten the test and added debug logs that will be helpful to figure out the issue. > > - Added code to capture screenshot (entire screen as well as the frame) in case of failure. > - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: added testRegion back to paint() ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25279/files - new: https://git.openjdk.org/jdk/pull/25279/files/73861a9c..e9c5b3ac Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25279&range=03-04 Stats: 16 lines in 1 file changed: 8 ins; 8 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/25279.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25279/head:pull/25279 PR: https://git.openjdk.org/jdk/pull/25279 From dnguyen at openjdk.org Fri May 30 00:42:50 2025 From: dnguyen at openjdk.org (Damon Nguyen) Date: Fri, 30 May 2025 00:42:50 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> References: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> Message-ID: On Tue, 27 May 2025 17:38:32 GMT, Sergey Bylokhov wrote: >> The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 >> >> AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. >> >> One of the test is updated just to touch that codepath. > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java > > Co-authored-by: Alexey Ivanov LGTM. Ran a test job myself and everything looks good. ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/25401#pullrequestreview-2879913986 From dgredler at openjdk.org Fri May 30 00:47:53 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 30 May 2025 00:47:53 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 29 May 2025 21:55:41 GMT, Phil Race wrote: >> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove one last now-unnecessary whitespace check inside CMap > > src/java.desktop/share/classes/sun/print/RasterPrinterJob.java line 2485: > >> 2483: for (int i = 0; i < len; i++) { >> 2484: char c = in_chars[i]; >> 2485: if (c > '\r' || c < '\t' || c == '\u000b' || c == '\u000c') { > > hmm. looks like you are fixing a bug here. I think those == were supposed to be != Hah, I've had to check it a few times but I do think the code was correct -- just formulated in a confusing way, probably as a micro-optimization. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24412#discussion_r2114953676 From dgredler at openjdk.org Fri May 30 00:54:54 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 30 May 2025 00:54:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Fri, 30 May 2025 00:45:36 GMT, Daniel Gredler wrote: >> src/java.desktop/share/classes/sun/print/RasterPrinterJob.java line 2485: >> >>> 2483: for (int i = 0; i < len; i++) { >>> 2484: char c = in_chars[i]; >>> 2485: if (c > '\r' || c < '\t' || c == '\u000b' || c == '\u000c') { >> >> hmm. looks like you are fixing a bug here. I think those == were supposed to be != > > Hah, I've had to check it a few times but I do think the code was correct -- just formulated in a confusing way, probably as a micro-optimization. Although I do think we will end up wanting to add Vertical Tab and Form Feed to the list of ignored whitespace chars later, as part of JDK-8356803. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24412#discussion_r2114958892 From psadhukhan at openjdk.org Fri May 30 02:10:02 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 30 May 2025 02:10:02 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: <2AKd-LMlhNMKnrNUXmxwYyyfDGIvFOESfwSAK-hJRfw=.7de2e85d-8412-4d25-bff8-5d4f6c9d1854@github.com> References: <2AKd-LMlhNMKnrNUXmxwYyyfDGIvFOESfwSAK-hJRfw=.7de2e85d-8412-4d25-bff8-5d4f6c9d1854@github.com> Message-ID: On Thu, 29 May 2025 23:29:37 GMT, Sergey Bylokhov wrote: >> ok > >>That is because down below it anyway calls SurfaceData_IntersectBounds(&dstInfo.bounds, &clipInfo.bounds); > so it should clip to clipInfo.bounds there. > > In addition to intersecting dst with clip, you're also intersecting src with clip, which seems incorrect. A better approach might be to compute the drawable width based on the non-overflowing range for both src and dst, and then proceed with the original logic. > > BTW I have not checked MaskBlit_MaskBlit yet it might require a similar update. We have not found any problem with that part of code so far..We have addressed the issue that was raised. MaskBlit might require similar update but since it was not proven to be problematic (we waited for your feedback) and since RDP1 is approaching, we will integrate this and you can come back with POC for us to check.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2115019947 From psadhukhan at openjdk.org Fri May 30 02:10:04 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 30 May 2025 02:10:04 GMT Subject: Integrated: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: Message-ID: On Wed, 21 May 2025 03:17:34 GMT, Prasanta Sadhukhan wrote: > Graphics copyArea overflow check bails out of copying pixels if there is overflow. > The spec says ""If a portion of the source rectangle lies outside the bounds of the component, or is obscured by another window or component, {@code copyArea} *will be unable to copy* the associated pixels" > > which suggests that we should always copy the parts inside the bounds and never the parts outside the bounds > but it seems currently, in the case of overflow it no longer copies any pixels, including the parts that are inside. > So, the fix clips the copyarea region to clip bounds so it will only affect pixels within the valid bounds, and any pixels outside will be ignored. This pull request has now been integrated. Changeset: 64503c78 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/64503c784bbddc638ce0098f5c6ef0cb81cbf938 Stats: 74 lines in 2 files changed: 62 ins; 5 del; 7 mod 8357299: Graphics copyArea doesn't copy any pixels when there is overflow Reviewed-by: achung, kizune, prr ------------- PR: https://git.openjdk.org/jdk/pull/25340 From serb at openjdk.org Fri May 30 02:40:00 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 30 May 2025 02:40:00 GMT Subject: RFR: 8357299: Graphics copyArea doesn't copy any pixels when there is overflow In-Reply-To: References: <2AKd-LMlhNMKnrNUXmxwYyyfDGIvFOESfwSAK-hJRfw=.7de2e85d-8412-4d25-bff8-5d4f6c9d1854@github.com> Message-ID: On Fri, 30 May 2025 02:06:29 GMT, Prasanta Sadhukhan wrote: >We have not found any problem with that part of code so far.. This is incorrect because the clip bounds are relative to the destination (dst), so you cannot intersect them directly with the source (src) surface. The usage of UNSAFE_TO_SUB below is also wrong, we cannot just exists. filed https://bugs.openjdk.org/browse/JDK-8358103 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25340#discussion_r2115043873 From serb at openjdk.org Fri May 30 04:16:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 30 May 2025 04:16:02 GMT Subject: RFR: 8358107: Rollback JDK-8357299 changeset Message-ID: The patch for [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) does not completely fix the regression it was intended to address. Instead of bailing out on overflow, it introduces additional logic around src and clip, which might lead to attempts to draw invalid source pixels. A test case demonstrating the issue is attached to [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103)(passed on jdk22 failed on latest openjdk/jdk). There are some unresolved discussions related to that patch, see [PR](https://github.com/openjdk/jdk/pull/25340). I believe it would be better to bail out early in case of overflow than risk incorrect calculations. Therefore, I propose reverting [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) until a proper fix is available. This approach would also simplify backports, since only the patch for [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103) would need to be backported @prsadhuk, @prrace please take a look ------------- Commit messages: - Revert "8357299: Graphics copyArea doesn't copy any pixels when there is overflow" Changes: https://git.openjdk.org/jdk/pull/25537/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25537&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8358107 Stats: 74 lines in 2 files changed: 5 ins; 62 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/25537.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25537/head:pull/25537 PR: https://git.openjdk.org/jdk/pull/25537 From psadhukhan at openjdk.org Fri May 30 04:55:51 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 30 May 2025 04:55:51 GMT Subject: RFR: 8358107: Rollback JDK-8357299 changeset In-Reply-To: References: Message-ID: On Fri, 30 May 2025 04:11:36 GMT, Sergey Bylokhov wrote: > The patch for [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) does not completely fix the regression it was intended to address. Instead of bailing out on overflow, it introduces additional logic around src and clip, which might lead to attempts to draw invalid source pixels. > > A test case demonstrating the issue is attached to [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103)(passed on jdk22 failed on latest openjdk/jdk). > > There are some unresolved discussions related to that patch, see [PR](https://github.com/openjdk/jdk/pull/25340). I believe it would be better to bail out early in case of overflow than risk incorrect calculations. > > Therefore, I propose reverting [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) until a proper fix is available. This approach would also simplify backports, since only the patch for [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103) would need to be backported > > @prsadhuk, @prrace please take a look Marked as reviewed by psadhukhan (Reviewer). > A test case demonstrating the issue is attached to [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103)(passed on jdk22 failed on latest openjdk/jdk). I believe this new testcase is also failing with jdk24.0.1 too where UNSAFE_TO_ADD macro was added for overflow check and caused [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) issue so both testcase is failing with jdk24.0.1 but if you feel the earlier bailout is better than this, then it's ok. ------------- PR Review: https://git.openjdk.org/jdk/pull/25537#pullrequestreview-2880172293 PR Comment: https://git.openjdk.org/jdk/pull/25537#issuecomment-2921224425 From abhiscxk at openjdk.org Fri May 30 06:28:00 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 30 May 2025 06:28:00 GMT Subject: RFR: 8341311: [Accessibility, macOS, VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu [v3] In-Reply-To: References: Message-ID: On Thu, 29 May 2025 07:03:58 GMT, Abhishek Kumar wrote: >> VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. >> >> **Issue:** Problem is with the a11y subsystem method call to get the accessible children details. >> >> **Analysis:** When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. >> >> **Proposed Fix:** Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. >> >> **Testing :** Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. >> >> `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` >> >> **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > code optimization >Note : While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. @azuev-java @savoptik Created a new JBS bug [JDK-8358121](https://bugs.openjdk.org/browse/JDK-8358121) to track the multi level submenu text announcement issue ------------- PR Comment: https://git.openjdk.org/jdk/pull/25470#issuecomment-2921351710 From abhiscxk at openjdk.org Fri May 30 06:28:01 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 30 May 2025 06:28:01 GMT Subject: Integrated: 8341311: [Accessibility,macOS,VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu In-Reply-To: References: Message-ID: <6pWCrhhcjDaluh6TQLW8cNjGvmwPKnECWH00HGZhdSU=.91ad57f0-e53b-4965-8e4d-3f8c3d91ceae@github.com> On Tue, 27 May 2025 17:01:16 GMT, Abhishek Kumar wrote: > VoiceOver announce incorrect number of child for a submenu of JPopupMenu when it is visible for the first time only. After that VO is able to announce the number of items correctly. > > **Issue:** Problem is with the a11y subsystem method call to get the accessible children details. > > **Analysis:** When the Submenu of a JPopupMenu is opened, accessible component of PopupMenu is created dynamically in the native side implementation and `PostMenuOpened` notification is sent to the a11y subsystem for the newly created PopupMenu. Once the notification is sent to a11y sub-system, it invokes the `accessibilityChildren` method to get the children details for the menu component. A11y subsystem always retrieve the information of the root level PopupMenu irrespective of the submenu's PopupMenu (PopupMenu is associated with each JMenu) and thus announce the root level PopupMenu child count which is incorrect. > > **Proposed Fix:** Proposed fix is to ensure the correct child details are sent back to a11y sub-system for correct announcement. So, whenever the `accessibilityChildren` method is invoked, first try to find out the current accessible PopupMenu which is opened for the Submenu and then return the child details. > > **Testing :** Manual test case is attached to verify the fix and there is no failure with fix in CI pipeline. > > `Current fix also ensures the correct child counts are announced for the JMenu's Submenu which are present in the JMenubar.` > > **Note :** While verifying the fix, a new issue is unearthed for multi-level submenu where VO is failed to announce the Submenu's text. Since the issue exists without the proposed fix too, it shall be treated as a new bug finding and will raise a separate JBS issue. This pull request has now been integrated. Changeset: e33eeeea Author: Abhishek Kumar URL: https://git.openjdk.org/jdk/commit/e33eeeea04fc7899bf66b0a2fdaccc30060854b4 Stats: 172 lines in 3 files changed: 170 ins; 0 del; 2 mod 8341311: [Accessibility,macOS,VoiceOver] VoiceOver announces incorrect number of items in submenu of JPopupMenu Reviewed-by: asemenov, kizune ------------- PR: https://git.openjdk.org/jdk/pull/25470 From psadhukhan at openjdk.org Fri May 30 06:42:51 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 30 May 2025 06:42:51 GMT Subject: RFR: 8251928: [macos] the printer DPI always be 72, cause some content lost when print out In-Reply-To: References: Message-ID: On Wed, 28 May 2025 10:29:17 GMT, GennadiyKrivoshein wrote: > The fix for the https://bugs.openjdk.org/browse/JDK-8251928. > > **Description**. > This PR contains changes to be able to print with DPI higher than 72 on macOS, set default CPrinterJob DPI is 300 like in the PSPrinterJob. > > As described in the macOS drawing guide, the following steps are required to draw with high DPI (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-BCICIJAJ): > 1. Convert the user-space point, size, or rectangle value to device space coordinates; > 2. Normalize the value in device space so that it is aligned to the appropriate pixel boundary; > 3. Convert the normalized value back to user space; > 4. Draw your content using the adjusted value. > > The 1-st step is now implemented in the CPrinterJob, a Graphics provided to the print method adjusted to a printer's DPI. > The 2-nd step is a drawing process in the java code (without changes). > The 3-rd step is now implemented in the PrinterView.m, the drawing scaled back to the 72 DPI. > The 4-th step is a drawing process in the native code (without changes). > > **Tests**. > I run all tests from javax.print package and there is no any regression. > New test covers macOS and Linux only because we know its default DPI - 300. While running PDFBOX4935PrintDpi testcase from the JBS, it is showing with your fix ScaleX: 4.166666 ScaleY: 4.166666 DPI = 300 while printing to pdf. Shouldn't the scale be shown as 2.0 for retina display while doing pdf printing? ------------- PR Comment: https://git.openjdk.org/jdk/pull/25489#issuecomment-2921381067 From tr at openjdk.org Fri May 30 09:45:52 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 30 May 2025 09:45:52 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> References: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> Message-ID: On Tue, 27 May 2025 17:38:32 GMT, Sergey Bylokhov wrote: >> The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 >> >> AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. >> >> One of the test is updated just to touch that codepath. > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java > > Co-authored-by: Alexey Ivanov test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 169: > 167: AWTEventListener[] array = tk.getAWTEventListeners(); > 168: if (array == null || array.length != expected) { > 169: System.out.println("[Simple test failed!!]"); I don't think this print statement is required? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2115522289 From tr at openjdk.org Fri May 30 09:55:54 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 30 May 2025 09:55:54 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> References: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> Message-ID: <5esyds_XiOkkKu-Az09lY9sXEBJ-v-2U-7M0xFbYIS8=.b3713dbe-4844-49dc-8c89-2057cb2d447b@github.com> On Tue, 27 May 2025 17:38:32 GMT, Sergey Bylokhov wrote: >> The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 >> >> AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. >> >> One of the test is updated just to touch that codepath. > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java > > Co-authored-by: Alexey Ivanov test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 24: > 22: */ > 23: > 24: /* Suggestion: /* * @test * @bug 4290704 8357598 * @summary Test use of AWTEventListenerProxyTest class */ Most of the test follow this pattern for jtreg tags. It would be good if you use it too for code consistency. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2115549915 From tr at openjdk.org Fri May 30 09:57:53 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 30 May 2025 09:57:53 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v2] In-Reply-To: References: Message-ID: <2_AeOX3dM4DrUFwnZ8jdwQMSUm1wmyKu4bH3E_vDYE4=.27c80a84-ca3f-4659-b8b6-4dd66b4600f7@github.com> On Mon, 26 May 2025 16:51:11 GMT, Jeremy Wood wrote: >> Make sure AquaTextPasswordFieldUI can't use selectWordAction. >> >> The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. >> >> So the problem is partially about multiple inheritance. >> >> My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. >> >> There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8354646: Update copyright year Marked as reviewed by tr (Reviewer). src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java line 651: > 649: TransferHandler.getPasteAction()); > 650: > 651: if (getComponent() instanceof JPasswordField) { Since the fix has been made in Basic, we should not restrict the test to Aqua L&F alone. It should be tested for all L&F. (For fix and for regression) ------------- PR Review: https://git.openjdk.org/jdk/pull/25443#pullrequestreview-2880804268 PR Review Comment: https://git.openjdk.org/jdk/pull/25443#discussion_r2115555622 From tr at openjdk.org Fri May 30 10:08:52 2025 From: tr at openjdk.org (Tejesh R) Date: Fri, 30 May 2025 10:08:52 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v2] In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:51:11 GMT, Jeremy Wood wrote: >> Make sure AquaTextPasswordFieldUI can't use selectWordAction. >> >> The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. >> >> So the problem is partially about multiple inheritance. >> >> My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. >> >> There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. > > Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: > > 8354646: Update copyright year Since the fix has been made in Basic, we should not restrict the test to Aqua L&F alone. It should be tested for all L&F. (For fix and for regression) Approved by mistake, mybad. ------------- PR Review: https://git.openjdk.org/jdk/pull/25443#pullrequestreview-2880829112 Changes requested by tr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/25443#pullrequestreview-2880836177 From aivanov at openjdk.org Fri May 30 10:52:55 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 30 May 2025 10:52:55 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: <5esyds_XiOkkKu-Az09lY9sXEBJ-v-2U-7M0xFbYIS8=.b3713dbe-4844-49dc-8c89-2057cb2d447b@github.com> References: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> <5esyds_XiOkkKu-Az09lY9sXEBJ-v-2U-7M0xFbYIS8=.b3713dbe-4844-49dc-8c89-2057cb2d447b@github.com> Message-ID: On Fri, 30 May 2025 09:52:21 GMT, Tejesh R wrote: >> Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: >> >> Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java >> >> Co-authored-by: Alexey Ivanov > > test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 24: > >> 22: */ >> 23: >> 24: /* > > Suggestion: > > /* > * @test > * @bug 4290704 8357598 > * @summary Test use of AWTEventListenerProxyTest class > */ > > > Most of the test follow this pattern for jtreg tags. It would be good if you use it too for code consistency. Not required, but can be updated? > test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java line 169: > >> 167: AWTEventListener[] array = tk.getAWTEventListeners(); >> 168: if (array == null || array.length != expected) { >> 169: System.out.println("[Simple test failed!!]"); > > I don't think this print statement is required? Probably not, but it follows the common pattern in the test. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2115659639 PR Review Comment: https://git.openjdk.org/jdk/pull/25401#discussion_r2115660853 From aivanov at openjdk.org Fri May 30 10:52:53 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 30 May 2025 10:52:53 GMT Subject: RFR: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy [v2] In-Reply-To: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> References: <-z-iY3P6QORAHKgWiQJRAVGxrxf46AOPlLYcQi_liOg=.55c0e62b-239f-4d23-92ac-6b53c3e8e1f7@github.com> Message-ID: On Tue, 27 May 2025 17:38:32 GMT, Sergey Bylokhov wrote: >> The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 >> >> AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. >> >> One of the test is updated just to touch that codepath. > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java > > Co-authored-by: Alexey Ivanov Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25401#pullrequestreview-2880953280 From vyazici at openjdk.org Fri May 30 11:04:23 2025 From: vyazici at openjdk.org (Volkan Yazici) Date: Fri, 30 May 2025 11:04:23 GMT Subject: RFR: 8357994: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner [client] Message-ID: Passes the `Charset` read from the `stdin.encoding` system property while creating `InputStreamReader` or `Scanner` instances for `System.in`. `stdin.encoding` is a recently added property for Java 25 in [JDK-8350703](https://bugs.openjdk.org/browse/JDK-8350703). Employing it throughout the entire code base is addressed by the parent ticket [JDK-8356893](https://bugs.openjdk.org/browse/JDK-8356893). JDK-8357994 this PR is addressing is a sub-task of JDK-8356893 and is concerned with only areas related to client libraries. ------------- Commit messages: - Discard changes unrelated with client libraries - Revert superfluous changes - Revert changes to 3rd parties in `com/sun/org/apache` - Revert `PandocFilter` changes - Use `stdin.encoding` in `InputStreamReader` and `Scanner` instantiations Changes: https://git.openjdk.org/jdk/pull/25543/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25543&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8357994 Stats: 17 lines in 3 files changed: 12 ins; 1 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/25543.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25543/head:pull/25543 PR: https://git.openjdk.org/jdk/pull/25543 From rmarchenko at openjdk.org Fri May 30 11:15:09 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 30 May 2025 11:15:09 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v15] In-Reply-To: References: Message-ID: <2G_AAjpoCzSpYwfIFRxq35O0qoBAcUiEbheaeQp_e5E=.37c5209f-cd3a-48ad-aa42-72618796a057@github.com> > Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. > > Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. > > --------- > `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. > > When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: > > - In case of a clash with a class method, the class version will take precedence rather than interface's one. > - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. > - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. > > `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: > > * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. > * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). > * Gettters/setters declared and not implemented are not considered. Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: Addes test scenario 10 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23443/files - new: https://git.openjdk.org/jdk/pull/23443/files/779194f1..82bad7d8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=14 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=13-14 Stats: 97 lines in 1 file changed: 97 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/23443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23443/head:pull/23443 PR: https://git.openjdk.org/jdk/pull/23443 From rmarchenko at openjdk.org Fri May 30 11:15:10 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 30 May 2025 11:15:10 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v9] In-Reply-To: References: Message-ID: On Mon, 14 Apr 2025 13:28:09 GMT, Alexey Ivanov wrote: >> I ran this changes through CI testing, and the results are good. > >> I do not have any other comments, @aivanov-jdk please take a look. >> >> @aivanov-jdk ?\ >> Could you review the PR, please? > > I'm currently busy, I'll get to look at this PR as soon as I can. > > Does it make sense to expand tests to cover cases that @mrserb brought up? With module system and exported vs non-exported classes and interfaces? > > Could you review, please? @aivanov-jdk @mrserb @azvegint > > Please update the test to cover the latest change. Done ------------- PR Comment: https://git.openjdk.org/jdk/pull/23443#issuecomment-2922070937 From rmarchenko at openjdk.org Fri May 30 11:20:39 2025 From: rmarchenko at openjdk.org (Roman Marchenko) Date: Fri, 30 May 2025 11:20:39 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v16] In-Reply-To: References: Message-ID: > Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. > > Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. > > --------- > `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. > > When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: > > - In case of a clash with a class method, the class version will take precedence rather than interface's one. > - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. > - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. > > `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: > > * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. > * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). > * Gettters/setters declared and not implemented are not considered. Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: minor change ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23443/files - new: https://git.openjdk.org/jdk/pull/23443/files/82bad7d8..8d46a88d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=15 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23443&range=14-15 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/23443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23443/head:pull/23443 PR: https://git.openjdk.org/jdk/pull/23443 From aivanov at openjdk.org Fri May 30 13:35:02 2025 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 30 May 2025 13:35:02 GMT Subject: Integrated: 8357675: Amend headless message In-Reply-To: References: Message-ID: On Mon, 26 May 2025 16:38:21 GMT, Alexey Ivanov wrote: > Currently, the default headless message ends with a comma instead of full stop and has an additional line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it, > > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Fix:** > > Amend the message so that it ends with a full stop and remove the line break. > > > Exception in thread "AWT-EventQueue-0" java.awt.HeadlessException: > No X11 DISPLAY variable was set, > or no headful library support was found, > but this program performed an operation which requires it. > at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:158) > at java.desktop/java.awt.Window.(Window.java:518) > at java.desktop/java.awt.Frame.(Frame.java:428) > at java.desktop/javax.swing.JFrame.(JFrame.java:224) > > > **Testing:** > > Build a headless-only JDK (pass `--enable-headless-only` to the `configure` script) and create a `JFrame`. > > It's impossible to create an automated test for this change, and I don't think a test is required, it's a cosmetic change. This pull request has now been integrated. Changeset: 12ee80ca Author: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/12ee80cac754c1a6dd37191a9f80c01de8b659ad Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod 8357675: Amend headless message Reviewed-by: prr, shade ------------- PR: https://git.openjdk.org/jdk/pull/25453 From azvegint at openjdk.org Fri May 30 13:53:51 2025 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 30 May 2025 13:53:51 GMT Subject: RFR: 8357688: Remove unnecessary List.get before remove in PopupFactory In-Reply-To: <3fcUgHLShP5HamE2sRaXGbXg2gJzO9xOu28IQ_eVZyo=.1de88e4f-9519-4160-97b8-41072221fc07@github.com> References: <3fcUgHLShP5HamE2sRaXGbXg2gJzO9xOu28IQ_eVZyo=.1de88e4f-9519-4160-97b8-41072221fc07@github.com> Message-ID: On Sat, 17 May 2025 07:42:59 GMT, Andrey Turbanov wrote: > Instead of separate List.get+List.remove calls we can use single `removeFirst`. It's clearer. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/25283#pullrequestreview-2881430115 From duke at openjdk.org Fri May 30 14:03:52 2025 From: duke at openjdk.org (GennadiyKrivoshein) Date: Fri, 30 May 2025 14:03:52 GMT Subject: RFR: 8251928: [macos] the printer DPI always be 72, cause some content lost when print out In-Reply-To: References: Message-ID: On Fri, 30 May 2025 06:40:40 GMT, Prasanta Sadhukhan wrote: >> The fix for the https://bugs.openjdk.org/browse/JDK-8251928. >> >> **Description**. >> This PR contains changes to be able to print with DPI higher than 72 on macOS, set default CPrinterJob DPI is 300 like in the PSPrinterJob. >> >> As described in the macOS drawing guide, the following steps are required to draw with high DPI (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-BCICIJAJ): >> 1. Convert the user-space point, size, or rectangle value to device space coordinates; >> 2. Normalize the value in device space so that it is aligned to the appropriate pixel boundary; >> 3. Convert the normalized value back to user space; >> 4. Draw your content using the adjusted value. >> >> The 1-st step is now implemented in the CPrinterJob, a Graphics provided to the print method adjusted to a printer's DPI. >> The 2-nd step is a drawing process in the java code (without changes). >> The 3-rd step is now implemented in the PrinterView.m, the drawing scaled back to the 72 DPI. >> The 4-th step is a drawing process in the native code (without changes). >> >> **Tests**. >> I run all tests from javax.print package and there is no any regression. >> New test covers macOS and Linux only because we know its default DPI - 300. > > While running PDFBOX4935PrintDpi testcase from the JBS, it is showing with your fix > ScaleX: 4.166666 > ScaleY: 4.166666 > DPI = 300 > > while printing to pdf. Shouldn't the scale be shown as 2.0 for retina display while doing pdf printing? @prsadhuk , no, the scale should be 4.166666. As described in the drawing guide https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-SW6 > Units in the user space are based on the printer's point, which was used in the publishing industry to measure the size of content on the printed page. A single point is equivalent to 1/72 of an inch. Points were adopted by earlier versions of Mac OS as the standard resolution for content on the screen. OS X continues to use the same effective ?resolution? for user-space drawing. > > Although a single point often corresponded directly to a pixel in the past, in OS X, that may not be the case. Points are not tied to the resolution of any particular device. If you draw a rectangle whose width and height are exactly three points, that does not mean it will be rendered on the screen as a three-pixel by three-pixel rectangle. On a 144 dpi screen, the rectangle might be rendered using six pixels per side, and on a 600-dpi printer, the rectangle would require 25 pixels per side. The actual translation from points to pixels is device dependent and handled for you automatically by OS X. So it does not matter what the actual device DPI is, we always use or see 72 on the java side. I set the default printing DPI for macOS to 300 in this PR, so if you do not provide different value using javax.print.attribute.standard.PrinterResolution then the scaling should be 300/72 = 4.16666. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25489#issuecomment-2922481400 From duke at openjdk.org Fri May 30 14:53:50 2025 From: duke at openjdk.org (Eirik Bakke) Date: Fri, 30 May 2025 14:53:50 GMT Subject: RFR: 8251928: [macos] the printer DPI always be 72, cause some content lost when print out In-Reply-To: References: Message-ID: On Wed, 28 May 2025 10:29:17 GMT, GennadiyKrivoshein wrote: > The fix for the https://bugs.openjdk.org/browse/JDK-8251928. > > **Description**. > This PR contains changes to be able to print with DPI higher than 72 on macOS, set default CPrinterJob DPI is 300 like in the PSPrinterJob. > > As described in the macOS drawing guide, the following steps are required to draw with high DPI (https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html#//apple_ref/doc/uid/TP40003290-CH204-BCICIJAJ): > 1. Convert the user-space point, size, or rectangle value to device space coordinates; > 2. Normalize the value in device space so that it is aligned to the appropriate pixel boundary; > 3. Convert the normalized value back to user space; > 4. Draw your content using the adjusted value. > > The 1-st step is now implemented in the CPrinterJob, a Graphics provided to the print method adjusted to a printer's DPI. > The 2-nd step is a drawing process in the java code (without changes). > The 3-rd step is now implemented in the PrinterView.m, the drawing scaled back to the 72 DPI. > The 4-th step is a drawing process in the native code (without changes). > > **Tests**. > I run all tests from javax.print package and there is no any regression. > New test covers macOS and Linux only because we know its default DPI - 300. Increasing the DPI in the Graphics2D transform on the Java side might have the side effect of also fixing this bug: [JDK-8278222](https://bugs.openjdk.org/browse/JDK-8278222) [macos] Inaccurate letter spacing (kerning) when printing via java.awt.print ------------- PR Comment: https://git.openjdk.org/jdk/pull/25489#issuecomment-2922610942 From duke at openjdk.org Fri May 30 16:52:14 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 30 May 2025 16:52:14 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v3] In-Reply-To: References: Message-ID: > Make sure AquaTextPasswordFieldUI can't use selectWordAction. > > The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. > > So the problem is partially about multiple inheritance. > > My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. > > There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. Jeremy Wood has updated the pull request incrementally with two additional commits since the last revision: - 8354646: move to /plaf/basic/ dir If this is longer focusing on Aqua then probably this should live in a directory focusing on BasicL&F This is partially in response to: https://github.com/openjdk/jdk/pull/25443#pullrequestreview-2880829112 - 8354646: remove os.family=="mac" This is in response to: https://github.com/openjdk/jdk/pull/25443#pullrequestreview-2880829112 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25443/files - new: https://git.openjdk.org/jdk/pull/25443/files/bdbd51b0..a7709b7e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=01-02 Stats: 4 lines in 1 file changed: 2 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443 PR: https://git.openjdk.org/jdk/pull/25443 From honkar at openjdk.org Fri May 30 16:52:55 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 16:52:55 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> Message-ID: <9q66ZT3geFmp0yNxaibi9o-C-wv7J_ON_Q3o-JebRtg=.bbd38ca8-6d8b-4f7b-ae9e-e3ddf236088f@github.com> On Wed, 28 May 2025 20:25:23 GMT, Daniel Gredler wrote: >>> @prrace Please don't approve yet. I was able to fix the code conflicts caused by PR #23665, but it looks like the logic does not layer nicely as there is now a test failure on macOS after the merge. I'm having a look and will let you know what I find. >> >> And indeed the tests just finished and a test (not the new one, a previous one : IgnoredWhitespaceTest.java) failed on macOS x64 and ARM .. >> >> java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] >> at IgnoredWhitespaceTest.assertEqual(IgnoredWhitespaceTest.java:127) >> at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:103) >> at IgnoredWhitespaceTest.test(IgnoredWhitespaceTest.java:69) >> at IgnoredWhitespaceTest.main(IgnoredWhitespaceTest.java:49) >> at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) >> at java.base/java.lang.reflect.Method.invoke(Method.java:565) >> at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) >> at java.base/java.lang.Thread.run(Thread.java:1447) >> >> JavaTest Message: Test threw exception: java.lang.RuntimeException: for text '\t\t\t\t\tXXXXX' with font java.awt.Font[family=Dialog,name=Dialog,style=plain,size=40]: java.awt.Rectangle[x=300,y=271,width=123,height=28] != java.awt.Rectangle[x=365,y=271,width=123,height=28] >> JavaTest Message: shutting down test > > @prrace This is ready for review again. I've updated the code to combine nicely with the recent whitespace fixes. The `test/jdk/java/awt/font`, `test/jdk/java/awt/print` and `test/jdk/java/awt/Graphics2D/DrawString` tests all pass for me locally on Windows, Linux and macOS. > > Once these changes are integrated it should be relatively simple to address JDK-8356803 ("Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance") and JDK-8356812 ("Create an automated version of TextLayout/TestControls"). @gredler In the process of reviewing this PR. Just a headsup, JDK 25 RDP1 is next week (https://openjdk.org/projects/jdk/25/) in case you are planning to get the following fixes into 25: [JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance [JDK-8356812](https://bugs.openjdk.org/browse/JDK-8356812) - Create an automated version of TextLayout/TestControls ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2922880879 From duke at openjdk.org Fri May 30 17:04:34 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 30 May 2025 17:04:34 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v4] In-Reply-To: References: Message-ID: > Make sure AquaTextPasswordFieldUI can't use selectWordAction. > > The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. > > So the problem is partially about multiple inheritance. > > My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. > > There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8354646: updating bug summary to include 4231444 This is partially in response to: https://github.com/openjdk/jdk/pull/25443#pullrequestreview-2880829112 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25443/files - new: https://git.openjdk.org/jdk/pull/25443/files/a7709b7e..de054277 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=02-03 Stats: 5 lines in 1 file changed: 0 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/25443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443 PR: https://git.openjdk.org/jdk/pull/25443 From duke at openjdk.org Fri May 30 17:07:55 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 30 May 2025 17:07:55 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v2] In-Reply-To: References: Message-ID: On Fri, 30 May 2025 10:03:56 GMT, Tejesh R wrote: > Since the fix has been made in Basic, we should not restrict the test to Aqua L&F alone. It should be tested for all L&F. (For fix and for regression) OK, this is updated. Since this is now meant to cover/discuss Basic L&F, I updated the test to reflect that it tests 4231444 too. (The code that this PR moves around is the solution from 4231444). That ticket was resolved in 2003 with no accompanying unit test. (To be clear: Basic L&F ux should not change at all with this PR, but Aqua L&F ux should (via class inheritance).) ------------- PR Comment: https://git.openjdk.org/jdk/pull/25443#issuecomment-2922910842 From duke at openjdk.org Fri May 30 17:13:24 2025 From: duke at openjdk.org (Jeremy Wood) Date: Fri, 30 May 2025 17:13:24 GMT Subject: RFR: 8354646: java.awt.TextField allows to identify the spaces in a password when double clicked at the starting and end of the text [v5] In-Reply-To: References: Message-ID: <9OsgP7Nt-I4n_uqYEzVaNAbp-3rYf4ozSFmiWyDoF5Q=.5dc3cbc6-942d-490b-b086-c9803c92ee14@github.com> > Make sure AquaTextPasswordFieldUI can't use selectWordAction. > > The core problem here was we could call selectWordAction in the Aqua LAF on a JPasswordField. This problem was already solved in the BasicPasswordFieldUI, but the AquaTextPasswordFieldUI (and SynthPasswordFieldUI) do NOT extend the BasicPasswordFieldUI, so they weren't inheriting this solution. > > So the problem is partially about multiple inheritance. > > My first response at solving the problem is just to move the existing solution to the parent BasicTextUI class and use an instanceof to make sure it is only applied to JPasswordFields. > > There may be many different philosophies/recommendations on how to resolve this; I'm open to suggestions. Jeremy Wood has updated the pull request incrementally with one additional commit since the last revision: 8354646: fixing typo in summary ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25443/files - new: https://git.openjdk.org/jdk/pull/25443/files/de054277..fe1b781c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25443&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25443.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25443/head:pull/25443 PR: https://git.openjdk.org/jdk/pull/25443 From dgredler at openjdk.org Fri May 30 17:29:54 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 30 May 2025 17:29:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: <9q66ZT3geFmp0yNxaibi9o-C-wv7J_ON_Q3o-JebRtg=.bbd38ca8-6d8b-4f7b-ae9e-e3ddf236088f@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> <7qRLx0aLwArI3Md49dSXjXVR_aqNzSfRWCo-59TcyYo=.e75861cf-bd30-4118-ab4b-53e6fe86b8f8@github.com> <9q66ZT3geFmp0yNxaibi9o-C-wv7J_ON_Q3o-JebRtg=.bbd38ca8-6d8b-4f7b-ae9e-e3ddf236088f@github.com> Message-ID: On Fri, 30 May 2025 16:49:46 GMT, Harshitha Onkar wrote: >> @prrace This is ready for review again. I've updated the code to combine nicely with the recent whitespace fixes. The `test/jdk/java/awt/font`, `test/jdk/java/awt/print` and `test/jdk/java/awt/Graphics2D/DrawString` tests all pass for me locally on Windows, Linux and macOS. >> >> Once these changes are integrated it should be relatively simple to address JDK-8356803 ("Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance") and JDK-8356812 ("Create an automated version of TextLayout/TestControls"). > > @gredler In the process of reviewing this PR. > > Just a headsup, JDK 25 RDP1 is next week (https://openjdk.org/projects/jdk/25/) in case you are planning to get the following fixes into 25: > [JDK-8356803](https://bugs.openjdk.org/browse/JDK-8356803) - Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance > [JDK-8356812](https://bugs.openjdk.org/browse/JDK-8356812) - Create an automated version of TextLayout/TestControls @honkar-jdk Thanks! It shouldn't take me more than a day to address those two issues once this PR has been integrated, so I think it will just depend on how long the reviews take. I'll keep a close eye out to keep things quick on my end, though. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2922956785 From prr at openjdk.org Fri May 30 18:20:59 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 30 May 2025 18:20:59 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v14] In-Reply-To: <-wufduQaG7bNR6MZksflsgCitkejQfKDFxXKNhB-2bQ=.998703db-0369-4d4c-98fc-1036e0479ed8@github.com> References: <-wufduQaG7bNR6MZksflsgCitkejQfKDFxXKNhB-2bQ=.998703db-0369-4d4c-98fc-1036e0479ed8@github.com> Message-ID: On Tue, 27 May 2025 17:35:17 GMT, Alisen Chung wrote: >> Currently on macOS when mouseMove is given an offscreen coordinate to move the mouse to, mouseMove will physically clamp to the edge of the screen, but if you try to grab the mouse location immediately after by using MouseInfo.getPointerInfo().getLocation() you will get the value of the offscreen point. >> >> Windows and linux do this clamping and coordinate handling for us, but new distributions may not necessarily handle clamping the same way, so Robot should be checking for clamping rather than delegating it to native. >> >> This fix updates shared code to cache the screen bounds and adds a check to not exceed the bounds in mouseMove. The caching is done in the Robot constructor, so if the screen bounds changes the constructor must be called again to update to the new bounds. > > Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: > > - add logging to test > - test require macos, spacing in crobot Feedback question with native reproducer sent to Apple on 5/22/25, follow up email sent the same day. No reply to either. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2923087053 From abhiscxk at openjdk.org Fri May 30 18:49:55 2025 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 30 May 2025 18:49:55 GMT Subject: RFR: 8352149: Test java/awt/Frame/MultiScreenTest.java generates too many frames on Linux [v6] In-Reply-To: References: <-t5iRw5c31W0E-mPWTvHk9PoP819SUA9xrAwMZfJEDc=.c61d9c20-5397-4ab2-89ac-dab4b50b2a0e@github.com> Message-ID: On Fri, 9 May 2025 13:05:40 GMT, Khalid Boulanouare wrote: >> Fixes issue in which the test fails when run on multi-screen machine. >> >> Tested on Ubuntu 24.04, MacOS 15 and Windows 11 >> >> JTREG >> >> runner starting test: java/awt/Frame/MultiScreenTest.java >> runner finished test: java/awt/Frame/MultiScreenTest.java >> Passed. Execution successful > > Khalid Boulanouare has updated the pull request incrementally with one additional commit since the last revision: > > Adds Override for overriden methods You may remove setting the `title for instruction` and `row count` for PassFailJFrame. test/jdk/java/awt/Frame/MultiScreenTest.java line 103: > 101: if (gc.length > 0) { > 102: for (int i = 0; i < gc.length && i < 10; i++) { > 103: JFrame f = new JFrame(gc[i]); //test JFrame( gc ) Suggestion: JFrame f = new JFrame(gc[i]); // test JFrame( gc ) test/jdk/java/awt/Frame/MultiScreenTest.java line 104: > 102: for (int i = 0; i < gc.length && i < 10; i++) { > 103: JFrame f = new JFrame(gc[i]); //test JFrame( gc ) > 104: GCCanvas c = new GCCanvas(gc[i]);// test canvas( gc ) For consistency Suggestion: GCCanvas c = new GCCanvas(gc[i]); // test canvas( gc ) test/jdk/java/awt/Frame/MultiScreenTest.java line 112: > 110: f.setTitle("Screen# " + Integer.toString(j) + ", GC#" + Integer.toString(i)); > 111: f.setSize(300, 200); > 112: f.setLocation(400 + xoffs, (i * 150) + yoffs);// test Suggestion: f.setLocation(400 + xoffs, (i * 150) + yoffs); // test test/jdk/java/awt/Frame/MultiScreenTest.java line 178: > 176: g.fillArc(150, 30, 30, 30, 0, 200); > 177: } > 178: @Override You may add a blank line before `@Override` line to maintain consistency. Also add 4 spaces to move `@Override` similar to other methods Suggestion: @Override ------------- PR Review: https://git.openjdk.org/jdk/pull/24752#pullrequestreview-2882210805 PR Review Comment: https://git.openjdk.org/jdk/pull/24752#discussion_r2116449111 PR Review Comment: https://git.openjdk.org/jdk/pull/24752#discussion_r2116448694 PR Review Comment: https://git.openjdk.org/jdk/pull/24752#discussion_r2116449951 PR Review Comment: https://git.openjdk.org/jdk/pull/24752#discussion_r2116450051 From honkar at openjdk.org Fri May 30 18:50:54 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 18:50:54 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 29 May 2025 11:10:38 GMT, Daniel Gredler wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Remove one last now-unnecessary whitespace check inside CMap LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24412#pullrequestreview-2882218602 From duke at openjdk.org Fri May 30 18:54:56 2025 From: duke at openjdk.org (duke) Date: Fri, 30 May 2025 18:54:56 GMT Subject: RFR: 8353230: Emoji rendering regression after JDK-8208377 [v4] In-Reply-To: References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 29 May 2025 11:10:38 GMT, Daniel Gredler wrote: >> It looks like this regression actually fits into a longer series of fixes / regressions in this area: >> >> - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions >> - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics >> - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions >> - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display >> >> We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. >> >> It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). >> >> The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). >> >> In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. >> >> Note two intricacies related to `CompositeGlyphMapper`: >> 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. >> 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. >> >> The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. >> >> Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for Harf... > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Remove one last now-unnecessary whitespace check inside CMap @gredler Your change (at version 95652a114b9a9ac6da2dd1c3722c22c130c69a33) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24412#issuecomment-2923189224 From dgredler at openjdk.org Fri May 30 19:19:02 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 30 May 2025 19:19:02 GMT Subject: Integrated: 8353230: Emoji rendering regression after JDK-8208377 In-Reply-To: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> References: <-N8_d2SHcl-h9yG8t6-WKGF_nGLJZQTu4ymMD2oPGrg=.651c8251-b235-4681-b82a-4ee680eb6593@github.com> Message-ID: On Thu, 3 Apr 2025 11:23:42 GMT, Daniel Gredler wrote: > It looks like this regression actually fits into a longer series of fixes / regressions in this area: > > - [JDK-4517298](https://bugs.openjdk.org/browse/JDK-4517298) fixed metrics for zero-width characters, but broke some ligatures / glyph substitutions > - [JDK-7017058](https://bugs.openjdk.org/browse/JDK-7017058) fixed the ligatures / glyph substitutions, but broke some zero-width metrics > - [JDK-8208377](https://bugs.openjdk.org/browse/JDK-8208377) fixed some metrics and rendering for zero-width characters, but broke some ligatures / glyph substitutions > - Now, with this PR, we aim to fix the ligatures without re-breaking zero-width metrics and display > > We have two different types of use cases pulling `CharToGlyphMapper` in two different directions: the users who need raw, untransformed glyph info, and the users who need normalized / transformed glyph info. > > It looks to me like, in the current code base, the only `CharToGlyphMapper` user which requires raw font data is HarfBuzz (explicitly confirmed with the HarfBuzz team here: https://github.com/harfbuzz/harfbuzz/discussions/5234). > > The regression mechanism at play here is that the HarfBuzz font callbacks are currently providing HarfBuzz with transformed glyph info (e.g. ZWJ -> INVISIBLE_GLYPH_ID), which prevents HarfBuzz from recognizing and applying the correct font GSUB substitutions (which involve ZWJ). > > In order to fix this without (yet again) breaking metrics and display behavior elsewhere, I've added two methods to `CharToGlyphMapper` which provide access to raw glyph info, to be used by the HarfBuzz font callbacks: `charToGlyphRaw(int)` and `charToVariationGlyphRaw(int)`. > > Note two intricacies related to `CompositeGlyphMapper`: > 1. We need to be careful to only cache raw (untransformed) values, to avoid conflicts between requests for a raw version of a glyph and a transformed version of the same glyph. Another option would have been two separate caches, but I don't think that's necessary. > 2. Consumers who are using `CompositeGlyphMapper.SLOTMASK` to check glyph slots (e.g. `FontRunIterator` and `CTextPipe`) will "see" invisible glyphs as having come from slot 0. This isn't new, and I think it's OK, but something to be aware of. > > The glyph cache handling in `CCharToGlyphMapper` (for macOS) also requires care to avoid mixing value types. > > Please also note that I'm not sure if the tweak to `sunFont.c` is being tested, since FFM is being used by default for HarfBuzz integration. (Is there a plan to remove... This pull request has now been integrated. Changeset: 94039e22 Author: Daniel Gredler Committer: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/94039e22bbe943888e858d8ae278145e2668526a Stats: 384 lines in 13 files changed: 257 ins; 66 del; 61 mod 8353230: Emoji rendering regression after JDK-8208377 Reviewed-by: prr, honkar ------------- PR: https://git.openjdk.org/jdk/pull/24412 From honkar at openjdk.org Fri May 30 20:40:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 30 May 2025 20:40:52 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v5] In-Reply-To: References: Message-ID: <54IGkudg-8nx4Tsb1_kGHteOnylYKpP7B4XNZ5O2BHM=.429d5cbd-6c3a-403f-ba4c-c15b1b9964ca@github.com> On Fri, 30 May 2025 00:40:11 GMT, Harshitha Onkar wrote: >> CopyAreaOOB.java was failing intermittently on some platforms on CI but recently it started to fail more frequently on macos-aarch64 when the entire test suite runs. >> >> Test failure is not reproducible when the test is run individually (multiple times) on CI. >> >> Rewritten the test and added debug logs that will be helpful to figure out the issue. >> >> - Added code to capture screenshot (entire screen as well as the frame) in case of failure. >> - Since it tests multiple regions added a StringBuffer to consolidate the error logs before throwing RuntimeException. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > added testRegion back to paint() @mrserb @aivanov-jdk Can you please re-review when you get a chance? This issue fix is targeted for jdk-25 and I was planning on integrating it on Monday if the updated test looks good. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25279#issuecomment-2923434327 From prr at openjdk.org Fri May 30 21:24:54 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 30 May 2025 21:24:54 GMT Subject: RFR: 8357994: Use "stdin.encoding" for reading System.in with InputStreamReader/Scanner [client] In-Reply-To: References: Message-ID: On Fri, 30 May 2025 10:59:17 GMT, Volkan Yazici wrote: > Passes the `Charset` read from the `stdin.encoding` system property while creating `InputStreamReader` or `Scanner` instances for `System.in`. > > `stdin.encoding` is a recently added property for Java 25 in [JDK-8350703](https://bugs.openjdk.org/browse/JDK-8350703). Employing it throughout the entire code base is addressed by the parent ticket [JDK-8356893](https://bugs.openjdk.org/browse/JDK-8356893). JDK-8357994 this PR is addressing is a sub-task of JDK-8356893 and is concerned with only areas related to client libraries. This is the first I've heard of it but it makes absolutely zero sense here. The data transfer case is things like "drag and drop" between applications. You'll never see it coming from stdin And the editor kits will read FILES with some content you want to edit. No one will ever type it in. So in summary, withdraw this PR. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25543#issuecomment-2923526310 From prr at openjdk.org Fri May 30 21:34:52 2025 From: prr at openjdk.org (Phil Race) Date: Fri, 30 May 2025 21:34:52 GMT Subject: RFR: 8355904: Use variadic macros for J2dTrace [v6] In-Reply-To: References: <-9CAObCkXrOQCQ85CXnMswvDaWWA4OmBy699xKF2qpI=.c081bd7e-1a31-4e36-99d7-97bb2e005d83@github.com> Message-ID: On Thu, 22 May 2025 20:44:30 GMT, Nikita Gubarkov wrote: >> J2dTrace macros have multiple overloads specifying number of arguments, making it less convent to change number of arguments. There were cases when existing macros were not enough and people had to add new variants with even more arguments. We could simply use variadic macros instead. >> >> Also, currently those macros expand to a { code block }, which doesn't require a semicolon at the end, so it can sometimes be missed, leading to an inconsistent code style. We could expand it directly to the function, forcing user to insert a semicolon after that, in a function-like style. > > Nikita Gubarkov has updated the pull request incrementally with one additional commit since the last revision: > > Update D3DShaderGen.c I would like to run this through our build system - which will build the debug builds as well as product but I find that a recent change means the patch doesn't apply. So pls merge the change with latest master and I will try after you've done that ------------- PR Comment: https://git.openjdk.org/jdk/pull/24949#issuecomment-2923541756 From dgredler at openjdk.org Fri May 30 23:48:26 2025 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 30 May 2025 23:48:26 GMT Subject: RFR: 8356803: Test TextLayout/TestControls fails on windows & linux: line and paragraph separator show non-zero advance Message-ID: Per discussion in JBS, adds the following chars to the list of ignorable whitespace chars: U+000B (Vertical Tab), U+000C (Form Feed), U+0085 (Next Line), U+2028 (Line Separator), U+2029 (Paragraph Separator). Adds the necessary testing in pre-existing automated test class `test/jdk/java/awt/font/TextLayout/FormatCharAdvanceTest.java`. Removes now-unnecessary manual test `test/jdk/java/awt/font/TextLayout/TestControls.java`. The `test/jdk/java/awt/font`, `test/jdk/java/awt/print` and `test/jdk/java/awt/Graphics2D/DrawString` tests all pass for me locally on Windows, Linux and macOS. ------------- Commit messages: - Add missing ignorable whitespace chars, add (automated) tests Changes: https://git.openjdk.org/jdk/pull/25560/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25560&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8356803 Stats: 215 lines in 3 files changed: 40 ins; 161 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/25560.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25560/head:pull/25560 PR: https://git.openjdk.org/jdk/pull/25560 From honkar at openjdk.org Sat May 31 00:00:52 2025 From: honkar at openjdk.org (Harshitha Onkar) Date: Sat, 31 May 2025 00:00:52 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data In-Reply-To: References: Message-ID: On Thu, 29 May 2025 10:22:39 GMT, Sergey Bylokhov wrote: > The [next PR](https://github.com/openjdk/jdk/pull/23044) introduces several new methods to the ICC_Profile class: > - getProfileClass(byte[]) > - getColorSpaceType(byte[]) > - getPCSType(byte[]) > - checkRenderingIntent(byte[]) > > These new methods extract data directly from the provided byte array rather than relying on the profile instance. The first three methods essentially duplicate the existing ones (getProfileClass(), getColorSpaceType(), getPCSType()). > > It is possible to update implementation: > - The existing methods getColorSpaceType() and getPCSType() could delegate to the new getColorSpaceType(byte[]) and getPCSType(byte[]) methods. > - The checkRenderingIntent(byte[]) method could be updated to report the actual invalid intent value when an error occurs > > Tests: > - Old ValidateICCHeaderData test is update to verify the new output of the checkRenderingIntent > - New RenderingIntentStressTest test is added to check the next part of the icc_spec: > > * ICC spec: only the least-significant 16 bits encode the rendering > * intent. The most significant 16 bits must be zero and can be ignored. > * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. > > > > @honkar-jdk please take a look. > > Note: There is currently an inconsistency in the usage of `getData(icSigHead)` vs `getData(cmmProfile(), icSigHead)` throughout the codebase. I plan to address this separately. Initial testing looks good. I have added minor inline comments. src/java.desktop/share/classes/java/awt/color/ICC_Profile.java line 1191: > 1189: * ICC spec: only the least-significant 16 bits encode the rendering > 1190: * intent. The most significant 16 bits must be zero and can be ignored. > 1191: * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. ICC Spec link in the comment refers to older one, probably update to the new version ? https://www.color.org/specification/ICC.1-2022-05.pdf , https://www.color.org/icc_specs2.xalter. test/jdk/java/awt/color/ICC_Profile/RenderingIntentStressTest.java line 95: > 93: || intent == icMediaRelativeColorimetric > 94: || intent == icSaturation || intent == icAbsoluteColorimetric > 95: || intent == icICCAbsoluteColorimetric; I hadn't noticed it earlier but `icAbsoluteColorimetric` and `icICCAbsoluteColorimetric` (since 1.5) point to the same intent. Can it be unified or has it be maintained as two separate constants for backward compatibility ? test/jdk/java/awt/color/ICC_Profile/ValidateICCHeaderData/ValidateICCHeaderData.java line 199: > 197: if (!message.contains(": " + invalidRenderIntent)) { > 198: throw new RuntimeException("Test Failed ! Unexpected text"); > 199: } The usual recommendation is not to check for specific exception messages but in this case it should be fine since this fix changes the exception msg and as regression test update for the fix. ------------- PR Review: https://git.openjdk.org/jdk/pull/25519#pullrequestreview-2882873809 PR Review Comment: https://git.openjdk.org/jdk/pull/25519#discussion_r2116863194 PR Review Comment: https://git.openjdk.org/jdk/pull/25519#discussion_r2116878277 PR Review Comment: https://git.openjdk.org/jdk/pull/25519#discussion_r2116872440 From serb at openjdk.org Sat May 31 00:30:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 00:30:02 GMT Subject: Integrated: 8358107: Rollback JDK-8357299 changeset In-Reply-To: References: Message-ID: <7josMxpLC0ELBOwp5yl5V8yjRJboF1sFXNCQBnxLncc=.39a4eb6a-afcd-4e5e-b152-9ea8b617c054@github.com> On Fri, 30 May 2025 04:11:36 GMT, Sergey Bylokhov wrote: > The patch for [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) does not completely fix the regression it was intended to address. Instead of bailing out on overflow, it introduces additional logic around src and clip, which might lead to attempts to draw invalid source pixels. > > A test case demonstrating the issue is attached to [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103)(passed on jdk22 failed on latest openjdk/jdk). > > There are some unresolved discussions related to that patch, see [PR](https://github.com/openjdk/jdk/pull/25340). I believe it would be better to bail out early in case of overflow than risk incorrect calculations. > > Therefore, I propose reverting [JDK-8357299](https://bugs.openjdk.org/browse/JDK-8357299) until a proper fix is available. This approach would also simplify backports, since only the patch for [JDK-8358103](https://bugs.openjdk.org/browse/JDK-8358103) would need to be backported > > @prsadhuk, @prrace please take a look This pull request has now been integrated. Changeset: d9d00d33 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/d9d00d33a6a0d540a10e0a58f6df27cae46d2753 Stats: 74 lines in 2 files changed: 5 ins; 62 del; 7 mod 8358107: Rollback JDK-8357299 changeset Reviewed-by: psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/25537 From serb at openjdk.org Sat May 31 00:32:02 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 00:32:02 GMT Subject: RFR: 8347826: Introspector shows wrong method list after 8071693 [v16] In-Reply-To: References: Message-ID: On Fri, 30 May 2025 11:20:39 GMT, Roman Marchenko wrote: >> Fixed `com.sun.beans.introspect.MethodInfo#MethodOrder` to make `Introspector.addMethod()` working properly when filtering methods out. >> >> Also, after PR discussion, added the approptiate test cases with corresponding fixes in MethodInfo.java and PropertyInfo.java. >> >> --------- >> `getMethodDescriptors()` returns descriptors of public methods of a class and its parent classes, including default and static methods defined in interfaces. The result doesn't include methods which were declared and not implemented, bridge methods, or methods which were overriden in subclasses. >> >> When a subclass "overrides" a static method from a parent class `getMethodDescriptors()` behaves as follows: >> >> - In case of a clash with a class method, the class version will take precedence rather than interface's one. >> - If the same method appears in multiple classes/interfaces within the same hierarchy, the version from the most specific sub-interface will be selected. >> - If the method appears in classes/interfaces from different hierarchies, the result is undefined, either version can be returned. >> >> `getPropertyDescriptors()` returns descriptors of methods which were identified as getters or setters. As there can be the only method getter/setter per property, the following rules are applied when choosing a getter/setter: >> >> * Getters/setters for the same property defined (not necessarily overriden) in subclasses have higher precedence. >> * If there are getters/setters for the same property defined in the same class and argument types are assignable one to another, the method with the Least Common Supertype has the lower priority. If argument types are not assignable, the result is undefined (any method will be chosen). >> * Gettters/setters declared and not implemented are not considered. > > Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision: > > minor change Marked as reviewed by serb (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/23443#pullrequestreview-2882939391 From serb at openjdk.org Sat May 31 01:03:04 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 01:03:04 GMT Subject: RFR: JDK-8357082 : Stabilize and add debug logs to CopyAreaOOB.java [v5] In-Reply-To: References: <-lBIVrQXyxII4hEx6bRTJaM9dtFYWTgu7ULBFS-5kOQ=.a653a92e-702d-48d2-b6fa-50d134d4996d@github.com> Message-ID: <1oCpyW01HIgsdailQXTvgyOi3EwZCpQvqvd6dMcYxzE=.958c3237-4786-4189-86d1-daf317d9e041@github.com> On Fri, 30 May 2025 00:31:55 GMT, Harshitha Onkar wrote: > Added back Toolkit.sync() and canvas capture to paint method. Although I'm not sure if I understood _"each render frame"_ correctly. Can you please explain? The paint method may be invoked multiple times after the frame becomes visible, so the validation logic inside paint will be executed for each rendering data. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25279#discussion_r2116940976 From serb at openjdk.org Sat May 31 01:07:53 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 01:07:53 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data In-Reply-To: References: Message-ID: On Fri, 30 May 2025 23:56:35 GMT, Harshitha Onkar wrote: >I hadn't noticed it earlier but icAbsoluteColorimetric and icICCAbsoluteColorimetric point to the same intent. Is it good to unify them into a single constant in src code during clean up (separate issue)? At some point, that constants were renamed in the ICC spec, and as a result, the new constants with the different names were added to ICC_Profile. The old one were not removed to avoid breaking compatibility. It wasn't considered critical, since both constants have the same value. >Since both indicate intent value of 3 only one comparison should be sufficient in the test. I just included all constants supported by the JDK for completeness. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25519#discussion_r2116951657 From serb at openjdk.org Sat May 31 01:23:12 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 01:23:12 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data [v2] In-Reply-To: References: Message-ID: <3Hc0HUBARShfH4xBoo2r6FzrQcpp1QzRNY_SiXJSaRs=.25f51547-f193-4d8a-9058-9cbd3c202d67@github.com> > The [next PR](https://github.com/openjdk/jdk/pull/23044) introduces several new methods to the ICC_Profile class: > - getProfileClass(byte[]) > - getColorSpaceType(byte[]) > - getPCSType(byte[]) > - checkRenderingIntent(byte[]) > > These new methods extract data directly from the provided byte array rather than relying on the profile instance. The first three methods essentially duplicate the existing ones (getProfileClass(), getColorSpaceType(), getPCSType()). > > It is possible to update implementation: > - The existing methods getColorSpaceType() and getPCSType() could delegate to the new getColorSpaceType(byte[]) and getPCSType(byte[]) methods. > - The checkRenderingIntent(byte[]) method could be updated to report the actual invalid intent value when an error occurs > > Tests: > - Old ValidateICCHeaderData test is update to verify the new output of the checkRenderingIntent > - New RenderingIntentStressTest test is added to check the next part of the icc_spec: > > * ICC spec: only the least-significant 16 bits encode the rendering > * intent. The most significant 16 bits must be zero and can be ignored. > * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. > > > > @honkar-jdk please take a look. > > Note: There is currently an inconsistency in the usage of `getData(icSigHead)` vs `getData(cmmProfile(), icSigHead)` throughout the codebase. I plan to address this separately. Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: Update link to specification ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25519/files - new: https://git.openjdk.org/jdk/pull/25519/files/fc6360d3..cc41d6d4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25519&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25519&range=00-01 Stats: 9 lines in 2 files changed: 0 ins; 3 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/25519.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25519/head:pull/25519 PR: https://git.openjdk.org/jdk/pull/25519 From psadhukhan at openjdk.org Sat May 31 04:18:01 2025 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Sat, 31 May 2025 04:18:01 GMT Subject: RFR: 8356594: JSplitPane loses divider location when reopened via JOptionPane.createDialog() [v4] In-Reply-To: <61tykjKijk-xkAT398xNxGXuqaSEBw88B4begSzHndo=.2a5c38cf-cef0-473d-bd86-516d7e21c47c@github.com> References: <61tykjKijk-xkAT398xNxGXuqaSEBw88B4begSzHndo=.2a5c38cf-cef0-473d-bd86-516d7e21c47c@github.com> Message-ID: On Wed, 28 May 2025 03:21:08 GMT, Prasanta Sadhukhan wrote: >> But we can read/save orientation, then call super, then make a check? >> I am not sure how important to always call super.setComponentOrientation(orientation); >> can we miss some notification fired from that method? > > OK. Current orientation is stored and then checked and super.setComponentOrientation is called before check. > I guess that method fires PropertyChangeEvent for orientation set and now it will be fired always like before.. I guess all concerns are addressed..If there is no proven concern on this, I would integrate this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25294#discussion_r2117210553 From serb at openjdk.org Sat May 31 04:24:47 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 04:24:47 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data [v3] In-Reply-To: References: Message-ID: > The [next PR](https://github.com/openjdk/jdk/pull/23044) introduces several new methods to the ICC_Profile class: > - getProfileClass(byte[]) > - getColorSpaceType(byte[]) > - getPCSType(byte[]) > - checkRenderingIntent(byte[]) > > These new methods extract data directly from the provided byte array rather than relying on the profile instance. The first three methods essentially duplicate the existing ones (getProfileClass(), getColorSpaceType(), getPCSType()). > > It is possible to update implementation: > - The existing methods getColorSpaceType() and getPCSType() could delegate to the new getColorSpaceType(byte[]) and getPCSType(byte[]) methods. > - The checkRenderingIntent(byte[]) method could be updated to report the actual invalid intent value when an error occurs > > Tests: > - Old ValidateICCHeaderData test is update to verify the new output of the checkRenderingIntent > - New RenderingIntentStressTest test is added to check the next part of the icc_spec: > > * ICC spec: only the least-significant 16 bits encode the rendering > * intent. The most significant 16 bits must be zero and can be ignored. > * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. > > > > @honkar-jdk please take a look. > > Note: There is currently an inconsistency in the usage of `getData(icSigHead)` vs `getData(cmmProfile(), icSigHead)` throughout the codebase. I plan to address this separately. Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: Update ValidateICCHeaderData.java ------------- Changes: - all: https://git.openjdk.org/jdk/pull/25519/files - new: https://git.openjdk.org/jdk/pull/25519/files/cc41d6d4..43b88ff3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=25519&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25519&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/25519.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/25519/head:pull/25519 PR: https://git.openjdk.org/jdk/pull/25519 From serb at openjdk.org Sat May 31 04:24:48 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 04:24:48 GMT Subject: RFR: 8358057: Update validation of ICC_Profile header data [v3] In-Reply-To: References: Message-ID: On Sat, 31 May 2025 04:21:41 GMT, Sergey Bylokhov wrote: >> The [next PR](https://github.com/openjdk/jdk/pull/23044) introduces several new methods to the ICC_Profile class: >> - getProfileClass(byte[]) >> - getColorSpaceType(byte[]) >> - getPCSType(byte[]) >> - checkRenderingIntent(byte[]) >> >> These new methods extract data directly from the provided byte array rather than relying on the profile instance. The first three methods essentially duplicate the existing ones (getProfileClass(), getColorSpaceType(), getPCSType()). >> >> It is possible to update implementation: >> - The existing methods getColorSpaceType() and getPCSType() could delegate to the new getColorSpaceType(byte[]) and getPCSType(byte[]) methods. >> - The checkRenderingIntent(byte[]) method could be updated to report the actual invalid intent value when an error occurs >> >> Tests: >> - Old ValidateICCHeaderData test is update to verify the new output of the checkRenderingIntent >> - New RenderingIntentStressTest test is added to check the next part of the icc_spec: >> >> * ICC spec: only the least-significant 16 bits encode the rendering >> * intent. The most significant 16 bits must be zero and can be ignored. >> * See https://www.color.org/ICC1v42_2006-05.pdf, section 7.2.15. >> >> >> >> @honkar-jdk please take a look. >> >> Note: There is currently an inconsistency in the usage of `getData(icSigHead)` vs `getData(cmmProfile(), icSigHead)` throughout the codebase. I plan to address this separately. > > Sergey Bylokhov has updated the pull request incrementally with one additional commit since the last revision: > > Update ValidateICCHeaderData.java test/jdk/java/awt/color/ICC_Profile/ValidateICCHeaderData/ValidateICCHeaderData.java line 27: > 25: * @test > 26: * @bug 8337703 8347377 8358057 > 27: * @summary To verify if ICC_Profile's setData() and getInstance() methods I have added 8347377 where this test was added and 8358057 for the current issue. @honkar-jdk I cannot access the 8337703 is it a "closed bug" or it is a typo and we can drop that id? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25519#discussion_r2117224965 From serb at openjdk.org Sat May 31 07:09:03 2025 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 31 May 2025 07:09:03 GMT Subject: Integrated: 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy In-Reply-To: References: Message-ID: On Thu, 22 May 2025 21:21:30 GMT, Sergey Bylokhov wrote: > The issue was found here: https://github.com/openjdk/jdk/pull/24692#discussion_r2089545502 > > AWTEventListener and AWTEventListenerProxy are public classes and there's no assertion that EventListenerProxy.getListener() will always return a non-null value. So removeAWTEventListener method should fetch the listener from the proxy and check it for null similar to how it is implemented in addAWTEventListener. Currently, it works fine because we never insert null values into the map. So it is just a code clarification. > > One of the test is updated just to touch that codepath. This pull request has now been integrated. Changeset: 3a3ea7e1 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/3a3ea7e17fff100e368c956350bb9aaa2261b8a9 Stats: 48 lines in 2 files changed: 28 ins; 15 del; 5 mod 8357598: Toolkit.removeAWTEventListener should handle null listener in AWTEventListenerProxy Reviewed-by: aivanov, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/25401