From duke at openjdk.org Sun Dec 1 00:50:12 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 1 Dec 2024 00:50:12 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v4] In-Reply-To: References: Message-ID: > 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 - Merge master - Merge master - ... and 4 more: https://git.openjdk.org/jdk/compare/28ae281b...242bf546 ------------- Changes: https://git.openjdk.org/jdk/pull/15319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=03 Stats: 235 lines in 5 files changed: 230 ins; 1 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/15319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319 PR: https://git.openjdk.org/jdk/pull/15319 From duke at openjdk.org Sun Dec 1 01:10:39 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 1 Dec 2024 01:10:39 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v3] In-Reply-To: <3QQGijNyprMJBC8JrdntzeD5RKklMDkZB60_BPC-2dw=.a1b6c3e9-1f3d-4010-933f-23d9c2375fdd@github.com> References: <3QQGijNyprMJBC8JrdntzeD5RKklMDkZB60_BPC-2dw=.a1b6c3e9-1f3d-4010-933f-23d9c2375fdd@github.com> Message-ID: On Tue, 21 Nov 2023 14:09:07 GMT, Alexey Ivanov wrote: > I wonder if it's possible to write a (unit) test which verifies the new behaviour? and whether it's worth doing. @aivanov-jdk Done. > please say when you will be getting back to this @prrace I'm getting back to this issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/15319#issuecomment-2509506629 From duke at openjdk.org Sun Dec 1 10:17:34 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 1 Dec 2024 10:17:34 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v5] In-Reply-To: References: Message-ID: > 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 = """ > > > >

> >

> 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 - Removes files make/javac.20231014_162919.args make/javac.20231014_220237.args make/javac.20231023_221655.args ------------- Changes: - all: https://git.openjdk.org/jdk/pull/15319/files - new: https://git.openjdk.org/jdk/pull/15319/files/242bf546..3411398d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=03-04 Stats: 175 lines in 4 files changed: 0 ins; 114 del; 61 mod Patch: https://git.openjdk.org/jdk/pull/15319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319 PR: https://git.openjdk.org/jdk/pull/15319 From duke at openjdk.org Sun Dec 1 10:48:34 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 1 Dec 2024 10:48:34 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v6] In-Reply-To: References: Message-ID: > 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 = """ > > > >

> >

> References: Message-ID: > 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 = """ > > > >

> >

> References: <7_6ap7IiM5hzP1kXLmWZ3kHns9kmkQOylEVIDQmjFOE=.00930420-3576-44bc-96fd-ab48a9c8d248@github.com> Message-ID: On Sat, 30 Nov 2024 03:55:50 GMT, Phil Race wrote: >> Remove uses of and references to SecurityManager from the printing code > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345142 Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22422#pullrequestreview-2471556976 From azvegint at openjdk.org Mon Dec 2 00:47:52 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 00:47:52 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v2] In-Reply-To: References: Message-ID: On Sat, 30 Nov 2024 03:50:24 GMT, Phil Race wrote: >> Remove SecurityManager related code from Swing filechooser implementation > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345141 Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22423#pullrequestreview-2471558552 From azvegint at openjdk.org Mon Dec 2 00:47:53 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 00:47:53 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v2] In-Reply-To: References: Message-ID: On Sat, 30 Nov 2024 03:45:14 GMT, Phil Race wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java line 167: >> >>> 165: >>> 166: static Win32ShellFolder2 getDesktop() { >>> 167: if (desktop == null) { >> >> `import java.util.stream.Stream;` unused > > Doesn't seem related to this change. I'll fix it here since a simple build should prove it is safe, but refactoring and non-SM clean up is not a goal in these fixes. In this case, it is related because you have removed its use: `- private static File[] checkFiles(Stream filesStream, @SuppressWarnings("removal") SecurityManager sm) {` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22423#discussion_r1865077865 From azvegint at openjdk.org Mon Dec 2 00:58:46 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 00:58:46 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v2] In-Reply-To: References: Message-ID: <7sYuojWQDsIRMswxvYS1uqj5_NepvjYfZjXT3Q7sTgQ=.817db01a-3ea3-4d3c-a7c5-d57b8be35c51@github.com> On Fri, 29 Nov 2024 01:04:32 GMT, Alexander Zvegintsev wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8345143 > > src/java.desktop/share/classes/javax/swing/Popup.java line 247: > >> 245: // Try to set "always-on-top" for the popup window. >> 246: // Applets usually don't have sufficient permissions to do it. >> 247: // In this case simply ignore the exception. > > Suggestion: This can still be updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1865083798 From prr at openjdk.org Mon Dec 2 04:23:46 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 04:23:46 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v3] In-Reply-To: <7sYuojWQDsIRMswxvYS1uqj5_NepvjYfZjXT3Q7sTgQ=.817db01a-3ea3-4d3c-a7c5-d57b8be35c51@github.com> References: <7sYuojWQDsIRMswxvYS1uqj5_NepvjYfZjXT3Q7sTgQ=.817db01a-3ea3-4d3c-a7c5-d57b8be35c51@github.com> Message-ID: On Mon, 2 Dec 2024 00:55:55 GMT, Alexander Zvegintsev wrote: >> src/java.desktop/share/classes/javax/swing/Popup.java line 247: >> >>> 245: // Try to set "always-on-top" for the popup window. >>> 246: // Applets usually don't have sufficient permissions to do it. >>> 247: // In this case simply ignore the exception. >> >> Suggestion: > > This can still be updated. fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1865204366 From prr at openjdk.org Mon Dec 2 04:23:45 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 04:23:45 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v3] In-Reply-To: References: Message-ID: <60yT3WANw9AZv4R8kKUPtf8bziCriK_I2-nk6Qn0jCA=.31992c2f-c8a2-497e-92ee-2f44c50caecc@github.com> > Remove SecurityManager related code in the desktop module that is not covered by other PRs Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8345143 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22424/files - new: https://git.openjdk.org/jdk/pull/22424/files/a02cecb4..17302404 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=01-02 Stats: 3 lines in 1 file changed: 0 ins; 3 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22424.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22424/head:pull/22424 PR: https://git.openjdk.org/jdk/pull/22424 From azvegint at openjdk.org Mon Dec 2 04:40:42 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 04:40:42 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v3] In-Reply-To: <60yT3WANw9AZv4R8kKUPtf8bziCriK_I2-nk6Qn0jCA=.31992c2f-c8a2-497e-92ee-2f44c50caecc@github.com> References: <60yT3WANw9AZv4R8kKUPtf8bziCriK_I2-nk6Qn0jCA=.31992c2f-c8a2-497e-92ee-2f44c50caecc@github.com> Message-ID: On Mon, 2 Dec 2024 04:23:45 GMT, Phil Race wrote: >> Remove SecurityManager related code in the desktop module that is not covered by other PRs > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345143 Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22424#pullrequestreview-2471726576 From psadhukhan at openjdk.org Mon Dec 2 05:26:46 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 2 Dec 2024 05:26:46 GMT Subject: RFR: 8345142: Remove uses of SecurityManager in Printing related classes [v2] In-Reply-To: References: <7_6ap7IiM5hzP1kXLmWZ3kHns9kmkQOylEVIDQmjFOE=.00930420-3576-44bc-96fd-ab48a9c8d248@github.com> Message-ID: On Sat, 30 Nov 2024 03:55:50 GMT, Phil Race wrote: >> Remove uses of and references to SecurityManager from the printing code > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345142 Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22422#pullrequestreview-2471767353 From abhiscxk at openjdk.org Mon Dec 2 06:51:40 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 2 Dec 2024 06:51:40 GMT Subject: RFR: 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java In-Reply-To: References: Message-ID: <_dxrFcF1VS3vfQcD-oavFtz9ZXAJ2MllL__DueYWA6o=.6e1bf024-d68f-4e2a-9908-0eab55d82a98@github.com> On Fri, 29 Nov 2024 12:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java is not failing in OCI but still listed in PL. > Removing as it is passing in OCI ubuntu22.04 system..Tested for 50 iterations in OCI.. test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java line 55: > 53: robot = new Robot(); > 54: robot.waitForIdle(); > 55: robot.delay(1000); Test is passing in my local machine without this extra delay. Does the test pass on CI machines without this increased delay or the delay is required to make the test more stable ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22458#discussion_r1865307896 From psadhukhan at openjdk.org Mon Dec 2 06:51:40 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 2 Dec 2024 06:51:40 GMT Subject: RFR: 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java In-Reply-To: <_dxrFcF1VS3vfQcD-oavFtz9ZXAJ2MllL__DueYWA6o=.6e1bf024-d68f-4e2a-9908-0eab55d82a98@github.com> References: <_dxrFcF1VS3vfQcD-oavFtz9ZXAJ2MllL__DueYWA6o=.6e1bf024-d68f-4e2a-9908-0eab55d82a98@github.com> Message-ID: On Mon, 2 Dec 2024 06:46:54 GMT, Abhishek Kumar wrote: >> test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java is not failing in OCI but still listed in PL. >> Removing as it is passing in OCI ubuntu22.04 system..Tested for 50 iterations in OCI.. > > test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java line 55: > >> 53: robot = new Robot(); >> 54: robot.waitForIdle(); >> 55: robot.delay(1000); > > Test is passing in my local machine without this extra delay. > > Does the test pass on CI machines without this increased delay or the delay is required to make the test more stable ? Its not needed strictly par se and it passed without it also but I modified as the test is using Robot class so better to use robot method.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22458#discussion_r1865309408 From abhiscxk at openjdk.org Mon Dec 2 07:03:37 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 2 Dec 2024 07:03:37 GMT Subject: RFR: 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java In-Reply-To: References: Message-ID: On Fri, 29 Nov 2024 12:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java is not failing in OCI but still listed in PL. > Removing as it is passing in OCI ubuntu22.04 system..Tested for 50 iterations in OCI.. Marked as reviewed by abhiscxk (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22458#pullrequestreview-2471879840 From abhiscxk at openjdk.org Mon Dec 2 07:03:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 2 Dec 2024 07:03:38 GMT Subject: RFR: 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java In-Reply-To: References: <_dxrFcF1VS3vfQcD-oavFtz9ZXAJ2MllL__DueYWA6o=.6e1bf024-d68f-4e2a-9908-0eab55d82a98@github.com> Message-ID: On Mon, 2 Dec 2024 06:48:34 GMT, Prasanta Sadhukhan wrote: >> test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java line 55: >> >>> 53: robot = new Robot(); >>> 54: robot.waitForIdle(); >>> 55: robot.delay(1000); >> >> Test is passing in my local machine without this extra delay. >> >> Does the test pass on CI machines without this increased delay or the delay is required to make the test more stable ? > > Its not needed strictly par se and it passed without it also but I modified as the test is using Robot class so better to use robot method.. Ok.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22458#discussion_r1865319232 From psadhukhan at openjdk.org Mon Dec 2 08:17:49 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 2 Dec 2024 08:17:49 GMT Subject: Integrated: 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java In-Reply-To: References: Message-ID: On Fri, 29 Nov 2024 12:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java is not failing in OCI but still listed in PL. > Removing as it is passing in OCI ubuntu22.04 system..Tested for 50 iterations in OCI.. This pull request has now been integrated. Changeset: 1c4c6531 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/1c4c653168bd4f39544eca08f8256a6ac6e4477c Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod 8345247: Deproblemlist test/jdk/javax/swing/JRadioButton/8075609/bug8075609.java Reviewed-by: abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22458 From jwaters at openjdk.org Mon Dec 2 12:04:43 2024 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 2 Dec 2024 12:04:43 GMT Subject: RFR: 8342870: Errors related to unused code on Windows after 8339120 in accessibility [v3] In-Reply-To: References: Message-ID: On Wed, 20 Nov 2024 05:41:58 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 > > Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits: > > - Merge branch 'master' into accessibility > - Remove now unused result > - Merge branch 'master' into accessibility > - 8342870 I am still not sure where to ask for A11Y people to look at this ------------- PR Comment: https://git.openjdk.org/jdk/pull/21656#issuecomment-2511349242 From psadhukhan at openjdk.org Mon Dec 2 12:57:56 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 2 Dec 2024 12:57:56 GMT Subject: RFR: 8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in ubuntu22.04 Message-ID: test/jdk/javax/swing/Action/8133039/bug8133039.java failed in OCI ubuntu 22.04 with exception "Method accept not invoked" Seems like robot keypress happened before testframe was visible..Added a delay.. Several iterations passed in OCI linux system.. ------------- Commit messages: - OCItest2 Changes: https://git.openjdk.org/jdk/pull/22480/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22480&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345297 Stats: 4 lines in 1 file changed: 2 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22480.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22480/head:pull/22480 PR: https://git.openjdk.org/jdk/pull/22480 From duke at openjdk.org Mon Dec 2 14:01:46 2024 From: duke at openjdk.org (ScientificWare) Date: Mon, 2 Dec 2024 14:01:46 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v7] In-Reply-To: References: Message-ID: On Sun, 1 Dec 2024 12:40:29 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 = """ >> >> >> >>

>> References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Tue, 26 Nov 2024 17:17:09 GMT, Magnus Ihse Bursie wrote: >> As a prerequisite for Hermetic Java, we need a statically linked `java` launcher. It should behave like the normal, dynamically linked `java` launcher, except that all JDK native libraries should be statically, not dynamically, linked. >> >> This patch is the first step towards this goal. It will generate a `static-jdk` image with a statically linked launcher. This launcher is missing several native libs, however, and does therefore not behave like a proper dynamic java. One of the reasons for this is that local symbol hiding in static libraries are not implemented yet, which causes symbol clashes when linking all static libraries together. This will be addressed in an upcoming patch. >> >> All changes in the `src` directory are copied from, or inspired by, changes made in [the hermetic-java-runtime branch in Project Leyden](https://github.com/openjdk/leyden/tree/hermetic-java-runtime). > > Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits: > > - Merge branch 'master' into static-jdk-image > - Remove LDFLAGS_STATIC_JDK > - Rename EXCLUDE_FROM_STATIC_LIBS to ONLY_EXPORTED, $(MODULE)_JDK_LIBS to $(MODULE)_INCLUDED_LIBS and module-libs.txt to module-included-libs.txt > - Find LIBZIP_OBJS automatically > - Find LIBJAVA_JPEG_OBJS automatically > - Just exclude the a11y libraries from static builds > - Copy debuginfo > - Restore SetExecname in java_md.c > - Fix incremental builds > - Merge branch 'master' into static-jdk-image > - ... and 15 more: https://git.openjdk.org/jdk/compare/c329f97f...8b1217a8 Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20837#pullrequestreview-2472889294 From azvegint at openjdk.org Mon Dec 2 14:42:44 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 14:42:44 GMT Subject: RFR: 8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 12:52:32 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/Action/8133039/bug8133039.java failed in OCI ubuntu 22.04 with exception "Method accept not invoked" > Seems like robot keypress happened before testframe was visible..Added a delay.. > Several iterations passed in OCI linux system.. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22480#pullrequestreview-2472891185 From ihse at openjdk.org Mon Dec 2 14:45:47 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 2 Dec 2024 14:45:47 GMT Subject: RFR: 8306579: Consider building with /Zc:throwingNew [v2] In-Reply-To: References: Message-ID: On Mon, 18 Nov 2024 05:48:57 GMT, Julian Waters wrote: >> [JDK-8305590](https://bugs.openjdk.org/browse/JDK-8305590) removed `-fcheck-new` when building with gcc. It turns out Visual Studio has a similar option, though inverted in behavior and default. >> >> It seems like /Zc:throwingNew- (the default) corresponds to gcc -fcheck-new, and /Zc:throwingNew corresponds to -fno-check-new (the default). >> >> The Visual Studio documentation strongly recommends using /Zc:throwingNew if possible, as turning it off (the default) seriously bloats code and inhibits optimizations. >> https://learn.microsoft.com/en-us/cpp/build/reference/zc-throwingnew-assume-operator-new-throws?view=msvc-170 >> >> As mentioned in [JDK-8305590](https://bugs.openjdk.org/browse/JDK-8305590), the standard says that an allocation function can report allocation failure either by returning null (when it must have a nothrow exception specification), or by throwing `std::bad_alloc` (so obviously must not be declared as non-throwing). HotSpot allocation functions terminate the program instead of throwing on allocation failure, so similarly don't need the result checked for null. >> >> The documentation for /Zc:throwingNew is somewhat vague and confusing, so some investigation is probably needed to verify it really has the desired effect for us. > > Julian Waters 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 patch-15 > - -Zc:throwingNew in flags-cflags.m4 > - 8306579 Build changes look fine. I also believe the AWT change is sound, based on Kim's reasoning. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22039#pullrequestreview-2472901733 From coleenp at openjdk.org Mon Dec 2 15:15:59 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Mon, 2 Dec 2024 15:15:59 GMT Subject: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21] In-Reply-To: References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Tue, 26 Nov 2024 17:17:09 GMT, Magnus Ihse Bursie wrote: >> As a prerequisite for Hermetic Java, we need a statically linked `java` launcher. It should behave like the normal, dynamically linked `java` launcher, except that all JDK native libraries should be statically, not dynamically, linked. >> >> This patch is the first step towards this goal. It will generate a `static-jdk` image with a statically linked launcher. This launcher is missing several native libs, however, and does therefore not behave like a proper dynamic java. One of the reasons for this is that local symbol hiding in static libraries are not implemented yet, which causes symbol clashes when linking all static libraries together. This will be addressed in an upcoming patch. >> >> All changes in the `src` directory are copied from, or inspired by, changes made in [the hermetic-java-runtime branch in Project Leyden](https://github.com/openjdk/leyden/tree/hermetic-java-runtime). > > Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits: > > - Merge branch 'master' into static-jdk-image > - Remove LDFLAGS_STATIC_JDK > - Rename EXCLUDE_FROM_STATIC_LIBS to ONLY_EXPORTED, $(MODULE)_JDK_LIBS to $(MODULE)_INCLUDED_LIBS and module-libs.txt to module-included-libs.txt > - Find LIBZIP_OBJS automatically > - Find LIBJAVA_JPEG_OBJS automatically > - Just exclude the a11y libraries from static builds > - Copy debuginfo > - Restore SetExecname in java_md.c > - Fix incremental builds > - Merge branch 'master' into static-jdk-image > - ... and 15 more: https://git.openjdk.org/jdk/compare/c329f97f...8b1217a8 Hotspot code looks okay. src/hotspot/os/linux/os_linux.cpp line 590: > 588: > 589: // Found the full path to the binary. It is normally of this structure: > 590: // /lib//libjvm.so You could change to server I believe, since there isn't a client (I hope) version anymore. ------------- Marked as reviewed by coleenp (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/20837#pullrequestreview-2472978117 PR Review Comment: https://git.openjdk.org/jdk/pull/20837#discussion_r1866025164 From ihse at openjdk.org Mon Dec 2 15:16:00 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 2 Dec 2024 15:16:00 GMT Subject: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21] In-Reply-To: References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Tue, 26 Nov 2024 21:20:10 GMT, David Holmes wrote: >> Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits: >> >> - Merge branch 'master' into static-jdk-image >> - Remove LDFLAGS_STATIC_JDK >> - Rename EXCLUDE_FROM_STATIC_LIBS to ONLY_EXPORTED, $(MODULE)_JDK_LIBS to $(MODULE)_INCLUDED_LIBS and module-libs.txt to module-included-libs.txt >> - Find LIBZIP_OBJS automatically >> - Find LIBJAVA_JPEG_OBJS automatically >> - Just exclude the a11y libraries from static builds >> - Copy debuginfo >> - Restore SetExecname in java_md.c >> - Fix incremental builds >> - Merge branch 'master' into static-jdk-image >> - ... and 15 more: https://git.openjdk.org/jdk/compare/c329f97f...8b1217a8 > > Hotspot changes look fine. > > Thanks @dholmes-ora @coleenp @erikj79 Thanks for your reviews! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20837#issuecomment-2511804187 From ihse at openjdk.org Mon Dec 2 15:16:01 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 2 Dec 2024 15:16:01 GMT Subject: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21] In-Reply-To: References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Mon, 2 Dec 2024 15:10:08 GMT, Coleen Phillimore wrote: >> Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 25 commits: >> >> - Merge branch 'master' into static-jdk-image >> - Remove LDFLAGS_STATIC_JDK >> - Rename EXCLUDE_FROM_STATIC_LIBS to ONLY_EXPORTED, $(MODULE)_JDK_LIBS to $(MODULE)_INCLUDED_LIBS and module-libs.txt to module-included-libs.txt >> - Find LIBZIP_OBJS automatically >> - Find LIBJAVA_JPEG_OBJS automatically >> - Just exclude the a11y libraries from static builds >> - Copy debuginfo >> - Restore SetExecname in java_md.c >> - Fix incremental builds >> - Merge branch 'master' into static-jdk-image >> - ... and 15 more: https://git.openjdk.org/jdk/compare/c329f97f...8b1217a8 > > src/hotspot/os/linux/os_linux.cpp line 590: > >> 588: >> 589: // Found the full path to the binary. It is normally of this structure: >> 590: // /lib//libjvm.so > > You could change to server I believe, since there isn't a client (I hope) version anymore. Variant can also be e.g. `minimal`. And I do think the client variant is still supported, even if it is not actively built..? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20837#discussion_r1866028280 From ihse at openjdk.org Mon Dec 2 15:16:02 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 2 Dec 2024 15:16:02 GMT Subject: Integrated: 8339480: Build static-jdk image with a statically linked launcher In-Reply-To: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Tue, 3 Sep 2024 12:50:01 GMT, Magnus Ihse Bursie wrote: > As a prerequisite for Hermetic Java, we need a statically linked `java` launcher. It should behave like the normal, dynamically linked `java` launcher, except that all JDK native libraries should be statically, not dynamically, linked. > > This patch is the first step towards this goal. It will generate a `static-jdk` image with a statically linked launcher. This launcher is missing several native libs, however, and does therefore not behave like a proper dynamic java. One of the reasons for this is that local symbol hiding in static libraries are not implemented yet, which causes symbol clashes when linking all static libraries together. This will be addressed in an upcoming patch. > > All changes in the `src` directory are copied from, or inspired by, changes made in [the hermetic-java-runtime branch in Project Leyden](https://github.com/openjdk/leyden/tree/hermetic-java-runtime). This pull request has now been integrated. Changeset: 1ca76445 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/1ca764454b1cb296f4aa38a4dfdf3d4abb5c19d6 Stats: 497 lines in 27 files changed: 399 ins; 23 del; 75 mod 8339480: Build static-jdk image with a statically linked launcher Co-authored-by: Magnus Ihse Bursie Co-authored-by: Jiangli Zhou Reviewed-by: dholmes, erikj, coleenp ------------- PR: https://git.openjdk.org/jdk/pull/20837 From coleenp at openjdk.org Mon Dec 2 15:22:53 2024 From: coleenp at openjdk.org (Coleen Phillimore) Date: Mon, 2 Dec 2024 15:22:53 GMT Subject: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21] In-Reply-To: References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Mon, 2 Dec 2024 15:11:54 GMT, Magnus Ihse Bursie wrote: >> src/hotspot/os/linux/os_linux.cpp line 590: >> >>> 588: >>> 589: // Found the full path to the binary. It is normally of this structure: >>> 590: // /lib//libjvm.so >> >> You could change to server I believe, since there isn't a client (I hope) version anymore. > > Variant can also be e.g. `minimal`. And I do think the client variant is still supported, even if it is not actively built..? Okay. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/20837#discussion_r1866042498 From duke at openjdk.org Mon Dec 2 16:20:38 2024 From: duke at openjdk.org (lawrence.andrews) Date: Mon, 2 Dec 2024 16:20:38 GMT Subject: RFR: 8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 12:52:32 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/Action/8133039/bug8133039.java failed in OCI ubuntu 22.04 with exception "Method accept not invoked" > Seems like robot keypress happened before testframe was visible..Added a delay.. > Several iterations passed in OCI linux system.. LGTM ------------- PR Comment: https://git.openjdk.org/jdk/pull/22480#issuecomment-2512014131 From aivanov at openjdk.org Mon Dec 2 16:51:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 2 Dec 2024 16:51:40 GMT Subject: RFR: 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap [v4] In-Reply-To: References: Message-ID: <7UqaykzRL3EO_PIfKn5WTvjkF7at2TJxHZlflNg57ik=.b3c22740-02be-4bc5-93fa-9fc60a8d3516@github.com> On Tue, 12 Nov 2024 20:28:55 GMT, Andrey Turbanov wrote: >> If a thread-safe implementation is not needed, it is recommended to use HashMap instead of legacy synchronized Hashtable. >> Map `CSS.htmlAttrToCssAttrMap` is modified only within static initialization block and then only `get` method is called. >> >> The only subtle difference is that Hashtable doesn't allow `null` keys and throws NPE from `get` method. >> I've checked all possible keys which are passed to `htmlAttrToCssAttrMap.get`. >> Currently 3 different execution paths are possible: >> >> **1,2** >> When `HTML.Attribute.BORDER` is passed as a key. It's definitely non-null. >> >> javax.swing.text.html.CSS#translateHTMLToCSS >> translateAttribute(HTML.Attribute.BORDER, "1", cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> javax.swing.text.html.CSS#translateAttributes >> translateAttribute(HTML.Attribute.BORDER, Integer.toString(borderWidth), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key);` >> >> >> **3** >> When non-null `key` is passed as a key. >> >> javax.swing.text.html.CSS#translateAttributes >> >> if (name instanceof HTML.Attribute) { // from this `instanceof` we know that it's non-null >> HTML.Attribute key = (HTML.Attribute)name; >> >> translateAttribute(key, (String) htmlAttrSet.getAttribute(key), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> ![idea_analyze_dataflow_to_here](https://github.com/user-attachments/assets/48ace4de-6d0a-468e-bb14-b579a193254b) >> >> >> I've used HashMap.newHashMap method instead of constructor to avoid resizing of internal HashMap array. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8343418: align more Looks good to me. I ran client tests once again, the tests pass. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21785#pullrequestreview-2473298051 From honkar at openjdk.org Mon Dec 2 17:16:46 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 17:16:46 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs Message-ID: The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. - java/awt/datatransfer/Independence/IndependenceAWTTest.java - java/awt/datatransfer/Independence/IndependenceSwingTest.java Multiple runs of the test on CI looks good and the tests pass. ------------- Commit messages: - removed author tags, delay changes - added missing import - datatransfer test changes Changes: https://git.openjdk.org/jdk/pull/22490/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8344368 Stats: 166 lines in 2 files changed: 63 ins; 31 del; 72 mod Patch: https://git.openjdk.org/jdk/pull/22490.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22490/head:pull/22490 PR: https://git.openjdk.org/jdk/pull/22490 From honkar at openjdk.org Mon Dec 2 17:20:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 17:20:39 GMT Subject: RFR: 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap [v4] In-Reply-To: References: Message-ID: On Tue, 12 Nov 2024 20:28:55 GMT, Andrey Turbanov wrote: >> If a thread-safe implementation is not needed, it is recommended to use HashMap instead of legacy synchronized Hashtable. >> Map `CSS.htmlAttrToCssAttrMap` is modified only within static initialization block and then only `get` method is called. >> >> The only subtle difference is that Hashtable doesn't allow `null` keys and throws NPE from `get` method. >> I've checked all possible keys which are passed to `htmlAttrToCssAttrMap.get`. >> Currently 3 different execution paths are possible: >> >> **1,2** >> When `HTML.Attribute.BORDER` is passed as a key. It's definitely non-null. >> >> javax.swing.text.html.CSS#translateHTMLToCSS >> translateAttribute(HTML.Attribute.BORDER, "1", cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> javax.swing.text.html.CSS#translateAttributes >> translateAttribute(HTML.Attribute.BORDER, Integer.toString(borderWidth), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key);` >> >> >> **3** >> When non-null `key` is passed as a key. >> >> javax.swing.text.html.CSS#translateAttributes >> >> if (name instanceof HTML.Attribute) { // from this `instanceof` we know that it's non-null >> HTML.Attribute key = (HTML.Attribute)name; >> >> translateAttribute(key, (String) htmlAttrSet.getAttribute(key), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> ![idea_analyze_dataflow_to_here](https://github.com/user-attachments/assets/48ace4de-6d0a-468e-bb14-b579a193254b) >> >> >> I've used HashMap.newHashMap method instead of constructor to avoid resizing of internal HashMap array. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8343418: align more Marked as reviewed by honkar (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21785#pullrequestreview-2473389039 From honkar at openjdk.org Mon Dec 2 17:20:40 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 17:20:40 GMT Subject: RFR: 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap [v3] In-Reply-To: References: Message-ID: On Wed, 6 Nov 2024 19:17:39 GMT, Andrey Turbanov wrote: > Replaced to use immutable Map. It fits even better because it has the same null handling as Hashtable - it throw NPE in get/containsKey methods. Replacement with immutable Map sounds reasonable in the given context. LGTM ------------- PR Comment: https://git.openjdk.org/jdk/pull/21785#issuecomment-2512207938 From duke at openjdk.org Mon Dec 2 17:26:00 2024 From: duke at openjdk.org (ScientificWare) Date: Mon, 2 Dec 2024 17:26:00 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v8] In-Reply-To: References: Message-ID: > 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 = """ > > > >

> >

> 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 - Removes files make/javac.20231014_162919.args make/javac.20231014_220237.args make/javac.20231023_221655.args - Adds a regression test for JDK-8314731. - Others changes in the working directory. - Merge Master - Merge master - ... and 10 more: https://git.openjdk.org/jdk/compare/352201dd...de644539 ------------- Changes: https://git.openjdk.org/jdk/pull/15319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=07 Stats: 217 lines in 2 files changed: 134 ins; 19 del; 64 mod Patch: https://git.openjdk.org/jdk/pull/15319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319 PR: https://git.openjdk.org/jdk/pull/15319 From duke at openjdk.org Mon Dec 2 17:28:45 2024 From: duke at openjdk.org (ScientificWare) Date: Mon, 2 Dec 2024 17:28:45 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v7] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 13:58:46 GMT, ScientificWare wrote: >> ScientificWare has updated the pull request incrementally with one additional commit since the last revision: >> >> bug8314731.java : Corrects the CopyRight date. > > test/jdk/javax/swing/text/html/CSS/bug8314731.java line 62: > >> 60: JEditorPane jEditorPane = new JEditorPane(); >> 61: jEditorPane.setEditable(false); >> 62: JFrame jf = new JFrame("CSS named colors Test"); > > Replace this title with "alt attribute test in HTML image type input". > Move this test to a better place. Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1866291455 From prr at openjdk.org Mon Dec 2 17:34:46 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 17:34:46 GMT Subject: Integrated: 8345142: Remove uses of SecurityManager in Printing related classes In-Reply-To: <7_6ap7IiM5hzP1kXLmWZ3kHns9kmkQOylEVIDQmjFOE=.00930420-3576-44bc-96fd-ab48a9c8d248@github.com> References: <7_6ap7IiM5hzP1kXLmWZ3kHns9kmkQOylEVIDQmjFOE=.00930420-3576-44bc-96fd-ab48a9c8d248@github.com> Message-ID: On Thu, 28 Nov 2024 00:30:27 GMT, Phil Race wrote: > Remove uses of and references to SecurityManager from the printing code This pull request has now been integrated. Changeset: 67f18cc9 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/67f18cc9cef0966ccafb21a47043a85b9f39642f Stats: 316 lines in 16 files changed: 7 ins; 279 del; 30 mod 8345142: Remove uses of SecurityManager in Printing related classes Reviewed-by: azvegint, psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/22422 From dnguyen at openjdk.org Mon Dec 2 17:42:21 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 2 Dec 2024 17:42:21 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v3] In-Reply-To: References: Message-ID: > Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. > > Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. > > Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: Amend test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22333/files - new: https://git.openjdk.org/jdk/pull/22333/files/5315580f..19fc99f9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22333&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22333&range=01-02 Stats: 23 lines in 1 file changed: 7 ins; 8 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/22333.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22333/head:pull/22333 PR: https://git.openjdk.org/jdk/pull/22333 From dnguyen at openjdk.org Mon Dec 2 17:42:22 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 2 Dec 2024 17:42:22 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v2] In-Reply-To: References: <1L3x_M-HilIlrUKLny19HiqLHUoEj7H73gC2uifCvTc=.8194c703-07af-4d40-88d3-f8de7539061a@github.com> Message-ID: On Fri, 29 Nov 2024 05:15:24 GMT, Abhishek Kumar wrote: >> Damon Nguyen has updated the pull request incrementally with two additional commits since the last revision: >> >> - String comparison >> - Review comments > > test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 110: > >> 108: loc = button.getLocationOnScreen(); >> 109: }); >> 110: robot.mouseMove(loc.x + button.getWidth() / 2, loc.y > > get button's width and height on EDT along with location. Done > test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 116: > >> 114: robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); >> 115: robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); >> 116: System.out.println("EIGHT"); > > Any reason to add these many print statements ? Is it for debugging purpose? Yes, was trying to test failure points again. Removed now! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866309901 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866309559 From honkar at openjdk.org Mon Dec 2 18:14:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 18:14:39 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs In-Reply-To: References: Message-ID: <_hb5XeKdcyYGoHt9dUl_1lOBVEbupn85_ZJgjWozZyU=.415d6d88-2c27-42f4-a52e-df0180a0a6de@github.com> On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar wrote: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. @alisenchung Just a headsup: You may want to sync your repo for https://github.com/openjdk/jdk/pull/22044, once this PR is merged since these tests use ExtendedRobot. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22490#issuecomment-2512326547 From prr at openjdk.org Mon Dec 2 18:32:38 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 18:32:38 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar wrote: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. So what, exactly, is the part of all these changes that fixes the instability of these tests ? I see tons of refactoring to wade through yet you didn't bother to put an evaluation of the actual problem in either this PR or the bug report. I'd prefer to be told the intent, rather than have to figure it out. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22490#issuecomment-2512376599 From kizune at openjdk.org Mon Dec 2 18:32:39 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 2 Dec 2024 18:32:39 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar wrote: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 167: > 165: robot.waitForIdle(500); > 166: > 167: if (primaryClip != null) { Do we even need this check? I mean in the getPrimaryClipboard() you throw a runtime exception if primaryClip is null. The only possible option when there is no exception thrown and primaryClip is null is when inside getPrimaryClipboard() HeadlessException happened which should not be the case because of headful tag in the header. So what are we checking for here? In original test it was a soft way to skip test on Windows and macOS but you eliminated that check and added platform requirement to the header. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866380758 From jiangli at openjdk.org Mon Dec 2 18:46:49 2024 From: jiangli at openjdk.org (Jiangli Zhou) Date: Mon, 2 Dec 2024 18:46:49 GMT Subject: RFR: 8339480: Build static-jdk image with a statically linked launcher [v21] In-Reply-To: References: <5r5p2HyEXsEIr7wnq_5RSMfcbw-gsP4fBvTgr9P2lvY=.d3a51eae-661a-45d2-80e1-723e05e5eb32@github.com> Message-ID: On Mon, 2 Dec 2024 15:12:24 GMT, Magnus Ihse Bursie wrote: >> Hotspot changes look fine. >> >> Thanks > > @dholmes-ora @coleenp @erikj79 Thanks for your reviews! @magicus Thanks for integrating the changes, particularly reworking and making the statically linked launcher build changes cleaner! ------------- PR Comment: https://git.openjdk.org/jdk/pull/20837#issuecomment-2512408268 From prr at openjdk.org Mon Dec 2 18:49:58 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 18:49:58 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v4] In-Reply-To: References: Message-ID: > Remove SecurityManager related code in the desktop module that is not covered by other PRs Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8345143 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22424/files - new: https://git.openjdk.org/jdk/pull/22424/files/17302404..c4810ca7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22424.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22424/head:pull/22424 PR: https://git.openjdk.org/jdk/pull/22424 From honkar at openjdk.org Mon Dec 2 18:52:40 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 18:52:40 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar wrote: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. So what, exactly, is the part of all these changes that fixes the instability of these tests ? After JEP486 Removal of SecurityManager, looks like the tests are running faster. Following are the changes made to stabilize the test. - Added invokeAndWait() when creating testUI. - Moved the testUI to center. - Reduced delays and removed unnecessary waitForIdle() calls between mousePress and mouseRelease. test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 67: > 65: robot = new ExtendedRobot(); > 66: > 67: SwingUtilities.invokeAndWait(IndependenceSwingTest::createAndShowUI); Added invokeAndWait() during test UI creation. test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 151: > 149: robot.waitForIdle(1000); > 150: frame.setLocation(100, 100); > 151: robot.waitForIdle(1000); Calling frame.setLocation() looked redundant since we are already positioning it in createAndShowUI. Removed unnecessary waitForIdle() + delay() calls. test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 170: > 168: center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2); > 169: ttf1Center = center; > 170: }); Wrapped in invokeAndWait() test/jdk/java/awt/datatransfer/Independence/IndependenceSwingTest.java line 189: > 187: robot.mouseMove(ttf1Center.x + 15, ttf1Center.y); > 188: robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); > 189: robot.waitForIdle(500); Removed unnecessary robot.waitForIdle() calls between mousePress and mouseRelease() and reduced delays ------------- PR Comment: https://git.openjdk.org/jdk/pull/22490#issuecomment-2512430525 PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866396846 PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866400665 PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866401288 PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866405148 From prr at openjdk.org Mon Dec 2 18:57:58 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 18:57:58 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v5] In-Reply-To: References: Message-ID: > Remove SecurityManager related code in the desktop module that is not covered by other PRs Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8345143 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22424/files - new: https://git.openjdk.org/jdk/pull/22424/files/c4810ca7..89c21e97 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22424.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22424/head:pull/22424 PR: https://git.openjdk.org/jdk/pull/22424 From prr at openjdk.org Mon Dec 2 19:01:06 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 19:01:06 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: References: Message-ID: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> > Remove SecurityManager related code in the desktop module that is not covered by other PRs Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8345143 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22424/files - new: https://git.openjdk.org/jdk/pull/22424/files/89c21e97..046edd8c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22424&range=04-05 Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22424.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22424/head:pull/22424 PR: https://git.openjdk.org/jdk/pull/22424 From honkar at openjdk.org Mon Dec 2 19:03:55 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 19:03:55 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: removed redundant null check ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22490/files - new: https://git.openjdk.org/jdk/pull/22490/files/68a84bfd..86de95ff Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=00-01 Stats: 59 lines in 2 files changed: 0 ins; 5 del; 54 mod Patch: https://git.openjdk.org/jdk/pull/22490.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22490/head:pull/22490 PR: https://git.openjdk.org/jdk/pull/22490 From honkar at openjdk.org Mon Dec 2 19:03:55 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 19:03:55 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 18:27:52 GMT, Alexander Zuev wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant null check > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 167: > >> 165: robot.waitForIdle(500); >> 166: >> 167: if (primaryClip != null) { > > Do we even need this check? I mean in the getPrimaryClipboard() you throw a runtime exception if primaryClip is null. The only possible option when there is no exception thrown and primaryClip is null is when inside getPrimaryClipboard() HeadlessException happened which should not be the case because of headful tag in the header. So what are we checking for here? In original test it was a soft way to skip test on Windows and macOS but you eliminated that check and added platform requirement to the header. That's correct, the check is redundant and no longer needed after the addition of `@requires` tag. Removed it in the latest commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866454824 From honkar at openjdk.org Mon Dec 2 19:12:38 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 19:12:38 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:03:55 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant null check test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 128: > 126: > 127: tp = primaryClip.getContents(null); > 128: ts = systemClip.getContents(null); Not related to stabilization but I noticed that requestor param is no longer used in Clipboard's [getContents()](https://github.com/openjdk/jdk/blob/7c944ee6f4dda4f1626721d63ac6bc6d1b40d33b/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java#L146), hence it was changed to null. `primaryClip.getContents(null)` ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866463894 From aivanov at openjdk.org Mon Dec 2 19:21:45 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 2 Dec 2024 19:21:45 GMT Subject: RFR: 8341982: Simplify JButton/bug4323121.java [v8] In-Reply-To: References: <-7Fhb1MTAWHX_CmxOdg8ixBhvQa4yt13dq8PBvNLlAs=.cbf5af5b-f7f3-4087-8628-8308d30660d0@github.com> <4QzYQ-UxwawUwT67vrvtW4AOOLQV4eagHHNl_TfNJu0=.aed37557-6a69-483e-937c-8dd3a6ba4c9d@github.com> Message-ID: On Fri, 18 Oct 2024 22:36:33 GMT, Sergey Bylokhov wrote: >> This test follows the same pattern that I used in https://github.com/openjdk/jdk/pull/21474: >> >> https://github.com/openjdk/jdk/pull/21474/files#diff-2a8cee50408407d7e24de4cb85f0921cfc5db7c215d3b29cf101a4050323e9a9R92 > >> To ensure all the events in the queue are handled, I added `robot.waitForIdle()`. > > This will flush events which were posted after the windows gained focus, but before the patch the test flushed all events (including event to show the window which might be asynchronous). My point is that this operation might be longer that 1 second(one of the reason we have all that deleyas). So we should waitForIdle first, then wait via delay or other sync_ops. > @mrserb Are any more concerns with the updated code in `JButton/bug4323121.java`? @mrserb Is there anything else you've got concerns about? If not, I'll integrate the PR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21475#discussion_r1866479254 From kizune at openjdk.org Mon Dec 2 19:22:42 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 2 Dec 2024 19:22:42 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:03:55 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant null check test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 114: > 112: if (primaryClip == null) { > 113: throw new RuntimeException("Method getSystemSelection() is returning null" > 114: + " on Linux platform"); In previous version it was mentioning X11 platform. Do we know if the system selection works the same way on Wayland as it was on X11? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866479878 From dnguyen at openjdk.org Mon Dec 2 19:28:47 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 2 Dec 2024 19:28:47 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:03:55 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant null check Tested the changes myself on linux and on CI with repeats. Looks stable to me and I didn't see anything odd. Updated changes also look fine. I suppose the modified waitForIdles and delays alongside moving things into the EDT did it. ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/22490#pullrequestreview-2473724192 From honkar at openjdk.org Mon Dec 2 19:51:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 19:51:39 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:19:42 GMT, Alexander Zuev wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant null check > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 114: > >> 112: if (primaryClip == null) { >> 113: throw new RuntimeException("Method getSystemSelection() is returning null" >> 114: + " on Linux platform"); > > In previous version it was mentioning X11 platform. Do we know if the system selection works the same way on Wayland as it was on X11? Good point. The tests seem to work the same way in both X11 and Wayland. I'm looking into getSystemSelection() and if there is any display server specific code related to clipboards. Currently tests look stable when I run on Wayland locally. It might be good to test it on Wayland CI node as well since these tests had stability issues. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866519395 From azvegint at openjdk.org Mon Dec 2 21:08:46 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Mon, 2 Dec 2024 21:08:46 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> References: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> Message-ID: On Mon, 2 Dec 2024 19:01:06 GMT, Phil Race wrote: >> Remove SecurityManager related code in the desktop module that is not covered by other PRs > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345143 Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22424#pullrequestreview-2473924924 From prr at openjdk.org Mon Dec 2 22:38:40 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 22:38:40 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:03:55 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant null check test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 76: > 74: > 75: private static void createAndShowUI() { > 76: frame = new Frame("IndependenceSwingTest"); Should that be ..AWTTest ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866721693 From honkar at openjdk.org Mon Dec 2 22:43:37 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 22:43:37 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v2] In-Reply-To: References: Message-ID: On Sat, 30 Nov 2024 03:50:24 GMT, Phil Race wrote: >> Remove SecurityManager related code from Swing filechooser implementation > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345141 LGTM, apart from the unused import in ShellFolderManager after checkFiles removal. src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java line 122: > 120: } > 121: > 122: private static File[] checkFiles(Stream fs, @SuppressWarnings("removal") SecurityManager sm) { Minor: Similar to what @azvegint pointed out in Win32ShellFolderManager.java `import java.util.stream.Stream;` is unused after removal of this method. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22423#pullrequestreview-2474093435 PR Review Comment: https://git.openjdk.org/jdk/pull/22423#discussion_r1866724149 From prr at openjdk.org Mon Dec 2 23:03:14 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 23:03:14 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v3] In-Reply-To: References: Message-ID: > Remove SecurityManager related code from Swing filechooser implementation Phil Race has updated the pull request incrementally with one additional commit since the last revision: 8345141 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22423/files - new: https://git.openjdk.org/jdk/pull/22423/files/1ee28bd6..8fdcb9c8 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22423&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22423&range=01-02 Stats: 2 lines in 1 file changed: 0 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22423.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22423/head:pull/22423 PR: https://git.openjdk.org/jdk/pull/22423 From prr at openjdk.org Mon Dec 2 23:03:14 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 2 Dec 2024 23:03:14 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 22:39:13 GMT, Harshitha Onkar wrote: >> Phil Race has updated the pull request incrementally with one additional commit since the last revision: >> >> 8345141 > > src/java.desktop/share/classes/sun/awt/shell/ShellFolderManager.java line 122: > >> 120: } >> 121: >> 122: private static File[] checkFiles(Stream fs, @SuppressWarnings("removal") SecurityManager sm) { > > Minor: Similar to what @azvegint pointed out in Win32ShellFolderManager.java `import java.util.stream.Stream;` is unused after removal of this method. fixed ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22423#discussion_r1866740806 From honkar at openjdk.org Mon Dec 2 23:10:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 23:10:39 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 23:03:14 GMT, Phil Race wrote: >> Remove SecurityManager related code from Swing filechooser implementation > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345141 Marked as reviewed by honkar (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22423#pullrequestreview-2474130025 From honkar at openjdk.org Mon Dec 2 23:18:43 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 23:18:43 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> References: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> Message-ID: On Mon, 2 Dec 2024 19:01:06 GMT, Phil Race wrote: >> Remove SecurityManager related code in the desktop module that is not covered by other PRs > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345143 LGTM src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java line 108: > 106: if (System.getSecurityManager() != null) { > 107: if (border != null) return border; > 108: return SAFE_NO_FOCUS_BORDER; Changes looks good. SAFE_NO_FOCUS_BORDER no longer used. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22424#pullrequestreview-2474123132 PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1866744305 From honkar at openjdk.org Mon Dec 2 23:39:44 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 2 Dec 2024 23:39:44 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> References: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> Message-ID: On Mon, 2 Dec 2024 19:01:06 GMT, Phil Race wrote: >> Remove SecurityManager related code in the desktop module that is not covered by other PRs > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345143 test/jdk/lib/client/ExtendedRobot.java line 64: > 62: // syncDelay = AccessController.doPrivileged(new GetIntegerAction("java.awt.robotdelay", DEFAULT_SYNC_DELAY)); > 63: //} > 64: Not related to this PR changes but since ExtendedRobot was mentioned here, I went through Robot.java and it has few SecurityException in javadoc [(as here)](https://github.com/openjdk/jdk/blob/db85090553ab14a84c3ed0a2604dd56c5b6e6982/src/java.desktop/share/classes/java/awt/Robot.java#L506C1-L507C43). Will changes to Robot.java be handled as separate PR + CSR ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1866768907 From achung at openjdk.org Tue Dec 3 00:10:11 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 3 Dec 2024 00:10:11 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v10] In-Reply-To: References: Message-ID: <4yhDeVm-nLtBPwQf287bL_lv4P87vRm8Dg47A0M6xg0=.74d92bf4-541f-46f6-b4b5-c0646cc9981a@github.com> > 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 two additional commits since the last revision: - add code tag to specifications in Robot - fix syncdelay in ER ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22044/files - new: https://git.openjdk.org/jdk/pull/22044/files/84384f92..420c4221 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=09 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=08-09 Stats: 17 lines in 2 files changed: 5 ins; 1 del; 11 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 prr at openjdk.org Tue Dec 3 00:15:48 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 3 Dec 2024 00:15:48 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: References: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> Message-ID: On Mon, 2 Dec 2024 23:37:03 GMT, Harshitha Onkar wrote: > Not related to this PR changes but since ExtendedRobot was mentioned here, I went through Robot.java and it has few SecurityException in javadoc [(as here)](https://github.com/openjdk/jdk/blob/db85090553ab14a84c3ed0a2604dd56c5b6e6982/src/java.desktop/share/classes/java/awt/Robot.java#L506C1-L507C43). Will changes to Robot.java be handled as separate PR + CSR ? We still use SecurityException in java.awt.Robot too. It is still needed for when the *desktop* denies access. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1866789983 From prr at openjdk.org Tue Dec 3 00:15:49 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 3 Dec 2024 00:15:49 GMT Subject: Integrated: 8345143: Remove uses of SecurityManager in the java.desktop module In-Reply-To: References: Message-ID: On Thu, 28 Nov 2024 00:36:35 GMT, Phil Race wrote: > Remove SecurityManager related code in the desktop module that is not covered by other PRs This pull request has now been integrated. Changeset: 3f6c0424 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/3f6c04247ff6ad69330bc219ed26944852954e85 Stats: 279 lines in 34 files changed: 1 ins; 246 del; 32 mod 8345143: Remove uses of SecurityManager in the java.desktop module Reviewed-by: azvegint, honkar ------------- PR: https://git.openjdk.org/jdk/pull/22424 From honkar at openjdk.org Tue Dec 3 00:17:11 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 00:17:11 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: frame title ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22490/files - new: https://git.openjdk.org/jdk/pull/22490/files/86de95ff..795f8bd1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22490.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22490/head:pull/22490 PR: https://git.openjdk.org/jdk/pull/22490 From honkar at openjdk.org Tue Dec 3 00:17:12 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 00:17:12 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v2] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 22:36:11 GMT, Phil Race wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant null check > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 76: > >> 74: >> 75: private static void createAndShowUI() { >> 76: frame = new Frame("IndependenceSwingTest"); > > Should that be ..AWTTest ? Updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866791003 From prr at openjdk.org Tue Dec 3 00:24:40 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 3 Dec 2024 00:24:40 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 00:17:11 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > frame title Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22490#pullrequestreview-2474201721 From honkar at openjdk.org Tue Dec 3 00:26:53 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 00:26:53 GMT Subject: RFR: 8345143: Remove uses of SecurityManager in the java.desktop module [v6] In-Reply-To: References: <8VPCW7QNB0ZRmg9Jf3icbbBcau6Kd0Xt02u76LibBWU=.c9d22099-2636-46c7-b363-a6af335e8bd2@github.com> Message-ID: On Tue, 3 Dec 2024 00:12:03 GMT, Phil Race wrote: >> test/jdk/lib/client/ExtendedRobot.java line 64: >> >>> 62: // syncDelay = AccessController.doPrivileged(new GetIntegerAction("java.awt.robotdelay", DEFAULT_SYNC_DELAY)); >>> 63: //} >>> 64: >> >> Not related to this PR changes but since ExtendedRobot was mentioned here, I went through Robot.java and it has few SecurityException in javadoc [(as here)](https://github.com/openjdk/jdk/blob/db85090553ab14a84c3ed0a2604dd56c5b6e6982/src/java.desktop/share/classes/java/awt/Robot.java#L506C1-L507C43). >> Will changes to Robot.java be handled as separate PR + CSR ? > >> Not related to this PR changes but since ExtendedRobot was mentioned here, I went through Robot.java and it has few SecurityException in javadoc [(as here)](https://github.com/openjdk/jdk/blob/db85090553ab14a84c3ed0a2604dd56c5b6e6982/src/java.desktop/share/classes/java/awt/Robot.java#L506C1-L507C43). Will changes to Robot.java be handled as separate PR + CSR ? > > We still use SecurityException in java.awt.Robot too. It is still needed for when the *desktop* denies access. Makes sense. Thanks for clarifying. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22424#discussion_r1866797014 From honkar at openjdk.org Tue Dec 3 01:34:48 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 01:34:48 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:42:21 GMT, Damon Nguyen wrote: >> Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. >> >> Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. >> >> Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Amend test LGTM, apart from the minor inline comments. test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 53: > 51: public class AccessibleChoiceTest { > 52: //Declare things used in the test, like buttons and labels here > 53: Frame frame = new Frame("window owner"); Following comment can be removed. `//Declare things used in the test, like buttons and labels here` test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 56: > 54: static Choice choice; > 55: static Button button; > 56: static CountDownLatch go; Suggestion: static volatile CountDownLatch go; test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 112: > 110: }); > 111: robot.mouseMove(loc.x + bWidth / 2, loc.y > 112: + bHeight / 2); Alignment Suggestion: robot.mouseMove(loc.x + bWidth / 2, loc.y + bHeight / 2); test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 145: > 143: > 144: String osName = System.getProperty("os.name").toLowerCase(); > 145: if (osName.startsWith("mac")) { Suggestion: Platform.isOSX() looks cleaner. jtreg @library tag is required in case jdk.test.lib.Platform is used. test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java line 159: > 157: if (!choice.getSelectedItem().equals(choice.getItem(1))) { > 158: // Print out os name to check if mac conditional is relevant > 159: System.err.println("Failed on os: " + osName); Not strictly required to print osName in case of failure (since the details are available), okay to have it though. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22333#pullrequestreview-2474269859 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866839216 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866840155 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866853625 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866841396 PR Review Comment: https://git.openjdk.org/jdk/pull/22333#discussion_r1866849950 From azvegint at openjdk.org Tue Dec 3 01:41:55 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 01:41:55 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 00:17:11 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > frame title test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 88: > 86: > 87: // TextFields to get the contents of clipboard > 88: tf2 = new TextField(); Line 82 --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java @@ -80,7 +80,7 @@ private static void createAndShowUI() { tf1 = new TextField(); tf1.addFocusListener(new FocusAdapter() { public void focusGained(FocusEvent fe) { - tf1.setText("Clipboards_Independance_Testing"); + tf1.setText("Clipboards_Independence_Testing"); } }); Same for the `IndependenceSwingTest` test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 170: > 168: }); > 169: > 170: robot.glide(new Point(0, 0), ttf1Center); Gliding from `0,0` can sometimes be time consuming, e.g. on my `3440x1440` screen this test took 24s, but with the following patch only 7s. --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java @@ -59,6 +59,7 @@ public class IndependenceAWTTest { private static Clipboard primaryClip; private static ExtendedRobot robot; private static volatile Point ttf1Center; + private static volatile Point glideStartLocation; public static void main (String[] args) throws Exception { try { @@ -165,9 +166,11 @@ private static void test() throws Exception { Point center = tf1.getLocationOnScreen(); center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2); ttf1Center = center; + glideStartLocation = frame.getLocationOnScreen(); + glideStartLocation.x -= 10; }); - robot.glide(new Point(0, 0), ttf1Center); + robot.glide(glideStartLocation, ttf1Center); robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(20); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866841320 PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866859287 From azvegint at openjdk.org Tue Dec 3 01:42:45 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 01:42:45 GMT Subject: RFR: 8345141: Remove uses of SecurityManager in ShellFolder related classes [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 23:03:14 GMT, Phil Race wrote: >> Remove SecurityManager related code from Swing filechooser implementation > > Phil Race has updated the pull request incrementally with one additional commit since the last revision: > > 8345141 Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22423#pullrequestreview-2474303220 From honkar at openjdk.org Tue Dec 3 02:04:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 02:04:39 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 01:38:49 GMT, Alexander Zvegintsev wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> frame title > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 170: > >> 168: }); >> 169: >> 170: robot.glide(new Point(0, 0), ttf1Center); > > Gliding from `0,0` can sometimes be time consuming, e.g. on my `3440x1440` screen this test took 24s, but with the following patch only 7s. > > > --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java > +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java > @@ -59,6 +59,7 @@ public class IndependenceAWTTest { > private static Clipboard primaryClip; > private static ExtendedRobot robot; > private static volatile Point ttf1Center; > + private static volatile Point glideStartLocation; > > public static void main (String[] args) throws Exception { > try { > @@ -165,9 +166,11 @@ private static void test() throws Exception { > Point center = tf1.getLocationOnScreen(); > center.translate(tf1.getWidth() / 2, tf1.getHeight() / 2); > ttf1Center = center; > + glideStartLocation = frame.getLocationOnScreen(); > + glideStartLocation.x -= 10; > }); > > - robot.glide(new Point(0, 0), ttf1Center); > + robot.glide(glideStartLocation, ttf1Center); > robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); > robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); > robot.waitForIdle(20); Thanks. With your patch the test executes much faster. Since I moved the frame to center, the time required for robot.glide() was more noticeable and using `glideStartLocation` works well. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866877817 From honkar at openjdk.org Tue Dec 3 02:09:41 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 02:09:41 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 19:19:42 GMT, Alexander Zuev wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> frame title > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 114: > >> 112: if (primaryClip == null) { >> 113: throw new RuntimeException("Method getSystemSelection() is returning null" >> 114: + " on Linux platform"); > > In previous version it was mentioning X11 platform. Do we know if the system selection works the same way on Wayland as it was on X11? @azuev-java getSystemSelection() works the same for X11 and Wayland (goes through XToolkit's getSystemSelection() for both). I think the original test was added before wayland was introduced (going by the test's copyright year 1999, no associated `@bug` tag though) hence x11 was mentioned explicitly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1866881392 From prr at openjdk.org Tue Dec 3 02:34:44 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 3 Dec 2024 02:34:44 GMT Subject: Integrated: 8345141: Remove uses of SecurityManager in ShellFolder related classes In-Reply-To: References: Message-ID: <0EeWxVU9YBMTOs2Ep20WMnWO3wqVVwnYfz3fTaTY4rE=.c34272f2-582b-4c87-b65f-d5f6e81c4dba@github.com> On Thu, 28 Nov 2024 00:34:07 GMT, Phil Race wrote: > Remove SecurityManager related code from Swing filechooser implementation This pull request has now been integrated. Changeset: 325366ee Author: Phil Race URL: https://git.openjdk.org/jdk/commit/325366ee1d72377c04344aa77f51f7c6d78b65d7 Stats: 141 lines in 5 files changed: 3 ins; 116 del; 22 mod 8345141: Remove uses of SecurityManager in ShellFolder related classes Reviewed-by: azvegint, honkar ------------- PR: https://git.openjdk.org/jdk/pull/22423 From psadhukhan at openjdk.org Tue Dec 3 03:23:41 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 3 Dec 2024 03:23:41 GMT Subject: Integrated: 8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 12:52:32 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/Action/8133039/bug8133039.java failed in OCI ubuntu 22.04 with exception "Method accept not invoked" > Seems like robot keypress happened before testframe was visible..Added a delay.. > Several iterations passed in OCI linux system.. This pull request has now been integrated. Changeset: e023addf Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/e023addf701ce4321040c96bd501355ece75a05c Stats: 4 lines in 1 file changed: 2 ins; 1 del; 1 mod 8345297: test/jdk/javax/swing/Action/8133039/bug8133039.java fails in ubuntu22.04 Reviewed-by: azvegint ------------- PR: https://git.openjdk.org/jdk/pull/22480 From honkar at openjdk.org Tue Dec 3 05:25:18 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 05:25:18 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v4] In-Reply-To: References: Message-ID: <2tlxhBruhWljkagCzkMdo1BLWW3UAkrFAuPL8g81CkE=.a1951a30-cf66-4f7f-a867-af09efaa236e@github.com> > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. Harshitha Onkar 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 seven additional commits since the last revision: - Merge branch 'master' into jep486_DataTransferTests - glideStartLocation changes - frame title - removed redundant null check - removed author tags, delay changes - added missing import - datatransfer test changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22490/files - new: https://git.openjdk.org/jdk/pull/22490/files/795f8bd1..baaa7785 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=02-03 Stats: 72332 lines in 814 files changed: 58290 ins; 10223 del; 3819 mod Patch: https://git.openjdk.org/jdk/pull/22490.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22490/head:pull/22490 PR: https://git.openjdk.org/jdk/pull/22490 From kizune at openjdk.org Tue Dec 3 05:38:40 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 3 Dec 2024 05:38:40 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v4] In-Reply-To: <2tlxhBruhWljkagCzkMdo1BLWW3UAkrFAuPL8g81CkE=.a1951a30-cf66-4f7f-a867-af09efaa236e@github.com> References: <2tlxhBruhWljkagCzkMdo1BLWW3UAkrFAuPL8g81CkE=.a1951a30-cf66-4f7f-a867-af09efaa236e@github.com> Message-ID: On Tue, 3 Dec 2024 05:25:18 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar 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 seven additional commits since the last revision: > > - Merge branch 'master' into jep486_DataTransferTests > - glideStartLocation changes > - frame title > - removed redundant null check > - removed author tags, delay changes > - added missing import > - datatransfer test changes Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22490#pullrequestreview-2474624811 From psadhukhan at openjdk.org Tue Dec 3 07:24:08 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 3 Dec 2024 07:24:08 GMT Subject: RFR: 8345357: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in ubuntu22.04 Message-ID: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in OCI system citing Radio Button Group Go To Next Component through Tab Key failed ----------System.err:(30/2118)---------- java.lang.reflect.InvocationTargetException at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1371) at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1346) at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) at bug8033699.runTest1(bug8033699.java:163) at bug8033699.main(bug8033699.java:71) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:573) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1575) Caused by: java.lang.RuntimeException: Focus is not on Radio Button Single as Expected in runTest1, the first subtest which seems to suggest test started before the frame is visible..Added a standard delay after frame visibility..Also added a token delay inbetween 8 subtests so that keypress(es) are not coming in one after other.. Test passed in CI in several OCI systems.. ------------- Commit messages: - OCItest Changes: https://git.openjdk.org/jdk/pull/22509/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22509&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345357 Stats: 18 lines in 1 file changed: 12 ins; 3 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22509.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22509/head:pull/22509 PR: https://git.openjdk.org/jdk/pull/22509 From aturbanov at openjdk.org Tue Dec 3 07:28:49 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 3 Dec 2024 07:28:49 GMT Subject: Integrated: 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap In-Reply-To: References: Message-ID: On Wed, 30 Oct 2024 12:02:14 GMT, Andrey Turbanov wrote: > If a thread-safe implementation is not needed, it is recommended to use HashMap instead of legacy synchronized Hashtable. > Map `CSS.htmlAttrToCssAttrMap` is modified only within static initialization block and then only `get` method is called. > > The only subtle difference is that Hashtable doesn't allow `null` keys and throws NPE from `get` method. > I've checked all possible keys which are passed to `htmlAttrToCssAttrMap.get`. > Currently 3 different execution paths are possible: > > **1,2** > When `HTML.Attribute.BORDER` is passed as a key. It's definitely non-null. > > javax.swing.text.html.CSS#translateHTMLToCSS > translateAttribute(HTML.Attribute.BORDER, "1", cssAttrSet); > CSS.Attribute[] cssAttrList = getCssAttribute(key); > > > javax.swing.text.html.CSS#translateAttributes > translateAttribute(HTML.Attribute.BORDER, Integer.toString(borderWidth), cssAttrSet); > CSS.Attribute[] cssAttrList = getCssAttribute(key);` > > > **3** > When non-null `key` is passed as a key. > > javax.swing.text.html.CSS#translateAttributes > > if (name instanceof HTML.Attribute) { // from this `instanceof` we know that it's non-null > HTML.Attribute key = (HTML.Attribute)name; > > translateAttribute(key, (String) htmlAttrSet.getAttribute(key), cssAttrSet); > CSS.Attribute[] cssAttrList = getCssAttribute(key); > > > ![idea_analyze_dataflow_to_here](https://github.com/user-attachments/assets/48ace4de-6d0a-468e-bb14-b579a193254b) > > > I've used HashMap.newHashMap method instead of constructor to avoid resizing of internal HashMap array. This pull request has now been integrated. Changeset: 659f70b3 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/659f70b37079ea2a54ebaaad5f47ce9600982d8d Stats: 53 lines in 1 file changed: 5 ins; 0 del; 48 mod 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap Reviewed-by: honkar, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/21785 From aturbanov at openjdk.org Tue Dec 3 07:28:49 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 3 Dec 2024 07:28:49 GMT Subject: RFR: 8343418: Unnecessary Hashtable usage in CSS.htmlAttrToCssAttrMap [v4] In-Reply-To: References: Message-ID: On Tue, 12 Nov 2024 20:28:55 GMT, Andrey Turbanov wrote: >> If a thread-safe implementation is not needed, it is recommended to use HashMap instead of legacy synchronized Hashtable. >> Map `CSS.htmlAttrToCssAttrMap` is modified only within static initialization block and then only `get` method is called. >> >> The only subtle difference is that Hashtable doesn't allow `null` keys and throws NPE from `get` method. >> I've checked all possible keys which are passed to `htmlAttrToCssAttrMap.get`. >> Currently 3 different execution paths are possible: >> >> **1,2** >> When `HTML.Attribute.BORDER` is passed as a key. It's definitely non-null. >> >> javax.swing.text.html.CSS#translateHTMLToCSS >> translateAttribute(HTML.Attribute.BORDER, "1", cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> javax.swing.text.html.CSS#translateAttributes >> translateAttribute(HTML.Attribute.BORDER, Integer.toString(borderWidth), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key);` >> >> >> **3** >> When non-null `key` is passed as a key. >> >> javax.swing.text.html.CSS#translateAttributes >> >> if (name instanceof HTML.Attribute) { // from this `instanceof` we know that it's non-null >> HTML.Attribute key = (HTML.Attribute)name; >> >> translateAttribute(key, (String) htmlAttrSet.getAttribute(key), cssAttrSet); >> CSS.Attribute[] cssAttrList = getCssAttribute(key); >> >> >> ![idea_analyze_dataflow_to_here](https://github.com/user-attachments/assets/48ace4de-6d0a-468e-bb14-b579a193254b) >> >> >> I've used HashMap.newHashMap method instead of constructor to avoid resizing of internal HashMap array. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8343418: align more Thank you for review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21785#issuecomment-2513744337 From psadhukhan at openjdk.org Tue Dec 3 07:36:38 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 3 Dec 2024 07:36:38 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v2] In-Reply-To: <4Ta4nqEij7hnWBAUU9jNlbccChDKy630EixwjlFsqT8=.38b466d6-afa2-45ed-aed4-472d26eb9000@github.com> References: <4Ta4nqEij7hnWBAUU9jNlbccChDKy630EixwjlFsqT8=.38b466d6-afa2-45ed-aed4-472d26eb9000@github.com> Message-ID: <0PCrEmFQPdtYru0LV15OwDO_jCvRWEUcHfJqcePIN7Y=.4164897e-3b31-4c43-9d98-b127add17fab@github.com> On Thu, 28 Nov 2024 13:42:14 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > update copyright Convention is to add the product fix JBS id i.e, this bugid to @bug tag in PaperSizeError.java regression test so that we have a tab of the product fix(es) the test is meant to test.. ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2474793312 From duke at openjdk.org Tue Dec 3 09:26:21 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Tue, 3 Dec 2024 09:26:21 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v3] In-Reply-To: References: Message-ID: > Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. > > **Reason of the bug:** > The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. > After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. > > For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. > *PaperDimension A4/A4: "595 842" > *PaperDimension BrA4_B/A4 (Borderless): "595 842" > After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. > After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". > > **Fix description:** > Create new MediaSize if there is no any other MediaSize with the same size. > > **Tests:** > OS: MacOS 12, Linux Ubuntu 22, Windows 11. > open/test/jdk/java/awt/print/Dialog/PaperSizeError.java > test/jdk/javax/print/CustomMediaSizeNameOOMETest.java > All tests from the test/jdk/javax/print/ GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: update test tag ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22429/files - new: https://git.openjdk.org/jdk/pull/22429/files/3cfca2c7..e31e6161 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22429.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22429/head:pull/22429 PR: https://git.openjdk.org/jdk/pull/22429 From duke at openjdk.org Tue Dec 3 09:28:38 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Tue, 3 Dec 2024 09:28:38 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v2] In-Reply-To: <0PCrEmFQPdtYru0LV15OwDO_jCvRWEUcHfJqcePIN7Y=.4164897e-3b31-4c43-9d98-b127add17fab@github.com> References: <4Ta4nqEij7hnWBAUU9jNlbccChDKy630EixwjlFsqT8=.38b466d6-afa2-45ed-aed4-472d26eb9000@github.com> <0PCrEmFQPdtYru0LV15OwDO_jCvRWEUcHfJqcePIN7Y=.4164897e-3b31-4c43-9d98-b127add17fab@github.com> Message-ID: <4wo2h3SCCdsET0kWeF8i0h_bSHU_HbjpVqaYpfL4yrE=.9f14da76-9c71-4688-8d52-5204e6efde74@github.com> On Tue, 3 Dec 2024 07:33:35 GMT, Prasanta Sadhukhan wrote: > Convention is to add the product fix JBS id i.e, this bugid to @bug tag in PaperSizeError.java regression test so that we have a tab of the product fix(es) the test is meant to test.. Updated. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22429#issuecomment-2513979809 From azvegint at openjdk.org Tue Dec 3 10:49:41 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 10:49:41 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 01:13:09 GMT, Alexander Zvegintsev wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> frame title > > test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 88: > >> 86: >> 87: // TextFields to get the contents of clipboard >> 88: tf2 = new TextField(); > > Line 82 > > > --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java > +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java > @@ -80,7 +80,7 @@ private static void createAndShowUI() { > tf1 = new TextField(); > tf1.addFocusListener(new FocusAdapter() { > public void focusGained(FocusEvent fe) { > - tf1.setText("Clipboards_Independance_Testing"); > + tf1.setText("Clipboards_Independence_Testing"); > } > }); > > > Same for the `IndependenceSwingTest` The typos are still there. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1867486240 From azvegint at openjdk.org Tue Dec 3 10:53:40 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 10:53:40 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v4] In-Reply-To: <2tlxhBruhWljkagCzkMdo1BLWW3UAkrFAuPL8g81CkE=.a1951a30-cf66-4f7f-a867-af09efaa236e@github.com> References: <2tlxhBruhWljkagCzkMdo1BLWW3UAkrFAuPL8g81CkE=.a1951a30-cf66-4f7f-a867-af09efaa236e@github.com> Message-ID: On Tue, 3 Dec 2024 05:25:18 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar 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 seven additional commits since the last revision: > > - Merge branch 'master' into jep486_DataTransferTests > - glideStartLocation changes > - frame title > - removed redundant null check > - removed author tags, delay changes > - added missing import > - datatransfer test changes Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22490#pullrequestreview-2475290237 From dmarkov at openjdk.org Tue Dec 3 11:07:37 2024 From: dmarkov at openjdk.org (Dmitry Markov) Date: Tue, 3 Dec 2024 11:07:37 GMT Subject: RFR: 8324491: Keyboard layout did not keep it state if it was changed when dialog is active In-Reply-To: References: Message-ID: On Wed, 27 Nov 2024 12:47:29 GMT, Dmitry Markov wrote: > If AWT/Swing app displays several windows and an user changes the keyboard layout and then closes the focused window, the app does not keep the keyboard layout changes. > > It is necessary to sync currentLocale and Windows keyboard layout values in `WInputMethod` class before component activation. Looking for volunteers to review the fix. Thanks in advance ------------- PR Comment: https://git.openjdk.org/jdk/pull/22411#issuecomment-2514235130 From abhiscxk at openjdk.org Tue Dec 3 11:39:42 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Tue, 3 Dec 2024 11:39:42 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v3] In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:42:21 GMT, Damon Nguyen wrote: >> Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. >> >> Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. >> >> Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Amend test LGTM, test works as expected on different platforms. ------------- Marked as reviewed by abhiscxk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22333#pullrequestreview-2475401257 From aivanov at openjdk.org Tue Dec 3 15:03:43 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 3 Dec 2024 15:03:43 GMT Subject: Integrated: 8342602: Remove JButton/PressedButtonRightClickTest test In-Reply-To: References: Message-ID: On Fri, 18 Oct 2024 16:41:43 GMT, Alexey Ivanov wrote: > The `javax/swing/JButton/PressedButtonRightClickTest.java` test that was added by [JDK-8049069](https://bugs.openjdk.org/browse/JDK-8049069) fully duplicates an existing test `javax/swing/JButton/bug4490179.java`. > > To save time running tests, I'm removing `PressedButtonRightClickTest.java`. This pull request has now been integrated. Changeset: 8647c001 Author: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/8647c00114385f74939bf705c9c07e709f41a18d Stats: 148 lines in 2 files changed: 0 ins; 147 del; 1 mod 8342602: Remove JButton/PressedButtonRightClickTest test Reviewed-by: dnguyen, prr ------------- PR: https://git.openjdk.org/jdk/pull/21587 From aivanov at openjdk.org Tue Dec 3 15:07:51 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 3 Dec 2024 15:07:51 GMT Subject: Integrated: 8337287: Update image in javax.swing.text.Document.insert In-Reply-To: References: Message-ID: On Mon, 29 Jul 2024 13:43:42 GMT, Alexey Ivanov wrote: > This changeset updates the image in the documentation for the `Document.insert` method. The image in `Document.remove` was updated by [JDK-4622866](https://bugs.openjdk.org/browse/JDK-4622866) in PR #15701. > > Now the illustration of inserting looks similar to removing. The new image is in SVG format. > > For reference: > > - [`Document.insert` in JDK 22](https://docs.oracle.com/en/java/javase/22/docs/api/java.desktop/javax/swing/text/Document.html#insertString(int,java.lang.String,javax.swing.text.AttributeSet)); > - [Updated docs for JDK 24](https://cr.openjdk.org/~aivanov/8337287/api/java.desktop/javax/swing/text/Document.html#insertString(int,java.lang.String,javax.swing.text.AttributeSet)). > > As in the case with `remove`, I marked up to classes and members with `{@code}`. This pull request has now been integrated. Changeset: caf053b3 Author: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/caf053b3ad53e4ce86d07adee6d71ea1ff3e8965 Stats: 171 lines in 3 files changed: 157 ins; 0 del; 14 mod 8337287: Update image in javax.swing.text.Document.insert Reviewed-by: serb, prr, abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/20376 From aturbanov at openjdk.org Tue Dec 3 15:07:58 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 3 Dec 2024 15:07:58 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor Message-ID: `Properties` doesn't allow `null` values. We can replace containsKey+getProperty with getProperty+null check. It's clearer and a bit faster. ------------- Commit messages: - [PATCH] Avoid redundant Properties.containsKey calls in Cursor.getSystemCustomCursor Changes: https://git.openjdk.org/jdk/pull/21824/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21824&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345398 Stats: 7 lines in 1 file changed: 2 ins; 3 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21824.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21824/head:pull/21824 PR: https://git.openjdk.org/jdk/pull/21824 From aivanov at openjdk.org Tue Dec 3 15:56:41 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 3 Dec 2024 15:56:41 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor In-Reply-To: References: Message-ID: On Fri, 1 Nov 2024 13:08:54 GMT, Andrey Turbanov wrote: > `Properties` doesn't allow `null` values. > We can replace containsKey+getProperty with getProperty+null check. > It's clearer and a bit faster. src/java.desktop/share/classes/java/awt/Cursor.java line 303: > 301: String key = prefix + DOT_FILE_SUFFIX; > 302: > 303: String fileName = systemCustomCursorProperties.getProperty(key); You can keep the `final` modifier, probably. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1867982490 From aivanov at openjdk.org Tue Dec 3 16:42:43 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 3 Dec 2024 16:42:43 GMT Subject: RFR: 8324491: Keyboard layout did not keep it state if it was changed when dialog is active In-Reply-To: References: Message-ID: <2rsx0fDpxzi9J3eL3VdbWsH3ScmmwRErdR3Hc_Bl-tg=.f0f9267e-be86-409e-abc6-6e8e19a6011c@github.com> On Wed, 27 Nov 2024 12:47:29 GMT, Dmitry Markov wrote: > If AWT/Swing app displays several windows and an user changes the keyboard layout and then closes the focused window, the app does not keep the keyboard layout changes. > > It is necessary to sync currentLocale and Windows keyboard layout values in `WInputMethod` class before component activation. Looks good to me. The keyboard layout is preserved after closing the dialog. I used SwingSet2 and **Show Input Dialog** to test the changes. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22411#pullrequestreview-2476237306 From honkar at openjdk.org Tue Dec 3 17:17:22 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 17:17:22 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v5] In-Reply-To: References: Message-ID: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: typo fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22490/files - new: https://git.openjdk.org/jdk/pull/22490/files/baaa7785..07aff62d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22490&range=03-04 Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22490.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22490/head:pull/22490 PR: https://git.openjdk.org/jdk/pull/22490 From honkar at openjdk.org Tue Dec 3 17:17:22 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 17:17:22 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v3] In-Reply-To: References: Message-ID: <_ivs_z-ts9_Gk5CD8kA-b_4bTk4OGHnr02RAv6uf0V0=.facb7f04-f124-4a35-b846-2752ae9feda8@github.com> On Tue, 3 Dec 2024 10:47:05 GMT, Alexander Zvegintsev wrote: >> test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java line 88: >> >>> 86: >>> 87: // TextFields to get the contents of clipboard >>> 88: tf2 = new TextField(); >> >> Line 82 >> >> >> --- a/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java >> +++ b/test/jdk/java/awt/datatransfer/Independence/IndependenceAWTTest.java >> @@ -80,7 +80,7 @@ private static void createAndShowUI() { >> tf1 = new TextField(); >> tf1.addFocusListener(new FocusAdapter() { >> public void focusGained(FocusEvent fe) { >> - tf1.setText("Clipboards_Independance_Testing"); >> + tf1.setText("Clipboards_Independence_Testing"); >> } >> }); >> >> >> Same for the `IndependenceSwingTest` > > The typos are still there. Missed it. Typo fixed now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22490#discussion_r1868108789 From azvegint at openjdk.org Tue Dec 3 17:35:53 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 17:35:53 GMT Subject: RFR: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs [v5] In-Reply-To: References: Message-ID: <3DkdaLquH6Qh5wp1uj0ndqaFu83iH9fOdUJrDLrDdH4=.b7e271ef-23e9-42de-9777-ef5e00938040@github.com> On Tue, 3 Dec 2024 17:17:22 GMT, Harshitha Onkar wrote: >> The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. >> This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. >> >> - java/awt/datatransfer/Independence/IndependenceAWTTest.java >> - java/awt/datatransfer/Independence/IndependenceSwingTest.java >> >> Multiple runs of the test on CI looks good and the tests pass. > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > typo fix Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22490#pullrequestreview-2476371411 From honkar at openjdk.org Tue Dec 3 17:39:46 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 17:39:46 GMT Subject: Integrated: JDK-8344368 : IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs In-Reply-To: References: Message-ID: On Mon, 2 Dec 2024 17:12:53 GMT, Harshitha Onkar wrote: > The following two tests failed intermittently due to stability issues after JEP486 (Removal of Security Manager). Tests have been updated for stability. > This test is applicable for linux platform only, hence `@requires (os.family == "linux")` jtreg tag is added and the redundant OS check within the test is removed. > > - java/awt/datatransfer/Independence/IndependenceAWTTest.java > - java/awt/datatransfer/Independence/IndependenceSwingTest.java > > Multiple runs of the test on CI looks good and the tests pass. This pull request has now been integrated. Changeset: 73b8b34a Author: Harshitha Onkar URL: https://git.openjdk.org/jdk/commit/73b8b34a8c627dd31ee97f3a301bd9d92d7031ed Stats: 201 lines in 2 files changed: 58 ins; 23 del; 120 mod 8344368: IndependenceSwingTest.java and IndependenceAWTTest.java failed: Selected text & clipboard contents differs Reviewed-by: azvegint, dnguyen, prr, kizune ------------- PR: https://git.openjdk.org/jdk/pull/22490 From aturbanov at openjdk.org Tue Dec 3 18:05:47 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 3 Dec 2024 18:05:47 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 15:52:30 GMT, Alexey Ivanov wrote: >> `Properties` doesn't allow `null` values. >> We can replace containsKey+getProperty with getProperty+null check. >> It's clearer and a bit faster. > > src/java.desktop/share/classes/java/awt/Cursor.java line 303: > >> 301: String key = prefix + DOT_FILE_SUFFIX; >> 302: >> 303: String fileName = systemCustomCursorProperties.getProperty(key); > > You can keep the `final` modifier, probably. I really like how this line now fits in 80 characters limit. But if you insist - I will return it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1868181704 From dnguyen at openjdk.org Tue Dec 3 18:07:22 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 3 Dec 2024 18:07:22 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v4] In-Reply-To: References: Message-ID: > Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. > > Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. > > Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: Final review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22333/files - new: https://git.openjdk.org/jdk/pull/22333/files/19fc99f9..e91e2e88 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22333&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22333&range=02-03 Stats: 4 lines in 1 file changed: 0 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22333.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22333/head:pull/22333 PR: https://git.openjdk.org/jdk/pull/22333 From honkar at openjdk.org Tue Dec 3 18:12:43 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 18:12:43 GMT Subject: RFR: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard [v4] In-Reply-To: References: Message-ID: <6OAQ2RUG8tbnjBrQjByT6fohhfhVbgQzHsY_vUDgdTs=.de4665cb-8044-44f1-85a8-580a7cc69584@github.com> On Tue, 3 Dec 2024 18:07:22 GMT, Damon Nguyen wrote: >> Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. >> >> Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. >> >> Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Final review comments LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22333#pullrequestreview-2476459398 From azvegint at openjdk.org Tue Dec 3 18:16:43 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 3 Dec 2024 18:16:43 GMT Subject: RFR: 8324491: Keyboard layout did not keep it state if it was changed when dialog is active In-Reply-To: References: Message-ID: <4_Jp5Iwmz3L2g7G2HJBqj1O_0Tqk2FrxH1qfqymcjTQ=.5d250b48-689d-4a16-80db-e6b289676655@github.com> On Wed, 27 Nov 2024 12:47:29 GMT, Dmitry Markov wrote: > If AWT/Swing app displays several windows and an user changes the keyboard layout and then closes the focused window, the app does not keep the keyboard layout changes. > > It is necessary to sync currentLocale and Windows keyboard layout values in `WInputMethod` class before component activation. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22411#pullrequestreview-2476468276 From dnguyen at openjdk.org Tue Dec 3 18:20:50 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 3 Dec 2024 18:20:50 GMT Subject: Integrated: 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard In-Reply-To: References: Message-ID: On Fri, 22 Nov 2024 19:24:28 GMT, Damon Nguyen wrote: > Test intermittently fails with a few different Exceptions. Initial report shows `Choice can't be controlled by keyboard` when failing. An additional report of an intermittent failure shows `Button does not have focus`. > > Added some stability fixes. Additional delays, removed extraneous window, and added an additional focus check. > > Debugged using additional screenshots during different failure points. Looks like sometimes the focus is still on the button. So, the delay has been added afterwards. Test passes on 22.04 Ubuntu machine with 100 repeats in CI. Also passed testing on all OS's with 50 repeats in CI. This pull request has now been integrated. Changeset: f37f64df Author: Damon Nguyen URL: https://git.openjdk.org/jdk/commit/f37f64df8c44fffa25a0b337193d67016f8380f3 Stats: 76 lines in 1 file changed: 33 ins; 22 del; 21 mod 8343736: Test java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java failed: Choice can't be controlled by keyboard Reviewed-by: honkar, abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22333 From dmarkov at openjdk.org Tue Dec 3 18:40:45 2024 From: dmarkov at openjdk.org (Dmitry Markov) Date: Tue, 3 Dec 2024 18:40:45 GMT Subject: Integrated: 8324491: Keyboard layout didn't keep its state if it was changed when dialog was active In-Reply-To: References: Message-ID: On Wed, 27 Nov 2024 12:47:29 GMT, Dmitry Markov wrote: > If AWT/Swing app displays several windows and an user changes the keyboard layout and then closes the focused window, the app does not keep the keyboard layout changes. > > It is necessary to sync currentLocale and Windows keyboard layout values in `WInputMethod` class before component activation. This pull request has now been integrated. Changeset: 2be07b5f Author: Dmitry Markov URL: https://git.openjdk.org/jdk/commit/2be07b5f9d2f3f0b885feb08ff10a57824ea5748 Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod 8324491: Keyboard layout didn't keep its state if it was changed when dialog was active Reviewed-by: aivanov, azvegint ------------- PR: https://git.openjdk.org/jdk/pull/22411 From honkar at openjdk.org Tue Dec 3 18:46:43 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 3 Dec 2024 18:46:43 GMT Subject: RFR: 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield [v2] In-Reply-To: <3_vX3P2Um340Vr9HCuhLxTYCTaqntCm_bnZun72byLI=.cc945e17-981d-450b-8b55-8854ddea3804@github.com> References: <3_vX3P2Um340Vr9HCuhLxTYCTaqntCm_bnZun72byLI=.cc945e17-981d-450b-8b55-8854ddea3804@github.com> Message-ID: On Thu, 28 Nov 2024 03:05:27 GMT, Prasanta Sadhukhan wrote: >> When a textfield is embedded in a TableCellEditor in a JTable in Aqua L&F and space is entered and caret moved back and forth by pressing left/right arrow button, an artifact is seen, which is basically the caret is not properly repainted leaving behind its trails. >> >> When caret is moved, it is repainted every time by "damaging" the area surrounding the caret to cause it to be repainted in a new location. AquaCaret overrides the default "damage" code to intersect the caret area with the border insets so that it does not damage the AquaBorder area.. >> For TextField case, AquaTextFieldBorder insets is removed from AquaTextField and then intersected with AquaCaret to get the dirry region which is then repainted, so as to not damage the border but it is done irrespective of whether border is shown or not, so proper dirty region is not repainted leaving behind artifacts when the caret is moved around... >> >> Fix is to see if border to be painted is not opaque in which case the proper dirty region is calculated which is then used in repaint logic to repaint the component.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix TestCaretArtifact (no-border case) and SwingSet2 (with border) work as expected with the fix. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22416#pullrequestreview-2476526952 From achung at openjdk.org Tue Dec 3 19:35:28 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 3 Dec 2024 19:35:28 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v11] 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: fix test with removed robot.glide using points ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22044/files - new: https://git.openjdk.org/jdk/pull/22044/files/420c4221..449b1d5f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=10 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=09-10 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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 achung at openjdk.org Tue Dec 3 19:56:31 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 3 Dec 2024 19:56:31 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v12] 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 with a new target base due to a merge or a rebase. The pull request now contains 19 commits: - 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 - add specification to public default fields - fix var names in ER - update specifications - ... and 9 more: https://git.openjdk.org/jdk/compare/a49f0776...bbfef4a8 ------------- Changes: https://git.openjdk.org/jdk/pull/22044/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=11 Stats: 826 lines in 236 files changed: 209 ins; 433 del; 184 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 achung at openjdk.org Tue Dec 3 21:03:59 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 3 Dec 2024 21:03:59 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v13] 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: update glide in test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22044/files - new: https://git.openjdk.org/jdk/pull/22044/files/bbfef4a8..97e2424a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=12 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=11-12 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 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 prr at openjdk.org Tue Dec 3 22:20:50 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 3 Dec 2024 22:20:50 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v8] In-Reply-To: References: Message-ID: <1CpHIs0qKh3uC4ay98jOj6Gj-k-qVAuSuDVHMnbKjuM=.73576799-e268-478d-9fcb-778c84f626a1@github.com> On Mon, 2 Dec 2024 17:26:00 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 = """ >> >> >> >>

>> > 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 > - Removes files > > make/javac.20231014_162919.args > make/javac.20231014_220237.args > make/javac.20231023_221655.args > - Adds a regression test for JDK-8314731. > - Others changes in the working directory. > - Merge Master > - Merge master > - ... and 10 more: https://git.openjdk.org/jdk/compare/352201dd...de644539 Changes requested by prr (Reviewer). src/java.desktop/share/classes/javax/swing/text/html/FormView.java line 196: > 194: AttributeSet attr = getElement().getAttributes(); > 195: HTML.Tag t = (HTML.Tag) > 196: attr.getAttribute(StyleConstants.NameAttribute); This PR has LOTS of completely unrelated changing to formatting. Please revert ALL of it, so we can see what is related to the change and not be distracted. test/jdk/javax/swing/text/html/bug8314731.java line 28: > 26: * @bug 8314731 > 27: * @summary FormView doesn't support the alt attribute > 28: * @library /java/swing/text/html What is this library ? I don't see it anywhere under the test/jdk folder. And there's no @build tag. Furthermore, this test clearly needs a display which means it needs to be marked @headful test/jdk/javax/swing/text/html/bug8314731.java line 51: > 49: > 50: public static void main(String[] args) throws Exception { > 51: new bug8314731(); the UI needs to be created on the EDT using SwingUtilities.invokeAndWait. And you need use a finally block to be SURE the Frame is disposed, else the test will just sit there. Please make sure you have used jtreg to validate this test. test/jdk/javax/swing/text/html/bug8314731.java line 53: > 51: new bug8314731(); > 52: if (testFailed) { > 53: System.out.println("ok"); I find this backwards - and hence confusing. You really mean "testPassed" not "testFailed". test/jdk/javax/swing/text/html/bug8314731.java line 80: > 78: 79: name=point > 80: src="file:logo.jpeg" and of course you don't need to supply logo.jpeg, because the point is that there should be no image found. ------------- PR Review: https://git.openjdk.org/jdk/pull/15319#pullrequestreview-2476851661 PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1868431626 PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1868428214 PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1868430794 PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1868428906 PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1868429679 From abhiscxk at openjdk.org Wed Dec 4 04:14:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 04:14:38 GMT Subject: RFR: 8345357: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 07:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in OCI system citing > > > Radio Button Group Go To Next Component through Tab Key failed > ----------System.err:(30/2118)---------- > java.lang.reflect.InvocationTargetException > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1371) > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1346) > at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) > at bug8033699.runTest1(bug8033699.java:163) > at bug8033699.main(bug8033699.java:71) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:573) > at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) > at java.base/java.lang.Thread.run(Thread.java:1575) > Caused by: java.lang.RuntimeException: Focus is not on Radio Button Single as Expected > > > in runTest1, the first subtest which seems to suggest test started before the frame is visible..Added a standard delay after frame visibility..Also added a token delay inbetween 8 subtests so that keypress(es) are not coming in one after other.. > Test passed in CI in several OCI systems.. Marked as reviewed by abhiscxk (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22509#pullrequestreview-2477246915 From abhiscxk at openjdk.org Wed Dec 4 04:24:40 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 04:24:40 GMT Subject: RFR: 8345357: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 07:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in OCI system citing > > > Radio Button Group Go To Next Component through Tab Key failed > ----------System.err:(30/2118)---------- > java.lang.reflect.InvocationTargetException > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1371) > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1346) > at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) > at bug8033699.runTest1(bug8033699.java:163) > at bug8033699.main(bug8033699.java:71) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:573) > at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) > at java.base/java.lang.Thread.run(Thread.java:1575) > Caused by: java.lang.RuntimeException: Focus is not on Radio Button Single as Expected > > > in runTest1, the first subtest which seems to suggest test started before the frame is visible..Added a standard delay after frame visibility..Also added a token delay inbetween 8 subtests so that keypress(es) are not coming in one after other.. > Test passed in CI in several OCI systems.. @prsadhuk Looks good to me, more like a stabilization fix. You may add CI testing link in JBS. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22509#issuecomment-2516155144 From psadhukhan at openjdk.org Wed Dec 4 04:31:41 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 04:31:41 GMT Subject: Integrated: 8345357: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 07:19:43 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in OCI system citing > > > Radio Button Group Go To Next Component through Tab Key failed > ----------System.err:(30/2118)---------- > java.lang.reflect.InvocationTargetException > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1371) > at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1346) > at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) > at bug8033699.runTest1(bug8033699.java:163) > at bug8033699.main(bug8033699.java:71) > at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) > at java.base/java.lang.reflect.Method.invoke(Method.java:573) > at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) > at java.base/java.lang.Thread.run(Thread.java:1575) > Caused by: java.lang.RuntimeException: Focus is not on Radio Button Single as Expected > > > in runTest1, the first subtest which seems to suggest test started before the frame is visible..Added a standard delay after frame visibility..Also added a token delay inbetween 8 subtests so that keypress(es) are not coming in one after other.. > Test passed in CI in several OCI systems.. This pull request has now been integrated. Changeset: 521ed72b Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/521ed72b87d0fb1def6d94485e08be22632deef0 Stats: 18 lines in 1 file changed: 12 ins; 3 del; 3 mod 8345357: test/jdk/javax/swing/JRadioButton/8033699/bug8033699.java fails in ubuntu22.04 Reviewed-by: abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22509 From psadhukhan at openjdk.org Wed Dec 4 05:27:37 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 05:27:37 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 09:26:21 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > update test tag Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2477320467 From psadhukhan at openjdk.org Wed Dec 4 07:10:12 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 07:10:12 GMT Subject: RFR: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 Message-ID: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in OCI system citing Caused by: java.lang.RuntimeException: setFloating does not work correctly at bug4529206.lambda$main$3(bug4529206.java:90) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) which suggests that the focus is not shifted from main frame to toolbar.. Added a stability waitForIdle and test passed in several OCI systems ------------- Commit messages: - test fix Changes: https://git.openjdk.org/jdk/pull/22536/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22536&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345447 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22536.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22536/head:pull/22536 PR: https://git.openjdk.org/jdk/pull/22536 From psadhukhan at openjdk.org Wed Dec 4 09:24:15 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 09:24:15 GMT Subject: RFR: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 Message-ID: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> Test is failing in OCI system citing java.lang.Error: The scrollbar block increment is incorect at bug4865918.main(bug4865918.java:68) seemingly because focus is not in scrollbar..Added stability delay to make test execution wait after frame visibility and made frame to center of screen. Test passed in several OCI systems with this modification... ------------- Commit messages: - 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 Changes: https://git.openjdk.org/jdk/pull/22540/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22540&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345468 Stats: 28 lines in 1 file changed: 7 ins; 12 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/22540.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22540/head:pull/22540 PR: https://git.openjdk.org/jdk/pull/22540 From abhiscxk at openjdk.org Wed Dec 4 13:26:43 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 13:26:43 GMT Subject: RFR: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 In-Reply-To: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> References: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> Message-ID: On Wed, 4 Dec 2024 09:18:51 GMT, Prasanta Sadhukhan wrote: > Test is failing in OCI system citing > > java.lang.Error: The scrollbar block increment is incorect > at bug4865918.main(bug4865918.java:68) > > seemingly because focus is not in scrollbar..Added stability delay to make test execution wait after frame visibility and made frame to center of screen. > Test passed in several OCI systems with this modification... test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 1: > 1: /* L72 - L77 can be changed to use lambda expression.. `SwingUtilities.invokeAndWait(() -> result[0] = sbar.getValue());` test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > 57: robot.delay(200); > 58: > 59: int value = getValue(); `getValue()` can be evaluated in if condition directly, no need to have `value` variable. typo in incorrect throw new Error("The scrollbar block increment is `incorrect`"); may be changed to RTE instead of Error. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22540#discussion_r1869489694 PR Review Comment: https://git.openjdk.org/jdk/pull/22540#discussion_r1869477006 From aivanov at openjdk.org Wed Dec 4 13:32:48 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 13:32:48 GMT Subject: Integrated: 8341982: Simplify JButton/bug4323121.java In-Reply-To: References: Message-ID: On Fri, 11 Oct 2024 18:20:52 GMT, Alexey Ivanov wrote: > The test `javax/swing/JButton/bug4323121.java` contains lots of unused methods. > > I removed all the unused methods by extending `MouseAdapter`. > > I use `CountDownLatch` to synchronise actions in the test. > > The test still verifies `button.getModel().isArmed()` doesn't always return `true` for classes which extend `JButton`. I verified the updated test fails in 1.3.0 and passes in 1.4.0, so the test still reproduces the original problem. This pull request has now been integrated. Changeset: 6fa5cea9 Author: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/6fa5cea984c31fbb74b39e1eec68daffea22ca92 Stats: 85 lines in 1 file changed: 24 ins; 40 del; 21 mod 8341982: Simplify JButton/bug4323121.java Reviewed-by: abhiscxk, honkar, dnguyen, achung ------------- PR: https://git.openjdk.org/jdk/pull/21475 From abhiscxk at openjdk.org Wed Dec 4 13:36:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 13:36:38 GMT Subject: RFR: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 07:04:58 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in OCI system citing > > Caused by: java.lang.RuntimeException: setFloating does not work correctly > at bug4529206.lambda$main$3(bug4529206.java:90) > at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) > > which suggests that the focus is not shifted from main frame to toolbar.. > Added a stability waitForIdle and test passed in several OCI systems test/jdk/javax/swing/JToolBar/4529206/bug4529206.java line 1: > 1: /* Since you are modifying this test, couple of suggestions: 1. Please limit L67 to 80 cols. 2. I guess L91 and L92 can be merged, it's slightly over 80 cols but should be ok. If not then may be split like throw new RuntimeException("setFloating" + "does not work correctly"); ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22536#discussion_r1869508259 From psadhukhan at openjdk.org Wed Dec 4 13:47:24 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 13:47:24 GMT Subject: RFR: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 [v2] In-Reply-To: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> References: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> Message-ID: <_BdiqNmVJuM7BJFOrf0HCl2eopRmnw-5tvbR1F2G0vo=.cb9c9ca3-057a-43c0-be61-f63f2e43d3c7@github.com> > Test is failing in OCI system citing > > java.lang.Error: The scrollbar block increment is incorect > at bug4865918.main(bug4865918.java:68) > > seemingly because focus is not in scrollbar..Added stability delay to make test execution wait after frame visibility and made frame to center of screen. > Test passed in several OCI systems with this modification... Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22540/files - new: https://git.openjdk.org/jdk/pull/22540/files/9455cfb0..1423bb75 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22540&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22540&range=00-01 Stats: 9 lines in 1 file changed: 0 ins; 5 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/22540.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22540/head:pull/22540 PR: https://git.openjdk.org/jdk/pull/22540 From psadhukhan at openjdk.org Wed Dec 4 13:47:24 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 13:47:24 GMT Subject: RFR: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 [v2] In-Reply-To: References: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> Message-ID: <9_PvXGwqhrIIPjd-cZl6U3SA6SNA2mHcFGt1yuqezhY=.aee26677-54bc-48d0-a099-39361df7e12f@github.com> On Wed, 4 Dec 2024 13:17:14 GMT, Abhishek Kumar wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> review > > test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > >> 57: robot.delay(200); >> 58: >> 59: int value = getValue(); > > `getValue()` can be evaluated in if condition directly, no need to have `value` variable. > > typo in incorrect > throw new Error("The scrollbar block increment is `incorrect`"); > > may be changed to RTE instead of Error. ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22540#discussion_r1869530570 From aivanov at openjdk.org Wed Dec 4 13:47:42 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 13:47:42 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor In-Reply-To: References: Message-ID: On Fri, 1 Nov 2024 13:08:54 GMT, Andrey Turbanov wrote: > `Properties` doesn't allow `null` values. > We can replace containsKey+getProperty with getProperty+null check. > It's clearer and a bit faster. Anyway, it looks good to me. Messing around with `final` doesn't bring much value. However, it may make the code look more consistent. src/java.desktop/share/classes/java/awt/Cursor.java line 300: > 298: loadSystemCustomCursorProperties(); > 299: > 300: String prefix = CURSOR_DOT_PREFIX + name; I'd mark `prefix` as `final`, it's used throughout the method, which highlights the inconsistency in applying `final`. src/java.desktop/share/classes/java/awt/Cursor.java line 301: > 299: > 300: String prefix = CURSOR_DOT_PREFIX + name; > 301: String key = prefix + DOT_FILE_SUFFIX; After you removed `containsKey(key)`, `key` is used only once, and `prefix + DOT_FILE_SUFFIX` can be inline in the call to `systemCustomCursorProperties.getProperty` to get the file name. This would align with other usages of `prefix` in the method. ------------- Marked as reviewed by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21824#pullrequestreview-2478650911 PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1869526952 PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1869519299 From aivanov at openjdk.org Wed Dec 4 13:47:43 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 13:47:43 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor In-Reply-To: References: Message-ID: <7_TtV-XPXM9keWIqNqeVRIUILeOGsbA5xbpcCFSrUjE=.76b2bf92-0560-4051-aba4-43d3ff5de39a@github.com> On Tue, 3 Dec 2024 18:02:45 GMT, Andrey Turbanov wrote: >> src/java.desktop/share/classes/java/awt/Cursor.java line 303: >> >>> 301: String key = prefix + DOT_FILE_SUFFIX; >>> 302: >>> 303: String fileName = systemCustomCursorProperties.getProperty(key); >> >> You can keep the `final` modifier, probably. > > I really like how this line now fits in 80 characters limit. But if you insist - I will return it. That's what I thought. At the same time, it's only two columns longer than 80 chars a line. The usage of `final` modifiers seems inconsistent in the method. Maybe remove `final` from `localized` too? Then there would be no `final` modifiers till `hotPoint`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1869522599 From psadhukhan at openjdk.org Wed Dec 4 13:53:12 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 13:53:12 GMT Subject: RFR: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: <2O7GGuLK_QsL5geKbfkcVlO0XI_AwPm2a28ehyq-vy0=.2d94cdfa-e4c4-453f-9a61-afc80dbadeea@github.com> > test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in OCI system citing > > Caused by: java.lang.RuntimeException: setFloating does not work correctly > at bug4529206.lambda$main$3(bug4529206.java:90) > at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) > > which suggests that the focus is not shifted from main frame to toolbar.. > Added a stability waitForIdle and test passed in several OCI systems Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22536/files - new: https://git.openjdk.org/jdk/pull/22536/files/80858d0b..7fec9941 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22536&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22536&range=00-01 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22536.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22536/head:pull/22536 PR: https://git.openjdk.org/jdk/pull/22536 From psadhukhan at openjdk.org Wed Dec 4 13:53:12 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 13:53:12 GMT Subject: RFR: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 13:33:56 GMT, Abhishek Kumar wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> review > > test/jdk/javax/swing/JToolBar/4529206/bug4529206.java line 1: > >> 1: /* > > Since you are modifying this test, couple of suggestions: > > 1. Please limit L67 to 80 cols. > 2. I guess L91 and L92 can be merged, it's slightly over 80 cols but should be ok. If not then may be split like > throw new RuntimeException("setFloating" + > "does not work correctly"); ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22536#discussion_r1869553180 From aturbanov at openjdk.org Wed Dec 4 14:51:14 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 4 Dec 2024 14:51:14 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor [v2] In-Reply-To: References: Message-ID: > `Properties` doesn't allow `null` values. > We can replace containsKey+getProperty with getProperty+null check. > It's clearer and a bit faster. Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: inline 'key' remove 'final' from 'localized' too ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21824/files - new: https://git.openjdk.org/jdk/pull/21824/files/36553550..5fcd5339 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21824&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21824&range=00-01 Stats: 4 lines in 1 file changed: 1 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21824.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21824/head:pull/21824 PR: https://git.openjdk.org/jdk/pull/21824 From aturbanov at openjdk.org Wed Dec 4 14:51:14 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 4 Dec 2024 14:51:14 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor [v2] In-Reply-To: <7_TtV-XPXM9keWIqNqeVRIUILeOGsbA5xbpcCFSrUjE=.76b2bf92-0560-4051-aba4-43d3ff5de39a@github.com> References: <7_TtV-XPXM9keWIqNqeVRIUILeOGsbA5xbpcCFSrUjE=.76b2bf92-0560-4051-aba4-43d3ff5de39a@github.com> Message-ID: On Wed, 4 Dec 2024 13:42:09 GMT, Alexey Ivanov wrote: >> I really like how this line now fits in 80 characters limit. But if you insist - I will return it. > > That's what I thought. At the same time, it's only two columns longer than 80 chars a line. > > The usage of `final` modifiers seems inconsistent in the method. Maybe remove `final` from `localized` too? Then there would be no `final` modifiers till `hotPoint`. Remove more `final`s. Code _feels_ cleaner without them. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21824#discussion_r1869676986 From abhiscxk at openjdk.org Wed Dec 4 15:23:43 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 15:23:43 GMT Subject: RFR: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 [v2] In-Reply-To: <_BdiqNmVJuM7BJFOrf0HCl2eopRmnw-5tvbR1F2G0vo=.cb9c9ca3-057a-43c0-be61-f63f2e43d3c7@github.com> References: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> <_BdiqNmVJuM7BJFOrf0HCl2eopRmnw-5tvbR1F2G0vo=.cb9c9ca3-057a-43c0-be61-f63f2e43d3c7@github.com> Message-ID: On Wed, 4 Dec 2024 13:47:24 GMT, Prasanta Sadhukhan wrote: >> Test is failing in OCI system citing >> >> java.lang.Error: The scrollbar block increment is incorect >> at bug4865918.main(bug4865918.java:68) >> >> seemingly because focus is not in scrollbar..Added stability delay to make test execution wait after frame visibility and made frame to center of screen. >> Test passed in several OCI systems with this modification... > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > review LGTM. ------------- Marked as reviewed by abhiscxk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22540#pullrequestreview-2479075340 From abhiscxk at openjdk.org Wed Dec 4 15:31:41 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 4 Dec 2024 15:31:41 GMT Subject: RFR: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 [v2] In-Reply-To: <2O7GGuLK_QsL5geKbfkcVlO0XI_AwPm2a28ehyq-vy0=.2d94cdfa-e4c4-453f-9a61-afc80dbadeea@github.com> References: <2O7GGuLK_QsL5geKbfkcVlO0XI_AwPm2a28ehyq-vy0=.2d94cdfa-e4c4-453f-9a61-afc80dbadeea@github.com> Message-ID: On Wed, 4 Dec 2024 13:53:12 GMT, Prasanta Sadhukhan wrote: >> test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in OCI system citing >> >> Caused by: java.lang.RuntimeException: setFloating does not work correctly >> at bug4529206.lambda$main$3(bug4529206.java:90) >> at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) >> >> which suggests that the focus is not shifted from main frame to toolbar.. >> Added a stability waitForIdle and test passed in several OCI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > review Update test look good to me. ------------- Marked as reviewed by abhiscxk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22536#pullrequestreview-2479102698 From psadhukhan at openjdk.org Wed Dec 4 15:36:52 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 15:36:52 GMT Subject: Integrated: 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 In-Reply-To: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> References: <6BmRbTaFgYiu9vEWljaihmOFiKBAtIKKVfDJTp4tluI=.cb5e76c3-a8bc-4fd9-9855-a2142d106897@github.com> Message-ID: On Wed, 4 Dec 2024 09:18:51 GMT, Prasanta Sadhukhan wrote: > Test is failing in OCI system citing > > java.lang.Error: The scrollbar block increment is incorect > at bug4865918.main(bug4865918.java:68) > > seemingly because focus is not in scrollbar..Added stability delay to make test execution wait after frame visibility and made frame to center of screen. > Test passed in several OCI systems with this modification... This pull request has now been integrated. Changeset: 6f307623 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/6f307623568efe4d90942cd22ec9a26b2e1ca1b1 Stats: 37 lines in 1 file changed: 7 ins; 17 del; 13 mod 8345468: test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java fails in ubuntu22.04 Reviewed-by: abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22540 From psadhukhan at openjdk.org Wed Dec 4 15:40:45 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 4 Dec 2024 15:40:45 GMT Subject: Integrated: 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 07:04:58 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in OCI system citing > > Caused by: java.lang.RuntimeException: setFloating does not work correctly > at bug4529206.lambda$main$3(bug4529206.java:90) > at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) > > which suggests that the focus is not shifted from main frame to toolbar.. > Added a stability waitForIdle and test passed in several OCI systems This pull request has now been integrated. Changeset: 923321cf Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/923321cfb1a9c66ca0e8f843ff029fd161a19b5b Stats: 8 lines in 1 file changed: 2 ins; 0 del; 6 mod 8345447: test/jdk/javax/swing/JToolBar/4529206/bug4529206.java fails in ubuntu22.04 Reviewed-by: abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22536 From aivanov at openjdk.org Wed Dec 4 15:45:56 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 15:45:56 GMT Subject: RFR: 8340580: Characters in Document diagrams not in the middle Message-ID: This is a continuation to #20376, it moves the text in `Document-{insert,remove}.svg` down by 0.5 pixel. This change makes the text centred in the boxes. Here are quotes from https://github.com/openjdk/jdk/pull/20376#issuecomment-2353728939 and https://github.com/openjdk/jdk/pull/20376#issuecomment-2353743533: > At 200% scale and Arial font, there are 6 pixels on top of ?T? and ?h?, but there are 8 pixels on the bottom of ?q?. > > Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side. ------------- Commit messages: - 8340580: Characters in Document diagrams not in the middle Changes: https://git.openjdk.org/jdk/pull/22549/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22549&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8340580 Stats: 39 lines in 2 files changed: 0 ins; 0 del; 39 mod Patch: https://git.openjdk.org/jdk/pull/22549.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22549/head:pull/22549 PR: https://git.openjdk.org/jdk/pull/22549 From azvegint at openjdk.org Wed Dec 4 15:55:39 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Wed, 4 Dec 2024 15:55:39 GMT Subject: RFR: 8340580: Characters in Document diagrams not in the middle In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 15:40:31 GMT, Alexey Ivanov wrote: > This is a continuation to #20376, it moves the text in `Document-{insert,remove}.svg` down by 0.5 pixel. > > This change makes the text centred in the boxes. > > Here are quotes from https://github.com/openjdk/jdk/pull/20376#issuecomment-2353728939 and https://github.com/openjdk/jdk/pull/20376#issuecomment-2353743533: > >> At 200% scale and Arial font, there are 6 pixels on top of ?T? and ?h?, but there are 8 pixels on the bottom of ?q?. >> >> Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22549#pullrequestreview-2479176022 From duke at openjdk.org Wed Dec 4 16:34:42 2024 From: duke at openjdk.org (duke) Date: Wed, 4 Dec 2024 16:34:42 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 09:26:21 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > update test tag @GennadiyKrivoshein Your change (at version e31e61613b3ec526053ad92a4148d3f856812872) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22429#issuecomment-2517962248 From kizune at openjdk.org Wed Dec 4 17:12:43 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Wed, 4 Dec 2024 17:12:43 GMT Subject: RFR: 8340580: Characters in Document diagrams not in the middle In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 15:40:31 GMT, Alexey Ivanov wrote: > This is a continuation to #20376, it moves the text in `Document-{insert,remove}.svg` down by 0.5 pixel. > > This change makes the text centred in the boxes. > > Here are quotes from https://github.com/openjdk/jdk/pull/20376#issuecomment-2353728939 and https://github.com/openjdk/jdk/pull/20376#issuecomment-2353743533: > >> At 200% scale and Arial font, there are 6 pixels on top of ?T? and ?h?, but there are 8 pixels on the bottom of ?q?. >> >> Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side. Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22549#pullrequestreview-2479385099 From prr at openjdk.org Wed Dec 4 18:50:48 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 18:50:48 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. Thanks for the suggestion, but it isn't a path I want to go. The patch is still fine as it is. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2518266042 From aivanov at openjdk.org Wed Dec 4 19:00:58 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 19:00:58 GMT Subject: Integrated: 8340580: Characters in Document diagrams not in the middle In-Reply-To: References: Message-ID: <54ZyVTmDWDtqrNN2gPFsMon4Pvv5WeYc-AcczcydO6c=.371ee1cf-f327-4bad-a65e-db26a8aad527@github.com> On Wed, 4 Dec 2024 15:40:31 GMT, Alexey Ivanov wrote: > This is a continuation to #20376, it moves the text in `Document-{insert,remove}.svg` down by 0.5 pixel. > > This change makes the text centred in the boxes. > > Here are quotes from https://github.com/openjdk/jdk/pull/20376#issuecomment-2353728939 and https://github.com/openjdk/jdk/pull/20376#issuecomment-2353743533: > >> At 200% scale and Arial font, there are 6 pixels on top of ?T? and ?h?, but there are 8 pixels on the bottom of ?q?. >> >> Moving the text position by 0.5 seems to help, and the values become equal: 7 on either side. This pull request has now been integrated. Changeset: faa109e8 Author: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/faa109e8d40dbe8c6beb26bd8f9e5f6f63e4cab1 Stats: 39 lines in 2 files changed: 0 ins; 0 del; 39 mod 8340580: Characters in Document diagrams not in the middle Move text in Document-{insert,remove}.svg by 0.5 of pixel Reviewed-by: azvegint, kizune ------------- PR: https://git.openjdk.org/jdk/pull/22549 From prr at openjdk.org Wed Dec 4 19:16:43 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 19:16:43 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor [v2] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 14:51:14 GMT, Andrey Turbanov wrote: >> `Properties` doesn't allow `null` values. >> We can replace containsKey+getProperty with getProperty+null check. >> It's clearer and a bit faster. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > inline 'key' > remove 'final' from 'localized' too Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21824#pullrequestreview-2479688101 From prr at openjdk.org Wed Dec 4 19:20:48 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 19:20:48 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Mon, 25 Nov 2024 22:34:46 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with one additional commit since the last revision: > > 8342782: expanding wildcard imports > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1857389973 @azvegint @honkar-jdk @prsadhuk @TejeshR13 could one of you be the 2nd reviewer for this please. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21962#issuecomment-2518355626 From prr at openjdk.org Wed Dec 4 19:21:44 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 19:21:44 GMT Subject: RFR: 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS [v4] In-Reply-To: References: Message-ID: On Thu, 28 Nov 2024 07:28:25 GMT, GennadiyKrivoshein wrote: >> This update allows users to print with grayscale using color printers. >> Actually, it is not possible to use the "Monochrome" option from the "Color Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print grayscale on color printers ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)). >> >> **Fix description** >> When a printer supports color printing and a user adds Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the final printing raster is transformed to the grayscale color using java.awt.image.ColorConvertOp. When the job is a PostScript job, then the "setColor" and "setPaint" methods of the Graphics are overridden, and user colors (paints) are transformed to the grayscale form using the new proxy class GrayscaleProxyGraphics2D. >> >> This approach is assumed to be platform, CUPS, and IPP protocol independent. >> >> **Tests** >> The fix was tested on Ubuntu 22.04 and MacOS 12.6.1. > > GennadiyKrivoshein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > > # Conflicts: > # src/java.desktop/share/classes/sun/print/RasterPrinterJob.java > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > - move grayscale methods to PSPathGraphics > - Update src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java > > Co-authored-by: Andrey Turbanov > - update copyright > - formatting > - grammar fixes > - 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS @prsadhuk please look at this ------------- PR Comment: https://git.openjdk.org/jdk/pull/21930#issuecomment-2518357989 From prr at openjdk.org Wed Dec 4 19:22:45 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 19:22:45 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine In-Reply-To: References: Message-ID: On Thu, 21 Nov 2024 00:20:36 GMT, Daniel Gredler wrote: > When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). > > Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. @azvegint @TejeshR13 @prsadhuk @honkar-jdk - this needs a 2nd reviewer ------------- PR Comment: https://git.openjdk.org/jdk/pull/22288#issuecomment-2518359987 From prr at openjdk.org Wed Dec 4 19:25:41 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 19:25:41 GMT Subject: RFR: 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files In-Reply-To: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> References: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> Message-ID: On Thu, 14 Nov 2024 16:15:46 GMT, GennadiyKrivoshein wrote: > **Description:** > The PR updates sun.print.CUPSPrinter's behavior in terms of reading media imageable area values according to the PostScript Printer Description File Format Specification. > The actual implementation reads X and Y coordinates of the upper right corner of the imageable area as width and height of the imageable area. https://bugs.openjdk.org/browse/JDK-8344119 > > **Updates:** > Added subtraction of the X and Y coordinates of the lower left corner to fix the width and height values of the imageable area. > > **Tests:** > Tested with `test/jdk/javax/print/DialogMargins.java` using Brother DCP-T720DW, the test draws a black line along the borders of the imageable area. > The test was run with the minimum possible margins. > _Before the fix_: the right and bottom lines are not printed (the right and bottom lines are outside the printable area). > _After the fix_: all lines are printed. @prsadhuk please review ------------- PR Comment: https://git.openjdk.org/jdk/pull/22110#issuecomment-2518372176 From achung at openjdk.org Wed Dec 4 19:53:38 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 4 Dec 2024 19:53:38 GMT Subject: RFR: 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield [v2] In-Reply-To: <3_vX3P2Um340Vr9HCuhLxTYCTaqntCm_bnZun72byLI=.cc945e17-981d-450b-8b55-8854ddea3804@github.com> References: <3_vX3P2Um340Vr9HCuhLxTYCTaqntCm_bnZun72byLI=.cc945e17-981d-450b-8b55-8854ddea3804@github.com> Message-ID: <2KtcPR-x1ByPR9rXUtZB-IbHMdkE1JLfiGt6C2b2PFU=.abda0049-e63c-46ef-bad3-7e5fbf68e3d9@github.com> On Thu, 28 Nov 2024 03:05:27 GMT, Prasanta Sadhukhan wrote: >> When a textfield is embedded in a TableCellEditor in a JTable in Aqua L&F and space is entered and caret moved back and forth by pressing left/right arrow button, an artifact is seen, which is basically the caret is not properly repainted leaving behind its trails. >> >> When caret is moved, it is repainted every time by "damaging" the area surrounding the caret to cause it to be repainted in a new location. AquaCaret overrides the default "damage" code to intersect the caret area with the border insets so that it does not damage the AquaBorder area.. >> For TextField case, AquaTextFieldBorder insets is removed from AquaTextField and then intersected with AquaCaret to get the dirry region which is then repainted, so as to not damage the border but it is done irrespective of whether border is shown or not, so proper dirty region is not repainted leaving behind artifacts when the caret is moved around... >> >> Fix is to see if border to be painted is not opaque in which case the proper dirty region is calculated which is then used in repaint logic to repaint the component.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix test/jdk/javax/swing/JTable/TestCaretArtifact.java line 51: > 49: If artifact is seen, press Fail else press Pass."""; > 50: > 51: public static void main(String[] args) throws Exception { small nitpick but I think there's an extra whitespace here after void test/jdk/javax/swing/JTable/TestCaretArtifact.java line 62: > 60: > 61: > 62: public static JFrame createUI() { extra whitespace here too ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22416#discussion_r1870194336 PR Review Comment: https://git.openjdk.org/jdk/pull/22416#discussion_r1870194570 From achung at openjdk.org Wed Dec 4 20:00:41 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 4 Dec 2024 20:00:41 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v3] In-Reply-To: References: Message-ID: On Tue, 3 Dec 2024 09:26:21 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > update test tag test/jdk/java/awt/print/Dialog/PaperSizeError.java line 23: > 21: * questions. > 22: */ > 23: could you expand wildcard imports on this test and update copyright year? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22429#discussion_r1870202797 From aivanov at openjdk.org Wed Dec 4 20:07:43 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 4 Dec 2024 20:07:43 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor [v2] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 14:51:14 GMT, Andrey Turbanov wrote: >> `Properties` doesn't allow `null` values. >> We can replace containsKey+getProperty with getProperty+null check. >> It's clearer and a bit faster. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > inline 'key' > remove 'final' from 'localized' too Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21824#pullrequestreview-2479792155 From duke at openjdk.org Wed Dec 4 20:38:52 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Wed, 4 Dec 2024 20:38:52 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v4] In-Reply-To: References: Message-ID: > Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. > > **Reason of the bug:** > The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. > After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. > > For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. > *PaperDimension A4/A4: "595 842" > *PaperDimension BrA4_B/A4 (Borderless): "595 842" > After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. > After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". > > **Fix description:** > Create new MediaSize if there is no any other MediaSize with the same size. > > **Tests:** > OS: MacOS 12, Linux Ubuntu 22, Windows 11. > open/test/jdk/java/awt/print/Dialog/PaperSizeError.java > test/jdk/javax/print/CustomMediaSizeNameOOMETest.java > All tests from the test/jdk/javax/print/ GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: expand imports ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22429/files - new: https://git.openjdk.org/jdk/pull/22429/files/e31e6161..987131c6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=02-03 Stats: 11 lines in 1 file changed: 6 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/22429.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22429/head:pull/22429 PR: https://git.openjdk.org/jdk/pull/22429 From duke at openjdk.org Wed Dec 4 20:43:40 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Wed, 4 Dec 2024 20:43:40 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v3] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 19:57:41 GMT, Alisen Chung wrote: >> GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: >> >> update test tag > > test/jdk/java/awt/print/Dialog/PaperSizeError.java line 23: > >> 21: * questions. >> 22: */ >> 23: > > could you expand wildcard imports on this test and update copyright year? Done. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22429#discussion_r1870251256 From honkar at openjdk.org Wed Dec 4 21:23:40 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 4 Dec 2024 21:23:40 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine In-Reply-To: References: Message-ID: On Thu, 21 Nov 2024 00:20:36 GMT, Daniel Gredler wrote: > When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). > > Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. @gredler There is one other place where `expandArray()` is called similarly - [TextLine.getComponents()](https://github.com/openjdk/jdk/blob/bb7a66ce7b08a7f50da3194390c1d077a0b1fb81/src/java.desktop/share/classes/java/awt/font/TextLine.java#L1078C1-L1081C22). ------------- PR Review: https://git.openjdk.org/jdk/pull/22288#pullrequestreview-2479929617 From philip.race at oracle.com Wed Dec 4 21:24:58 2024 From: philip.race at oracle.com (Philip Race) Date: Wed, 4 Dec 2024 13:24:58 -0800 Subject: FYI: Draft JEP : JDK-8345525: Remove the Terminally Deprecated Applet API Message-ID: I just submitted? - in draft state - https://bugs.openjdk.org/browse/JDK-8345525 which proposes to finally remove the Applet API. -phil. From achung at openjdk.org Wed Dec 4 22:37:50 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 4 Dec 2024 22:37:50 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException Message-ID: When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. ------------- Commit messages: - init commit Changes: https://git.openjdk.org/jdk/pull/22564/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345144 Stats: 32 lines in 1 file changed: 32 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22564/head:pull/22564 PR: https://git.openjdk.org/jdk/pull/22564 From prr at openjdk.org Wed Dec 4 22:57:49 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 4 Dec 2024 22:57:49 GMT Subject: RFR: 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS [v4] In-Reply-To: References: Message-ID: On Thu, 28 Nov 2024 07:28:25 GMT, GennadiyKrivoshein wrote: >> This update allows users to print with grayscale using color printers. >> Actually, it is not possible to use the "Monochrome" option from the "Color Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print grayscale on color printers ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)). >> >> **Fix description** >> When a printer supports color printing and a user adds Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the final printing raster is transformed to the grayscale color using java.awt.image.ColorConvertOp. When the job is a PostScript job, then the "setColor" and "setPaint" methods of the Graphics are overridden, and user colors (paints) are transformed to the grayscale form using the new proxy class GrayscaleProxyGraphics2D. >> >> This approach is assumed to be platform, CUPS, and IPP protocol independent. >> >> **Tests** >> The fix was tested on Ubuntu 22.04 and MacOS 12.6.1. > > GennadiyKrivoshein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: > > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > > # Conflicts: > # src/java.desktop/share/classes/sun/print/RasterPrinterJob.java > - Merge remote-tracking branch 'openjdk/master' into monochrome-printing > - move grayscale methods to PSPathGraphics > - Update src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java > > Co-authored-by: Andrey Turbanov > - update copyright > - formatting > - grammar fixes > - 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS I've pointed out some issues. That does not mean these are the only issues. src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java line 794: > 792: BufferedImage bufferedImage = new BufferedImage((int)page.getWidth(), (int)page.getHeight(), > 793: BufferedImage.TYPE_INT_ARGB); > 794: Graphics2D g2 = bufferedImage.createGraphics(); The problem here is that the image is not at printer resolution. So it will be VERY grainy when printed. If you are doing this band printing you need to do something like what is happening in RasterPrinterJob. In fact probably defer to that. And this is definitely a "mis-use" of path graphics. On top of that I think it odd to create an image of BufferedImage.TYPE_INT_ARGB and then convert it to greyscale. Why not just create a BI of type BufferedImage.TYPE_USHORT_GRAY ? And then the conversion is done by 2D when drawing into it and there's no need to filter the image. I tested that but for whatever reason I needed to clear the image to white first. But I don't think you should be "here" if the only way you can do monochrome on mac is by printing a greyscale image. It should go to the existing code in RasterPrinterJob which will handle the resolution. It would be wrong to replicate that code here. I am not sure that code is used today in the mac printing path,. but it is the code that does what you need .. mostly. src/java.desktop/share/classes/sun/print/PSPathGraphics.java line 858: > 856: * @return grayscale BufferedImage > 857: */ > 858: private BufferedImage getGrayscaleImage(Image img) { This code is bizarre. Why not just draw to a grayscale image ? src/java.desktop/share/classes/sun/print/PSPrinterJob.java line 2: > 1: /* > 2: * Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved. Nothing changed here! src/java.desktop/share/classes/sun/print/RasterPrinterJob.java line 1173: > 1171: } > 1172: > 1173: protected boolean isAttributeCategorySupported(Class category) { hmm. Not sure why this isn't private, and why it has the same name as the PrintService method which can be confusing. It has one purpose and one use which is to ask if Chromaticity is supported so it can be clearer. src/java.desktop/share/classes/sun/print/RasterPrinterJob.java line 2413: > 2411: painterGraphics.dispose(); > 2412: if (monochrome) { > 2413: monochromeConverter.filter(band, band); Like I mentioned elsewhere, I think a greyscale image would mean you don't need to do this. However the code that sends the image to the printer needs a version that handles that format. Currently the Postscript code handles only BGR .. Also, this code is used on WINDOWS as well as other platforms, and monochrome is handled natively by the printer, so this looks like it is doing things that are unnecessary on that platform. ------------- Changes requested by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21930#pullrequestreview-2480062758 PR Review Comment: https://git.openjdk.org/jdk/pull/21930#discussion_r1870376113 PR Review Comment: https://git.openjdk.org/jdk/pull/21930#discussion_r1870379822 PR Review Comment: https://git.openjdk.org/jdk/pull/21930#discussion_r1870376422 PR Review Comment: https://git.openjdk.org/jdk/pull/21930#discussion_r1870385907 PR Review Comment: https://git.openjdk.org/jdk/pull/21930#discussion_r1870377584 From achung at openjdk.org Wed Dec 4 23:03:57 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 4 Dec 2024 23:03:57 GMT Subject: RFR: 8150564: Migrate useful ExtendedRobot methods into awt.Robot [v14] In-Reply-To: References: Message-ID: <2kMU9VE7ZdEWMrFaD1SJROeFhsHdIfHVHxow0JHGb0U=.463948af-8fdc-4ec7-a3a4-09615c3267ad@github.com> > 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: update specifications, replace default values in specifications with links to default var ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22044/files - new: https://git.openjdk.org/jdk/pull/22044/files/97e2424a..c3e5671a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=13 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22044&range=12-13 Stats: 35 lines in 1 file changed: 3 ins; 13 del; 19 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 lbourges at openjdk.org Wed Dec 4 23:40:42 2024 From: lbourges at openjdk.org (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Wed, 4 Dec 2024 23:40:42 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Mon, 25 Nov 2024 22:34:46 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with one additional commit since the last revision: > > 8342782: expanding wildcard imports > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1857389973 Marked as reviewed by lbourges (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21962#pullrequestreview-2456369033 From lbourges at openjdk.org Wed Dec 4 23:40:44 2024 From: lbourges at openjdk.org (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Wed, 4 Dec 2024 23:40:44 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Sat, 23 Nov 2024 08:18:52 GMT, Laurent Bourg?s wrote: >> src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java line 991: >> >>> 989: while (true) { >>> 990: if (++level > 500) >>> 991: return true; >> >> our coding standards require that you always include the body in { .. } > > 500 is magic number ? > I recommend using a constant explaining how this magic value has been determined empirically ? Please move comments into the code (implementation details) instead of javadoc. Do not mention '500' but say the rebalance threshold... ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1855148909 From lbourges at openjdk.org Wed Dec 4 23:40:46 2024 From: lbourges at openjdk.org (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Wed, 4 Dec 2024 23:40:46 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Sun, 24 Nov 2024 08:10:28 GMT, Jeremy wrote: >> src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java line 991: >> >>> 989: while (true) { >>> 990: if (++level > 500) >>> 991: return true; >> >> our coding standards require that you always include the body in { .. } > > @prrace : I added { .. } > > @bourgesl : I'm struggling to define this as a constant in a helpful way. Is there an example of a similar constant somewhere in the codebase you could refer me to for comparison? > > I think part of my challenge here is the AWTEventMulticaster doesn't promise to be any particular kind of tree. (For example: if it promised it was a self-balancing tree, then we'd know what our obligations were to meet that expectation.) > > This PR's implementation is intended to be a fast heuristic/educated guess, but it does not scan the entire height of the left or right node. This makes it ... hard for me to name. > > (Relatedly: the value 500 is arbitrary, and I'm happy to change it if someone would rather it be closer to 50 or 1000.) Here is a constant declaration (hotspot friendly): https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java#L38 private static final int ALL_BUT_LSB = 0xFFFFFFFE; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1855397860 From lbourges at openjdk.org Wed Dec 4 23:40:46 2024 From: lbourges at openjdk.org (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Wed, 4 Dec 2024 23:40:46 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> On Sun, 24 Nov 2024 08:51:59 GMT, Laurent Bourg?s wrote: >> @prrace : I added { .. } >> >> @bourgesl : I'm struggling to define this as a constant in a helpful way. Is there an example of a similar constant somewhere in the codebase you could refer me to for comparison? >> >> I think part of my challenge here is the AWTEventMulticaster doesn't promise to be any particular kind of tree. (For example: if it promised it was a self-balancing tree, then we'd know what our obligations were to meet that expectation.) >> >> This PR's implementation is intended to be a fast heuristic/educated guess, but it does not scan the entire height of the left or right node. This makes it ... hard for me to name. >> >> (Relatedly: the value 500 is arbitrary, and I'm happy to change it if someone would rather it be closer to 50 or 1000.) > > Here is a constant declaration (hotspot friendly): > https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java#L38 > > private static final int ALL_BUT_LSB = 0xFFFFFFFE; '500 iterations' looks high, maybe 100? It is a recursion ? You could try max recursion depth + 3 samples (first, middle, last) ? Or this magic threshold could be tunable ac runtime using special static getter using a System property + default value, used by constant declaration (final static is mandatory): https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L50 https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L303 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1855398578 From psadhukhan at openjdk.org Thu Dec 5 03:14:13 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 03:14:13 GMT Subject: RFR: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 Message-ID: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java tests movement of caret between word and fails in OCI citing java.lang.RuntimeException: Test failed. at bug4278839.main(bug4278839.java:92) which suggests caret is not moved as per expectation..It also seems the focus is not in the frame when the test start executing. Added robot delay and waitForIdle and it passed in several OCI systems ------------- Commit messages: - test fix Changes: https://git.openjdk.org/jdk/pull/22566/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22566&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345547 Stats: 21 lines in 1 file changed: 3 ins; 10 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/22566.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22566/head:pull/22566 PR: https://git.openjdk.org/jdk/pull/22566 From abhiscxk at openjdk.org Thu Dec 5 04:18:37 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 5 Dec 2024 04:18:37 GMT Subject: RFR: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 03:09:27 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java tests movement of caret between word and fails in OCI citing > > > java.lang.RuntimeException: Test failed. > at bug4278839.main(bug4278839.java:92) > > which suggests caret is not moved as per expectation..It also seems the focus is not in the frame when the test start executing. > Added robot delay and waitForIdle and it passed in several OCI systems test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java line 1: > 1: /* Please update copyright year. Wild imports. Remove author tag from jtreg block. L109 to L114.. can be replaced with lambda. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22566#discussion_r1870594858 From abhiscxk at openjdk.org Thu Dec 5 04:24:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 5 Dec 2024 04:24:38 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 22:33:41 GMT, Alisen Chung wrote: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Needs a CSR ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22564#issuecomment-2519062673 From psadhukhan at openjdk.org Thu Dec 5 04:26:17 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 04:26:17 GMT Subject: RFR: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: > test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java tests movement of caret between word and fails in OCI citing > > > java.lang.RuntimeException: Test failed. > at bug4278839.main(bug4278839.java:92) > > which suggests caret is not moved as per expectation..It also seems the focus is not in the frame when the test start executing. > Added robot delay and waitForIdle and it passed in several OCI systems Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22566/files - new: https://git.openjdk.org/jdk/pull/22566/files/64ea23e5..aee0cdbb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22566&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22566&range=00-01 Stats: 16 lines in 1 file changed: 6 ins; 4 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/22566.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22566/head:pull/22566 PR: https://git.openjdk.org/jdk/pull/22566 From psadhukhan at openjdk.org Thu Dec 5 04:26:17 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 04:26:17 GMT Subject: RFR: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 04:15:36 GMT, Abhishek Kumar wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> review > > test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java line 1: > >> 1: /* > > Please update copyright year. > Wild imports. > Remove author tag from jtreg block. > L109 to L114.. can be replaced with lambda. ok ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22566#discussion_r1870598713 From abhiscxk at openjdk.org Thu Dec 5 06:36:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 5 Dec 2024 06:36:38 GMT Subject: RFR: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 04:26:17 GMT, Prasanta Sadhukhan wrote: >> test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java tests movement of caret between word and fails in OCI citing >> >> >> java.lang.RuntimeException: Test failed. >> at bug4278839.main(bug4278839.java:92) >> >> which suggests caret is not moved as per expectation..It also seems the focus is not in the frame when the test start executing. >> Added robot delay and waitForIdle and it passed in several OCI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > review LGTM. ------------- Marked as reviewed by abhiscxk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22566#pullrequestreview-2480604031 From psadhukhan at openjdk.org Thu Dec 5 07:32:41 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 07:32:41 GMT Subject: Integrated: 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: <5eKz51KIeDN3VLxF6epsOeGXXT233720RhgfZVQTlDI=.59df93cf-2b3f-418f-94cb-f00504be26eb@github.com> On Thu, 5 Dec 2024 03:09:27 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java tests movement of caret between word and fails in OCI citing > > > java.lang.RuntimeException: Test failed. > at bug4278839.main(bug4278839.java:92) > > which suggests caret is not moved as per expectation..It also seems the focus is not in the frame when the test start executing. > Added robot delay and waitForIdle and it passed in several OCI systems This pull request has now been integrated. Changeset: e46d822a Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/e46d822aebee02d3cb4862c204293d388f6f3466 Stats: 37 lines in 1 file changed: 9 ins; 14 del; 14 mod 8345547: test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java fails in ubuntu22.04 Reviewed-by: abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22566 From aturbanov at openjdk.org Thu Dec 5 09:10:51 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 5 Dec 2024 09:10:51 GMT Subject: RFR: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor [v2] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 14:51:14 GMT, Andrey Turbanov wrote: >> `Properties` doesn't allow `null` values. >> We can replace containsKey+getProperty with getProperty+null check. >> It's clearer and a bit faster. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > inline 'key' > remove 'final' from 'localized' too Thank you for review! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21824#issuecomment-2519687285 From aturbanov at openjdk.org Thu Dec 5 09:10:52 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 5 Dec 2024 09:10:52 GMT Subject: Integrated: 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor In-Reply-To: References: Message-ID: On Fri, 1 Nov 2024 13:08:54 GMT, Andrey Turbanov wrote: > `Properties` doesn't allow `null` values. > We can replace containsKey+getProperty with getProperty+null check. > It's clearer and a bit faster. This pull request has now been integrated. Changeset: 3b7571d3 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/3b7571d37812472a2152f9c8cbfd2a4abdb35016 Stats: 10 lines in 1 file changed: 3 ins; 4 del; 3 mod 8345398: Avoid redundant Properties.containsKey call in Cursor.getSystemCustomCursor Reviewed-by: aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/21824 From shade at openjdk.org Thu Dec 5 09:23:43 2024 From: shade at openjdk.org (Aleksey Shipilev) Date: Thu, 5 Dec 2024 09:23:43 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 18:47:52 GMT, Phil Race wrote: > Thanks for the suggestion, but it isn't a path I want to go. The patch is still fine as it is. Well, the point of the review process is to get at least some reviewers to agree. I do not see anyone agreeing so far. My problem with current version is that exposing non-constant-foldable `Method/VarHandle`-s is a performance anti-pattern. I poked around the font code, and I have not been able to convince myself these accesses are never on the hot-path. I see this is also a _cache_, so I would think there is an expectation that most, if not all things in it work as fast as reasonably possible. Therefore, I cannot put my approval on current version, sorry. I do not quite understand what is the problem with stamping `@Stable` over the now-non-`final` fields in your current PR, like below? Is this only about the conceptual uncleanliness of exposing `@Stable` to `java.desktop`, or is it about something else? diff --git a/src/java.base/share/classes/module-info.java b/src/java.base/share/classes/module-info.java index c3bcbed4e3b..66ffff5723a 100644 --- a/src/java.base/share/classes/module-info.java +++ b/src/java.base/share/classes/module-info.java @@ -261,6 +261,7 @@ jdk.internal.vm.ci, jdk.jfr; exports jdk.internal.vm.annotation to + java.desktop, java.instrument, jdk.internal.vm.ci, jdk.incubator.vector, diff --git a/src/java.desktop/share/classes/sun/font/StrikeCache.java b/src/java.desktop/share/classes/sun/font/StrikeCache.java index e71235d54c0..5271afbe611 100644 --- a/src/java.desktop/share/classes/sun/font/StrikeCache.java +++ b/src/java.desktop/share/classes/sun/font/StrikeCache.java @@ -43,6 +43,8 @@ import java.lang.ref.WeakReference; import java.util.*; +import jdk.internal.vm.annotation.Stable; + import sun.java2d.Disposer; import sun.java2d.pipe.BufferedContext; import sun.java2d.pipe.RenderQueue; @@ -136,16 +138,16 @@ private static VarHandle getVarHandle(StructLayout struct, String name) { return MethodHandles.insertCoordinates(h, 1, 0L).withInvokeExactBehavior(); } - private static VarHandle xAdvanceHandle; - private static VarHandle yAdvanceHandle; - private static VarHandle widthHandle; - private static VarHandle heightHandle; - private static VarHandle rowBytesHandle; - private static VarHandle managedHandle; - private static VarHandle topLeftXHandle; - private static VarHandle topLeftYHandle; - private static VarHandle cellInfoHandle; - private static VarHandle imageHandle; + @Stable private static VarHandle xAdvanceHandle; + @Stable private static VarHandle yAdvanceHandle; + @Stable private static VarHandle widthHandle; + @Stable private static VarHandle heightHandle; + @Stable private static VarHandle rowBytesHandle; + @Stable private static VarHandle managedHandle; + @Stable private static VarHandle topLeftXHandle; + @Stable private static VarHandle topLeftYHandle; + @Stable private static VarHandle cellInfoHandle; + @Stable private static VarHandle imageHandle; private static VarHandle getXAdvanceHandle() { if (xAdvanceHandle == null) { ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2519724561 From psadhukhan at openjdk.org Thu Dec 5 10:09:48 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 10:09:48 GMT Subject: RFR: 8345566: Deproblemlist test/jdk/javax/swing/JComboBox/6559152/bug6559152.java Message-ID: test/jdk/javax/swing/JComboBox/6559152/bug6559152.java does not seem to fail in listed CI job but is problemlisted. Test is passing in several OCI systems so deproblemlisting.. ------------- Commit messages: - test fix Changes: https://git.openjdk.org/jdk/pull/22570/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22570&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345566 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/22570.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22570/head:pull/22570 PR: https://git.openjdk.org/jdk/pull/22570 From tr at openjdk.org Thu Dec 5 11:51:37 2024 From: tr at openjdk.org (Tejesh R) Date: Thu, 5 Dec 2024 11:51:37 GMT Subject: RFR: 8345566: Deproblemlist test/jdk/javax/swing/JComboBox/6559152/bug6559152.java In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 10:04:25 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JComboBox/6559152/bug6559152.java does not seem to fail in listed CI job but is problemlisted. > Test is passing in several OCI systems so deproblemlisting.. LGTM. ------------- Marked as reviewed by tr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22570#pullrequestreview-2481443545 From psadhukhan at openjdk.org Thu Dec 5 11:54:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 5 Dec 2024 11:54:39 GMT Subject: Integrated: 8345566: Deproblemlist test/jdk/javax/swing/JComboBox/6559152/bug6559152.java In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 10:04:25 GMT, Prasanta Sadhukhan wrote: > test/jdk/javax/swing/JComboBox/6559152/bug6559152.java does not seem to fail in listed CI job but is problemlisted. > Test is passing in several OCI systems so deproblemlisting.. This pull request has now been integrated. Changeset: 7ee84d8f Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/7ee84d8f7096ccfc4666d5bff78e7e5ac6d614bd Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod 8345566: Deproblemlist test/jdk/javax/swing/JComboBox/6559152/bug6559152.java Reviewed-by: tr ------------- PR: https://git.openjdk.org/jdk/pull/22570 From tr at openjdk.org Thu Dec 5 13:04:42 2024 From: tr at openjdk.org (Tejesh R) Date: Thu, 5 Dec 2024 13:04:42 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Mon, 25 Nov 2024 22:34:46 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with one additional commit since the last revision: > > 8342782: expanding wildcard imports > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1857389973 test/jdk/java/awt/event/StressTest/LargeAWTEventMulticasterTest.java line 96: > 94: } > 95: } > 96: } Please add an empty line representing EOF. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1871348260 From tr at openjdk.org Thu Dec 5 13:30:42 2024 From: tr at openjdk.org (Tejesh R) Date: Thu, 5 Dec 2024 13:30:42 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Mon, 25 Nov 2024 22:34:46 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with one additional commit since the last revision: > > 8342782: expanding wildcard imports > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1857389973 src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java line 1020: > 1018: return new AWTEventMulticaster(array[index0], array[index1]); > 1019: } > 1020: int mid = (index0 + index1)/2; Suggestion: int mid = (index0 + index1) / 2; ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1871376542 From dgredler at openjdk.org Thu Dec 5 18:22:27 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 5 Dec 2024 18:22:27 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v2] In-Reply-To: References: Message-ID: > When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). > > Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Fix second array expansion site ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22288/files - new: https://git.openjdk.org/jdk/pull/22288/files/bb7a66ce..4ca6782f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22288&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22288&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22288.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22288/head:pull/22288 PR: https://git.openjdk.org/jdk/pull/22288 From dgredler at openjdk.org Thu Dec 5 18:22:28 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 5 Dec 2024 18:22:28 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v2] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 21:20:37 GMT, Harshitha Onkar wrote: >> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix second array expansion site > > @gredler There is one other place where `expandArray()` is called similarly - [TextLine.getComponents()](https://github.com/openjdk/jdk/blob/bb7a66ce7b08a7f50da3194390c1d077a0b1fb81/src/java.desktop/share/classes/java/awt/font/TextLine.java#L1078C1-L1081C22). @honkar-jdk Good catch -- I've gone ahead and fixed that one, too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22288#issuecomment-2521103573 From aturbanov at openjdk.org Thu Dec 5 19:28:52 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 5 Dec 2024 19:28:52 GMT Subject: RFR: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element Message-ID: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> The Hashtable `javax.swing.text.html.parser.Element#contentTypes` is initialized only within `` block. We can replace it with immutable map to avoid Hashtable `synchronized` overhead. ------------- Commit messages: - [PATCH] Unnecessary Hashtable usage in javax.swing.text.html.parser.Element Changes: https://git.openjdk.org/jdk/pull/21825/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21825&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345616 Stats: 16 lines in 1 file changed: 0 ins; 5 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/21825.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21825/head:pull/21825 PR: https://git.openjdk.org/jdk/pull/21825 From achung at openjdk.org Thu Dec 5 19:52:40 2024 From: achung at openjdk.org (Alisen Chung) Date: Thu, 5 Dec 2024 19:52:40 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v4] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 20:38:52 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > expand imports Marked as reviewed by achung (Committer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2482720843 From honkar at openjdk.org Thu Dec 5 20:09:41 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 5 Dec 2024 20:09:41 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v2] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 18:22:27 GMT, Daniel Gredler wrote: >> When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). >> >> Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Fix second array expansion site LGTM. Ran awt/font and java/awt/font/LineBreakMeasurer tests with fix and they work as expected. @gredler Missed mentioning it earlier, copyright year needs to be updated for TextLine.java ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22288#pullrequestreview-2482750639 From dgredler at openjdk.org Thu Dec 5 20:27:16 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 5 Dec 2024 20:27:16 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v3] In-Reply-To: References: Message-ID: > When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). > > Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Update copyright year ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22288/files - new: https://git.openjdk.org/jdk/pull/22288/files/4ca6782f..557a3b18 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22288&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22288&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22288.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22288/head:pull/22288 PR: https://git.openjdk.org/jdk/pull/22288 From dgredler at openjdk.org Thu Dec 5 20:27:16 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 5 Dec 2024 20:27:16 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v2] In-Reply-To: References: Message-ID: <_zEttKve0-iK2bp7UpLLQ1Guo5ydJUDieAtlrTqiUV8=.1343a7f8-71ae-40d2-bdf3-52775673473e@github.com> On Thu, 5 Dec 2024 20:07:18 GMT, Harshitha Onkar wrote: >> Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix second array expansion site > > LGTM. Ran awt/font and java/awt/font/LineBreakMeasurer tests with fix and they work as expected. > > @gredler Missed mentioning it earlier, copyright year needs to be updated for TextLine.java @honkar-jdk Done! Let me know if there's anything else that catches your eye. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22288#issuecomment-2521320792 From honkar at openjdk.org Thu Dec 5 20:35:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 5 Dec 2024 20:35:39 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v3] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 20:27:16 GMT, Daniel Gredler wrote: >> When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). >> >> Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update copyright year > @honkar-jdk Done! Let me know if there's anything else that catches your eye. Looks good now. Re-approved. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22288#pullrequestreview-2482795873 From duke at openjdk.org Thu Dec 5 23:01:41 2024 From: duke at openjdk.org (duke) Date: Thu, 5 Dec 2024 23:01:41 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v3] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 20:27:16 GMT, Daniel Gredler wrote: >> When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). >> >> Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update copyright year @gredler Your change (at version 557a3b18f100b9b0302c2bdd2ad1ca6d73533b6a) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22288#issuecomment-2521650827 From dgredler at openjdk.org Thu Dec 5 23:01:41 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 5 Dec 2024 23:01:41 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 19:20:11 GMT, Phil Race wrote: >> When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). >> >> Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. > > @azvegint @TejeshR13 @prsadhuk @honkar-jdk - this needs a 2nd reviewer @prrace I think this is ready to be sponsored. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/22288#issuecomment-2521655008 From prr at openjdk.org Thu Dec 5 23:56:38 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 5 Dec 2024 23:56:38 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. A dependency on the internals of the base module is another reason not to do this. And as I have already said runtime performance is a complete non-issue here. This is about startup (not even warm-up, just startup). There's absolutely no (good) reason to worry about runtime here. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2521748701 From liach at openjdk.org Fri Dec 6 02:19:42 2024 From: liach at openjdk.org (Chen Liang) Date: Fri, 6 Dec 2024 02:19:42 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. Are you sure all these var handles are rarely used (not on hot code path)? This current patch can slow down the use of these var handles by many times. If this is startup-only, we can probably just create the vh once, invoke it, and discard it, or look into FFM API and see if we have better one-time invocation solutions. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2521939803 From prr at openjdk.org Fri Dec 6 02:54:40 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 6 Dec 2024 02:54:40 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 02:17:01 GMT, Chen Liang wrote: > Are you sure all these var handles are rarely used (not on hot code path)? This current patch can slow down the use of these var handles by many times. If this is startup-only, we can probably just create the vh once, invoke it, and discard it, or look into FFM API and see if we have better one-time invocation solutions. I don't know what you are thinking. Or perhaps you are overthinking it. You invented the reference to "rarely". Discarding would be silly. The FFM angle is understood by the Panama team. The patch stands. I've not seen a single suggestion to change it that makes sense for the problem. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2522011746 From psadhukhan at openjdk.org Fri Dec 6 03:21:49 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 6 Dec 2024 03:21:49 GMT Subject: Integrated: 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield In-Reply-To: References: Message-ID: On Wed, 27 Nov 2024 16:22:49 GMT, Prasanta Sadhukhan wrote: > When a textfield is embedded in a TableCellEditor in a JTable in Aqua L&F and space is entered and caret moved back and forth by pressing left/right arrow button, an artifact is seen, which is basically the caret is not properly repainted leaving behind its trails. > > When caret is moved, it is repainted every time by "damaging" the area surrounding the caret to cause it to be repainted in a new location. AquaCaret overrides the default "damage" code to intersect the caret area with the border insets so that it does not damage the AquaBorder area.. > For TextField case, AquaTextFieldBorder insets is removed from AquaTextField and then intersected with AquaCaret to get the dirry region which is then repainted, so as to not damage the border but it is done irrespective of whether border is shown or not, so proper dirty region is not repainted leaving behind artifacts when the caret is moved around... > > Fix is to see if border to be painted is not opaque in which case the proper dirty region is calculated which is then used in repaint logic to repaint the component.. This pull request has now been integrated. Changeset: 84032850 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/84032850dbe3add7b7c8d6a4b2fbd5d5cab4483a Stats: 103 lines in 2 files changed: 95 ins; 4 del; 4 mod 8268145: [macos] Rendering artifacts is seen when text inside the JTable with TableCellEditor having JTextfield Reviewed-by: kizune, abhiscxk, honkar ------------- PR: https://git.openjdk.org/jdk/pull/22416 From liach at openjdk.org Fri Dec 6 04:28:42 2024 From: liach at openjdk.org (Chen Liang) Date: Fri, 6 Dec 2024 04:28:42 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. >From the FFM API pov, we might be able to make the VarHandle lazy, that it contains symbolic information and is fully expanded upon first use, effectively the same as the laziness here. Don't know if this works for FFM, but this is how java lang invoke ones work if they have to initialize classes. If such laziness is implemented, we can always revisit the existing uses later. This patch is fine as long as there is no bad side effects. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2522095066 From prr at openjdk.org Fri Dec 6 04:57:41 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 6 Dec 2024 04:57:41 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 04:25:23 GMT, Chen Liang wrote: > From the FFM API pov, we might be able to make the VarHandle lazy, that it contains symbolic information and is fully expanded upon first use, effectively the same as the laziness here. Don't know if this works for FFM, but this is how java lang invoke ones work if they have to initialize classes. If such laziness is implemented, we can always revisit the existing uses later. This patch is fine as long as there is no bad side effects. So some day this patch may be obsolete ? So no reason to make it more complex. Bad side effects ? I think that is improbable. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2522127979 From psadhukhan at openjdk.org Fri Dec 6 06:50:09 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 6 Dec 2024 06:50:09 GMT Subject: RFR: 8334581: Remove no-arg constructor BasicSliderUI() Message-ID: The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. ------------- Commit messages: - jcheck - 8334581: Remove no-arg constructor BasicSliderUI() Changes: https://git.openjdk.org/jdk/pull/22598/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22598&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8334581 Stats: 10 lines in 1 file changed: 0 ins; 10 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22598.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22598/head:pull/22598 PR: https://git.openjdk.org/jdk/pull/22598 From abhiscxk at openjdk.org Fri Dec 6 06:59:40 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 6 Dec 2024 06:59:40 GMT Subject: RFR: 8334581: Remove no-arg constructor BasicSliderUI() In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 06:37:28 GMT, Prasanta Sadhukhan wrote: > The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. > > [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. Marked as reviewed by abhiscxk (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22598#pullrequestreview-2483792320 From abhiscxk at openjdk.org Fri Dec 6 07:05:41 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Fri, 6 Dec 2024 07:05:41 GMT Subject: RFR: 8334581: Remove no-arg constructor BasicSliderUI() In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 06:37:28 GMT, Prasanta Sadhukhan wrote: > The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. > > [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. Do we need a CSR for removal ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22598#issuecomment-2522282277 From aivanov at openjdk.org Fri Dec 6 11:09:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 6 Dec 2024 11:09:40 GMT Subject: RFR: 8334581: Remove no-arg constructor BasicSliderUI() In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 06:37:28 GMT, Prasanta Sadhukhan wrote: > The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. > > [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22598#pullrequestreview-2484418144 From azvegint at openjdk.org Fri Dec 6 12:59:36 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 6 Dec 2024 12:59:36 GMT Subject: RFR: 8334581: Remove no-arg constructor BasicSliderUI() In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 06:37:28 GMT, Prasanta Sadhukhan wrote: > The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. > > [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22598#pullrequestreview-2484774018 From azvegint at openjdk.org Fri Dec 6 13:10:46 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 6 Dec 2024 13:10:46 GMT Subject: RFR: 8344668: Unnecessary array allocations and copying in TextLine [v3] In-Reply-To: References: Message-ID: On Thu, 5 Dec 2024 20:27:16 GMT, Daniel Gredler wrote: >> When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). >> >> Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Update copyright year Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22288#pullrequestreview-2484796121 From dgredler at openjdk.org Fri Dec 6 13:10:48 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 6 Dec 2024 13:10:48 GMT Subject: Integrated: 8344668: Unnecessary array allocations and copying in TextLine In-Reply-To: References: Message-ID: On Thu, 21 Nov 2024 00:20:36 GMT, Daniel Gredler wrote: > When `LineBreakMeasurer` is used to break text into lines, internally it uses `TextMeasurer` and `TextLine` to do the job. In the common case, `TextLine.getComponents(...)` allocates a `TextLineComponent[]` with room for a single array entry, and passes it to `TextLine.createComponentsOnRun(...)`, which fills the array and returns it, optionally resizing to a larger array if necessary, after which the array is resized back down to actual size (if necessary). > > Unfortunately `TextLine.createComponentsOnRun(...)` is too eager in allocating larger arrays. In the most common case of a single component, this means that a single-element array is allocated, then a 9-element array is allocated (via `expandArray(...)`), and then another single-element array is allocated (to shrink the array back to actual size). Only one array allocation is necessary in this common case, and no array copying is needed. This pull request has now been integrated. Changeset: f6021a9c Author: Daniel Gredler URL: https://git.openjdk.org/jdk/commit/f6021a9c34da877bf954f5b90b4233949ec0ffc7 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod 8344668: Unnecessary array allocations and copying in TextLine Reviewed-by: honkar, azvegint, prr ------------- PR: https://git.openjdk.org/jdk/pull/22288 From mr at openjdk.org Fri Dec 6 14:11:39 2024 From: mr at openjdk.org (Mark Reinhold) Date: Fri, 6 Dec 2024 14:11:39 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. Phil, I don?t understand your resistance to using the `@Stable` annotation, which is already exported by the `java.base` module to five other JDK modules. Yes, it?s marked `internal`, but that means ?internal to the JDK,? not ?internal to the base module.? There?s no conceptual uncleanliness here. You could well be correct in saying that run-time performance is a complete non-issue, for all users at all times, but why not apply `@Stable` just in case it turns out to be an issue for some user at some time? Seems like cheap insurance. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2523331075 From liach at openjdk.org Fri Dec 6 14:26:41 2024 From: liach at openjdk.org (Chen Liang) Date: Fri, 6 Dec 2024 14:26:41 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. Stable annotation requires the class to be loaded by the boot loader. Need to verify that for java.desktop first. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2523359372 From aivanov at openjdk.org Fri Dec 6 14:40:36 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 6 Dec 2024 14:40:36 GMT Subject: RFR: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element In-Reply-To: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> References: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> Message-ID: On Fri, 1 Nov 2024 13:32:07 GMT, Andrey Turbanov wrote: > The Hashtable `javax.swing.text.html.parser.Element#contentTypes` is initialized only within `` block. > We can replace it with immutable map to avoid Hashtable `synchronized` overhead. Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21825#pullrequestreview-2485009600 From mr at openjdk.org Fri Dec 6 14:56:43 2024 From: mr at openjdk.org (Mark Reinhold) Date: Fri, 6 Dec 2024 14:56:43 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. `java.desktop` is loaded by the bootstrap class loader: https://github.com/openjdk/jdk/blob/496641955041c5e48359e6256a4a61812653d900/make/conf/module-loader-map.conf#L36 ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2523426886 From liach at openjdk.org Fri Dec 6 15:26:43 2024 From: liach at openjdk.org (Chen Liang) Date: Fri, 6 Dec 2024 15:26:43 GMT Subject: RFR: 8337505: Footprint and startup regressions up to 20% in GUI apps In-Reply-To: References: Message-ID: <1zbaDxzno6NMokIVMy9sKQPYbuhjXZ-xyFwMqhQzEqw=.502fb002-5ac4-4ebc-ad93-9bb2529af7d2@github.com> On Mon, 28 Oct 2024 21:26:38 GMT, Phil Race wrote: > https://bugs.openjdk.org/browse/JDK-8338677 already improved things for this so that's good. > > This fix adds to it lazy initialisation of VarHandles in StrikeCache at the cost of some extra code. > Since these VarHandles get used more or less immediately on Linux this new fix won't further improve matters there > But should help on Mac where they aren't usually needed at startup > And Windows is somewhere in between. Thanks for the verification Mark. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21748#issuecomment-2523487153 From honkar at openjdk.org Fri Dec 6 23:59:52 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 6 Dec 2024 23:59:52 GMT Subject: RFR: 8344637: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on Linux and Windows [v7] In-Reply-To: References: Message-ID: On Wed, 20 Nov 2024 19:07:28 GMT, Daniel Gredler wrote: >> This PR fixes the issue identified in JDK-8148334 in screenshots `Page8_landscape.JPG` and `Page8_portrait.JPG`. >> >> It does not address `mac_Page1.png` or `mac_Page8.png`, which I'm not even sure are still issues (I have no access to a Mac). >> >> The method in question, `PathGraphics.printedSimpleGlyphVector(...)` is quite complex, with many special cases being handled in different ways. In this specific scenario (page 8 of `PrintTextTest`), all special case checks fail, and we fall through all the way to the final handling block, which draws the individual characters one by one. It looks like the problem is that the font transform translation is applied twice, once via the glyph positions, and again by `drawString(...)` via the font. The proposed fix is to provide `drawString(...)` a font without any translation transform. >> >> Testing looks good on Linux, but needs to be done on Mac and Windows. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Add additional issue ID to PrintTextTest bug list Testing looks good on Windows and no regressions are observed on other pages. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/21980#pullrequestreview-2486168871 From honkar at openjdk.org Fri Dec 6 23:59:53 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 6 Dec 2024 23:59:53 GMT Subject: RFR: 8344637: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on Linux and Windows [v7] In-Reply-To: References: Message-ID: On Fri, 29 Nov 2024 18:12:06 GMT, Daniel Gredler wrote: >> src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java line 873: >> >>> 871: AffineTransform.getScaleInstance(scaleFactorX, scaleFactorY); >>> 872: advanceTransform.rotate(devangle); // radians >>> 873: advanceTransform.rotate(iangle * Math.PI / 1800.0); // 1/10 degrees -> radians >> >> Fix to WPathGraphics.java is a little more intricate and certainly requires a more expert review from @prrace. >> Was devangle fix added for the landscape issue observed on Pg#8 ? >> >> A earlier comment mentions that device space rotation must not be added. >> >> >> GDI advances must not include device space rotation. >> See earlier comment in printGlyphVector() for details. > > The two angles (`iangle` + `devangle`) need to be used to fix the Windows page 8 printed "GlyphVector with position adjustments" test case, here's what it looks like without these rotation angles (left side is printed and incorrect, right side is not printed and is correct): > > ![no-angle](https://github.com/user-attachments/assets/0366606d-b71c-4a4c-9d2c-402144aaf7d3) > > Adding `iangle` alone looks OK in the printed portrait page, but not in the printed landscape page (`devangle` is zero and therefore makes no difference when printing in portrait mode, but not so for landscape mode). > > This restores the rotation transformation that was being applied prior to commit 5c2672351683467fdeeda7796d971634fc3c51ae (prior to this commit the advance transform was a copy of the device transform, with the extra `iangle` rotation applied, meaning that both the device rotation and the `iangle` rotation were included). Thanks for including the details. Sounds reasonable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21980#discussion_r1874151081 From duke at openjdk.org Sun Dec 8 07:52:17 2024 From: duke at openjdk.org (Jeremy) Date: Sun, 8 Dec 2024 07:52:17 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: > The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. > > In the original headful test: > We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: > > java.desktop/java.awt.AWTEventMulticaster.removeInternal() > java.desktop/java.awt.AWTEventMulticaster.remove() > > > With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) > > JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. > > Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. Jeremy has updated the pull request incrementally with five additional commits since the last revision: - 8342782: move comments re implementation details inside method Also avoid restating constant, instead only refer to it as "threshold" This is in response to: https://github.com/openjdk/jdk/pull/21962#discussion_r1855148909 - 8342782: adding an empty line representing EOF This is in response to: https://github.com/openjdk/jdk/pull/21962#discussion_r1871348260 - 8342782: changing "/2" to " / 2" This is in response to: https://github.com/openjdk/jdk/pull/21962#discussion_r1871376542 - 8342782: change threshold from 500 to 100 This is in response to: https://github.com/openjdk/jdk/pull/21962#discussion_r1855398578 - 8342782: convert value (500) to named constant This is in response to: https://github.com/openjdk/jdk/pull/21962#discussion_r1855397860 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/21962/files - new: https://git.openjdk.org/jdk/pull/21962/files/ed6a585a..f2212092 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=21962&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21962&range=04-05 Stats: 14 lines in 2 files changed: 6 ins; 5 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/21962.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21962/head:pull/21962 PR: https://git.openjdk.org/jdk/pull/21962 From duke at openjdk.org Sun Dec 8 07:52:17 2024 From: duke at openjdk.org (Jeremy) Date: Sun, 8 Dec 2024 07:52:17 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> Message-ID: <8P1Txs_3sgpJ5DNgDCl9Vkhzg_U0gndc_E_vj-Mrrbg=.54aae5ed-ed9f-4776-b2aa-6fc3d0361d72@github.com> On Sun, 24 Nov 2024 08:55:20 GMT, Laurent Bourg?s wrote: >> Here is a constant declaration (hotspot friendly): >> https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java#L38 >> >> private static final int ALL_BUT_LSB = 0xFFFFFFFE; > > '500 iterations' looks high, maybe 100? > It is a recursion ? You could try max recursion depth + 3 samples (first, middle, last) ? > > Or this magic threshold could be tunable ac runtime using special static getter using a System property + default value, used by constant declaration (final static is mandatory): > > https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L50 > > https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L303 I added a constant `MAX_UNBALANCED_TOP_NODES = 100`, and I moved some comments from outside the method to inside the method. Regarding recursion: I'm reluctant to explore the tree recursively because I want `needsRebalance` to be a light/fast call. (It will be called with every addition.) The primary use case I'm worried about is code that resembles this example in Container.java: public synchronized void addContainerListener(ContainerListener l) { if (l == null) { return; } containerListener = AWTEventMulticaster.add(containerListener, l); newEventsOnly = true; } There are several of these static `AWTEventMulticaster.add(X, X)` methods. This is (IMO) the recommended/primary way to interact with the AWTEventMulticaster. This implementation (without rebalancing) created a tree where the *top* of the tree was guaranteed to be unbalanced. (Specifically: every left node may be a tree, and every right node will be a leaf.) It's not necessary to recursively scan the entire tree to identify this condition, so I'd prefer not to make `needsRebalance` more complex than it needs to be to identify this usage. (That is: there's no need to look at the middle or bottom of the tree, or even to identify the size or height of the tree.) Regarding a System property: I'm also reluctant to add this; it feels like bloat to me that nobody will ever use. Do you think you (or anyone else) will want to customize this property over time? My broad goal here is to prevent a StackOverflowError; not to fine-tune tree performance. I definitely appreciate seeing `System.getProperty("x")` in several important pieces of code, but IMO altering the `MAX_UNBALANCED_TOP_NODES` field will only ever yield negligible changes. (Or that could be the subject of another ticket, with another test case?) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1874643208 From duke at openjdk.org Sun Dec 8 07:52:17 2024 From: duke at openjdk.org (Jeremy) Date: Sun, 8 Dec 2024 07:52:17 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v5] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Thu, 5 Dec 2024 13:22:01 GMT, Tejesh R wrote: >> Jeremy has updated the pull request incrementally with one additional commit since the last revision: >> >> 8342782: expanding wildcard imports >> >> This is in response to: >> https://github.com/openjdk/jdk/pull/21962#discussion_r1857389973 > > src/java.desktop/share/classes/java/awt/AWTEventMulticaster.java line 1020: > >> 1018: return new AWTEventMulticaster(array[index0], array[index1]); >> 1019: } >> 1020: int mid = (index0 + index1)/2; > > Suggestion: > > int mid = (index0 + index1) / 2; OK; this is updated > test/jdk/java/awt/event/StressTest/LargeAWTEventMulticasterTest.java line 96: > >> 94: } >> 95: } >> 96: } > > Please add an empty line representing EOF. OK; this is updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1874638586 PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1874638707 From duke at openjdk.org Sun Dec 8 19:47:42 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 8 Dec 2024 19:47:42 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v8] In-Reply-To: <1CpHIs0qKh3uC4ay98jOj6Gj-k-qVAuSuDVHMnbKjuM=.73576799-e268-478d-9fcb-778c84f626a1@github.com> References: <1CpHIs0qKh3uC4ay98jOj6Gj-k-qVAuSuDVHMnbKjuM=.73576799-e268-478d-9fcb-778c84f626a1@github.com> Message-ID: On Tue, 3 Dec 2024 22:09:57 GMT, Phil Race wrote: >> ScientificWare has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 20 commits: >> >> - 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 >> - Removes files >> >> make/javac.20231014_162919.args >> make/javac.20231014_220237.args >> make/javac.20231023_221655.args >> - Adds a regression test for JDK-8314731. >> - Others changes in the working directory. >> - Merge Master >> - Merge master >> - ... and 10 more: https://git.openjdk.org/jdk/compare/352201dd...de644539 > > test/jdk/javax/swing/text/html/bug8314731.java line 51: > >> 49: >> 50: public static void main(String[] args) throws Exception { >> 51: new bug8314731(); > > the UI needs to be created on the EDT using SwingUtilities.invokeAndWait. > And you need use a finally block to be SURE the Frame is disposed, else the test will just sit there. > > Please make sure you have used jtreg to validate this test. Test Passed with JDK master patched

----------System.out:(1/3)---------- ok ----------System.err:(1/15)---------- STATUS:Passed. ----------rerun:(40/2653)*---------- cd /home/scientificwaredev/Documents/openjdk-sources/JTwork/scratch && \\ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \\ DESKTOP_SESSION=01plasma \\ DISPLAY=:0 \\ HOME=/home/scientificwaredev \\ LANG=fr_FR.UTF-8 \\ PATH=/bin:/usr/bin:/usr/sbin \\ XDG_CONFIG_DIRS=/home/scientificwaredev/.config/kdedefaults:/etc/xdg:/etc/xdg/kf5:/var/lib/plasma5-profiles/common/xdg \\ XDG_CURRENT_DESKTOP=KDE \\ XDG_DATA_DIRS=/home/scientificwaredev/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share \\ XDG_MENU_PREFIX=plasma- \\ XDG_RUNTIME_DIR=/run/user/1000 \\ XDG_SEAT=seat0 \\ XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 \\ XDG_SESSION_CLASS=user \\ XDG_SESSION_DESKTOP=KDE \\ XDG_SESSION_ID=c2 \\ XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 \\ XDG_SESSION_TYPE=x11 \\ XDG_VTNR=2 \\ XMODIFIERS=@im=none \\ CLASSPATH=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d:/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html:/home/scientificwaredev/Documents/jtreg/lib/javatest.jar:/home/scientificwaredev/Documents/jtreg/lib/jtreg.jar \\ /home/scientificwaredev/Documents/openjdk-sources/jdk/build/linux-x86_64-server-release/jdk/bin/java \\ -Dtest.vm.opts= \\ -Dtest.tool.vm.opts= \\ -Dtest.compiler.opts= \\ -Dtest.java.opts= \\ -Dtest.jdk=/home/scientificwaredev/Documents/openjdk-sources/jdk/build/linux-x86_64-server-release/jdk \\ -Dcompile.jdk=/home/scientificwaredev/Documents/openjdk-sources/jdk/build/linux-x86_64-server-release/jdk \\ -Dtest.timeout.factor=1.0 \\ -Dtest.root=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk \\ -Dtest.name=javax/swing/text/html/bug8314731.java \\ -Dtest.file=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html/bug8314731.java \\ -Dtest.src=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html \\ -Dtest.src.path=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html \\ -Dtest.classes=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d \\ -Dtest.class.path=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d \\ -Dtest.modules=java.desktop \\ --add-modules java.desktop \\ com.sun.javatest.regtest.agent.MainWrapper /home/scientificwaredev/Documents/openjdk-sources/JTwork/javax/swing/text/html/bug8314731.d/main.0.jta result: Passed. Execution successful test result: Passed. Execution successful
Test Failed with JDK 23.0.1.
----------System.out:(0/0)---------- ----------System.err:(11/728)---------- java.lang.RuntimeException: FormView doesn't support the alt attribute, see JDK-8314731. at bug8314731.main(bug8314731.java:57) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1575) JavaTest Message: Test threw exception: java.lang.RuntimeException: FormView doesn't support the alt attribute, see JDK-8314731. JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.lang.RuntimeException: FormView doesn't support the alt attribute, see JDK-8314731. ----------rerun:(40/2512)*---------- cd /home/scientificwaredev/Documents/openjdk-sources/JTwork/scratch && \\ DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \\ DESKTOP_SESSION=01plasma \\ DISPLAY=:0 \\ HOME=/home/scientificwaredev \\ LANG=fr_FR.UTF-8 \\ PATH=/bin:/usr/bin:/usr/sbin \\ XDG_CONFIG_DIRS=/home/scientificwaredev/.config/kdedefaults:/etc/xdg:/etc/xdg/kf5:/var/lib/plasma5-profiles/common/xdg \\ XDG_CURRENT_DESKTOP=KDE \\ XDG_DATA_DIRS=/home/scientificwaredev/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share \\ XDG_MENU_PREFIX=plasma- \\ XDG_RUNTIME_DIR=/run/user/1000 \\ XDG_SEAT=seat0 \\ XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 \\ XDG_SESSION_CLASS=user \\ XDG_SESSION_DESKTOP=KDE \\ XDG_SESSION_ID=c2 \\ XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1 \\ XDG_SESSION_TYPE=x11 \\ XDG_VTNR=2 \\ XMODIFIERS=@im=none \\ CLASSPATH=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d:/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html:/home/scientificwaredev/Documents/jtreg/lib/javatest.jar:/home/scientificwaredev/Documents/jtreg/lib/jtreg.jar \\ /home/scientificwaredev/Documents/jdk-23.0.1/bin/java \\ -Dtest.vm.opts= \\ -Dtest.tool.vm.opts= \\ -Dtest.compiler.opts= \\ -Dtest.java.opts= \\ -Dtest.jdk=/home/scientificwaredev/Documents/jdk-23.0.1 \\ -Dcompile.jdk=/home/scientificwaredev/Documents/jdk-23.0.1 \\ -Dtest.timeout.factor=1.0 \\ -Dtest.root=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk \\ -Dtest.name=javax/swing/text/html/bug8314731.java \\ -Dtest.file=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html/bug8314731.java \\ -Dtest.src=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html \\ -Dtest.src.path=/home/scientificwaredev/Documents/openjdk-sources/jdk/test/jdk/javax/swing/text/html \\ -Dtest.classes=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d \\ -Dtest.class.path=/home/scientificwaredev/Documents/openjdk-sources/JTwork/classes/javax/swing/text/html/bug8314731.d \\ -Dtest.modules=java.desktop \\ --add-modules java.desktop \\ com.sun.javatest.regtest.agent.MainWrapper /home/scientificwaredev/Documents/openjdk-sources/JTwork/javax/swing/text/html/bug8314731.d/main.0.jta result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: FormView doesn't support the alt attribute, see JDK-8314731. test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: FormView doesn't support the alt attribute, see JDK-8314731.
------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15319#discussion_r1875026909 From duke at openjdk.org Sun Dec 8 19:59:23 2024 From: duke at openjdk.org (ScientificWare) Date: Sun, 8 Dec 2024 19:59:23 GMT Subject: RFR: JDK-8314731 : Add support for the alt attribute in the image type input HTML tag [v9] In-Reply-To: References: Message-ID: > 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 = """ > > > >

> >

> 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 - Removes files make/javac.20231014_162919.args make/javac.20231014_220237.args make/javac.20231023_221655.args - Adds a regression test for JDK-8314731. - ... and 13 more: https://git.openjdk.org/jdk/compare/c517ffba...7464eee4 ------------- Changes: https://git.openjdk.org/jdk/pull/15319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=08 Stats: 183 lines in 2 files changed: 133 ins; 1 del; 49 mod Patch: https://git.openjdk.org/jdk/pull/15319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319 PR: https://git.openjdk.org/jdk/pull/15319 From psadhukhan at openjdk.org Mon Dec 9 05:36:17 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 9 Dec 2024 05:36:17 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 Message-ID: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane Verifier 2 passed Verifier 3 passed Verifier 4 passed ----------System.err:(11/842)---------- java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue ------------- Commit messages: - Test fix Changes: https://git.openjdk.org/jdk/pull/22631/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22631&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345767 Stats: 12 lines in 1 file changed: 10 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22631/head:pull/22631 PR: https://git.openjdk.org/jdk/pull/22631 From abhiscxk at openjdk.org Mon Dec 9 06:47:38 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Mon, 9 Dec 2024 06:47:38 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 05:31:35 GMT, Prasanta Sadhukhan wrote: > javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing > > > Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane > Verifier 2 passed > Verifier 3 passed > Verifier 4 passed > ----------System.err:(11/842)---------- > java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel > > > seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue test/jdk/javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java line 1: > 1: /* Few changes can be done. 1. Frame title can be added. 2. Calling frame.pack() and frame.setSize() is redundant. 3. Few lines are crossing the column limit. (Including comments) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22631#discussion_r1875438164 From psadhukhan at openjdk.org Mon Dec 9 07:00:19 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 9 Dec 2024 07:00:19 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> > javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing > > > Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane > Verifier 2 passed > Verifier 3 passed > Verifier 4 passed > ----------System.err:(11/842)---------- > java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel > > > seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22631/files - new: https://git.openjdk.org/jdk/pull/22631/files/c96cdc8d..0b3de433 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22631&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22631&range=00-01 Stats: 10 lines in 1 file changed: 4 ins; 1 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/22631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22631/head:pull/22631 PR: https://git.openjdk.org/jdk/pull/22631 From duke at openjdk.org Mon Dec 9 09:56:15 2024 From: duke at openjdk.org (ScientificWare) Date: Mon, 9 Dec 2024 09:56:15 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: > 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 = """ > > > >

> >

> 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 ------------- Changes: https://git.openjdk.org/jdk/pull/15319/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15319&range=09 Stats: 137 lines in 2 files changed: 133 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/15319.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/15319/head:pull/15319 PR: https://git.openjdk.org/jdk/pull/15319 From ihse at openjdk.org Mon Dec 9 12:12:13 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 12:12:13 GMT Subject: RFR: 8345793: Update copyright year to 2024 for the build system in files where it was missed Message-ID: Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. I have located these modified files using: git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list and then run a script to update the copyright year to 2024 on these files. I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. ------------- Commit messages: - 8345793: Update copyright year to 2024 for the build system in files where it was missed Changes: https://git.openjdk.org/jdk/pull/22636/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22636&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345793 Stats: 71 lines in 71 files changed: 0 ins; 0 del; 71 mod Patch: https://git.openjdk.org/jdk/pull/22636.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22636/head:pull/22636 PR: https://git.openjdk.org/jdk/pull/22636 From ihse at openjdk.org Mon Dec 9 12:22:25 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 12:22:25 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed Message-ID: Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. I have located these modified files using: git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list and then run a script to update the copyright year to 2024 on these files. I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. ------------- Commit messages: - 8345797: Update copyright year to 2024 for client-libs in files where it was missed Changes: https://git.openjdk.org/jdk/pull/22638/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22638&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345797 Stats: 326 lines in 344 files changed: 0 ins; 0 del; 326 mod Patch: https://git.openjdk.org/jdk/pull/22638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22638/head:pull/22638 PR: https://git.openjdk.org/jdk/pull/22638 From ihse at openjdk.org Mon Dec 9 12:34:53 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 12:34:53 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed Message-ID: Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. I have located these modified files using: git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list and then run a script to update the copyright year to 2024 on these files. I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. ------------- Commit messages: - 8345799: Update copyright year to 2024 for core-libs in files where it was missed Changes: https://git.openjdk.org/jdk/pull/22640/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22640&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345799 Stats: 432 lines in 436 files changed: 0 ins; 0 del; 432 mod Patch: https://git.openjdk.org/jdk/pull/22640.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22640/head:pull/22640 PR: https://git.openjdk.org/jdk/pull/22640 From ihse at openjdk.org Mon Dec 9 12:37:37 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 12:37:37 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Add more client files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22638/files - new: https://git.openjdk.org/jdk/pull/22638/files/49387718..e196d3f6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22638&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22638&range=00-01 Stats: 16 lines in 17 files changed: 0 ins; 0 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/22638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22638/head:pull/22638 PR: https://git.openjdk.org/jdk/pull/22638 From ihse at openjdk.org Mon Dec 9 13:03:06 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 13:03:06 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Add more core-libs files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22640/files - new: https://git.openjdk.org/jdk/pull/22640/files/e7cfe0f7..8e040c3a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22640&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22640&range=00-01 Stats: 9 lines in 9 files changed: 0 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/22640.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22640/head:pull/22640 PR: https://git.openjdk.org/jdk/pull/22640 From dfuchs at openjdk.org Mon Dec 9 13:30:43 2024 From: dfuchs at openjdk.org (Daniel Fuchs) Date: Mon, 9 Dec 2024 13:30:43 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 13:03:06 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Add more core-libs files changes to sun.net and java.naming/jdk.naming.* look ok ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2527957595 From kevinw at openjdk.org Mon Dec 9 14:02:39 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 9 Dec 2024 14:02:39 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 13:03:06 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Add more core-libs files Looks good. They all seem to follow the pattern, I looked at some and yes they have changes in 2024 but no year update. One of them was mine I noticed! ------------- Marked as reviewed by kevinw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2488883450 From rriggs at openjdk.org Mon Dec 9 15:19:38 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 9 Dec 2024 15:19:38 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 13:03:06 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Add more core-libs files Copyright dates in third party files are not updated uniformly. See the previous comment. That git query isn't correct for all the files in the repo. In particular, the copyrights on third party files are NOT updated uniformly when new versions are applied. In particular, XML files are NOT updated. ------------- Changes requested by rriggs (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2489132284 PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2528303669 From kevinw at openjdk.org Mon Dec 9 15:28:38 2024 From: kevinw at openjdk.org (Kevin Walls) Date: Mon, 9 Dec 2024 15:28:38 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 13:03:06 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Add more core-libs files I also meant to note that there are updates to binaries, src/java.base/share/classes/jdk/internal/icu/impl/data/icudt76b/... which maybe isn't intentional, or I just don't understand? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2528357715 From ihse at openjdk.org Mon Dec 9 15:42:57 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 15:42:57 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Revert changes to binary files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22640/files - new: https://git.openjdk.org/jdk/pull/22640/files/8e040c3a..c8d541f9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22640&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22640&range=01-02 Stats: 0 lines in 4 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22640.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22640/head:pull/22640 PR: https://git.openjdk.org/jdk/pull/22640 From ihse at openjdk.org Mon Dec 9 15:42:57 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 15:42:57 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:26:00 GMT, Kevin Walls wrote: > I also meant to note that there are updates to binaries, src/java.base/share/classes/jdk/internal/icu/impl/data/icudt76b/... which maybe isn't intentional, or I just don't understand? That was certainly not intentional! I'm not sure how that happened, I need to look at my copyright update script again... ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2528425161 From ihse at openjdk.org Mon Dec 9 15:48:38 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 15:48:38 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:16:10 GMT, Roger Riggs wrote: > That git query isn't correct for all the files in the repo. In particular, the copyrights on third party files are NOT updated uniformly when new versions are applied. In particular, XML files are NOT updated. I'm not sure I understand what you mean. Are you saying that I did not update files that should have been updated, or that I updated files that should not have been updated? The only 3rd party XML files I know about are the ones in `make/data/cldr`. They have certainly been updated in 2024 from upstream, but they do not carry an Oracle copyright header, so there is nothing there to update. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2528451279 From joehw at openjdk.org Mon Dec 9 17:44:40 2024 From: joehw at openjdk.org (Joe Wang) Date: Mon, 9 Dec 2024 17:44:40 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files The git query found all those java.xml properties files likely due to the jcheck change (JDK-8325558) you made. That patch correctly kept the copyright years as they were since we generally don't change copyright year unless the change is significant. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2528864312 From prr at openjdk.org Mon Dec 9 18:15:43 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 9 Dec 2024 18:15:43 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: <-CBeobDgFBPLaO0HJADt-SzXLUbrgCDhklHTiElA2RY=.7ec7eede-d6aa-4189-b6f1-5b23250a7512@github.com> On Mon, 9 Dec 2024 12:37:37 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Add more client files There's an image (JPG) file in this list ! Why ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22638#issuecomment-2528980141 From ihse at openjdk.org Mon Dec 9 19:04:44 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 19:04:44 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v2] In-Reply-To: <-CBeobDgFBPLaO0HJADt-SzXLUbrgCDhklHTiElA2RY=.7ec7eede-d6aa-4189-b6f1-5b23250a7512@github.com> References: <-CBeobDgFBPLaO0HJADt-SzXLUbrgCDhklHTiElA2RY=.7ec7eede-d6aa-4189-b6f1-5b23250a7512@github.com> Message-ID: <08brSTaz5WLn_Hv1i0feMAZUYn-GnboDXiKPBZh_VIg=.25d76d8b-3c31-45c1-bfeb-39e5b2ad641d@github.com> On Mon, 9 Dec 2024 18:13:25 GMT, Phil Race wrote: > There's an image (JPG) file in this list ! Why ? That is indeed a very good question. I got a few other modified binary files as well; I can't say why. I am basically doing a sed for `Copyright (c) ... Oracle`, and I have double-checked that there are no such strings in that file. ... ohhh... I think I get it, sed might have mistaken CRLF as line endings and converted it to pure LF. I'll revert it anyway. Thanks for spotting. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22638#issuecomment-2529120261 From ihse at openjdk.org Mon Dec 9 19:11:05 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Mon, 9 Dec 2024 19:11:05 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Revert mistakenly modified binary files ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22638/files - new: https://git.openjdk.org/jdk/pull/22638/files/e196d3f6..973f9573 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22638&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22638&range=01-02 Stats: 0 lines in 19 files changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22638.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22638/head:pull/22638 PR: https://git.openjdk.org/jdk/pull/22638 From joehw at openjdk.org Mon Dec 9 19:53:38 2024 From: joehw at openjdk.org (Joe Wang) Date: Mon, 9 Dec 2024 19:53:38 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files Marked as reviewed by joehw (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2489899005 From honkar at openjdk.org Mon Dec 9 20:11:37 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 9 Dec 2024 20:11:37 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> References: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> Message-ID: On Mon, 9 Dec 2024 07:00:19 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing >> >> >> Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane >> Verifier 2 passed >> Verifier 3 passed >> Verifier 4 passed >> ----------System.err:(11/842)---------- >> java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel >> >> >> seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review Apart from the following suggestions, test changes LGTM and work as expected on x11 & wayland. Ln#174: Is it better to move the button click to the center of the btn for stability? robot.mouseMove(buttonLoc.x + button.getWidth() / 2, buttonLoc.y + button.getHeight() / 2); Ln#230: `frame = null` is not required in disposeFrame() and can be removed. ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22631#pullrequestreview-2489974117 From honkar at openjdk.org Mon Dec 9 20:49:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 9 Dec 2024 20:49:36 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 22:33:41 GMT, Alisen Chung wrote: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Doc changes look good to me. As @kumarabhi006 pointed, a corresponding CSR is required. I have the same question as @azvegint suggested earlier: In case of robot.delay() is it good to have a recommendation - "to not call on EDT" or would it be better if the check is done by the method itself to avoid relying on the end-user to check it? public void delay(int ms) { if (isEventDispatchThread()) { throw new IllegalThreadStateException("delay() called on EDT"); } ------------- PR Review: https://git.openjdk.org/jdk/pull/22564#pullrequestreview-2490046593 From rriggs at openjdk.org Mon Dec 9 21:11:40 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Mon, 9 Dec 2024 21:11:40 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v2] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:45:42 GMT, Magnus Ihse Bursie wrote: >> That git query isn't correct for all the files in the repo. In particular, the copyrights on third party files are NOT updated uniformly when new versions are applied. In particular, XML files are NOT updated. > >> That git query isn't correct for all the files in the repo. In particular, the copyrights on third party files are NOT updated uniformly when new versions are applied. In particular, XML files are NOT updated. > > I'm not sure I understand what you mean. Are you saying that I did not update files that should have been updated, or that I updated files that should not have been updated? > > The only 3rd party XML files I know about are the ones in `make/data/cldr`. They have certainly been updated in 2024 from upstream, but they do not carry an Oracle copyright header, so there is nothing there to update. @magicus My question was about third party (xml) code used from Apache. Joe's review and approval resolved that question. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2529462025 From dnguyen at openjdk.org Mon Dec 9 21:13:38 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 9 Dec 2024 21:13:38 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> References: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> Message-ID: On Mon, 9 Dec 2024 07:00:19 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing >> >> >> Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane >> Verifier 2 passed >> Verifier 3 passed >> Verifier 4 passed >> ----------System.err:(11/842)---------- >> java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel >> >> >> seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review I only checked this on x11, but works as I expect on Ubuntu 22.04. Also ran it with 50 repeats and it looks OK, however for similar Ubuntu 22.04 fixes, I've had some 50 repeat jobs pass while the failure was still intermittent. I believe this test was a part of the suite of Ubuntu 22.04 tests that were ProblemListed. Is there any plan to remove the test from it? Or leave it as is for now? Otherwise, changes look good. ------------- Marked as reviewed by dnguyen (Committer). PR Review: https://git.openjdk.org/jdk/pull/22631#pullrequestreview-2490098224 From eirbjo at openjdk.org Mon Dec 9 22:00:49 2024 From: eirbjo at openjdk.org (Eirik =?UTF-8?B?QmrDuHJzbsO4cw==?=) Date: Mon, 9 Dec 2024 22:00:49 GMT Subject: RFR: 8344059: Remove doPrivileged calls from windows platform sources in the java.desktop module [v7] In-Reply-To: References: Message-ID: On Sun, 17 Nov 2024 06:50:30 GMT, Prasanta Sadhukhan wrote: >> Since JEP 486 : Permanently Disable the Security Manager >> [https://bugs.openjdk.org/browse/JDK-8338625] is now integrated, calls to java.security.AccessController.doPrivileged are obsolete and can be removed. >> >> This PR takes care of the windows-platform files in the java.desktop module to have them removed. > > Prasanta Sadhukhan has updated the pull request incrementally with two additional commits since the last revision: > > - Fix to getBoolean > - FIx Boolean.getBoolean src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java line 102: > 100: > 101: if (textLayoutStr != null) { > 102: useGDITextLayout = Boolean.getBoolean(textLayoutStr); Noticed a possible pre-existing bug: `Boolean::getBoolean` takes a system property to look up and evaluate to boolean. Here, this method is given a string which is the result of reading the system propery "sun.java2d.print.enableGDITextLayout". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22083#discussion_r1876820904 From jlu at openjdk.org Mon Dec 9 23:01:39 2024 From: jlu at openjdk.org (Justin Lu) Date: Mon, 9 Dec 2024 23:01:39 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files Looked at the i18n changes (src, test, and 3rd party icu files w/ Oracle header) and they look correct to me. ------------- Marked as reviewed by jlu (Committer). PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2490302089 From honkar at openjdk.org Tue Dec 10 01:15:49 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 10 Dec 2024 01:15:49 GMT Subject: RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor [v4] In-Reply-To: <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> Message-ID: On Wed, 20 Nov 2024 18:10:40 GMT, Damon Nguyen wrote: >> Change test instructions and drawString to say "Text" instead of "Default" for cursor type. Added instructions to test `setCursor` for the frame as well. Also increased the column count to fit the instructions in linux, as it was mentioned that the instructions didn't fit there. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Fix whitespace LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22055#pullrequestreview-2490521909 From honkar at openjdk.org Tue Dec 10 01:20:42 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 10 Dec 2024 01:20:42 GMT Subject: RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor In-Reply-To: References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> <8jfPD0ZD7kA_BtIhbh5iaOpzWvbfJGebldtH3PWMhrA=.a3c0e7cf-4356-4b25-8521-4563c3308d2c@github.com> Message-ID: On Wed, 13 Nov 2024 21:56:16 GMT, Damon Nguyen wrote: >> I notice one more cursor type (resize cursor?) in between the "move" panel and the panel containing the crosshair button and hand panel. I think it's caused by the JSplitPane resizing option. Since this test is about checking different cursor types while hovering parts of the frame, it might be worth either adding this cursor to the instructions or setting the JSplitPane to not be resizable to remove the cursor. > >> I notice one more cursor type (resize cursor?) in between the "move" panel and the panel containing the crosshair button and hand panel. I think it's caused by the JSplitPane resizing option. Since this test is about checking different cursor types while hovering parts of the frame, it might be worth either adding this cursor to the instructions or setting the JSplitPane to not be resizable to remove the cursor. > > I saw this when initially converting the test, but since the original bug description and the test summary is checking for the functionality of `setCursor()`, I don't think it's worth adding a check for the resize cursor. > > But I realized that the frame's wait cursor works on all OS's and the frame isn't part of the original test instructions anyway, so I repurposed the wait cursor for the pane instead. Simplifies the instructions too. @DamonGuy Tested on windows and it works as expected, does the test instructions hold good on all platforms ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22055#issuecomment-2529962446 From honkar at openjdk.org Tue Dec 10 01:42:45 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 10 Dec 2024 01:42:45 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> References: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> Message-ID: <7zKL8WBnQRtItDtDw_MHHhO6HCPGf7GuY5fX7iHzZG0=.df292e9f-67d9-49c2-8aa5-7ee7f565275f@github.com> On Mon, 9 Dec 2024 07:00:19 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing >> >> >> Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane >> Verifier 2 passed >> Verifier 3 passed >> Verifier 4 passed >> ----------System.err:(11/842)---------- >> java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel >> >> >> seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review @prsadhuk Ran test on CI multiple times (repeat count 20) and the test failed on 3rd run. Looks like intermittent issue is still present. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22631#issuecomment-2530005842 From psadhukhan at openjdk.org Tue Dec 10 02:52:43 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 02:52:43 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 19:11:05 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert mistakenly modified binary files src/jdk.accessibility/windows/man/jabswitch.md line 3: > 1: --- > 2: # Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. > 3: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. I guess this was committed 3 weeks ago, so shouldn't it be just 2024? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22638#discussion_r1877170365 From psadhukhan at openjdk.org Tue Dec 10 07:16:25 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 07:16:25 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v3] In-Reply-To: References: Message-ID: > javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing > > > Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane > Verifier 2 passed > Verifier 3 passed > Verifier 4 passed > ----------System.err:(11/842)---------- > java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel > > > seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Review ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22631/files - new: https://git.openjdk.org/jdk/pull/22631/files/0b3de433..caa0c24a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22631&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22631&range=01-02 Stats: 3 lines in 1 file changed: 1 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22631.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22631/head:pull/22631 PR: https://git.openjdk.org/jdk/pull/22631 From psadhukhan at openjdk.org Tue Dec 10 07:16:25 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 07:16:25 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: References: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> Message-ID: On Mon, 9 Dec 2024 20:09:01 GMT, Harshitha Onkar wrote: > Apart from the following suggestions, test changes LGTM and work as expected on x11 & wayland. > > Ln#174: Is it better to move the button click to the center of the btn for stability? > > ``` > robot.mouseMove(buttonLoc.x + button.getWidth() / 2, > buttonLoc.y + button.getHeight() / 2); > ``` > > Ln#230: `frame = null` is not required in disposeFrame() and can be removed. ok..good point...updated... ------------- PR Comment: https://git.openjdk.org/jdk/pull/22631#issuecomment-2530618905 From ihse at openjdk.org Tue Dec 10 08:50:41 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 10 Dec 2024 08:50:41 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 02:50:18 GMT, Prasanta Sadhukhan wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert mistakenly modified binary files > > src/jdk.accessibility/windows/man/jabswitch.md line 3: > >> 1: --- >> 2: # Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. >> 3: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > > I guess this was committed 3 weeks ago, so shouldn't it be just 2024? The file existed before, but in the Oracle-only closed repo. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22638#discussion_r1877608909 From psadhukhan at openjdk.org Tue Dec 10 09:04:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 09:04:39 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 19:11:05 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert mistakenly modified binary files Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22638#pullrequestreview-2491516974 From psadhukhan at openjdk.org Tue Dec 10 09:04:41 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 09:04:41 GMT Subject: RFR: 8345797: Update copyright year to 2024 for client-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: <-6Df1pwq9YbsxOYNxM_JJtLxLiU-j0yKeinp4gBDVbI=.bedd6e2a-a7f0-4de2-ab48-1ea46e168e66@github.com> On Tue, 10 Dec 2024 08:47:50 GMT, Magnus Ihse Bursie wrote: >> src/jdk.accessibility/windows/man/jabswitch.md line 3: >> >>> 1: --- >>> 2: # Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved. >>> 3: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >> >> I guess this was committed 3 weeks ago, so shouldn't it be just 2024? > > The file existed before, but in the Oracle-only closed repo. ok..LGTM ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22638#discussion_r1877641673 From psadhukhan at openjdk.org Tue Dec 10 09:33:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 09:33:39 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: <0IesHKVS6gy8WPLSFCevvtbtchywwafjo_iChBhuvds=.b02be63c-a28f-47a8-80d3-8293993d9c15@github.com> On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files not sure why client label is added, no java.desktop/accessibility files are in there ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2530994967 From psadhukhan at openjdk.org Tue Dec 10 10:07:37 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 10:07:37 GMT Subject: RFR: 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files In-Reply-To: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> References: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> Message-ID: On Thu, 14 Nov 2024 16:15:46 GMT, GennadiyKrivoshein wrote: > **Description:** > The PR updates sun.print.CUPSPrinter's behavior in terms of reading media imageable area values according to the PostScript Printer Description File Format Specification. > The actual implementation reads X and Y coordinates of the upper right corner of the imageable area as width and height of the imageable area. https://bugs.openjdk.org/browse/JDK-8344119 > > **Updates:** > Added subtraction of the X and Y coordinates of the lower left corner to fix the width and height values of the imageable area. > > **Tests:** > Tested with `test/jdk/javax/print/DialogMargins.java` using Brother DCP-T720DW, the test draws a black line along the borders of the imageable area. > The test was run with the minimum possible margins. > _Before the fix_: the right and bottom lines are not printed (the right and bottom lines are outside the printable area). > _After the fix_: all lines are printed. I can see the spec https://web.mit.edu/PostScript/Adobe/Documents/5003.PPD_Spec_v4.3.pdf indeed say that that > "The bounding box value of *ImageableArea is given as four real numbers, repre- > senting the x and y coordinates of the lower left and upper right corners of the > region, respectively, in the PostScript language default user space coordinate > system." > but I believe it will be better if we do the correction in CUPSfuncs.c#getPageSizes() which reads the "PageSize" and store the value so that it stores the correct value in native.. Also, it will be better to add a manual test similar to what is mentioned in the description above.. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22110#issuecomment-2531082681 From nbenalla at openjdk.org Tue Dec 10 11:48:11 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 10 Dec 2024 11:48:11 GMT Subject: RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 Message-ID: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Please review this trivial change fixing a broken link in `PresentationDirection.java` The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. TIA ------------- Commit messages: - Broken link in the JDK 24 JavaDoc API documentation, build 27 Changes: https://git.openjdk.org/jdk/pull/22660/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22660&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345888 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22660.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22660/head:pull/22660 PR: https://git.openjdk.org/jdk/pull/22660 From psadhukhan at openjdk.org Tue Dec 10 12:01:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 12:01:39 GMT Subject: RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> References: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Message-ID: On Tue, 10 Dec 2024 11:43:44 GMT, Nizar Benalla wrote: > Please review this trivial change fixing a broken link in `PresentationDirection.java` > > The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. > > TIA Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22660#pullrequestreview-2492101031 From duke at openjdk.org Tue Dec 10 12:22:46 2024 From: duke at openjdk.org (Saagar Jha) Date: Tue, 10 Dec 2024 12:22:46 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code Message-ID: 8345876: Update nativeAddAtIndex comment to match the code ------------- Commit messages: - Update nativeAddAtIndex comment to match the code Changes: https://git.openjdk.org/jdk/pull/22627/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22627&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345876 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22627.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22627/head:pull/22627 PR: https://git.openjdk.org/jdk/pull/22627 From psadhukhan at openjdk.org Tue Dec 10 12:22:46 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 12:22:46 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code No issue listed..I have added one ALso you need to verify your OCA status ------------- PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2531018667 PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2531020810 From psadhukhan at openjdk.org Tue Dec 10 12:28:40 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 10 Dec 2024 12:28:40 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2492178750 From duke at openjdk.org Tue Dec 10 12:28:40 2024 From: duke at openjdk.org (Saagar Jha) Date: Tue, 10 Dec 2024 12:28:40 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code Ok so I think that solved the "I don't have a way to make a bug for this" issue. I have signed an OCA a while back, is there anything else I need to do there? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2531492754 From azvegint at openjdk.org Tue Dec 10 13:31:40 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 10 Dec 2024 13:31:40 GMT Subject: RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor [v4] In-Reply-To: <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> Message-ID: On Wed, 20 Nov 2024 18:10:40 GMT, Damon Nguyen wrote: >> Change test instructions and drawString to say "Text" instead of "Default" for cursor type. Added instructions to test `setCursor` for the frame as well. Also increased the column count to fit the instructions in linux, as it was mentioned that the instructions didn't fit there. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Fix whitespace Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22055#pullrequestreview-2492329732 From azvegint at openjdk.org Tue Dec 10 13:40:39 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 10 Dec 2024 13:40:39 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 20:47:07 GMT, Harshitha Onkar wrote: > ``` > public void delay(int ms) { > if (isEventDispatchThread()) { > throw new IllegalThreadStateException("delay() called on EDT"); > } > ``` There is already a `checkNotDispatchThread` method, so we can reuse it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22564#issuecomment-2531663053 From azvegint at openjdk.org Tue Dec 10 17:15:40 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 10 Dec 2024 17:15:40 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code > Ok so I think that solved the "I don't have a way to make a bug for this" issue. I have signed an OCA a while back, is there anything else I need to do there? It looks like you are good to go, just follow the last paragraph of the https://github.com/openjdk/jdk/pull/22627#issuecomment-2524872192 ------------- Marked as reviewed by azvegint (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2493022490 From kizune at openjdk.org Tue Dec 10 18:00:39 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 10 Dec 2024 18:00:39 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2493141212 From honkar at openjdk.org Tue Dec 10 18:25:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 10 Dec 2024 18:25:39 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v3] In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 07:16:25 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing >> >> >> Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane >> Verifier 2 passed >> Verifier 3 passed >> Verifier 4 passed >> ----------System.err:(11/842)---------- >> java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel >> >> >> seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Review Updated changes LGTM ------------- Marked as reviewed by honkar (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22631#pullrequestreview-2493227890 From nbenalla at openjdk.org Tue Dec 10 18:30:43 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 10 Dec 2024 18:30:43 GMT Subject: RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> References: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Message-ID: On Tue, 10 Dec 2024 11:43:44 GMT, Nizar Benalla wrote: > Please review this trivial change fixing a broken link in `PresentationDirection.java` > > The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. > > TIA Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/22660#issuecomment-2532561239 From nbenalla at openjdk.org Tue Dec 10 18:30:43 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 10 Dec 2024 18:30:43 GMT Subject: Integrated: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> References: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Message-ID: On Tue, 10 Dec 2024 11:43:44 GMT, Nizar Benalla wrote: > Please review this trivial change fixing a broken link in `PresentationDirection.java` > > The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. > > TIA This pull request has now been integrated. Changeset: 9bd70ec8 Author: Nizar Benalla URL: https://git.openjdk.org/jdk/commit/9bd70ec806ac0134926f32e222f4075e3d407422 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 Reviewed-by: psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/22660 From azvegint at openjdk.org Tue Dec 10 18:33:42 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 10 Dec 2024 18:33:42 GMT Subject: RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> References: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Message-ID: On Tue, 10 Dec 2024 11:43:44 GMT, Nizar Benalla wrote: > Please review this trivial change fixing a broken link in `PresentationDirection.java` > > The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. > > TIA Marked as reviewed by azvegint (Reviewer). src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java line 46: > 44: * IPP Compatibility: This attribute is not an IPP 1.1 attribute; it is > 45: * an attribute in the Production Printing Extension > 46: * ( The old FTP link is not broken, it still works, but requires an FTP client, but I agree that the `https` link is more convenient and secure. Both links return the same content. ------------- PR Review: https://git.openjdk.org/jdk/pull/22660#pullrequestreview-2493240776 PR Review Comment: https://git.openjdk.org/jdk/pull/22660#discussion_r1878621980 From nbenalla at openjdk.org Tue Dec 10 18:38:47 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 10 Dec 2024 18:38:47 GMT Subject: [jdk24] RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 Message-ID: Hi all, This pull request contains a backport of commit 9bd70ec806ac0134926f32e222f4075e3d407422 from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. The commit being backported was authored by Nizar Benalla on 10 Dec 2024 and was reviewed by [Prasanta Sadhukhan](https://github.com/prsadhuk). Thanks! ------------- Commit messages: - Backport 9bd70ec806ac0134926f32e222f4075e3d407422 Changes: https://git.openjdk.org/jdk/pull/22669/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22669&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345888 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22669.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22669/head:pull/22669 PR: https://git.openjdk.org/jdk/pull/22669 From nbenalla at openjdk.org Tue Dec 10 18:41:41 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 10 Dec 2024 18:41:41 GMT Subject: RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: References: <7IgLUzT3pEbrB7V5Ul8WoZEHlfbuVQ6Jv-Du3LFInnM=.44171e14-becf-42b2-8275-956fe202b0cc@github.com> Message-ID: On Tue, 10 Dec 2024 18:29:17 GMT, Alexander Zvegintsev wrote: >> Please review this trivial change fixing a broken link in `PresentationDirection.java` >> >> The contents of the links are identical, I used the [wayback machine](https://web.archive.org/web/20210511075617/https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf) to view the old content. >> >> TIA > > src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java line 46: > >> 44: * IPP Compatibility: This attribute is not an IPP 1.1 attribute; it is >> 45: * an attribute in the Production Printing Extension >> 46: * ( > > The old FTP link is not broken, it still works, but requires an FTP client, but I agree that the `https` link is more convenient and secure. > Both links return the same content. Thanks Aleksandr, and sorry that the title is inaccurate. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22660#discussion_r1878635159 From dnguyen at openjdk.org Tue Dec 10 18:58:38 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 10 Dec 2024 18:58:38 GMT Subject: RFR: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 [v2] In-Reply-To: <7zKL8WBnQRtItDtDw_MHHhO6HCPGf7GuY5fX7iHzZG0=.df292e9f-67d9-49c2-8aa5-7ee7f565275f@github.com> References: <6f2OXC-rRbrEXUEZFlMlzbBB5iJ2kHBJjwzezjxYkOM=.84d35e28-a2bb-4c63-96a2-bed9f4e11f92@github.com> <7zKL8WBnQRtItDtDw_MHHhO6HCPGf7GuY5fX7iHzZG0=.df292e9f-67d9-49c2-8aa5-7ee7f565275f@github.com> Message-ID: On Tue, 10 Dec 2024 01:39:34 GMT, Harshitha Onkar wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Review > > @prsadhuk Looks like Damon may be correct, ran the test on CI multiple times (repeat count 20) and the test failed on 3rd run. > Looks like intermittent issue is still present. If what @honkar-jdk said is true, then best to leave it on the ProblemList. But then isn't the issue not properly fixed? Is this worth integrating as is? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22631#issuecomment-2532621863 From aivanov at openjdk.org Tue Dec 10 20:02:38 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 10 Dec 2024 20:02:38 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code Marked as reviewed by aivanov (Reviewer). src/java.desktop/macosx/native/libawt_lwawt/awt/CMenuBar.m line 1: > 1: /* Please update the copyright line: - * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved. ------------- PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2493446261 PR Review Comment: https://git.openjdk.org/jdk/pull/22627#discussion_r1878749047 From dgredler at openjdk.org Tue Dec 10 20:13:53 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 10 Dec 2024 20:13:53 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout Message-ID: Soft hyphens should never render, regardless of the rendering path used internally. This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. ------------- Commit messages: - Always use invisible glyphs for 'default ignorable' chars Changes: https://git.openjdk.org/jdk/pull/22670/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22670&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8208377 Stats: 348 lines in 5 files changed: 325 ins; 15 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/22670.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22670/head:pull/22670 PR: https://git.openjdk.org/jdk/pull/22670 From dgredler at openjdk.org Tue Dec 10 20:15:44 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 10 Dec 2024 20:15:44 GMT Subject: RFR: 8344637: Fix Page8 of manual test java/awt/print/PrinterJob/PrintTextTest.java on Linux and Windows [v7] In-Reply-To: References: Message-ID: On Wed, 20 Nov 2024 19:07:28 GMT, Daniel Gredler wrote: >> This PR fixes the issue identified in JDK-8148334 in screenshots `Page8_landscape.JPG` and `Page8_portrait.JPG`. >> >> It does not address `mac_Page1.png` or `mac_Page8.png`, which I'm not even sure are still issues (I have no access to a Mac). >> >> The method in question, `PathGraphics.printedSimpleGlyphVector(...)` is quite complex, with many special cases being handled in different ways. In this specific scenario (page 8 of `PrintTextTest`), all special case checks fail, and we fall through all the way to the final handling block, which draws the individual characters one by one. It looks like the problem is that the font transform translation is applied twice, once via the glyph positions, and again by `drawString(...)` via the font. The proposed fix is to provide `drawString(...)` a font without any translation transform. >> >> Testing looks good on Linux, but needs to be done on Mac and Windows. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Add additional issue ID to PrintTextTest bug list @prrace Might you have time to review this PR in the next week or two, now that the SecurityManager exorcism is complete? The code being changed is related to a few bug fixes that you implemented over the past few years, so I'm not sure if anybody else really has as much context on this one as you do. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/21980#issuecomment-2532770362 From prr at openjdk.org Tue Dec 10 21:11:39 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 10 Dec 2024 21:11:39 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: <0IesHKVS6gy8WPLSFCevvtbtchywwafjo_iChBhuvds=.b02be63c-a28f-47a8-80d3-8293993d9c15@github.com> References: <0IesHKVS6gy8WPLSFCevvtbtchywwafjo_iChBhuvds=.b02be63c-a28f-47a8-80d3-8293993d9c15@github.com> Message-ID: On Tue, 10 Dec 2024 09:31:21 GMT, Prasanta Sadhukhan wrote: > not sure why client label is added, no java.desktop/accessibility files are in there I was puzzling over that too. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2532895836 From dnguyen at openjdk.org Tue Dec 10 22:58:40 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 10 Dec 2024 22:58:40 GMT Subject: RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor In-Reply-To: References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> <8jfPD0ZD7kA_BtIhbh5iaOpzWvbfJGebldtH3PWMhrA=.a3c0e7cf-4356-4b25-8521-4563c3308d2c@github.com> Message-ID: On Wed, 13 Nov 2024 21:56:16 GMT, Damon Nguyen wrote: >> I notice one more cursor type (resize cursor?) in between the "move" panel and the panel containing the crosshair button and hand panel. I think it's caused by the JSplitPane resizing option. Since this test is about checking different cursor types while hovering parts of the frame, it might be worth either adding this cursor to the instructions or setting the JSplitPane to not be resizable to remove the cursor. > >> I notice one more cursor type (resize cursor?) in between the "move" panel and the panel containing the crosshair button and hand panel. I think it's caused by the JSplitPane resizing option. Since this test is about checking different cursor types while hovering parts of the frame, it might be worth either adding this cursor to the instructions or setting the JSplitPane to not be resizable to remove the cursor. > > I saw this when initially converting the test, but since the original bug description and the test summary is checking for the functionality of `setCursor()`, I don't think it's worth adding a check for the resize cursor. > > But I realized that the frame's wait cursor works on all OS's and the frame isn't part of the original test instructions anyway, so I repurposed the wait cursor for the pane instead. Simplifies the instructions too. > @DamonGuy Tested on windows and it works as expected, does the test instructions hold good on all platforms ? Yup! Changed the cursor types so they're applicable on all platforms. Thanks ------------- PR Comment: https://git.openjdk.org/jdk/pull/22055#issuecomment-2533141746 From honkar at openjdk.org Tue Dec 10 23:02:42 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 10 Dec 2024 23:02:42 GMT Subject: RFR: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor [v4] In-Reply-To: <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> <5DwlgKc2MmuUyOn69gRGzrr3WL5n7LAOZRtBm5rc7qs=.1d009904-79e3-4733-bdd9-682de5d5b999@github.com> Message-ID: On Wed, 20 Nov 2024 18:10:40 GMT, Damon Nguyen wrote: >> Change test instructions and drawString to say "Text" instead of "Default" for cursor type. Added instructions to test `setCursor` for the frame as well. Also increased the column count to fit the instructions in linux, as it was mentioned that the instructions didn't fit there. > > Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision: > > Fix whitespace Marked as reviewed by honkar (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22055#pullrequestreview-2493868720 From dnguyen at openjdk.org Tue Dec 10 23:54:46 2024 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 10 Dec 2024 23:54:46 GMT Subject: Integrated: 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor In-Reply-To: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> References: <9dslXMAfNQ4x-WWKb9TlwMDyJEXSIwtZu_czv_HBd9w=.19afa24f-73fc-4140-adc6-754ea6c2c290@github.com> Message-ID: On Wed, 13 Nov 2024 01:14:26 GMT, Damon Nguyen wrote: > Change test instructions and drawString to say "Text" instead of "Default" for cursor type. Added instructions to test `setCursor` for the frame as well. Also increased the column count to fit the instructions in linux, as it was mentioned that the instructions didn't fit there. This pull request has now been integrated. Changeset: c6317191 Author: Damon Nguyen URL: https://git.openjdk.org/jdk/commit/c6317191e323e27cde61b5ed3c23d1a230053969 Stats: 12 lines in 1 file changed: 3 ins; 0 del; 9 mod 8343170: java/awt/Cursor/JPanelCursorTest/JPanelCursorTest.java does not show the default cursor Reviewed-by: honkar, azvegint, achung ------------- PR: https://git.openjdk.org/jdk/pull/22055 From psadhukhan at openjdk.org Wed Dec 11 03:52:43 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 11 Dec 2024 03:52:43 GMT Subject: Integrated: 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 05:31:35 GMT, Prasanta Sadhukhan wrote: > javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 citing > > > Verifier 1 failed, rightButton2 is not focus owner,F6 doesn't transfer focus to the right/bottom side of the splitpane > Verifier 2 passed > Verifier 3 passed > Verifier 4 passed > ----------System.err:(11/842)---------- > java.lang.RuntimeException: Test failed, verifiers 1, failed for com.sun.java.swing.plaf.motif.MotifLookAndFeel > > > seems like focus is not transferred in time but is very intermittent...Added stability fixes with waitForIdle, delay and test passed in several OCI systems without issue This pull request has now been integrated. Changeset: 8de0622c Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/8de0622c3a5c9e01e79659ef0b43b1b01dfa5cf6 Stats: 25 lines in 1 file changed: 15 ins; 2 del; 8 mod 8345767: javax/swing/JSplitPane/4164779/JSplitPaneKeyboardNavigationTest.java fails in ubuntu22.04 Reviewed-by: honkar, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/22631 From psadhukhan at openjdk.org Wed Dec 11 04:02:42 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 11 Dec 2024 04:02:42 GMT Subject: Integrated: 8334581: Remove no-arg constructor BasicSliderUI() In-Reply-To: References: Message-ID: On Fri, 6 Dec 2024 06:37:28 GMT, Prasanta Sadhukhan wrote: > The no-arg constructor BasicSliderUI() was added accidentally. It should be removed. > > [JDK-8334580](https://bugs.openjdk.org/browse/JDK-8334580) deprecates the BasicSliderUI() constructor, and this follow-up is to remove the constructor. This pull request has now been integrated. Changeset: c40140eb Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/c40140eb9c156415622b2d03fd8681c16f6ee362 Stats: 10 lines in 1 file changed: 0 ins; 10 del; 0 mod 8334581: Remove no-arg constructor BasicSliderUI() Reviewed-by: abhiscxk, aivanov, azvegint ------------- PR: https://git.openjdk.org/jdk/pull/22598 From psadhukhan at openjdk.org Wed Dec 11 04:52:43 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 11 Dec 2024 04:52:43 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v4] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 20:38:52 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > expand imports Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2494297346 From jwaters at openjdk.org Wed Dec 11 06:22:46 2024 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 11 Dec 2024 06:22:46 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: References: Message-ID: On Fri, 25 Oct 2024 10:11:57 GMT, Magnus Ihse Bursie wrote: >> It's a checkout error from the original gigantic Pull Request, sorry. I don't plan to raise the JDK to C++17 in this one. But I'm not sure what to do with this now, since maybe_unused is C++17. I don't think anyone is going to appreciate [[gnu::unused]] inside Windows code > > Then you'll have to create a macro for disabling the unused warnings (however, I'm not sure how well that would be received). Or fix the bug if it is actually unused. Or wait until we go to 17. @magicus Sorry for the ping, but I'm a bit confused. Do you know what bug report site Phil is referring to when he says to submit a bug to AWT instead? Is it just the JBS? (There's a little bit of a problem if it is, it is extremely inconvenient to review what to do with the problem areas in the JBS as opposed to a Pull Request, that and no one actually checks the JBS for new issues, so a bug submitted there is doomed to be ignored until the end of time) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1879413329 From aturbanov at openjdk.org Wed Dec 11 08:24:37 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 11 Dec 2024 08:24:37 GMT Subject: RFR: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element In-Reply-To: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> References: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> Message-ID: <7NMQVXxO1l65IA5bvDAx77XqY_IPf1lqq7fM5LipSwQ=.03a70440-b5e5-44aa-916d-01b33c78e405@github.com> On Fri, 1 Nov 2024 13:32:07 GMT, Andrey Turbanov wrote: > The Hashtable `javax.swing.text.html.parser.Element#contentTypes` is initialized only within `` block. > We can replace it with immutable map to avoid Hashtable `synchronized` overhead. Can I get a second review, please? ------------- PR Comment: https://git.openjdk.org/jdk/pull/21825#issuecomment-2534852929 From duke at openjdk.org Wed Dec 11 09:13:06 2024 From: duke at openjdk.org (Saagar Jha) Date: Wed, 11 Dec 2024 09:13:06 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: References: Message-ID: > 8345876: Update nativeAddAtIndex comment to match the code Saagar Jha 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: Update nativeAddAtIndex comment to match the code ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22627/files - new: https://git.openjdk.org/jdk/pull/22627/files/62da15c0..ba67be45 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22627&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22627&range=00-01 Stats: 5443 lines in 1149 files changed: 3353 ins; 432 del; 1658 mod Patch: https://git.openjdk.org/jdk/pull/22627.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22627/head:pull/22627 PR: https://git.openjdk.org/jdk/pull/22627 From duke at openjdk.org Wed Dec 11 09:16:41 2024 From: duke at openjdk.org (Saagar Jha) Date: Wed, 11 Dec 2024 09:16:41 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: References: Message-ID: <7p5pn42O4Ea41vjgg3HHchlOXT53ccmTAft-GaQr5nQ=.ceb96445-20ca-4bf1-bd23-dcf87aa56db2@github.com> On Wed, 11 Dec 2024 09:13:06 GMT, Saagar Jha wrote: >> 8345876: Update nativeAddAtIndex comment to match the code > > Saagar Jha has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > Update nativeAddAtIndex comment to match the code Oops I guess I wasn't supposed to rebase on top of master. Sorry :( Anyway, I added the copyright year in. I'll hold off on `/integrate` just in case I'm supposed to get this reviewed again, but if it looks good I can go ahead and do that. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2535264912 From mli at openjdk.org Wed Dec 11 09:40:38 2024 From: mli at openjdk.org (Hamlin Li) Date: Wed, 11 Dec 2024 09:40:38 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files Nice batch cleanup. ------------- Marked as reviewed by mli (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2494928848 From lancea at openjdk.org Wed Dec 11 11:41:40 2024 From: lancea at openjdk.org (Lance Andersen) Date: Wed, 11 Dec 2024 11:41:40 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 15:42:57 GMT, Magnus Ihse Bursie wrote: >> Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. >> >> I have located these modified files using: >> >> git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list >> >> and then run a script to update the copyright year to 2024 on these files. >> >> I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Revert changes to binary files Marked as reviewed by lancea (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22640#pullrequestreview-2495330243 From azvegint at openjdk.org Wed Dec 11 14:16:42 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Wed, 11 Dec 2024 14:16:42 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 09:13:06 GMT, Saagar Jha wrote: >> 8345876: Update nativeAddAtIndex comment to match the code > > Saagar Jha has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > Update nativeAddAtIndex comment to match the code Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2495794430 From aivanov at openjdk.org Wed Dec 11 15:00:26 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 11 Dec 2024 15:00:26 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 09:13:06 GMT, Saagar Jha wrote: >> 8345876: Update nativeAddAtIndex comment to match the code > > Saagar Jha 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: > > Update nativeAddAtIndex comment to match the code Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22627#pullrequestreview-2495883435 From aivanov at openjdk.org Wed Dec 11 15:00:34 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 11 Dec 2024 15:00:34 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: <7p5pn42O4Ea41vjgg3HHchlOXT53ccmTAft-GaQr5nQ=.ceb96445-20ca-4bf1-bd23-dcf87aa56db2@github.com> References: <7p5pn42O4Ea41vjgg3HHchlOXT53ccmTAft-GaQr5nQ=.ceb96445-20ca-4bf1-bd23-dcf87aa56db2@github.com> Message-ID: <7_bBAr56MUJqbIz89HzcXWkQDtJktZ_x95T9l4VfghI=.812b59f1-2137-48de-83b7-3e4b1b8388f1@github.com> On Wed, 11 Dec 2024 09:13:48 GMT, Saagar Jha wrote: > Oops I guess I wasn't supposed to rebase on top of master. Sorry :( You must never use `git rebase` for a branch being reviewed. All your commits get new hashes as the result of the rebase operation, therefore all the comments become orphaned. The correct way is to use `git merge master -m 'Merge master'` after you pulled all the latest changes for master. --- However, as the bot has warned you https://github.com/openjdk/jdk/pull/22627#issuecomment-2524872307, you're using the `master` branch as the base branch for your contribution. *After this PR is integrated*, you'll have to handle diverged branches between the `master` branch in `openjdk/jdk` and your fork if you're going to contribute any other changes. To avoid this problem, you would create *a new branch* off the master branch for each bug / contribution. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2536186861 From alexey.ivanov at oracle.com Wed Dec 11 17:42:04 2024 From: alexey.ivanov at oracle.com (Alexey Ivanov) Date: Wed, 11 Dec 2024 17:42:04 +0000 Subject: Where to submit a bug to A11Y and AWT for people to take a look at? In-Reply-To: <920afe63-6bdc-4c58-82cb-47de50746c4c@oracle.com> References: <920afe63-6bdc-4c58-82cb-47de50746c4c@oracle.com> Message-ID: <090f55ce-1e31-48c8-8cc3-c289a168fe7c@oracle.com> Hi Phil, Both JDK-8342869 and JDK-8342870 [1][2] which correspond to the PRs have subcomponent set to javax.accessibility, which is correct. Do you mean that these bugs need to be assigned to someone from clientlibs? In Oracle? Do you mean Julian needs to submit new bugs and leave them unassigned? What could help is adding a log of the build, an excerpt thereof, which lists all the errors found. Should this problem be discussed on client-libs-dev mailing list instead? [1] https://bugs.openjdk.org/browse/JDK-8342869 [2] https://bugs.openjdk.org/browse/JDK-8342870 On 11/12/2024 17:24, Philip Race wrote: > Yes, there are JBS sub-components for these. > > -phil. > > > On 12/11/24 5:25 AM, Julian Waters wrote: >> Hi all, >> >> In review of 2 of my Pull Requests the following recommendations came >> up: >> >>> I think it would be better to withdraw it and submit a bug against >>> A11Y for people to look at what should really be done about these >>> cases. >>> I think it would be better to withdraw it and submit a bug against >>> AWT for people to look at what should really be done about these cases. >> I'm not sure where this suggestion is referring to, though. Is it just >> referring to the JBS under AWT and A11Y subcomponents? Or is there a >> separate place for AWT and A11Y bugs and issues that I'm not aware of? >> I'm a little perplexed on where to go to draw attention from the >> relevant AWT or A11Y Reviewers to see what to do next in any case. >> Where should I go to have the problem areas in the Pull Requests >> looked at, as per the instructions given to me? >> >> best regards, >> Julian >> >> P.S. The Pull Requests in question are >> https://github.com/openjdk/jdk/pull/21656#issuecomment-2486392776 and >> https://github.com/openjdk/jdk/pull/21655#issuecomment-2486391417 -- Alexey From azvegint at openjdk.org Wed Dec 11 17:58:15 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Wed, 11 Dec 2024 17:58:15 GMT Subject: RFR: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element In-Reply-To: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> References: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> Message-ID: On Fri, 1 Nov 2024 13:32:07 GMT, Andrey Turbanov wrote: > The Hashtable `javax.swing.text.html.parser.Element#contentTypes` is initialized only within `` block. > We can replace it with immutable map to avoid Hashtable `synchronized` overhead. Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21825#pullrequestreview-2496435737 From aturbanov at openjdk.org Wed Dec 11 18:25:16 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 11 Dec 2024 18:25:16 GMT Subject: Integrated: 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element In-Reply-To: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> References: <-niCcMlDNUfllahrMsxSfIARJypyinVjjldTn-Swv-c=.9c275ad6-3c80-45f9-ac50-9febdb77b2c0@github.com> Message-ID: On Fri, 1 Nov 2024 13:32:07 GMT, Andrey Turbanov wrote: > The Hashtable `javax.swing.text.html.parser.Element#contentTypes` is initialized only within `` block. > We can replace it with immutable map to avoid Hashtable `synchronized` overhead. This pull request has now been integrated. Changeset: e4a34e96 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/e4a34e96cd7eb227bd43e55d370d0b18d365ae1b Stats: 16 lines in 1 file changed: 0 ins; 5 del; 11 mod 8345616: Unnecessary Hashtable usage in javax.swing.text.html.parser.Element Reviewed-by: aivanov, azvegint ------------- PR: https://git.openjdk.org/jdk/pull/21825 From achung at openjdk.org Wed Dec 11 19:10:16 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 11 Dec 2024 19:10:16 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v2] In-Reply-To: References: Message-ID: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: remove extra html tag, update wording ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22564/files - new: https://git.openjdk.org/jdk/pull/22564/files/c5e72b82..9378c168 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=00-01 Stats: 12 lines in 1 file changed: 1 ins; 0 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/22564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22564/head:pull/22564 PR: https://git.openjdk.org/jdk/pull/22564 From achung at openjdk.org Wed Dec 11 19:40:51 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 11 Dec 2024 19:40:51 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v3] In-Reply-To: References: Message-ID: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: - align spacing - remove extra space ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22564/files - new: https://git.openjdk.org/jdk/pull/22564/files/9378c168..4928e4b5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=01-02 Stats: 2 lines in 1 file changed: 0 ins; 1 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22564/head:pull/22564 PR: https://git.openjdk.org/jdk/pull/22564 From aturbanov at openjdk.org Wed Dec 11 20:08:11 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Wed, 11 Dec 2024 20:08:11 GMT Subject: RFR: 8346036: Unnecessary Hashtable usage in javax.swing.text.html.parser.Entity Message-ID: The Hashtable `javax.swing.text.html.parser.Entity#entityTypes` is modified only within `` block. We can replace it with immutable map to avoid Hashtable synchronization overhead. ------------- Commit messages: - [PATCH] Unnecessary Hashtable usage in javax.swing.text.html.parser.Entity Changes: https://git.openjdk.org/jdk/pull/21831/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21831&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346036 Stats: 26 lines in 1 file changed: 0 ins; 11 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/21831.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21831/head:pull/21831 PR: https://git.openjdk.org/jdk/pull/21831 From achung at openjdk.org Wed Dec 11 20:51:38 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 11 Dec 2024 20:51:38 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 20:09:09 GMT, Daniel Gredler wrote: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. Test currently fails with error `java.lang.RuntimeException: stringWidth for char 00ad using font Dialog: 101 != 333 ` ------------- PR Review: https://git.openjdk.org/jdk/pull/22670#pullrequestreview-2496921523 From ihse at openjdk.org Wed Dec 11 20:58:45 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 11 Dec 2024 20:58:45 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: References: Message-ID: <-_DAlBzNB8W3GHrNOp3I6iyv-MFVgHtAaUqzaBT96eQ=.d29a3ad9-e7bd-48a8-adf2-e15c1af760da@github.com> On Wed, 11 Dec 2024 06:20:07 GMT, Julian Waters wrote: >> Then you'll have to create a macro for disabling the unused warnings (however, I'm not sure how well that would be received). Or fix the bug if it is actually unused. Or wait until we go to 17. > > @magicus Sorry for the ping, but I'm a bit confused. Do you know what bug report site Phil is referring to when he says to submit a bug to AWT instead? Is it just the JBS? (There's a little bit of a problem if it is, it is extremely inconvenient to review what to do with the problem areas in the JBS as opposed to a Pull Request, that and no one actually checks the JBS for new issues, so a bug submitted there is doomed to be ignored until the end of time) You need to split this up into multiple parts. One part is about removing dead code. Do not comment it out, just remove it. Open a new JBS issue on client-libs for removal of dead code. This should be trivial to get pushed. Then, you have some other changes. Looks like you moved something from a header file to a cpp file. Make that a separate PR, also on client-libs. Then you are making some annotation stuff. I have not seen these before. Are they established? This might need some more discussion to get a consensus on how to proceed with. And finally you are bumping the C++ language level. You have already opened a separate JBS issue for that, and we've said that we do that when we do that. So just drop that part. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1880973110 From dgredler at openjdk.org Wed Dec 11 20:59:45 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 11 Dec 2024 20:59:45 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 20:48:51 GMT, Alisen Chung wrote: >> Soft hyphens should never render, regardless of the rendering path used internally. >> >> This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). >> >> Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. >> >> The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. > > Test currently fails with error `java.lang.RuntimeException: stringWidth for char 00ad using font Dialog: 101 != 333 > ` @alisenchung Interesting, what OS and architecture are you testing on? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2537150163 From ihse at openjdk.org Wed Dec 11 21:10:52 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 11 Dec 2024 21:10:52 GMT Subject: RFR: 8345799: Update copyright year to 2024 for core-libs in files where it was missed [v3] In-Reply-To: <0IesHKVS6gy8WPLSFCevvtbtchywwafjo_iChBhuvds=.b02be63c-a28f-47a8-80d3-8293993d9c15@github.com> References: <0IesHKVS6gy8WPLSFCevvtbtchywwafjo_iChBhuvds=.b02be63c-a28f-47a8-80d3-8293993d9c15@github.com> Message-ID: On Tue, 10 Dec 2024 09:31:21 GMT, Prasanta Sadhukhan wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: >> >> Revert changes to binary files > > not sure why client label is added, no java.desktop/accessibility files are in there @prsadhuk @prrace `src/java.base/share/classes/jdk/internal/access/JavaAWTFontAccess.java` matches the pattern `"src/java.base/share/classes/jdk/internal/access/\\w+AWT"` which is setup for `client` in the Skara `jdk.json` label configuration. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22640#issuecomment-2537183864 From ihse at openjdk.org Wed Dec 11 21:10:53 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 11 Dec 2024 21:10:53 GMT Subject: Integrated: 8345799: Update copyright year to 2024 for core-libs in files where it was missed In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 12:30:19 GMT, Magnus Ihse Bursie wrote: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. This pull request has now been integrated. Changeset: ddf04617 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/ddf04617887dc389cd7667e820da7ac91eea9e8c Stats: 441 lines in 441 files changed: 0 ins; 0 del; 441 mod 8345799: Update copyright year to 2024 for core-libs in files where it was missed Reviewed-by: joehw, jlu, mli, lancea, kevinw ------------- PR: https://git.openjdk.org/jdk/pull/22640 From ihse at openjdk.org Wed Dec 11 21:32:44 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 11 Dec 2024 21:32:44 GMT Subject: Integrated: 8345797: Update copyright year to 2024 for client-libs in files where it was missed In-Reply-To: References: Message-ID: On Mon, 9 Dec 2024 12:16:26 GMT, Magnus Ihse Bursie wrote: > Some files have been modified in 2024, but the copyright year has not been properly updated. This should be fixed. > > I have located these modified files using: > > git log --since="Jan 1" --name-only --pretty=format: | sort -u > file.list > > and then run a script to update the copyright year to 2024 on these files. > > I have made a manual sampling of files in the list to verify that they have indeed been modified in 2024. This pull request has now been integrated. Changeset: 64fad1c7 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/64fad1c7d374bbc635bad3b1fa7941379f39565f Stats: 342 lines in 342 files changed: 0 ins; 0 del; 342 mod 8345797: Update copyright year to 2024 for client-libs in files where it was missed Reviewed-by: psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/22638 From duke at openjdk.org Wed Dec 11 21:55:41 2024 From: duke at openjdk.org (duke) Date: Wed, 11 Dec 2024 21:55:41 GMT Subject: RFR: 8345876: Update nativeAddAtIndex comment to match the code [v2] In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 09:13:06 GMT, Saagar Jha wrote: >> 8345876: Update nativeAddAtIndex comment to match the code > > Saagar Jha has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit: > > Update nativeAddAtIndex comment to match the code @saagarjha Your change (at version ba67be459bc49c37da43d905b89b08fe259fe1de) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22627#issuecomment-2537272262 From duke at openjdk.org Thu Dec 12 00:05:33 2024 From: duke at openjdk.org (=?UTF-8?B?5p+z6bKy6bmP?=) Date: Thu, 12 Dec 2024 00:05:33 GMT Subject: RFR: 8264728: When use chinese IME, the candidate box isn't moved with caret of JTextArea [v12] In-Reply-To: <4JjGitYNWd7jQbHa4_1M6awOvkgtpfd2AY5LKS3MnUM=.8126670d-c076-4756-98be-9b6c7b7a565d@github.com> References: <4JjGitYNWd7jQbHa4_1M6awOvkgtpfd2AY5LKS3MnUM=.8126670d-c076-4756-98be-9b6c7b7a565d@github.com> Message-ID: > Candidat box can moving with caret on windows version. Someone must wrote codes for linux(ubuntu), but it doesn't work, so he didn't commit the codes. Why it doesn't work, is the key problem. > > 1, I wrote a example for linux: > https://github.com/quantum6/X11InputMethod > > I tried all parameters to test and as my research: > If you use XIMPreeditCallbacks to initiate, the box can't be moved with caret. > If you use XIMPreeditNothing, it works. > All examples use XIMPreeditCallbacks to initiate input method and candidate box can't moving. So I understand why he didn't commit the codes. > > 2, I traced the route of transfering caret coordites on windows version, then add codes for linux. > 3, Taishan Office(like Microsoft Office Word) is running on jdk, we tested for a long time, it works OK. > 4, I am not sure for AIX( no environment). > > > JDK-8264728 : When use chinese IME, the candidate box isn't moved with caret of JTextArea > Type: Bug > Component: client-libs > Sub-Component: java.awt:i18n > Affected Version: 8,9,15,16 > Priority: P3 > Status: Open > Resolution: Unresolved > OS: linux > CPU: x86_64 ??? 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 11 additional commits since the last revision: - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Update to lastest - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - Remove tab - Update to latest and make code safer - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 - ... and 1 more: https://git.openjdk.org/jdk/compare/a0357a3b...0ab7a467 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/13055/files - new: https://git.openjdk.org/jdk/pull/13055/files/02cdff34..0ab7a467 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=13055&range=11 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=13055&range=10-11 Stats: 1063513 lines in 13075 files changed: 687567 ins; 289278 del; 86668 mod Patch: https://git.openjdk.org/jdk/pull/13055.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/13055/head:pull/13055 PR: https://git.openjdk.org/jdk/pull/13055 From psadhukhan at openjdk.org Thu Dec 12 02:46:05 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 12 Dec 2024 02:46:05 GMT Subject: RFR: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 Message-ID: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 seems to fail in OCI system citing "Test failed" suggesting caret is not at expected place after text is typed, but I could not find any CI jobs having it failed. Anyway simplified the test and added stability fixes which made it pass now in several OCI systems.. ------------- Commit messages: - jcheck - testfix Changes: https://git.openjdk.org/jdk/pull/22698/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22698&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346055 Stats: 80 lines in 1 file changed: 18 ins; 40 del; 22 mod Patch: https://git.openjdk.org/jdk/pull/22698.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22698/head:pull/22698 PR: https://git.openjdk.org/jdk/pull/22698 From duke at openjdk.org Thu Dec 12 03:23:43 2024 From: duke at openjdk.org (Saagar Jha) Date: Thu, 12 Dec 2024 03:23:43 GMT Subject: Integrated: 8345876: Update nativeAddAtIndex comment to match the code In-Reply-To: References: Message-ID: On Sat, 7 Dec 2024 04:41:01 GMT, Saagar Jha wrote: > 8345876: Update nativeAddAtIndex comment to match the code This pull request has now been integrated. Changeset: 72c59de6 Author: Saagar Jha URL: https://git.openjdk.org/jdk/commit/72c59de615b216c1729de4f4251652488f6f74ef Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8345876: Update nativeAddAtIndex comment to match the code Reviewed-by: azvegint, aivanov, psadhukhan, kizune ------------- PR: https://git.openjdk.org/jdk/pull/22627 From psadhukhan at openjdk.org Thu Dec 12 03:42:19 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 12 Dec 2024 03:42:19 GMT Subject: [jdk24] RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 18:31:18 GMT, Nizar Benalla wrote: > Hi all, > > This pull request contains a backport of commit 9bd70ec806ac0134926f32e222f4075e3d407422 from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Nizar Benalla on 10 Dec 2024 and was reviewed by [Prasanta Sadhukhan](https://github.com/prsadhuk). > > Thanks! Marked as reviewed by psadhukhan (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22669#pullrequestreview-2497524340 From syan at openjdk.org Thu Dec 12 04:38:09 2024 From: syan at openjdk.org (SendaoYan) Date: Thu, 12 Dec 2024 04:38:09 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 Message-ID: Hi all, This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. Additional testing: - [ ] jtreg tests(include tier1/2/3) on linux-x64 with release build - [ ] jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build - [ ] jtreg tests(include tier1/2/3) on linux-aarch64 with release build - [ ] jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build ------------- Commit messages: - 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 Changes: https://git.openjdk.org/jdk/pull/22701/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22701&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346059 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22701.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22701/head:pull/22701 PR: https://git.openjdk.org/jdk/pull/22701 From jwaters at openjdk.org Thu Dec 12 05:41:41 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 12 Dec 2024 05:41:41 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: <-_DAlBzNB8W3GHrNOp3I6iyv-MFVgHtAaUqzaBT96eQ=.d29a3ad9-e7bd-48a8-adf2-e15c1af760da@github.com> References: <-_DAlBzNB8W3GHrNOp3I6iyv-MFVgHtAaUqzaBT96eQ=.d29a3ad9-e7bd-48a8-adf2-e15c1af760da@github.com> Message-ID: <9DrjvW9_E_UXMrz228Zw8dhPmVxpMJk8dPawkFPrM-o=.21e0f362-ed29-4dd3-ba0e-9f2120985cdf@github.com> On Wed, 11 Dec 2024 20:55:41 GMT, Magnus Ihse Bursie wrote: >> @magicus Sorry for the ping, but I'm a bit confused. Do you know what bug report site Phil is referring to when he says to submit a bug to AWT instead? Is it just the JBS? (There's a little bit of a problem if it is, it is extremely inconvenient to review what to do with the problem areas in the JBS as opposed to a Pull Request, that and no one actually checks the JBS for new issues, so a bug submitted there is doomed to be ignored until the end of time) > > You need to split this up into multiple parts. One part is about removing dead code. Do not comment it out, just remove it. Open a new JBS issue on client-libs for removal of dead code. This should be trivial to get pushed. > > Then, you have some other changes. Looks like you moved something from a header file to a cpp file. Make that a separate PR, also on client-libs. > > Then you are making some annotation stuff. I have not seen these before. Are they established? This might need some more discussion to get a consensus on how to proceed with. > > And finally you are bumping the C++ language level. You have already opened a separate JBS issue for that, and we've said that we do that when we do that. So just drop that part. The dead code removal may not be correct, same goes for the rest of the changes. Most, if not all of them (Especially the C++17 change) are pure placeholders to simply draw attention to the problem sites. I think all of them need discussion on how to proceed with (Same with the corresponding jdk.accessibility changes), not just the annotations. Speaking of which, the annotations are C++ attributes, introduced in C++11, and are (fortunately) Standard and not compiler extensions. Splitting this up to even smaller changes may or may not inconvenience the few reviewers that AWT and A11Y has, which is what I'm worried about ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1881409701 From ihse at openjdk.org Thu Dec 12 09:39:45 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Dec 2024 09:39:45 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: <9DrjvW9_E_UXMrz228Zw8dhPmVxpMJk8dPawkFPrM-o=.21e0f362-ed29-4dd3-ba0e-9f2120985cdf@github.com> References: <-_DAlBzNB8W3GHrNOp3I6iyv-MFVgHtAaUqzaBT96eQ=.d29a3ad9-e7bd-48a8-adf2-e15c1af760da@github.com> <9DrjvW9_E_UXMrz228Zw8dhPmVxpMJk8dPawkFPrM-o=.21e0f362-ed29-4dd3-ba0e-9f2120985cdf@github.com> Message-ID: On Thu, 12 Dec 2024 05:39:04 GMT, Julian Waters wrote: >> You need to split this up into multiple parts. One part is about removing dead code. Do not comment it out, just remove it. Open a new JBS issue on client-libs for removal of dead code. This should be trivial to get pushed. >> >> Then, you have some other changes. Looks like you moved something from a header file to a cpp file. Make that a separate PR, also on client-libs. >> >> Then you are making some annotation stuff. I have not seen these before. Are they established? This might need some more discussion to get a consensus on how to proceed with. >> >> And finally you are bumping the C++ language level. You have already opened a separate JBS issue for that, and we've said that we do that when we do that. So just drop that part. > > The dead code removal may not be correct, same goes for the rest of the changes. Most, if not all of them (Especially the C++17 change) are pure placeholders to simply draw attention to the problem sites. I think all of them need discussion on how to proceed with (Same with the corresponding jdk.accessibility changes), not just the annotations. Speaking of which, the annotations are C++ attributes, introduced in C++11, and are (fortunately) Standard and not compiler extensions. Splitting this up to even smaller changes may or may not inconvenience the few reviewers that AWT and A11Y has, which is what I'm worried about The code has likely been dead for years. If no-one has reported any bugs about this, it is likely correct that it is unused. If you think that is a bug, do some git archaeology to determine when it became dead, or locate what pathway you think it should be used it, and try to provoke an error. I still think publishing a simple PR which just removes dead code is the best way for you to proceed here. Such a PR should be trivial to review. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1881717235 From ihse at openjdk.org Thu Dec 12 10:31:36 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Dec 2024 10:31:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. > > Additional testing: > > - [x] jtreg tests(include tier1/2/3) on linux-x64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141: > 139: dladdr((void *)AWT_OnLoad, &dlinfo); > 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { > 141: perror((char *)dlinfo.dli_fname); Having error handling is better than no error handling, but is `perror` the best we can do? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1881802079 From ihse at openjdk.org Thu Dec 12 10:35:35 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Dec 2024 10:35:35 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: <7fqa72Q-76dLLcrh5JBPkN1CND66FluPrfVvTD61PBg=.eaa7aca3-3d47-41dc-b5df-88b282e01690@github.com> On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. > > Additional testing: > > - [x] jtreg tests(include tier1/2/3) on linux-x64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build Looks good to me. ------------- Marked as reviewed by ihse (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22701#pullrequestreview-2498852788 From azvegint at openjdk.org Thu Dec 12 11:39:39 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Thu, 12 Dec 2024 11:39:39 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v4] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 20:38:52 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > expand imports @AlexanderScherbatiy you might want to take a look test/jdk/java/awt/print/Dialog/PaperSizeError.java line 2: > 1: /* > 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. Suggestion: * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. Please fix the years, it should be `created year` - `last modified year`, like in the `CustomMediaSizeName.java` Looks good otherwise. ------------- Changes requested by azvegint (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2499100416 PR Review Comment: https://git.openjdk.org/jdk/pull/22429#discussion_r1881898227 From duke at openjdk.org Thu Dec 12 13:24:37 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Thu, 12 Dec 2024 13:24:37 GMT Subject: RFR: 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files In-Reply-To: References: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> Message-ID: On Tue, 10 Dec 2024 10:05:18 GMT, Prasanta Sadhukhan wrote: >> **Description:** >> The PR updates sun.print.CUPSPrinter's behavior in terms of reading media imageable area values according to the PostScript Printer Description File Format Specification. >> The actual implementation reads X and Y coordinates of the upper right corner of the imageable area as width and height of the imageable area. https://bugs.openjdk.org/browse/JDK-8344119 >> >> **Updates:** >> Added subtraction of the X and Y coordinates of the lower left corner to fix the width and height values of the imageable area. >> >> **Tests:** >> Tested with `test/jdk/javax/print/DialogMargins.java` using Brother DCP-T720DW, the test draws a black line along the borders of the imageable area. >> The test was run with the minimum possible margins. >> _Before the fix_: the right and bottom lines are not printed (the right and bottom lines are outside the printable area). >> _After the fix_: all lines are printed. > > I can see the spec https://web.mit.edu/PostScript/Adobe/Documents/5003.PPD_Spec_v4.3.pdf > indeed say that that > >> "The bounding box value of *ImageableArea is given as four real numbers, repre- >> senting the x and y coordinates of the lower left and upper right corners of the >> region, respectively, in the PostScript language default user space coordinate >> system." >> > > but I believe it will be better if we do the correction in CUPSfuncs.c#getPageSizes() which reads the "PageSize" and store the value so that it stores the correct value in native.. > > Also, it will be better to add a manual test similar to what is mentioned in the description above.. @prsadhuk, thanks for your review. Let me explain my decision before I move the changes to the native code. CUPS uses ppd_size_t structure to store a page size, and I suggested that we should return values from the native code as much closer to the CUPS's ppd_size_t structure. The structure contains 6 float values: width, length, left, bottom, right, and top; thus we should return from the native function the same 6 float values. typedef struct ppd_size_s // Page Sizes @deprecated@ { int marked; // Page size selected? char name[PPD_MAX_NAME]; // Media size option float width; // Width of media in points float length; // Length of media in points float left; // Left printable margin in points float bottom; // Bottom printable margin in points float right; // Right printable margin in points float top; // Top printable margin in points } ppd_size_t; https://github.com/OpenPrinting/cups/blob/c76b026e54a3f95d56d20c36d42c8bb4d4e23029/cups/ppd.h#L195 ------------- PR Comment: https://git.openjdk.org/jdk/pull/22110#issuecomment-2538903474 From duke at openjdk.org Thu Dec 12 13:29:55 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Thu, 12 Dec 2024 13:29:55 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v5] In-Reply-To: References: Message-ID: <7HEMx1Kk0jfocH6oZaciVEmR3pLMIjAvyFR_qd_0Dv0=.726a9cb1-7d98-494a-9c9b-647eded0ffef@github.com> > Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. > > **Reason of the bug:** > The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. > After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. > > For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. > *PaperDimension A4/A4: "595 842" > *PaperDimension BrA4_B/A4 (Borderless): "595 842" > After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. > After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". > > **Fix description:** > Create new MediaSize if there is no any other MediaSize with the same size. > > **Tests:** > OS: MacOS 12, Linux Ubuntu 22, Windows 11. > open/test/jdk/java/awt/print/Dialog/PaperSizeError.java > test/jdk/javax/print/CustomMediaSizeNameOOMETest.java > All tests from the test/jdk/javax/print/ GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: Update test/jdk/java/awt/print/Dialog/PaperSizeError.java Add created year to the copyright Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com> ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22429/files - new: https://git.openjdk.org/jdk/pull/22429/files/987131c6..f33d38e4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22429.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22429/head:pull/22429 PR: https://git.openjdk.org/jdk/pull/22429 From duke at openjdk.org Thu Dec 12 13:29:56 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Thu, 12 Dec 2024 13:29:56 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v4] In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 11:34:42 GMT, Alexander Zvegintsev wrote: >> GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: >> >> expand imports > > test/jdk/java/awt/print/Dialog/PaperSizeError.java line 2: > >> 1: /* >> 2: * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. > > Suggestion: > > * Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved. > > > Please fix the years, it should be `created year` - `last modified year`, like in the `CustomMediaSizeName.java` > > Looks good otherwise. Thanks, done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22429#discussion_r1882079358 From duke at openjdk.org Thu Dec 12 13:30:43 2024 From: duke at openjdk.org (Karm Michal Babacek) Date: Thu, 12 Dec 2024 13:30:43 GMT Subject: RFR: 8336382: Fixes error reporting in loading AWT and fonts [v10] In-Reply-To: References: Message-ID: On Tue, 26 Nov 2024 15:11:58 GMT, Karm Michal Babacek wrote: >> If there is a problem with finding and calling e.g. `java/awt/GraphicsEnvironment` in `AWTIsHeadless`, the env' Exception remains set and it is not cleared. Later, that manifests as: >> >> Fatal error reported via JNI: Could not allocate library name >> >> Which is misleading. The code path is perhaps rare in a normal JDK usage, but it has been complicating our users' bug reports in the GraalVM/native-image ecosystem for quite some time. >> >> Instead of failing later indicating that the user has incorrectly configured JNI, it bails out very soon with a message that seems as if a jstring could not have been allocated. It sends users on wild goose chases where it appears `JNU_NewStringPlatform` calls failed, e.g. >> >> * https://github.com/oracle/graal/issues/9138 >> * https://github.com/oracle/graal/issues/8475 >> * https://github.com/oracle/graal/issues/9300 >> * https://github.com/quarkusio/quarkus/issues/31596 >> * https://github.com/graalvm/mandrel/issues/292 >> * https://github.com/Karm/mandrel-integration-tests/issues/262 >> >> This commit fixes the error reporting in the AWTIsHeadless. >> >> Furthermore, when AOT compiled, there is little sense for having a JAVA_HOME, yet some parts of AWT code look for it to search fonts. In such case, an empty directory structure is enough to accommodate it, e.g. >> >> /tmp/JAVA_HOME/ >> /tmp/JAVA_HOME/conf >> /tmp/JAVA_HOME/conf/fonts >> /tmp/JAVA_HOME/lib >> >> The exception is somewhat cryptic for users again, merely stating: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 22.0.1/java.awt.Font.createFont0(Font.java:1205) >> at java.desktop at 22.0.1/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139 >> >> Adding the cause there makes it clearer, i.e. that JAVA_HOME might be missing: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 23-internal/java.awt.Font.createFont0(Font.java:1206) >> at java.desktop at 23-internal/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139) >> at imageio.Main.paintRectangles(Main.java:97) >> at imageio.Main.main(Main.java:195) >> at java.base at 23-internal/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH) >> Caused by: java.lang.Error: java.home property not set >> at java.desktop at 23-internal/sun.awt.FontConfiguration.findFontConfigF... > > Karm Michal Babacek has updated the pull request incrementally with one additional commit since the last revision: > > Amended error message, doesn't clear exception @mrserb Gentle nudge that this is ready for a re-review. Cheers K. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20169#issuecomment-2538920726 From psadhukhan at openjdk.org Thu Dec 12 16:03:38 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Thu, 12 Dec 2024 16:03:38 GMT Subject: RFR: 8344119: CUPSPrinter does not respect PostScript printer definition specification in case of reading ImageableArea values from PPD files In-Reply-To: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> References: <5S8fyVLCYJ6-k-4bqikLIsfJ9X6QFLsGm-55-PF-giY=.e7c503ec-d666-4fcb-b34b-243d205d127e@github.com> Message-ID: On Thu, 14 Nov 2024 16:15:46 GMT, GennadiyKrivoshein wrote: > **Description:** > The PR updates sun.print.CUPSPrinter's behavior in terms of reading media imageable area values according to the PostScript Printer Description File Format Specification. > The actual implementation reads X and Y coordinates of the upper right corner of the imageable area as width and height of the imageable area. https://bugs.openjdk.org/browse/JDK-8344119 > > **Updates:** > Added subtraction of the X and Y coordinates of the lower left corner to fix the width and height values of the imageable area. > > **Tests:** > Tested with `test/jdk/javax/print/DialogMargins.java` using Brother DCP-T720DW, the test draws a black line along the borders of the imageable area. > The test was run with the minimum possible margins. > _Before the fix_: the right and bottom lines are not printed (the right and bottom lines are outside the printable area). > _After the fix_: all lines are printed. So, how returning the correct values from JNI violate this? Even if we do the calculation in the native, we will still be returning float values for upper top, right coordinates, correct? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22110#issuecomment-2539369493 From prr at openjdk.org Thu Dec 12 19:55:37 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 12 Dec 2024 19:55:37 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Thu, 12 Dec 2024 10:28:57 GMT, Magnus Ihse Bursie wrote: >> Hi all, >> This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. >> >> Additional testing: >> >> - [x] jtreg tests(include tier1/2/3) on linux-x64 with release build >> - [x] jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build >> - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with release build >> - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build > > src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141: > >> 139: dladdr((void *)AWT_OnLoad, &dlinfo); >> 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { >> 141: perror((char *)dlinfo.dli_fname); > > Having error handling is better than no error handling, but is `perror` the best we can do? > > OTOH, maybe it doesn't matter as much. Something would be very, very broken if this were to fail. I saw this in another bug report too from the same submitter. I don't know that I want to encourage this as a pattern, except in debug builds. better might be to just copy dlinfo.dli_fname into buf .. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1882797066 From prr at openjdk.org Thu Dec 12 19:59:36 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 12 Dec 2024 19:59:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. > > Additional testing: > > - [x] jtreg tests(include tier1/2/3) on linux-x64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with release build > - [x] jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build > jtreg tests(include tier1/2/3) on linux-x64 with release build >jtreg tests(include tier1/2/3) on linux-x64 with fastdebug build >jtreg tests(include tier1/2/3) on linux-aarch64 with release build >jtreg tests(include tier1/2/3) on linux-aarch64 with fastdebug build That was entirely a waste of time and hasn't proved anything. If you examine the content of those tiers you will not find even a single test that loads AWT ! Try running the jdk_desktop group instead. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2539894262 From ihse at openjdk.org Thu Dec 12 22:58:40 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 12 Dec 2024 22:58:40 GMT Subject: RFR: 8336382: Fixes error reporting in loading AWT and fonts [v10] In-Reply-To: References: Message-ID: On Tue, 26 Nov 2024 15:11:58 GMT, Karm Michal Babacek wrote: >> If there is a problem with finding and calling e.g. `java/awt/GraphicsEnvironment` in `AWTIsHeadless`, the env' Exception remains set and it is not cleared. Later, that manifests as: >> >> Fatal error reported via JNI: Could not allocate library name >> >> Which is misleading. The code path is perhaps rare in a normal JDK usage, but it has been complicating our users' bug reports in the GraalVM/native-image ecosystem for quite some time. >> >> Instead of failing later indicating that the user has incorrectly configured JNI, it bails out very soon with a message that seems as if a jstring could not have been allocated. It sends users on wild goose chases where it appears `JNU_NewStringPlatform` calls failed, e.g. >> >> * https://github.com/oracle/graal/issues/9138 >> * https://github.com/oracle/graal/issues/8475 >> * https://github.com/oracle/graal/issues/9300 >> * https://github.com/quarkusio/quarkus/issues/31596 >> * https://github.com/graalvm/mandrel/issues/292 >> * https://github.com/Karm/mandrel-integration-tests/issues/262 >> >> This commit fixes the error reporting in the AWTIsHeadless. >> >> Furthermore, when AOT compiled, there is little sense for having a JAVA_HOME, yet some parts of AWT code look for it to search fonts. In such case, an empty directory structure is enough to accommodate it, e.g. >> >> /tmp/JAVA_HOME/ >> /tmp/JAVA_HOME/conf >> /tmp/JAVA_HOME/conf/fonts >> /tmp/JAVA_HOME/lib >> >> The exception is somewhat cryptic for users again, merely stating: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 22.0.1/java.awt.Font.createFont0(Font.java:1205) >> at java.desktop at 22.0.1/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139 >> >> Adding the cause there makes it clearer, i.e. that JAVA_HOME might be missing: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 23-internal/java.awt.Font.createFont0(Font.java:1206) >> at java.desktop at 23-internal/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139) >> at imageio.Main.paintRectangles(Main.java:97) >> at imageio.Main.main(Main.java:195) >> at java.base at 23-internal/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH) >> Caused by: java.lang.Error: java.home property not set >> at java.desktop at 23-internal/sun.awt.FontConfiguration.findFontConfigF... > > Karm Michal Babacek has updated the pull request incrementally with one additional commit since the last revision: > > Amended error message, doesn't clear exception I think this looks like a prudent solution. I am not part of the client team though, so don't count this as a formal review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/20169#issuecomment-2540172918 From syan at openjdk.org Fri Dec 13 03:28:36 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 03:28:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Thu, 12 Dec 2024 19:53:12 GMT, Phil Race wrote: >> src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141: >> >>> 139: dladdr((void *)AWT_OnLoad, &dlinfo); >>> 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { >>> 141: perror((char *)dlinfo.dli_fname); >> >> Having error handling is better than no error handling, but is `perror` the best we can do? >> >> OTOH, maybe it doesn't matter as much. Something would be very, very broken if this were to fail. > > I saw this in another bug report too from the same submitter. > I don't know that I want to encourage this as a pattern, except in debug builds. better might be to just copy dlinfo.dli_fname into buf .. `perror` will print the given message accrording the previous `errno` info to stderr, so this change will not change the original behaviour. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883201733 From syan at openjdk.org Fri Dec 13 03:37:36 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 03:37:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Thu, 12 Dec 2024 19:53:12 GMT, Phil Race wrote: >> src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 141: >> >>> 139: dladdr((void *)AWT_OnLoad, &dlinfo); >>> 140: if (realpath((char *)dlinfo.dli_fname, buf) == NULL) { >>> 141: perror((char *)dlinfo.dli_fname); >> >> Having error handling is better than no error handling, but is `perror` the best we can do? >> >> OTOH, maybe it doesn't matter as much. Something would be very, very broken if this were to fail. > > I saw this in another bug report too from the same submitter. > I don't know that I want to encourage this as a pattern, except in debug builds. better might be to just copy dlinfo.dli_fname into buf .. Hi @prrace, > I saw this in another bug report too from the same submitter. I did create 3 clang17 compile waring issues, the compile warings occur in different files, and maybe use should different solutions to solve the issue, so I create the separate issues. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883209539 From syan at openjdk.org Fri Dec 13 03:40:37 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 03:40:37 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Fri, 13 Dec 2024 03:34:32 GMT, SendaoYan wrote: >> I saw this in another bug report too from the same submitter. >> I don't know that I want to encourage this as a pattern, except in debug builds. better might be to just copy dlinfo.dli_fname into buf .. > > Hi @prrace, >> I saw this in another bug report too from the same submitter. > > I did create 3 clang17 compile waring issues, the compile warings occur in different files, and maybe use should different solutions to solve the issue, so I create the separate issues. > better might be to just copy dlinfo.dli_fname into buf "Something would be very, very broken if this were to fail.", So I think `perror` maybe better, it will print which file and the reason get realpath fail. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883212016 From syan at openjdk.org Fri Dec 13 03:57:40 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 03:57:40 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 19:57:13 GMT, Phil Race wrote: > Try running the jdk_desktop group instead. Thanks your advice. Mine meaning was verify this change will not cause new failures, since it will not change behaviour in theory. I will run jdk_desktop group now. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2540493179 From azvegint at openjdk.org Fri Dec 13 04:20:48 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 13 Dec 2024 04:20:48 GMT Subject: RFR: 8342096: Popup menus that request focus are not shown on Linux with Wayland Message-ID: The previous [JDK-8319103](https://bugs.openjdk.org/browse/JDK-8319103) fix was not complete. The case where a menu item with a focusable component was not a direct child of a window was missing(failing the `if (window == oppositeWindow.getParent() ) {` check), so the ungrab event was posted prematurely. This can be fixed by adding `waylandWindowFocusListener` to all submenus in hierarchy. The manual test updated to use this case, and also added an automated test that checks that it didn't close prematurely. ------------- Commit messages: - 8342096: Popup menus that request focus are not shown on Linux with Wayland Changes: https://git.openjdk.org/jdk/pull/22729/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22729&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342096 Stats: 133 lines in 3 files changed: 121 ins; 4 del; 8 mod Patch: https://git.openjdk.org/jdk/pull/22729.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22729/head:pull/22729 PR: https://git.openjdk.org/jdk/pull/22729 From syan at openjdk.org Fri Dec 13 04:31:34 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 04:31:34 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Fri, 13 Dec 2024 03:38:15 GMT, SendaoYan wrote: >> Hi @prrace, >>> I saw this in another bug report too from the same submitter. >> >> I did create 3 clang17 compile waring issues, the compile warings occur in different files, and maybe use should different solutions to solve the issue, so I create the separate issues. > >> better might be to just copy dlinfo.dli_fname into buf > > "Something would be very, very broken if this were to fail.", So I think `perror` maybe better, it will print which file and the reason get realpath fail. Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883270736 From tr at openjdk.org Fri Dec 13 05:05:36 2024 From: tr at openjdk.org (Tejesh R) Date: Fri, 13 Dec 2024 05:05:36 GMT Subject: RFR: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 02:39:07 GMT, Prasanta Sadhukhan wrote: > javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 seems to fail in OCI system citing "Test failed" > suggesting caret is not at expected place after text is typed, but I could not find any CI jobs having it failed. > Anyway simplified the test and added stability fixes which made it pass now in several OCI systems.. test/jdk/javax/swing/text/StyledEditorKit/4506788/bug4506788.java line 95: > 93: jep = new JEditorPane(); > 94: String text = "abc"; > 95: JFrame f = new JFrame("bug4506788"); `JFrame f` is not disposed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22698#discussion_r1883295811 From azvegint at openjdk.org Fri Dec 13 05:08:38 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 13 Dec 2024 05:08:38 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v5] In-Reply-To: <7HEMx1Kk0jfocH6oZaciVEmR3pLMIjAvyFR_qd_0Dv0=.726a9cb1-7d98-494a-9c9b-647eded0ffef@github.com> References: <7HEMx1Kk0jfocH6oZaciVEmR3pLMIjAvyFR_qd_0Dv0=.726a9cb1-7d98-494a-9c9b-647eded0ffef@github.com> Message-ID: On Thu, 12 Dec 2024 13:29:55 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/print/Dialog/PaperSizeError.java > > Add created year to the copyright > > Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com> Marked as reviewed by azvegint (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2501306068 From psadhukhan at openjdk.org Fri Dec 13 05:14:13 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 13 Dec 2024 05:14:13 GMT Subject: RFR: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: > javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 seems to fail in OCI system citing "Test failed" > suggesting caret is not at expected place after text is typed, but I could not find any CI jobs having it failed. > Anyway simplified the test and added stability fixes which made it pass now in several OCI systems.. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: dispose ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22698/files - new: https://git.openjdk.org/jdk/pull/22698/files/c5d78be9..a8cff5dc Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22698&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22698&range=00-01 Stats: 38 lines in 1 file changed: 9 ins; 0 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/22698.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22698/head:pull/22698 PR: https://git.openjdk.org/jdk/pull/22698 From psadhukhan at openjdk.org Fri Dec 13 05:14:13 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 13 Dec 2024 05:14:13 GMT Subject: RFR: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 05:02:57 GMT, Tejesh R wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> dispose > > test/jdk/javax/swing/text/StyledEditorKit/4506788/bug4506788.java line 95: > >> 93: jep = new JEditorPane(); >> 94: String text = "abc"; >> 95: JFrame f = new JFrame("bug4506788"); > > `JFrame f` is not disposed. done ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22698#discussion_r1883301674 From tr at openjdk.org Fri Dec 13 05:24:35 2024 From: tr at openjdk.org (Tejesh R) Date: Fri, 13 Dec 2024 05:24:35 GMT Subject: RFR: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 [v2] In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 05:14:13 GMT, Prasanta Sadhukhan wrote: >> javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 seems to fail in OCI system citing "Test failed" >> suggesting caret is not at expected place after text is typed, but I could not find any CI jobs having it failed. >> Anyway simplified the test and added stability fixes which made it pass now in several OCI systems.. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > dispose LGTM ------------- Marked as reviewed by tr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22698#pullrequestreview-2501326635 From psadhukhan at openjdk.org Fri Dec 13 05:52:39 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 13 Dec 2024 05:52:39 GMT Subject: Integrated: 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 02:39:07 GMT, Prasanta Sadhukhan wrote: > javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 seems to fail in OCI system citing "Test failed" > suggesting caret is not at expected place after text is typed, but I could not find any CI jobs having it failed. > Anyway simplified the test and added stability fixes which made it pass now in several OCI systems.. This pull request has now been integrated. Changeset: 31ceec7c Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/31ceec7cd55b455cddf0953cc23aaa64612bd6e7 Stats: 110 lines in 1 file changed: 37 ins; 50 del; 23 mod 8346055: javax/swing/text/StyledEditorKit/4506788/bug4506788.java fails in ubuntu22.04 Reviewed-by: tr ------------- PR: https://git.openjdk.org/jdk/pull/22698 From syan at openjdk.org Fri Dec 13 07:55:35 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 07:55:35 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. Compile warning of [JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059) was introduced recently, Compile warnings of [JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103) has exists for several years. So I want to deal with [JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059) separately make other issues can be backported to jdk21u-dev or jdk17u-dev cleanly. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2540806883 From ihse at openjdk.org Fri Dec 13 08:08:35 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 13 Dec 2024 08:08:35 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 03:55:09 GMT, SendaoYan wrote: > Thanks your advice. Mine meaning was verify this change will not cause new failures, since it will not change behaviour in theory. Well, yes, but to prove that you do need to run tests that actually exercise the code. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2540825997 From ihse at openjdk.org Fri Dec 13 08:08:35 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 13 Dec 2024 08:08:35 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: On Fri, 13 Dec 2024 04:29:09 GMT, SendaoYan wrote: >>> better might be to just copy dlinfo.dli_fname into buf >> >> "Something would be very, very broken if this were to fail.", So I think `perror` maybe better, it will print which file and the reason get realpath fail. > > Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue > `perror` will print the given message accrording the previous `errno` info to stderr, so this change will not change the original behaviour. What do you mean? The original behavior would not write anything to stderr under any circumstance. Now since the file name comes from a loaded library, I can't possibly imagine anything (short of a provoked situation where someone deliberatly removes the library after starting the JVM or something like that) that would cause realpath to fail. So this is basically just about keeping the compiler quiet. Had we *really* expected that this could happen, this would not have been an accepted solution. Then you'd had to raise an exception, perhaps, and see if/how the operation could be retried, what consequences a failure would have, etc. But as I said, in this particular instance, it might be okay. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883520144 From ihse at openjdk.org Fri Dec 13 08:12:36 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 13 Dec 2024 08:12:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> Message-ID: <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> On Fri, 13 Dec 2024 08:04:50 GMT, Magnus Ihse Bursie wrote: >> Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue > >> `perror` will print the given message accrording the previous `errno` info to stderr, so this change will not change the original behaviour. > > What do you mean? The original behavior would not write anything to stderr under any circumstance. > > Now since the file name comes from a loaded library, I can't possibly imagine anything (short of a provoked situation where someone deliberatly removes the library after starting the JVM or something like that) that would cause realpath to fail. So this is basically just about keeping the compiler quiet. > > Had we *really* expected that this could happen, this would not have been an accepted solution. Then you'd had to raise an exception, perhaps, and see if/how the operation could be retried, what consequences a failure would have, etc. > > But as I said, in this particular instance, it might be okay. > Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue I personally would probably have started out by making a single issue for these, since they all try to address the same new warning in clang, and are all in client code, and only split it up later if reviewers had requested it. But since you have created separate issues, I suggest you do not change things now. Also, the other two I believe need a more serious response; a write to a pipe has a somewhat more realistic chance at failure than this filename lookup. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883525731 From syan at openjdk.org Fri Dec 13 08:28:36 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 08:28:36 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> Message-ID: On Fri, 13 Dec 2024 08:10:10 GMT, Magnus Ihse Bursie wrote: >>> `perror` will print the given message accrording the previous `errno` info to stderr, so this change will not change the original behaviour. >> >> What do you mean? The original behavior would not write anything to stderr under any circumstance. >> >> Now since the file name comes from a loaded library, I can't possibly imagine anything (short of a provoked situation where someone deliberatly removes the library after starting the JVM or something like that) that would cause realpath to fail. So this is basically just about keeping the compiler quiet. >> >> Had we *really* expected that this could happen, this would not have been an accepted solution. Then you'd had to raise an exception, perhaps, and see if/how the operation could be retried, what consequences a failure would have, etc. >> >> But as I said, in this particular instance, it might be okay. > >> Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue > > I personally would probably have started out by making a single issue for these, since they all try to address the same new warning in clang, and are all in client code, and only split it up later if reviewers had requested it. But since you have created separate issues, I suggest you do not change things now. Also, the other two I believe need a more serious response; a write to a pipe has a somewhat more realistic chance at failure than this filename lookup. Sorry for the confuse. I mean this PR change nothing except it will print a message to stderr when realpath return NULL. Thanks magicus. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1883544101 From syan at openjdk.org Fri Dec 13 08:37:40 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 08:37:40 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. Thanks all for the reviews. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2540869736 From syan at openjdk.org Fri Dec 13 08:37:41 2024 From: syan at openjdk.org (SendaoYan) Date: Fri, 13 Dec 2024 08:37:41 GMT Subject: Integrated: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. This pull request has now been integrated. Changeset: 367c3041 Author: SendaoYan URL: https://git.openjdk.org/jdk/commit/367c3041272d43b0474b433c555f22a3e15579f6 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 Reviewed-by: ihse ------------- PR: https://git.openjdk.org/jdk/pull/22701 From nbenalla at openjdk.org Fri Dec 13 11:28:39 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Fri, 13 Dec 2024 11:28:39 GMT Subject: [jdk24] RFR: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 18:31:18 GMT, Nizar Benalla wrote: > Hi all, > > This pull request contains a backport of commit 9bd70ec806ac0134926f32e222f4075e3d407422 from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Nizar Benalla on 10 Dec 2024 and was reviewed by [Prasanta Sadhukhan](https://github.com/prsadhuk). > > Thanks! I wanted to mark the backport as clean, but it's not enabled. Thanks for the review! This change is identical to https://github.com/openjdk/jdk/commit/9bd70ec806ac0134926f32e222f4075e3d407422 ------------- PR Comment: https://git.openjdk.org/jdk/pull/22669#issuecomment-2541235245 From nbenalla at openjdk.org Fri Dec 13 11:28:40 2024 From: nbenalla at openjdk.org (Nizar Benalla) Date: Fri, 13 Dec 2024 11:28:40 GMT Subject: [jdk24] Integrated: 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 In-Reply-To: References: Message-ID: <7feC_FJuMW1vP5iEYBaQW_p5t1WLheYig9WF5Bo4mig=.a33fb541-1b7c-49cc-8352-105c19f5f48a@github.com> On Tue, 10 Dec 2024 18:31:18 GMT, Nizar Benalla wrote: > Hi all, > > This pull request contains a backport of commit 9bd70ec806ac0134926f32e222f4075e3d407422 from the [openjdk/jdk](https://git.openjdk.org/jdk) repository. > > The commit being backported was authored by Nizar Benalla on 10 Dec 2024 and was reviewed by [Prasanta Sadhukhan](https://github.com/prsadhuk). > > Thanks! This pull request has now been integrated. Changeset: 6bc14d6b Author: Nizar Benalla URL: https://git.openjdk.org/jdk/commit/6bc14d6b7740a2a08ce234b24a3a94a433df994c Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8345888: Broken links in the JDK 24 JavaDoc API documentation, build 27 Reviewed-by: psadhukhan Backport-of: 9bd70ec806ac0134926f32e222f4075e3d407422 ------------- PR: https://git.openjdk.org/jdk/pull/22669 From aivanov at openjdk.org Fri Dec 13 12:50:39 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 13 Dec 2024 12:50:39 GMT Subject: RFR: 8342096: Popup menus that request focus are not shown on Linux with Wayland In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 04:16:06 GMT, Alexander Zvegintsev wrote: > The previous [JDK-8319103](https://bugs.openjdk.org/browse/JDK-8319103) fix was not complete. > > The case where a menu item with a focusable component was not a direct child of a window was missing(failing the `if (window == oppositeWindow.getParent() ) {` check), so the ungrab event was posted prematurely. > > This can be fixed by adding `waylandWindowFocusListener` to all submenus in hierarchy. > > The manual test updated to use this case, and also added an automated test that checks that it didn't close prematurely. src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java line 532: > 530: } > 531: } > 532: return false; If you like, you may use Stream API: Suggestion: return Arrays.stream(window.getWindowFocusListeners()) .anyMatch(fl -> fl == waylandWindowFocusListener); I haven't tested the code though. src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java line 550: > 548: addWaylandWindowFocusListenerToWindow(oppositeWindow); > 549: return; > 550: } So it's possible now that several windows in a hierarchy will have the listener added? Won't the listener be leaked? In other words, do we always remove the listener? test/jdk/javax/swing/JPopupMenu/NestedFocusablePopupTest.java line 53: > 51: //test is valid only when running on Wayland. > 52: return; > 53: } I think it should rather throw `jtreg.SkippedException`. With [jtreg enhancements](https://github.com/openjdk/jtreg/pull/217) and further reporting enhancements, we'll be able to see if tests aren't actually executed. test/jdk/javax/swing/JPopupMenu/NestedFocusablePopupTest.java line 80: > 78: if (!popupMenu.isVisible()) { > 79: throw new RuntimeException("Popup is not visible"); > 80: } Perhaps, you should call `popupMenu.isVisible()` on EDT? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1883879389 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1883871284 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1883884693 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1883889144 From ihse at openjdk.org Fri Dec 13 14:36:08 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 13 Dec 2024 14:36:08 GMT Subject: RFR: 8346195: Fix static initialization problem in GDIHashtable Message-ID: There has been a latent problem in `GDIHashtable` since time immemorial, but due to sheer luck it has not caused any issues for us. However, I managed to provoke it when I was doing some build changes. This is the problem: In `GDIHashtable`, there is a static field `GDIHashtable::BatchDestructionManager manager`, which is initialized in `GDIHashtable.cpp`. In `AwtPen`, there is a static field `GDIHashtable cache`, which is initialized in `awt_Pen.cpp`. The `GDIHashtable` constructor calls `manager.add(this)`. For this to work, the manager must have been initialized prior to the AwtPen. However, the order of which static initializers are run between different compilation units are not well-defined, and we've just been lucky so far that it works. This problem is known as the "Static Initialization Order Fiasco", see e.g. https://en.cppreference.com/w/cpp/language/siof I have solved this by encapsulating the static manager instance in a method, which guarantees that it has been initialized before use. This seemed to me to be the cleanest solution. ------------- Commit messages: - 8346195: Fix static initialization problem in GDIHashtable Changes: https://git.openjdk.org/jdk/pull/22736/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22736&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346195 Stats: 14 lines in 2 files changed: 3 ins; 2 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/22736.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22736/head:pull/22736 PR: https://git.openjdk.org/jdk/pull/22736 From azvegint at openjdk.org Fri Dec 13 22:19:36 2024 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Fri, 13 Dec 2024 22:19:36 GMT Subject: RFR: 8342096: Popup menus that request focus are not shown on Linux with Wayland In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 12:39:02 GMT, Alexey Ivanov wrote: >> The previous [JDK-8319103](https://bugs.openjdk.org/browse/JDK-8319103) fix was not complete. >> >> The case where a menu item with a focusable component was not a direct child of a window was missing(failing the `if (window == oppositeWindow.getParent() ) {` check), so the ungrab event was posted prematurely. >> >> This can be fixed by adding `waylandWindowFocusListener` to all submenus in hierarchy. >> >> The manual test updated to use this case, and also added an automated test that checks that it didn't close prematurely. > > src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java line 532: > >> 530: } >> 531: } >> 532: return false; > > If you like, you may use Stream API: > Suggestion: > > return Arrays.stream(window.getWindowFocusListeners()) > .anyMatch(fl -> fl == waylandWindowFocusListener); > > I haven't tested the code though. I didn't use the stream API on purpose to be a bit faster, since we're usually working with very small arrays (usually about 0-1 elements). > src/java.desktop/unix/classes/sun/awt/UNIXToolkit.java line 550: > >> 548: addWaylandWindowFocusListenerToWindow(oppositeWindow); >> 549: return; >> 550: } > > So it's possible now that several windows in a hierarchy will have the listener added? Won't the listener be leaked? In other words, do we always remove the listener? As far as my tests with an instrumented build show - yes, but I discovered another case not covered: for (int i = 0; i <= 1; i++) { JMenu menu = new JMenu("Menu " + i); menu.add(new JTextField("JTextField " + i)); popupMenu.add(menu); } Clicking on gnome text editor does not hide the menu if the second menu is open. I do have a fix for it, but will not rush to post it, as I do not have enough time to test it thoroughly. I will move this PR to draft status as I will be on vacation starting next week. > test/jdk/javax/swing/JPopupMenu/NestedFocusablePopupTest.java line 53: > >> 51: //test is valid only when running on Wayland. >> 52: return; >> 53: } > > I think it should rather throw `jtreg.SkippedException`. > > With [jtreg enhancements](https://github.com/openjdk/jtreg/pull/217) and further reporting enhancements, we'll be able to see if tests aren't actually executed. Ok, but this test will lose the ability to run standalone with just `java NestedFocusablePopupTest.java`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1884600821 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1884598134 PR Review Comment: https://git.openjdk.org/jdk/pull/22729#discussion_r1884599302 From davidalayachew at gmail.com Sun Dec 15 21:04:02 2024 From: davidalayachew at gmail.com (David Alayachew) Date: Sun, 15 Dec 2024 16:04:02 -0500 Subject: Windows Magnifier does not work with my Swing applications Message-ID: 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 duke at openjdk.org Mon Dec 16 16:01:44 2024 From: duke at openjdk.org (duke) Date: Mon, 16 Dec 2024 16:01:44 GMT Subject: Withdrawn: 8341984: Use PassFailJFrame for TimeChangeButtonClickTest.java In-Reply-To: <3Xa-4MDxZJ6PPZS28GBEvQvHMPWAwsobsWWip_y7Z3E=.98a86678-8afa-4046-9c76-fa167fa5dcf4@github.com> References: <3Xa-4MDxZJ6PPZS28GBEvQvHMPWAwsobsWWip_y7Z3E=.98a86678-8afa-4046-9c76-fa167fa5dcf4@github.com> Message-ID: On Fri, 11 Oct 2024 18:47:47 GMT, Alexey Ivanov wrote: > Refactor the test `javax/swing/JButton/TimeChangeButtonClickTest.java` to use the `PassFailJFrame` framework to handle the tester's decision on whether the test passes or fails. > > I reformatted the instructions for performing the test into HTML. > > I preserved the test UI panel which contains the button to press and the label with button press counter. > > The updated test is shorter by nearly 100 lines. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/21476 From psadhukhan at openjdk.org Mon Dec 16 16:51:06 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 16 Dec 2024 16:51:06 GMT Subject: RFR: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI Message-ID: Test seem to fail in CI due to caret position not in expected position after pressing VK_RIGHT/VK_LEFT. Added some log which shows the same passed1 moveCaret1 true passed2 moveCaret5 true passed3 moveCaret8 true passed4 moveCaret9 false passed5 moveCaret13 false passed6 moveCaret16 false passed7 moveCaret17 false Added some delay for this slow system..Tested to pass in several systems..link in JBS ------------- Commit messages: - 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI Changes: https://git.openjdk.org/jdk/pull/22768/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22768&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346234 Stats: 30 lines in 1 file changed: 30 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22768.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22768/head:pull/22768 PR: https://git.openjdk.org/jdk/pull/22768 From kizune at openjdk.org Mon Dec 16 19:22:37 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 16 Dec 2024 19:22:37 GMT Subject: RFR: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI In-Reply-To: References: Message-ID: <6Z7thOLyW4n7fun8KWy3boub3bbe8lO188Ymu0lUFGM=.cba07f09-3e00-4c4a-ad64-f3a873a89140@github.com> On Mon, 16 Dec 2024 16:46:10 GMT, Prasanta Sadhukhan wrote: > Test seem to fail in CI due to caret position not in expected position after pressing VK_RIGHT/VK_LEFT. > Added some log which shows the same > > > passed1 moveCaret1 true > passed2 moveCaret5 true > passed3 moveCaret8 true > passed4 moveCaret9 false > passed5 moveCaret13 false > passed6 moveCaret16 false > passed7 moveCaret17 false > > > Added some delay for this slow system..Tested to pass in several systems..link in JBS test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java line 71: > 69: > 70: passed &= moveCaret(true) == 1; > 71: System.out.println("passed1 moveCaret1 " + passed); If you are trying to get more information here why not logging the actual position of the caret after the move? Either inside the moveCaret() method or just add a new variable like `int caret;` And then every time you do the test you assign it. `passed &= (caret = moveCaret(true)) == 1;` and then you can just output the new caret position after each iteration like "Expected position 1 actual position " + caret. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22768#discussion_r1887371569 From kizune at openjdk.org Mon Dec 16 19:48:42 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Mon, 16 Dec 2024 19:48:42 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Sun, 8 Dec 2024 07:52:17 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after 500 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with five additional commits since the last revision: > > - 8342782: move comments re implementation details inside method > > Also avoid restating constant, instead only refer to it as "threshold" > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855148909 > - 8342782: adding an empty line representing EOF > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1871348260 > - 8342782: changing "/2" to " / 2" > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1871376542 > - 8342782: change threshold from 500 to 100 > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855398578 > - 8342782: convert value (500) to named constant > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855397860 Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/21962#pullrequestreview-2507190370 From alexsch at openjdk.org Mon Dec 16 20:19:38 2024 From: alexsch at openjdk.org (Alexander Scherbatiy) Date: Mon, 16 Dec 2024 20:19:38 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v5] In-Reply-To: <7HEMx1Kk0jfocH6oZaciVEmR3pLMIjAvyFR_qd_0Dv0=.726a9cb1-7d98-494a-9c9b-647eded0ffef@github.com> References: <7HEMx1Kk0jfocH6oZaciVEmR3pLMIjAvyFR_qd_0Dv0=.726a9cb1-7d98-494a-9c9b-647eded0ffef@github.com> Message-ID: On Thu, 12 Dec 2024 13:29:55 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein has updated the pull request incrementally with one additional commit since the last revision: > > Update test/jdk/java/awt/print/Dialog/PaperSizeError.java > > Add created year to the copyright > > Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com> Marked as reviewed by alexsch (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22429#pullrequestreview-2507274611 From duke at openjdk.org Mon Dec 16 21:54:39 2024 From: duke at openjdk.org (Jeremy) Date: Mon, 16 Dec 2024 21:54:39 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> Message-ID: <3PC_fuUXCVt-ahn73GDqFfqY83YZJGJOWapuwi-Q5V0=.6b39f47e-b9a2-4403-bb7e-89a42f244a4d@github.com> On Sun, 24 Nov 2024 08:55:20 GMT, Laurent Bourg?s wrote: >> Here is a constant declaration (hotspot friendly): >> https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/Renderer.java#L38 >> >> private static final int ALL_BUT_LSB = 0xFFFFFFFE; > > '500 iterations' looks high, maybe 100? > It is a recursion ? You could try max recursion depth + 3 samples (first, middle, last) ? > > Or this magic threshold could be tunable ac runtime using special static getter using a System property + default value, used by constant declaration (final static is mandatory): > > https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L50 > > https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L303 @bourgesl before I try to integrate these changes: does my response above make sense/satisfy your concern? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1887628360 From honkar at openjdk.org Mon Dec 16 23:54:45 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 16 Dec 2024 23:54:45 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null Message-ID: Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. long hIcon = getSystemIcon(iconType.getIconID()); //Can return null Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. getSystemIcon calls LoadIcon (User32.dll). This can return null. https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona ------------- Commit messages: - null check for Win icons Changes: https://git.openjdk.org/jdk/pull/22776/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22776&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8344907 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22776.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22776/head:pull/22776 PR: https://git.openjdk.org/jdk/pull/22776 From honkar at openjdk.org Tue Dec 17 00:06:35 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 17 Dec 2024 00:06:35 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Mon, 16 Dec 2024 23:49:58 GMT, Harshitha Onkar wrote: > Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. > > > long hIcon = getSystemIcon(iconType.getIconID()); //Can return null > Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false > if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null > > > Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. > > getSystemIcon calls LoadIcon (User32.dll). This can return null. > https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1220: > 1218: Image icon = makeIcon(hIcon); > 1219: if (icon != null && size != icon.getWidth(null)) { > 1220: icon = new MultiResolutionIconImage(size, icon); Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1887726278 From achung at openjdk.org Tue Dec 17 01:10:12 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 17 Dec 2024 01:10:12 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen Message-ID: 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. ------------- Commit messages: - init commit Changes: https://git.openjdk.org/jdk/pull/22781/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8345538 Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 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 honkar at openjdk.org Tue Dec 17 01:43:39 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 17 Dec 2024 01:43:39 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 01:01:55 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. src/java.desktop/share/classes/java/awt/Robot.java line 223: > 221: */ > 222: public synchronized void mouseMove(int x, int y) { > 223: // peer.mouseMove(x, y); Commented line can be removed. src/java.desktop/share/classes/java/awt/Robot.java line 226: > 224: peer.mouseMove(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width), > 225: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height)); > 226: afterEvent(); @alisenchung It might be good to add a simple test case. Probably robot.mouseMove() to off-screen coordinates and pass the test if the coordinates returned by MouseInfo.getPointerInfo().getLocation() is clamped (limited to screen bounds) else fail. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1887779880 PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1887784313 From psadhukhan at openjdk.org Tue Dec 17 02:48:11 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 17 Dec 2024 02:48:11 GMT Subject: RFR: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI [v2] In-Reply-To: References: Message-ID: > Test seem to fail in CI due to caret position not in expected position after pressing VK_RIGHT/VK_LEFT. > Added some log which shows the same > > > passed1 moveCaret1 true > passed2 moveCaret5 true > passed3 moveCaret8 true > passed4 moveCaret9 false > passed5 moveCaret13 false > passed6 moveCaret16 false > passed7 moveCaret17 false > > > Added some delay for this slow system..Tested to pass in several systems..link in JBS Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: log caret position ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22768/files - new: https://git.openjdk.org/jdk/pull/22768/files/75a2f7f8..3b1d0d18 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22768&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22768&range=00-01 Stats: 43 lines in 1 file changed: 15 ins; 0 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/22768.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22768/head:pull/22768 PR: https://git.openjdk.org/jdk/pull/22768 From psadhukhan at openjdk.org Tue Dec 17 02:48:11 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 17 Dec 2024 02:48:11 GMT Subject: RFR: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI [v2] In-Reply-To: <6Z7thOLyW4n7fun8KWy3boub3bbe8lO188Ymu0lUFGM=.cba07f09-3e00-4c4a-ad64-f3a873a89140@github.com> References: <6Z7thOLyW4n7fun8KWy3boub3bbe8lO188Ymu0lUFGM=.cba07f09-3e00-4c4a-ad64-f3a873a89140@github.com> Message-ID: On Mon, 16 Dec 2024 19:19:29 GMT, Alexander Zuev wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> log caret position > > test/jdk/javax/swing/text/DefaultEditorKit/4278839/bug4278839.java line 71: > >> 69: >> 70: passed &= moveCaret(true) == 1; >> 71: System.out.println("passed1 moveCaret1 " + passed); > > If you are trying to get more information here why not logging the actual position of the caret after the move? Either inside the moveCaret() method or just add a new variable like > `int caret;` > And then every time you do the test you assign it. > `passed &= (caret = moveCaret(true)) == 1;` > and then you can just output the new caret position after each iteration like "Expected position 1 actual position " + caret. good point..logged.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22768#discussion_r1887822094 From kizune at openjdk.org Tue Dec 17 03:50:35 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 17 Dec 2024 03:50:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 01:01:55 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. src/java.desktop/share/classes/java/awt/Robot.java line 225: > 223: // peer.mouseMove(x, y); > 224: peer.mouseMove(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width), > 225: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height)); But that will limit current robot's functionality on the multi-monitor setups. Right now i can move mouse using robot from one screen to another, With your change it seems to be impossible? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1887856509 From kizune at openjdk.org Tue Dec 17 04:03:36 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 17 Dec 2024 04:03:36 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: <05MkkfzbRX2lMEda-gJ4nifEfVvmRFtcSdKV1AV8tWA=.791003ac-8be1-4c74-a558-cddbbf39abd0@github.com> On Mon, 16 Dec 2024 23:49:58 GMT, Harshitha Onkar wrote: > Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. > > > long hIcon = getSystemIcon(iconType.getIconID()); //Can return null > Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false > if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null > > > Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. > > getSystemIcon calls LoadIcon (User32.dll). This can return null. > https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1203: > 1201: */ > 1202: static Image getSystemIcon(SystemIcon iconType) { > 1203: long hIcon = getSystemIcon(iconType.getIconID()); What is hIcon value here? If it is 0 we can simply add the same condition as in the getShell32Icon and avoid all the makeIcon and disposeIcon calls. Or we have a valid hIcon code but makeIcon is unable to construct an icon for it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1887863199 From kizune at openjdk.org Tue Dec 17 04:40:35 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 17 Dec 2024 04:40:35 GMT Subject: RFR: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI [v2] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 02:48:11 GMT, Prasanta Sadhukhan wrote: >> Test seem to fail in CI due to caret position not in expected position after pressing VK_RIGHT/VK_LEFT. >> Added some log which shows the same >> >> >> passed1 moveCaret1 true >> passed2 moveCaret5 true >> passed3 moveCaret8 true >> passed4 moveCaret9 false >> passed5 moveCaret13 false >> passed6 moveCaret16 false >> passed7 moveCaret17 false >> >> >> Added some delay for this slow system..Tested to pass in several systems..link in JBS > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > log caret position Marked as reviewed by kizune (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22768#pullrequestreview-2507830426 From lbourges at openjdk.org Tue Dec 17 06:49:43 2024 From: lbourges at openjdk.org (Laurent =?UTF-8?B?Qm91cmfDqHM=?=) Date: Tue, 17 Dec 2024 06:49:43 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: <3PC_fuUXCVt-ahn73GDqFfqY83YZJGJOWapuwi-Q5V0=.6b39f47e-b9a2-4403-bb7e-89a42f244a4d@github.com> References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> <7gp-NCHUoqWy8a-UuUICrvAIYbLfRsH3vOGnos7gx_s=.f5342625-2385-44fa-8ca0-6e40496b1e27@github.com> <3PC_fuUXCVt-ahn73GDqFfqY83YZJGJOWapuwi-Q5V0=.6b39f47e-b9a2-4403-bb7e-89a42f244a4d@github.com> Message-ID: On Mon, 16 Dec 2024 21:51:35 GMT, Jeremy wrote: >> '500 iterations' looks high, maybe 100? >> It is a recursion ? You could try max recursion depth + 3 samples (first, middle, last) ? >> >> Or this magic threshold could be tunable ac runtime using special static getter using a System property + default value, used by constant declaration (final static is mandatory): >> >> https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L50 >> >> https://github.com/bourgesl/jdk-official/blob/d0b770c938be6b5b3a0176148265ef33184a9b8b/src/java.desktop/share/classes/sun/java2d/marlin/MarlinProperties.java#L303 > > @bourgesl before I try to integrate these changes: does my response above make sense/satisfy your concern? LGTM ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21962#discussion_r1887982779 From psadhukhan at openjdk.org Tue Dec 17 07:49:43 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 17 Dec 2024 07:49:43 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI Message-ID: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing java.lang.RuntimeException: The scrollbar block increment is incorrect at bug4865918.main(bug4865918.java:60) Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. Fix is passing in CI in several CI systems ------------- Commit messages: - test fix Changes: https://git.openjdk.org/jdk/pull/22783/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346324 Stats: 10 lines in 1 file changed: 10 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22783.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22783/head:pull/22783 PR: https://git.openjdk.org/jdk/pull/22783 From psadhukhan at openjdk.org Tue Dec 17 07:49:55 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 17 Dec 2024 07:49:55 GMT Subject: Integrated: 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI In-Reply-To: References: Message-ID: On Mon, 16 Dec 2024 16:46:10 GMT, Prasanta Sadhukhan wrote: > Test seem to fail in CI due to caret position not in expected position after pressing VK_RIGHT/VK_LEFT. > Added some log which shows the same > > > passed1 moveCaret1 true > passed2 moveCaret5 true > passed3 moveCaret8 true > passed4 moveCaret9 false > passed5 moveCaret13 false > passed6 moveCaret16 false > passed7 moveCaret17 false > > > Added some delay for this slow system..Tested to pass in several systems..link in JBS This pull request has now been integrated. Changeset: 466c00ac Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/466c00ac88569d145a47845b2c9a2522a1649889 Stats: 59 lines in 1 file changed: 45 ins; 0 del; 14 mod 8346234: javax/swing/text/DefaultEditorKit/4278839/bug4278839.java still fails in CI Reviewed-by: kizune ------------- PR: https://git.openjdk.org/jdk/pull/22768 From duke at openjdk.org Tue Dec 17 08:58:28 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Tue, 17 Dec 2024 08:58:28 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v6] In-Reply-To: References: Message-ID: > Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. > > **Reason of the bug:** > The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. > After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. > > For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. > *PaperDimension A4/A4: "595 842" > *PaperDimension BrA4_B/A4 (Borderless): "595 842" > After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. > After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". > > **Fix description:** > Create new MediaSize if there is no any other MediaSize with the same size. > > **Tests:** > OS: MacOS 12, Linux Ubuntu 22, Windows 11. > open/test/jdk/java/awt/print/Dialog/PaperSizeError.java > test/jdk/javax/print/CustomMediaSizeNameOOMETest.java > All tests from the test/jdk/javax/print/ GennadiyKrivoshein 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 8343224-print.Dialog.PaperSizeError.java-fails - Update test/jdk/java/awt/print/Dialog/PaperSizeError.java Add created year to the copyright Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com> - expand imports - update test tag - update copyright - Create MediaSize only if getStandardMedia is null ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22429/files - new: https://git.openjdk.org/jdk/pull/22429/files/f33d38e4..c9e0d19b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22429&range=04-05 Stats: 110732 lines in 4120 files changed: 84928 ins; 14962 del; 10842 mod Patch: https://git.openjdk.org/jdk/pull/22429.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22429/head:pull/22429 PR: https://git.openjdk.org/jdk/pull/22429 From ihse at openjdk.org Tue Dec 17 10:18:37 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 10:18:37 GMT Subject: RFR: 8346195: Fix static initialization problem in GDIHashtable In-Reply-To: References: Message-ID: <8PgvmMmyd5n2KatXu1dnEkBT_NAD7hTtZaxho-xxuuU=.3cd02baa-baa0-4402-8f8e-51e9e6de1938@github.com> On Fri, 13 Dec 2024 14:30:37 GMT, Magnus Ihse Bursie wrote: > There has been a latent problem in `GDIHashtable` since time immemorial, but due to sheer luck it has not caused any issues for us. However, I managed to provoke it when I was doing some build changes. > > This is the problem: > In `GDIHashtable`, there is a static field `GDIHashtable::BatchDestructionManager manager`, which is initialized in `GDIHashtable.cpp`. > > In `AwtPen`, there is a static field `GDIHashtable cache`, which is initialized in `awt_Pen.cpp`. > > The `GDIHashtable` constructor calls `manager.add(this)`. > > For this to work, the manager must have been initialized prior to the AwtPen. However, the order of which static initializers are run between different compilation units are not well-defined, and we've just been lucky so far that it works. > > This problem is known as the "Static Initialization Order Fiasco", see e.g. https://en.cppreference.com/w/cpp/language/siof > > I have solved this by encapsulating the static manager instance in a method, which guarantees that it has been initialized before use. This seemed to me to be the cleanest solution. Any reviewers on this? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22736#issuecomment-2548055286 From dgredler at openjdk.org Tue Dec 17 12:05:43 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Tue, 17 Dec 2024 12:05:43 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 20:48:51 GMT, Alisen Chung wrote: >> Soft hyphens should never render, regardless of the rendering path used internally. >> >> This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). >> >> Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. >> >> The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. > > Test currently fails with error `java.lang.RuntimeException: stringWidth for char 00ad using font Dialog: 101 != 333 > ` @alisenchung What OS and architecture are you testing on where you see failures? The automated checks seem to have all passed (except for `macos-aarch64`, which has been broken for quite a few weeks due to an unrelated toolchain issue: `xcode-select: error: invalid developer directory '/Applications/Xcode_14.3.1.app/Contents/Developer'`). ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2548274677 From ihse at openjdk.org Tue Dec 17 12:59:24 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 12:59:24 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds Message-ID: All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. Our bundled version of freetype is missing such a marker. This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. ------------- Commit messages: - 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds Changes: https://git.openjdk.org/jdk/pull/22791/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22791&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346394 Stats: 6 lines in 2 files changed: 1 ins; 3 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22791.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22791/head:pull/22791 PR: https://git.openjdk.org/jdk/pull/22791 From jwaters at openjdk.org Tue Dec 17 13:09:37 2024 From: jwaters at openjdk.org (Julian Waters) Date: Tue, 17 Dec 2024 13:09:37 GMT Subject: RFR: 8346195: Fix static initialization problem in GDIHashtable In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 14:30:37 GMT, Magnus Ihse Bursie wrote: > There has been a latent problem in `GDIHashtable` since time immemorial, but due to sheer luck it has not caused any issues for us. However, I managed to provoke it when I was doing some build changes. > > This is the problem: > In `GDIHashtable`, there is a static field `GDIHashtable::BatchDestructionManager manager`, which is initialized in `GDIHashtable.cpp`. > > In `AwtPen`, there is a static field `GDIHashtable cache`, which is initialized in `awt_Pen.cpp`. > > The `GDIHashtable` constructor calls `manager.add(this)`. > > For this to work, the manager must have been initialized prior to the AwtPen. However, the order of which static initializers are run between different compilation units are not well-defined, and we've just been lucky so far that it works. > > This problem is known as the "Static Initialization Order Fiasco", see e.g. https://en.cppreference.com/w/cpp/language/siof > > I have solved this by encapsulating the static manager instance in a method, which guarantees that it has been initialized before use. This seemed to me to be the cleanest solution. > Any reviewers on this? Looks ok and trivial to me (But I'm not a Reviewer, unfortunately) ------------- Marked as reviewed by jwaters (Committer). PR Review: https://git.openjdk.org/jdk/pull/22736#pullrequestreview-2508837537 From aivanov at openjdk.org Tue Dec 17 13:18:38 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 13:18:38 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 07:44:11 GMT, Prasanta Sadhukhan wrote: > javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing > > java.lang.RuntimeException: The scrollbar block increment is incorrect > at bug4865918.main(bug4865918.java:60) > > Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. > Fix is passing in CI in several CI systems In the description you say, ?scrollbar is not in focus when mouse is pressed.? Yet there's nothing in the test which handles the focus? even in the updated test. However, I agree that your update makes the test more reliable, the latch guarantees the synthetic mouse event is handled before analysing the result. So, it looks good exception for a couple of nits. test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 50: > 48: > 49: public static void main(String[] argv) throws Exception { > 50: latch = new CountDownLatch(1); Initialise the latch at its declaration. Suggestion: private static final CountDownLatch latch = new CountDownLatch(1); public static void main(String[] argv) throws Exception { `mousePressLatch` would be a more descriptive name. test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > 57: > 58: SwingUtilities.invokeAndWait(() -> sbar.pressMouse()); > 59: latch.await(); You should use timed `await` and throw an exception if the wait times out. This way the timeout would be handled more gracefully? and more quickly, a two-second timeout should be enough. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22783#pullrequestreview-2508835078 PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1888490126 PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1888496261 From ihse at openjdk.org Tue Dec 17 13:22:19 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 13:22:19 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: References: Message-ID: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> > All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. > > Our bundled version of freetype is missing such a marker. > > This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Move the file out of "src" as it is not part of upstream lib ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22791/files - new: https://git.openjdk.org/jdk/pull/22791/files/bf0ad054..13c93e63 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22791&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22791&range=00-01 Stats: 0 lines in 1 file changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22791.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22791/head:pull/22791 PR: https://git.openjdk.org/jdk/pull/22791 From erikj at openjdk.org Tue Dec 17 13:46:43 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 17 Dec 2024 13:46:43 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 13:22:19 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Move the file out of "src" as it is not part of upstream lib Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22791#pullrequestreview-2508924318 From aivanov at openjdk.org Tue Dec 17 14:47:35 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 14:47:35 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Mon, 16 Dec 2024 23:49:58 GMT, Harshitha Onkar wrote: > Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. > > > long hIcon = getSystemIcon(iconType.getIconID()); //Can return null > Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false > if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null > > > Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. > > getSystemIcon calls LoadIcon (User32.dll). This can return null. > https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona I wonder in what state the problem occurs? [JDK-8344907](https://bugs.openjdk.org/browse/JDK-8344907) states the problem occurs *often*. I've never seen [`LoadIcon`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadiconw) fails for the standard icons. The only reason I can think of is when GDI handles are exhausted. ------------- Changes requested by aivanov (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22776#pullrequestreview-2509014924 From aivanov at openjdk.org Tue Dec 17 14:47:37 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 14:47:37 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: <05MkkfzbRX2lMEda-gJ4nifEfVvmRFtcSdKV1AV8tWA=.791003ac-8be1-4c74-a558-cddbbf39abd0@github.com> References: <05MkkfzbRX2lMEda-gJ4nifEfVvmRFtcSdKV1AV8tWA=.791003ac-8be1-4c74-a558-cddbbf39abd0@github.com> Message-ID: On Tue, 17 Dec 2024 04:01:18 GMT, Alexander Zuev wrote: >> Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. >> >> >> long hIcon = getSystemIcon(iconType.getIconID()); //Can return null >> Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false >> if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null >> >> >> Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. >> >> getSystemIcon calls LoadIcon (User32.dll). This can return null. >> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona > > src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1203: > >> 1201: */ >> 1202: static Image getSystemIcon(SystemIcon iconType) { >> 1203: long hIcon = getSystemIcon(iconType.getIconID()); > > What is hIcon value here? If it is 0 we can simply add the same condition as in the getShell32Icon and avoid all the makeIcon and disposeIcon calls. Or we have a valid hIcon code but makeIcon is unable to construct an icon for it? Yes, I think you should add the condition `if (hIcon != 0)` before calling `makeIcon(hIcon)`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1888597821 From aivanov at openjdk.org Tue Dec 17 14:47:38 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 14:47:38 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 00:03:32 GMT, Harshitha Onkar wrote: >> Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. >> >> >> long hIcon = getSystemIcon(iconType.getIconID()); //Can return null >> Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false >> if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null >> >> >> Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. >> >> getSystemIcon calls LoadIcon (User32.dll). This can return null. >> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona > > src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1220: > >> 1218: Image icon = makeIcon(hIcon); >> 1219: if (icon != null && size != icon.getWidth(null)) { >> 1220: icon = new MultiResolutionIconImage(size, icon); > > Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1888602404 From aivanov at openjdk.org Tue Dec 17 14:52:38 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 14:52:38 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 14:19:41 GMT, Alexey Ivanov wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1220: >> >>> 1218: Image icon = makeIcon(hIcon); >>> 1219: if (icon != null && size != icon.getWidth(null)) { >>> 1220: icon = new MultiResolutionIconImage(size, icon); >> >> Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). > > I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. > > Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). > > I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. Now that I've thought about it more, you're right `icon != null` is also needed? if the icon bits can't be extracted which can also occur if *GDI resources are exhausted*. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1888645356 From jkratochvil at openjdk.org Tue Dec 17 15:02:54 2024 From: jkratochvil at openjdk.org (Jan Kratochvil) Date: Tue, 17 Dec 2024 15:02:54 GMT Subject: RFR: 8346436: Compilation with clang fails Message-ID: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> 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, ...) \ | ^ ------------- Commit messages: - 8346436: Compilation with clang fails Changes: https://git.openjdk.org/jdk/pull/22794/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22794&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346436 Stats: 11 lines in 4 files changed: 8 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22794.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22794/head:pull/22794 PR: https://git.openjdk.org/jdk/pull/22794 From prr at openjdk.org Tue Dec 17 15:16:35 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 15:16:35 GMT Subject: RFR: 8346195: Fix static initialization problem in GDIHashtable In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 14:30:37 GMT, Magnus Ihse Bursie wrote: > There has been a latent problem in `GDIHashtable` since time immemorial, but due to sheer luck it has not caused any issues for us. However, I managed to provoke it when I was doing some build changes. > > This is the problem: > In `GDIHashtable`, there is a static field `GDIHashtable::BatchDestructionManager manager`, which is initialized in `GDIHashtable.cpp`. > > In `AwtPen`, there is a static field `GDIHashtable cache`, which is initialized in `awt_Pen.cpp`. > > The `GDIHashtable` constructor calls `manager.add(this)`. > > For this to work, the manager must have been initialized prior to the AwtPen. However, the order of which static initializers are run between different compilation units are not well-defined, and we've just been lucky so far that it works. > > This problem is known as the "Static Initialization Order Fiasco", see e.g. https://en.cppreference.com/w/cpp/language/siof > > I have solved this by encapsulating the static manager instance in a method, which guarantees that it has been initialized before use. This seemed to me to be the cleanest solution. I am not sure if this is already on my list of reasons I don't like C++. ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22736#pullrequestreview-2509160956 From prr at openjdk.org Tue Dec 17 15:24:38 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 15:24:38 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 13:22:19 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Move the file out of "src" as it is not part of upstream lib If I understand correctly, this is a "new" requirement because of the need to support static builds ? Seems odd if the library doesn't actually use JNI. And what if the JDK is trying to load a library that is not part of the JDK ? > freetype bundling is only enabled on Windows anyways. We bundle it on mac too .. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2548742753 From prr at openjdk.org Tue Dec 17 15:28:39 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 15:28:39 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 13:22:19 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Move the file out of "src" as it is not part of upstream lib Do not integrate this until I have approved. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2548753843 From prr at openjdk.org Tue Dec 17 15:30:46 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 15:30:46 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> Message-ID: On Fri, 13 Dec 2024 08:26:05 GMT, SendaoYan wrote: >>> Should I combine 3 similar issues([JDK-8346104](https://bugs.openjdk.org/browse/JDK-8346104)/[JDK-8346103](https://bugs.openjdk.org/browse/JDK-8346103)/[JDK-8346059](https://bugs.openjdk.org/browse/JDK-8346059)) to 1 issue >> >> I personally would probably have started out by making a single issue for these, since they all try to address the same new warning in clang, and are all in client code, and only split it up later if reviewers had requested it. But since you have created separate issues, I suggest you do not change things now. Also, the other two I believe need a more serious response; a write to a pipe has a somewhat more realistic chance at failure than this filename lookup. > > Sorry for the confuse. I mean this PR change nothing except it will print a message to stderr when realpath return NULL. Thanks magicus. Why did you integrate this ? It did not yet have my approval even though I was clearly reviewing it. Nor did it have the required 2nd reviewer, in fact did it not have ANY reviewer from the client team which is responsible for this code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1888708459 From ihse at openjdk.org Tue Dec 17 15:53:34 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 15:53:34 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 15:21:53 GMT, Phil Race wrote: > If I understand correctly, this is a "new" requirement because of the need to support static builds ? Yes. > Seems odd if the library doesn't actually use JNI. `DEF_STATIC_JNI_OnLoad` is kind of a misnomer. It really means "mark this library as a JDK library, which is included in the statically linked binary, so if a request comes to load a dynamic library by this name, just ignore it, since it is already loaded". (I am thinking about renaming the macro to be more clear on this, as part of the general cleanup on how static builds are being done..) So what this means is that the code executing `System.loadLibrary("freetype")` will not actually try to load a `freetype.dll` and fail. > And what if the JDK is trying to load a library that is not part of the JDK ? Then it will not find the special marker method, and assume it will have to load it normally, as it then is a user-supplied or 3rd party dll. > > freetype bundling is only enabled on Windows anyways. > > We bundle it on mac too .. Oh, that's right. But the macOS bundling is done purely at link time, so we do not have this problem, as far as I can tell. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2548830757 From ihse at openjdk.org Tue Dec 17 15:51:42 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 15:51:42 GMT Subject: Integrated: 8346195: Fix static initialization problem in GDIHashtable In-Reply-To: References: Message-ID: On Fri, 13 Dec 2024 14:30:37 GMT, Magnus Ihse Bursie wrote: > There has been a latent problem in `GDIHashtable` since time immemorial, but due to sheer luck it has not caused any issues for us. However, I managed to provoke it when I was doing some build changes. > > This is the problem: > In `GDIHashtable`, there is a static field `GDIHashtable::BatchDestructionManager manager`, which is initialized in `GDIHashtable.cpp`. > > In `AwtPen`, there is a static field `GDIHashtable cache`, which is initialized in `awt_Pen.cpp`. > > The `GDIHashtable` constructor calls `manager.add(this)`. > > For this to work, the manager must have been initialized prior to the AwtPen. However, the order of which static initializers are run between different compilation units are not well-defined, and we've just been lucky so far that it works. > > This problem is known as the "Static Initialization Order Fiasco", see e.g. https://en.cppreference.com/w/cpp/language/siof > > I have solved this by encapsulating the static manager instance in a method, which guarantees that it has been initialized before use. This seemed to me to be the cleanest solution. This pull request has now been integrated. Changeset: 03821d97 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/03821d979b00ec60304ec0ba38b4755c773c6450 Stats: 14 lines in 2 files changed: 3 ins; 2 del; 9 mod 8346195: Fix static initialization problem in GDIHashtable Reviewed-by: jwaters, prr ------------- PR: https://git.openjdk.org/jdk/pull/22736 From duke at openjdk.org Tue Dec 17 16:32:43 2024 From: duke at openjdk.org (duke) Date: Tue, 17 Dec 2024 16:32:43 GMT Subject: RFR: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 [v6] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 08:58:28 GMT, GennadiyKrivoshein wrote: >> Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. >> >> **Reason of the bug:** >> The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. >> After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. >> >> For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. >> *PaperDimension A4/A4: "595 842" >> *PaperDimension BrA4_B/A4 (Borderless): "595 842" >> After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. >> After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". >> >> **Fix description:** >> Create new MediaSize if there is no any other MediaSize with the same size. >> >> **Tests:** >> OS: MacOS 12, Linux Ubuntu 22, Windows 11. >> open/test/jdk/java/awt/print/Dialog/PaperSizeError.java >> test/jdk/javax/print/CustomMediaSizeNameOOMETest.java >> All tests from the test/jdk/javax/print/ > > GennadiyKrivoshein 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 8343224-print.Dialog.PaperSizeError.java-fails > - Update test/jdk/java/awt/print/Dialog/PaperSizeError.java > > Add created year to the copyright > > Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com> > - expand imports > - update test tag > - update copyright > - Create MediaSize only if getStandardMedia is null @GennadiyKrivoshein Your change (at version c9e0d19b748a7a6011b1e67a57aeb30fb75503f4) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22429#issuecomment-2548956554 From philip.race at oracle.com Tue Dec 17 16:56:04 2024 From: philip.race at oracle.com (Philip Race) Date: Tue, 17 Dec 2024 08:56:04 -0800 Subject: Windows Magnifier does not work with my Swing applications In-Reply-To: References: Message-ID: 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 davidalayachew at gmail.com Tue Dec 17 16:58:34 2024 From: davidalayachew at gmail.com (David Alayachew) Date: Tue, 17 Dec 2024 11:58:34 -0500 Subject: Windows Magnifier does not work with my Swing applications In-Reply-To: References: Message-ID: 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 kizune at openjdk.org Tue Dec 17 17:06:35 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 17 Dec 2024 17:06:35 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 14:49:34 GMT, Alexey Ivanov wrote: >> I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. > >> > Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). >> >> I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. > > Now that I've thought about it more, you're right `icon != null` is also needed? if the icon bits can't be extracted which can also occur if *GDI resources are exhausted*. Then i would suggest doing both checks in both places. No need to even try to extract icon bits for hIcon == 0 but if we failed to extract icon for the correct handle we should handle it too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1888900624 From prr at openjdk.org Tue Dec 17 17:07:47 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 17:07:47 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 15:51:27 GMT, Magnus Ihse Bursie wrote: > > We bundle it on mac too .. > > Oh, that's right. But the macOS bundling is done purely at link time, so we do not have this problem, as far as I can tell. I see (I think) ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2549054983 From prr at openjdk.org Tue Dec 17 17:10:45 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 17:10:45 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v2] In-Reply-To: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> References: <7PFwGeo_KFojUu_H2OqaZ2feKiGgAOimfawWp5rNw6o=.8b68e24c-6dd9-470d-9386-fe41aa4df293@github.com> Message-ID: On Tue, 17 Dec 2024 13:22:19 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Move the file out of "src" as it is not part of upstream lib Marked as reviewed by prr (Reviewer). src/java.desktop/share/native/libfreetype/java_freetype.c line 27: > 25: > 26: #include "jni_util.h" > 27: A comment here explaining why this is needed might be a good idea. ------------- PR Review: https://git.openjdk.org/jdk/pull/22791#pullrequestreview-2509539457 PR Review Comment: https://git.openjdk.org/jdk/pull/22791#discussion_r1888905762 From aivanov at openjdk.org Tue Dec 17 17:13:41 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 17:13:41 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 17:04:10 GMT, Alexander Zuev wrote: >>> > Although `icon != null` check is not strictly required here due to `hIcon != 0` check, added it as sanity check and to be consistent with other locations in Win32ShellFolder2.java where makeIcon() is called (which is followed by a null check for the returned icon). >>> >>> I'd leave it out here. As @azuev-java [notes above](https://github.com/openjdk/jdk/pull/22776/files#r1887863199), the likely problem is `hIcon == 0` rather than `makeIcon` returns `null`. >> >> Now that I've thought about it more, you're right `icon != null` is also needed? if the icon bits can't be extracted which can also occur if *GDI resources are exhausted*. > > Then i would suggest doing both checks in both places. No need to even try to extract icon bits for hIcon == 0 but if we failed to extract icon for the correct handle we should handle it too. Yes, I did [suggest it](https://github.com/openjdk/jdk/pull/22776#discussion_r1888597821) too. On the other hand, `makeIcon` starts with this condition https://github.com/openjdk/jdk/blob/4f44cf6bf2423a57a841be817f348e3b1e88f0eb/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java#L1030-L1031 Anyway, not calling `makeIcon` when `hIcon == 0` is clearer. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1888911087 From aivanov at openjdk.org Tue Dec 17 17:39:48 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 17 Dec 2024 17:39:48 GMT Subject: RFR: 8344059: Remove doPrivileged calls from windows platform sources in the java.desktop module [v7] In-Reply-To: References: Message-ID: <5nL8r9nqFoqpaQJFGYora9FLe4JjePxmRyKCJul3LbM=.b42581aa-91e3-4a3e-9623-d1d3b8c825d2@github.com> On Mon, 9 Dec 2024 21:57:35 GMT, Eirik Bj?rsn?s wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with two additional commits since the last revision: >> >> - Fix to getBoolean >> - FIx Boolean.getBoolean > > src/java.desktop/windows/classes/sun/awt/windows/WPathGraphics.java line 102: > >> 100: >> 101: if (textLayoutStr != null) { >> 102: useGDITextLayout = Boolean.getBoolean(textLayoutStr); > > Noticed a possible pre-existing bug: > > `Boolean::getBoolean` takes a system property to look up and evaluate to boolean. Here, this method is given a string which is the result of reading the system propery "sun.java2d.print.enableGDITextLayout". @eirbjo Thank you for submitting [JDK-8345934](https://bugs.openjdk.org/browse/JDK-8345934). [I found this issue](https://github.com/openjdk/jdk/pull/22083#discussion_r1846889627) too, yet it's marked as resolved? because it's out of scope for this change. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22083#discussion_r1888947742 From ihse at openjdk.org Tue Dec 17 18:02:42 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 18:02:42 GMT Subject: RFR: 8346195: Fix static initialization problem in GDIHashtable In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 15:14:07 GMT, Phil Race wrote: > I am not sure if this is already on my list of reasons I don't like C++. I did not know about this until I tried to resolve this bug (it took some time to figure out the problem). I can surely put it on my such list. :) ------------- PR Comment: https://git.openjdk.org/jdk/pull/22736#issuecomment-2549207950 From ihse at openjdk.org Tue Dec 17 18:14:15 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 18:14:15 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds Message-ID: To be able to properly support static builds on Windows in [JDK-8346377](https://bugs.openjdk.org/browse/JDK-8346377), we cannot use `DllMain`, for two reasons: 1) This is not called for statically linked libraries, and 2) There are multiple `DllMain` definitions throughout the JDK native libraries, causing name collisions. While it could have been possible to keep the `DllMain` function for non-static builds and just use an alternative solution for static builds, I think it is preferable to have a single solution that works as well for both static and dynamic builds. In this case, the `DllMain` function did two things: 1) At startup, it called SetModuleHandle. This has been moved to the `JNI_OnLoad` function, which is called by the JVM right after loading the DLL, or in the case of a static build, when the `awt` native library has been requested. 2) At DLL unload -- for debug builds only -- it "disabled" the mutexes for the DTrace and DMem debug systems. In this case, "disable" means writing NULL to the mutexes, causing any further calls to the continue without locking, since the enter/exit calls only do the locking if the mutex is not NULL. (This is pre-existing code so I am not discussing the soundness of this approach.) But why did we need to do that? After the DLL unloading, which is done by Windows when the process is exiting, no code should be executing in AWT, right? No, wrong. There are three static objects, one instance of AwtDebugSupport and two instances of GDIHashtable, and the destructors of these objects are called by Windows at the time of process shutdown. I have not been able to confirm that the `DllMain` code is guaranteed to be called before the destructors are called, so I guess the fact that this ever worked has just been a lucky coincidence. I have solved this by disabling the mutexes in the destructors themselves, thereby guaranteeing that they are disabled before the last few calls to the DTrace/DMem calls are made. There is no guarantee in which order these destructors are made, so I do the same on both locations. (There is no bad effect from calling these twice in a row, it's just setting a mutex to NULL). Finally, I have wrapped the `DEF_JNI_OnLoad` function in `extern "C" { ... }`. This is needed since DEF_JNI_OnLoad is a macro that actually creates two functions, where one is a wrapper calling the other which has a generated name, and without this, the C++ name mangling messed things up. (To be clear: this means that the JNI_OnLoad function has never been called on Windows, but since it did not do anything of substance before, nobody noticed this.) ------------- Commit messages: - Merge branch 'master' into dll-main-in-libawt - 8346388: Cannot use DllMain in libawt for static builds Changes: https://git.openjdk.org/jdk/pull/22790/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22790&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346388 Stats: 61 lines in 3 files changed: 35 ins; 26 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22790.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22790/head:pull/22790 PR: https://git.openjdk.org/jdk/pull/22790 From ihse at openjdk.org Tue Dec 17 18:14:15 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 18:14:15 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 11:51:51 GMT, Magnus Ihse Bursie wrote: > To be able to properly support static builds on Windows in [JDK-8346377](https://bugs.openjdk.org/browse/JDK-8346377), we cannot use `DllMain`, for two reasons: > > 1) This is not called for statically linked libraries, and > 2) There are multiple `DllMain` definitions throughout the JDK native libraries, causing name collisions. > > While it could have been possible to keep the `DllMain` function for non-static builds and just use an alternative solution for static builds, I think it is preferable to have a single solution that works as well for both static and dynamic builds. > > In this case, the `DllMain` function did two things: > > 1) At startup, it called SetModuleHandle. This has been moved to the `JNI_OnLoad` function, which is called by the JVM right after loading the DLL, or in the case of a static build, when the `awt` native library has been requested. > > 2) At DLL unload -- for debug builds only -- it "disabled" the mutexes for the DTrace and DMem debug systems. In this case, "disable" means writing NULL to the mutexes, causing any further calls to the continue without locking, since the enter/exit calls only do the locking if the mutex is not NULL. (This is pre-existing code so I am not discussing the soundness of this approach.) > > But why did we need to do that? After the DLL unloading, which is done by Windows when the process is exiting, no code should be executing in AWT, right? No, wrong. There are three static objects, one instance of AwtDebugSupport and two instances of GDIHashtable, and the destructors of these objects are called by Windows at the time of process shutdown. I have not been able to confirm that the `DllMain` code is guaranteed to be called before the destructors are called, so I guess the fact that this ever worked has just been a lucky coincidence. > > I have solved this by disabling the mutexes in the destructors themselves, thereby guaranteeing that they are disabled before the last few calls to the DTrace/DMem calls are made. There is no guarantee in which order these destructors are made, so I do the same on both locations. (There is no bad effect from calling these twice in a row, it's just setting a mutex to NULL). > > Finally, I have wrapped the `DEF_JNI_OnLoad` function in `extern "C" { ... }`. This is needed since DEF_JNI_OnLoad is a macro that actually creates two functions, where one is a wrapper calling the other which has a generated name, and without this, the C++ name mangling messed things up. (To be clear: this means tha... I would appreciate some suggestions on how to make sure this is properly tested, with both release and debug build. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2548258880 From jwaters at openjdk.org Tue Dec 17 18:14:15 2024 From: jwaters at openjdk.org (Julian Waters) Date: Tue, 17 Dec 2024 18:14:15 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: References: Message-ID: <_2DwqcHMDvwsuT4AW8NzSwCw7LDZgOA9sYlNjHqqTU8=.71312e83-31d6-4f56-9b76-58087982e19c@github.com> On Tue, 17 Dec 2024 11:51:51 GMT, Magnus Ihse Bursie wrote: > To be able to properly support static builds on Windows in [JDK-8346377](https://bugs.openjdk.org/browse/JDK-8346377), we cannot use `DllMain`, for two reasons: > > 1) This is not called for statically linked libraries, and > 2) There are multiple `DllMain` definitions throughout the JDK native libraries, causing name collisions. > > While it could have been possible to keep the `DllMain` function for non-static builds and just use an alternative solution for static builds, I think it is preferable to have a single solution that works as well for both static and dynamic builds. > > In this case, the `DllMain` function did two things: > > 1) At startup, it called SetModuleHandle. This has been moved to the `JNI_OnLoad` function, which is called by the JVM right after loading the DLL, or in the case of a static build, when the `awt` native library has been requested. > > 2) At DLL unload -- for debug builds only -- it "disabled" the mutexes for the DTrace and DMem debug systems. In this case, "disable" means writing NULL to the mutexes, causing any further calls to the continue without locking, since the enter/exit calls only do the locking if the mutex is not NULL. (This is pre-existing code so I am not discussing the soundness of this approach.) > > But why did we need to do that? After the DLL unloading, which is done by Windows when the process is exiting, no code should be executing in AWT, right? No, wrong. There are three static objects, one instance of AwtDebugSupport and two instances of GDIHashtable, and the destructors of these objects are called by Windows at the time of process shutdown. I have not been able to confirm that the `DllMain` code is guaranteed to be called before the destructors are called, so I guess the fact that this ever worked has just been a lucky coincidence. > > I have solved this by disabling the mutexes in the destructors themselves, thereby guaranteeing that they are disabled before the last few calls to the DTrace/DMem calls are made. There is no guarantee in which order these destructors are made, so I do the same on both locations. (There is no bad effect from calling these twice in a row, it's just setting a mutex to NULL). > > Finally, I have wrapped the `DEF_JNI_OnLoad` function in `extern "C" { ... }`. This is needed since DEF_JNI_OnLoad is a macro that actually creates two functions, where one is a wrapper calling the other which has a generated name, and without this, the C++ name mangling messed things up. (To be clear: this means tha... AWT tests are in tier 4, to my knowledge src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp line 112: > 110: GetModuleHandleEx( > 111: GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, > 112: (LPCTSTR) &GetAwtModuleHandle, I had to look up the docs on why this was casting a function pointer to a string because it was just so confusing. Wow that threw me for a loop ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2548387835 PR Review Comment: https://git.openjdk.org/jdk/pull/22790#discussion_r1888473624 From ihse at openjdk.org Tue Dec 17 18:14:15 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 18:14:15 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: <_2DwqcHMDvwsuT4AW8NzSwCw7LDZgOA9sYlNjHqqTU8=.71312e83-31d6-4f56-9b76-58087982e19c@github.com> References: <_2DwqcHMDvwsuT4AW8NzSwCw7LDZgOA9sYlNjHqqTU8=.71312e83-31d6-4f56-9b76-58087982e19c@github.com> Message-ID: On Tue, 17 Dec 2024 12:54:41 GMT, Julian Waters wrote: >> To be able to properly support static builds on Windows in [JDK-8346377](https://bugs.openjdk.org/browse/JDK-8346377), we cannot use `DllMain`, for two reasons: >> >> 1) This is not called for statically linked libraries, and >> 2) There are multiple `DllMain` definitions throughout the JDK native libraries, causing name collisions. >> >> While it could have been possible to keep the `DllMain` function for non-static builds and just use an alternative solution for static builds, I think it is preferable to have a single solution that works as well for both static and dynamic builds. >> >> In this case, the `DllMain` function did two things: >> >> 1) At startup, it called SetModuleHandle. This has been moved to the `JNI_OnLoad` function, which is called by the JVM right after loading the DLL, or in the case of a static build, when the `awt` native library has been requested. >> >> 2) At DLL unload -- for debug builds only -- it "disabled" the mutexes for the DTrace and DMem debug systems. In this case, "disable" means writing NULL to the mutexes, causing any further calls to the continue without locking, since the enter/exit calls only do the locking if the mutex is not NULL. (This is pre-existing code so I am not discussing the soundness of this approach.) >> >> But why did we need to do that? After the DLL unloading, which is done by Windows when the process is exiting, no code should be executing in AWT, right? No, wrong. There are three static objects, one instance of AwtDebugSupport and two instances of GDIHashtable, and the destructors of these objects are called by Windows at the time of process shutdown. I have not been able to confirm that the `DllMain` code is guaranteed to be called before the destructors are called, so I guess the fact that this ever worked has just been a lucky coincidence. >> >> I have solved this by disabling the mutexes in the destructors themselves, thereby guaranteeing that they are disabled before the last few calls to the DTrace/DMem calls are made. There is no guarantee in which order these destructors are made, so I do the same on both locations. (There is no bad effect from calling these twice in a row, it's just setting a mutex to NULL). >> >> Finally, I have wrapped the `DEF_JNI_OnLoad` function in `extern "C" { ... }`. This is needed since DEF_JNI_OnLoad is a macro that actually creates two functions, where one is a wrapper calling the other which has a generated name, and without this, the C++ name mangling messed thi... > > src/java.desktop/windows/native/libawt/windows/awt_Toolkit.cpp line 112: > >> 110: GetModuleHandleEx( >> 111: GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, >> 112: (LPCTSTR) &GetAwtModuleHandle, > > I had to look up the docs on why this was casting a function pointer to a string because it was just so confusing. Wow that threw me for a loop Yeah, it looks weird, but it is a standard Windows idiom. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22790#discussion_r1888503672 From ihse at openjdk.org Tue Dec 17 18:16:55 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 18:16:55 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: Message-ID: > All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. > > Our bundled version of freetype is missing such a marker. > > This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Document purpose of java_freetype.c ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22791/files - new: https://git.openjdk.org/jdk/pull/22791/files/13c93e63..0fada047 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22791&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22791&range=01-02 Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22791.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22791/head:pull/22791 PR: https://git.openjdk.org/jdk/pull/22791 From erikj at openjdk.org Tue Dec 17 18:25:42 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 17 Dec 2024 18:25:42 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 18:16:55 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Document purpose of java_freetype.c Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22791#pullrequestreview-2509734898 From prr at openjdk.org Tue Dec 17 18:51:39 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 17 Dec 2024 18:51:39 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen In-Reply-To: References: Message-ID: <_ZcECw-XMUkUP4jHKV2fBALSAKABYCcQBkN-j_t-344=.11480a9d-34d5-4c3e-9500-c443dc116f8f@github.com> On Tue, 17 Dec 2024 03:48:27 GMT, Alexander Zuev 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. > > src/java.desktop/share/classes/java/awt/Robot.java line 225: > >> 223: // peer.mouseMove(x, y); >> 224: peer.mouseMove(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width), >> 225: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height)); > > But that will limit current robot's functionality on the multi-monitor setups. Right now i can move mouse using robot from one screen to another, With your change it seems to be impossible? Robot is already created with a screen .. ie GraphicsDevice .. the bounds are from that .. and it is already used elsewhere in Robot If that can be across physical screens it will still work. If screens are separate then Robot is constrained to that anyway. Can you show a specific case where this is a problem ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1889053168 From ihse at openjdk.org Tue Dec 17 19:12:44 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Tue, 17 Dec 2024 19:12:44 GMT Subject: Integrated: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 12:53:35 GMT, Magnus Ihse Bursie wrote: > All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. > > Our bundled version of freetype is missing such a marker. > > This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. This pull request has now been integrated. Changeset: f3e2f882 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/f3e2f8821a63711599b9cecb91d62db59b915c90 Stats: 34 lines in 2 files changed: 33 ins; 0 del; 1 mod 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds Reviewed-by: erikj, prr ------------- PR: https://git.openjdk.org/jdk/pull/22791 From achung at openjdk.org Tue Dec 17 19:58:36 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 17 Dec 2024 19:58:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 01:40:32 GMT, Harshitha Onkar 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. > > src/java.desktop/share/classes/java/awt/Robot.java line 226: > >> 224: peer.mouseMove(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width), >> 225: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height)); >> 226: afterEvent(); > > @alisenchung It might be good to add a simple test case. Probably robot.mouseMove() to off-screen coordinates and pass the test if the coordinates returned by MouseInfo.getPointerInfo().getLocation() is clamped (limited to screen bounds) else fail. oops, i had a test and forgot to include it in the PR, good reminder! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1889135269 From achung at openjdk.org Tue Dec 17 20:03:37 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 17 Dec 2024 20:03:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v2] In-Reply-To: References: Message-ID: > 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 one additional commit since the last revision: add test, remove comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22781/files - new: https://git.openjdk.org/jdk/pull/22781/files/effa0f05..62e7dede Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=00-01 Stats: 50 lines in 2 files changed: 49 ins; 1 del; 0 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 achung at openjdk.org Tue Dec 17 20:46:54 2024 From: achung at openjdk.org (Alisen Chung) Date: Tue, 17 Dec 2024 20:46:54 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: > 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 one additional commit since the last revision: fixed test to fail before fix and pass after fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22781/files - new: https://git.openjdk.org/jdk/pull/22781/files/62e7dede..678712fb Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=01-02 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 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 duke at openjdk.org Tue Dec 17 22:03:40 2024 From: duke at openjdk.org (duke) Date: Tue, 17 Dec 2024 22:03:40 GMT Subject: RFR: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI [v6] In-Reply-To: References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Sun, 8 Dec 2024 07:52:17 GMT, Jeremy wrote: >> The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after ~~500~~ 100 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. >> >> In the original headful test: >> We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: >> >> java.desktop/java.awt.AWTEventMulticaster.removeInternal() >> java.desktop/java.awt.AWTEventMulticaster.remove() >> >> >> With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) >> >> JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. >> >> Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. > > Jeremy has updated the pull request incrementally with five additional commits since the last revision: > > - 8342782: move comments re implementation details inside method > > Also avoid restating constant, instead only refer to it as "threshold" > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855148909 > - 8342782: adding an empty line representing EOF > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1871348260 > - 8342782: changing "/2" to " / 2" > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1871376542 > - 8342782: change threshold from 500 to 100 > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855398578 > - 8342782: convert value (500) to named constant > > This is in response to: > https://github.com/openjdk/jdk/pull/21962#discussion_r1855397860 @mickleness Your change (at version f221209239e67cef691f4f848000a201c3a79119) is now ready to be sponsored by a Committer. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21962#issuecomment-2549729906 From psadhukhan at openjdk.org Wed Dec 18 03:05:16 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 03:05:16 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v2] In-Reply-To: References: Message-ID: > javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing > > java.lang.RuntimeException: The scrollbar block increment is incorrect > at bug4865918.main(bug4865918.java:60) > > Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. > Fix is passing in CI in several CI systems Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Latch update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22783/files - new: https://git.openjdk.org/jdk/pull/22783/files/d33aa49a..0befa727 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=00-01 Stats: 5 lines in 1 file changed: 1 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22783.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22783/head:pull/22783 PR: https://git.openjdk.org/jdk/pull/22783 From psadhukhan at openjdk.org Wed Dec 18 03:05:16 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 03:05:16 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v2] In-Reply-To: References: Message-ID: <7pZZvR7Xpu3qCe3MFO4QoHtFx-zTZsnNQggRAJB3Mak=.bd028acf-b8b8-4fab-a47d-edcec2929826@github.com> On Tue, 17 Dec 2024 13:10:51 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Latch update > > test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > >> 57: >> 58: SwingUtilities.invokeAndWait(() -> sbar.pressMouse()); >> 59: latch.await(); > > You should use timed `await` and throw an exception if the wait times out. This way the timeout would be handled more gracefully? and more quickly, a two-second timeout should be enough. updated.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1889541835 From dholmes at openjdk.org Wed Dec 18 04:51:41 2024 From: dholmes at openjdk.org (David Holmes) Date: Wed, 18 Dec 2024 04:51:41 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: Message-ID: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> On Tue, 17 Dec 2024 18:16:55 GMT, Magnus Ihse Bursie wrote: >> All JDK native libraries needs to have a proper `JNI_OnLoad`, set either by `DEF_STATIC_JNI_OnLoad` or `DEF_JNI_OnLoad`. This is so that in a static build, the JVM can recognize that the library is already loaded, and does not try to load a (non-existent) external library. >> >> Our bundled version of freetype is missing such a marker. >> >> This turns out to be a problem just on Windows, since the `System.loadLibrary("freetype")` code in `FontManagerNativeLibrary` is only executed on Windows. However, the cost of including this in the bundled versions on all platforms is very small, and it is a safeguard for any future changes. In practice, freetype bundling is only enabled on Windows anyways. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Document purpose of java_freetype.c A bit late but why do we presume that just because this library is bundled that it has to be part of the static image? This static build stuff continues to leave me with a "bad taste in my mouth". ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2550331028 From jwaters at openjdk.org Wed Dec 18 06:10:40 2024 From: jwaters at openjdk.org (Julian Waters) Date: Wed, 18 Dec 2024 06:10:40 GMT Subject: RFR: 8342870: Errors related to unused code on Windows after 8339120 in accessibility [v2] In-Reply-To: References: Message-ID: On Tue, 19 Nov 2024 17:58:59 GMT, Phil Race wrote: >> Julian Waters 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: >> >> - Remove now unused result >> - Merge branch 'master' into accessibility >> - 8342870 > > There's not much I like about this PR. I think it would be better to withdraw it and submit a bug against A11Y for people to look at what should really be done about these cases. Which could include "do nothing". @prrace Sorry for the trouble, but are there other maintainers for accessibility that can take a look at this change? I know you can't really review this properly since you're pretty busy, so I was thinking of trying to get the attention of other maintainers, but I unfortunately don't know who they are ------------- PR Comment: https://git.openjdk.org/jdk/pull/21656#issuecomment-2550435080 From abhiscxk at openjdk.org Wed Dec 18 06:41:36 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 18 Dec 2024 06:41:36 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v2] In-Reply-To: References: Message-ID: On Wed, 18 Dec 2024 03:05:16 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing >> >> java.lang.RuntimeException: The scrollbar block increment is incorrect >> at bug4865918.main(bug4865918.java:60) >> >> Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. >> Fix is passing in CI in several CI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Latch update Seems good. test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 37: > 35: import javax.swing.JScrollBar; > 36: import javax.swing.SwingUtilities; > 37: import java.awt.event.MouseAdapter; awt imports can be grouped together. ------------- PR Review: https://git.openjdk.org/jdk/pull/22783#pullrequestreview-2510920174 PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1889688526 From psadhukhan at openjdk.org Wed Dec 18 06:55:12 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 06:55:12 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v3] In-Reply-To: References: Message-ID: > javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing > > java.lang.RuntimeException: The scrollbar block increment is incorrect > at bug4865918.main(bug4865918.java:60) > > Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. > Fix is passing in CI in several CI systems Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: import ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22783/files - new: https://git.openjdk.org/jdk/pull/22783/files/0befa727..2eb13c95 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=01-02 Stats: 4 lines in 1 file changed: 2 ins; 2 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/22783.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22783/head:pull/22783 PR: https://git.openjdk.org/jdk/pull/22783 From syan at openjdk.org Wed Dec 18 09:24:40 2024 From: syan at openjdk.org (SendaoYan) Date: Wed, 18 Dec 2024 09:24:40 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> Message-ID: On Tue, 17 Dec 2024 15:27:30 GMT, Phil Race wrote: >> Sorry for the confuse. I mean this PR change nothing except it will print a message to stderr when realpath return NULL. Thanks magicus. > > Why did you integrate this ? > It did not yet have my approval even though I was clearly reviewing it. > Nor did it have the required 2nd reviewer, in fact did it not have ANY reviewer from the client team which is responsible for this code. Hi @prrace , sorry for the rash integrated. I can backout this change quickly if it's necessary. I will pay more attention for the future PRs. Apologize for the rash integrated again. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1889897333 From duke at openjdk.org Wed Dec 18 09:32:48 2024 From: duke at openjdk.org (Jeremy) Date: Wed, 18 Dec 2024 09:32:48 GMT Subject: Integrated: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI In-Reply-To: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> References: <7t-UgshCotHJ-oMhj4wjBYZQFlR6I6fY8hmco1llX3I=.350afe82-8afb-4409-911b-3324915756e1@github.com> Message-ID: On Thu, 7 Nov 2024 17:49:29 GMT, Jeremy wrote: > The AWTEventMulticaster is a tree node with 2 children. This PR proposes rebalancing that tree after ~~500~~ 100 additions to avoid potential StackOverflowErrors when trying to interact with a large AWTEventMulticaster. > > In the original headful test: > We added 8,000 checkboxes, and when their parent panel was hidden the stack needed to grow to 24,000 lines. It took 8,000 lines to recursively call `java.awt.AWTEventMulticaster.componentHidden`, and then 16,000 additional lines to call two recursive methods to remove a listener: > > java.desktop/java.awt.AWTEventMulticaster.removeInternal() > java.desktop/java.awt.AWTEventMulticaster.remove() > > > With this current PR the max stack size reaches 1,267 instead. (If we rebalanced at EVERY addition, then that same scenario would reach a max stack size of 71.) > > JDK-8342782 included a headful test case, but I think the main problem it demonstrated can be represented by the headless test case attached to this PR. > > Depending on how this PR is received I may submit a separate ticket & PR to modify AquaButtonUI so it doesn't always attach an AncestorListener. (That is: if my GUI includes 8,000 checkboxes then I don't need 8,000 AncestorListeners.) But JDK-8342782's test case is currently written in a way that should reproduce across all L&F's, so that can be discussed separately. This pull request has now been integrated. Changeset: 5b703c70 Author: jeremy URL: https://git.openjdk.org/jdk/commit/5b703c702323bc50452d3f6fd27b165b74006c3e Stats: 157 lines in 2 files changed: 156 ins; 0 del; 1 mod 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI Reviewed-by: kizune, prr, lbourges ------------- PR: https://git.openjdk.org/jdk/pull/21962 From stuefe at openjdk.org Wed Dec 18 09:52:44 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Wed, 18 Dec 2024 09:52:44 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: Message-ID: <48JEHfsVHTKpHpefSsIXJ8H0Bi3fQtK_PY3TAoRZu6Y=.a6220f37-88f1-4ef8-8f9c-956cbf2f69c5@github.com> On Thu, 12 Dec 2024 04:32:14 GMT, SendaoYan wrote: > Hi all, > This PR fix file src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c reported compile warning "ignoring return value of function" by clang17, which add check the return value of `realpath` function. Risk is low. Drive-By comment: I think we should avoid `perror`, since its error message is localized. I would prefer these messages in English, not in whatever language the customer set up. If you really want to print a message, at least also print out the numerical value of errno. See https://pubs.opengroup.org/onlinepubs/007904875/functions/perror.html "The perror() function shall map the error number accessed through the symbol errno to a _language-dependent_ error message" ------------- PR Comment: https://git.openjdk.org/jdk/pull/22701#issuecomment-2550866548 From ihse at openjdk.org Wed Dec 18 10:09:42 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 18 Dec 2024 10:09:42 GMT Subject: RFR: 8346059: [ASAN] awt_LoadLibrary.c reported compile warning ignoring return value of function by clang17 In-Reply-To: References: <9xMcgUuns52gMcnEol0EcEGoVuO3tcEAoYKvxGiEGsY=.1f960e78-90a9-4d7e-bc12-64ff5c09a848@github.com> <8lcAU0eWJKs1_kfDmrTE7VwLikAY0RCtn8JBG5CkARk=.fffd5b13-8659-46e7-b5c3-742d7fd6f7e7@github.com> Message-ID: On Tue, 17 Dec 2024 15:27:30 GMT, Phil Race wrote: >> Sorry for the confuse. I mean this PR change nothing except it will print a message to stderr when realpath return NULL. Thanks magicus. > > Why did you integrate this ? > It did not yet have my approval even though I was clearly reviewing it. > Nor did it have the required 2nd reviewer, in fact did it not have ANY reviewer from the client team which is responsible for this code. @prrace I don't think it is reasonable for you to blame @sendaoYan for integrating. He had a review from a Reviewer, and he waited 24 hours after that before integrating. The general JDK rule is that one review is enough; Hotspot as a special case requires two. Your comment did not say that you wanted to review it further, nor did you clearly request any changes, just a vague idea of replacing realpath with a strcpy (which seems like much more risky, and potentially incorrect, change!) The responsibility for this PR is mine. I had reviewed and approved the PR. I did consider if I should increase the number of reviewers and state that a client team reviewer was also needed, but decided against it. That was my decision as a reviewer. The PR was clearly unproblematic. It added some extra logging in case something gets terribly wrong. Without this fix, AWT would just break without any indication whatsoever if something did go wrong with realpath. With this fix, this unlikely problem will at least get some indication. I did not think this needed confirmation from the client team as well. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22701#discussion_r1889966811 From karm at redhat.com Wed Dec 18 10:13:06 2024 From: karm at redhat.com (Karm Michal Babacek) Date: Wed, 18 Dec 2024 11:13:06 +0100 Subject: awt_LoadLibrary.c & co. Message-ID: Hello, I can see on the list that updates to this file are debated based on an ASAN report. I'd like to bring this PR in review to your attention as it touches the very same file: https://github.com/openjdk/jdk/pull/20169 Thx Cheers K. -- Sent from my Hosaka Ono-Sendai Cyberspace 7 -- Karm Michal Babacek Red Hat | UTC+01:00 From ihse at openjdk.org Wed Dec 18 10:17:42 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 18 Dec 2024 10:17:42 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> References: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> Message-ID: On Wed, 18 Dec 2024 04:48:53 GMT, David Holmes wrote: > A bit late but why do we presume that just because this library is bundled that it has to be part of the static image? No? The library can be bundled as a dynamic library as well, that has always been and still is the case. > This static build stuff continues to leave me with a "bad taste in my mouth". I agree that the static build stuff is still not up to normal JDK standards. It was originally "tacked on" from the side, with a lot of kludges to get it to work. I am trying to work through these problematic cases and clean up the code. This current kludge is that there is a lot of code doing System.loadLibrary(someInternalLibrary), and for static builds these calls should really be a no-op. But how do you know? The solution chosen by the original implementors of static builds was to look for a symbol JNI_OnLoad_someInternalLibrary, and if it was found, skip loading the dynamic library. It can certainly be discussed if this was a good way of doing things, but that is how it currently works. (It does have the advantage that users can add static libraries of their own in this way.) ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2550922542 From abhiscxk at openjdk.org Wed Dec 18 11:28:40 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Wed, 18 Dec 2024 11:28:40 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v3] In-Reply-To: References: Message-ID: On Wed, 18 Dec 2024 06:55:12 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing >> >> java.lang.RuntimeException: The scrollbar block increment is incorrect >> at bug4865918.main(bug4865918.java:60) >> >> Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. >> Fix is passing in CI in several CI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > import Marked as reviewed by abhiscxk (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22783#pullrequestreview-2511556622 From aivanov at openjdk.org Wed Dec 18 12:48:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 18 Dec 2024 12:48:40 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v3] In-Reply-To: References: Message-ID: <1D-KOxKD93xLNSFF8xDCVasQ7r1CwIetJkqp9AfdjoI=.0df71c8b-a3b1-4346-9f2c-8589419adca8@github.com> On Wed, 18 Dec 2024 06:55:12 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing >> >> java.lang.RuntimeException: The scrollbar block increment is incorrect >> at bug4865918.main(bug4865918.java:60) >> >> Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. >> Fix is passing in CI in several CI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > import Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > 57: > 58: SwingUtilities.invokeAndWait(() -> sbar.pressMouse()); > 59: mousePressLatch.await(2, TimeUnit.SECONDS); Suggestion: if (!mousePressLatch.await(2, TimeUnit.SECONDS)) { throw new RuntimeException("Timed out waiting for mouse press"); } If you don't throw the exception, the test will continue to run? Yet we're sure it is likely to fail. ------------- PR Review: https://git.openjdk.org/jdk/pull/22783#pullrequestreview-2511729351 PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1890179715 From psadhukhan at openjdk.org Wed Dec 18 12:55:50 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 12:55:50 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v4] In-Reply-To: References: Message-ID: > javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing > > java.lang.RuntimeException: The scrollbar block increment is incorrect > at bug4865918.main(bug4865918.java:60) > > Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. > Fix is passing in CI in several CI systems Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: throw excpn ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22783/files - new: https://git.openjdk.org/jdk/pull/22783/files/2eb13c95..92c09afe Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22783&range=02-03 Stats: 3 lines in 1 file changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22783.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22783/head:pull/22783 PR: https://git.openjdk.org/jdk/pull/22783 From psadhukhan at openjdk.org Wed Dec 18 12:55:51 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 12:55:51 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v3] In-Reply-To: <1D-KOxKD93xLNSFF8xDCVasQ7r1CwIetJkqp9AfdjoI=.0df71c8b-a3b1-4346-9f2c-8589419adca8@github.com> References: <1D-KOxKD93xLNSFF8xDCVasQ7r1CwIetJkqp9AfdjoI=.0df71c8b-a3b1-4346-9f2c-8589419adca8@github.com> Message-ID: On Wed, 18 Dec 2024 12:45:45 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> import > > test/jdk/javax/swing/JScrollBar/4865918/bug4865918.java line 59: > >> 57: >> 58: SwingUtilities.invokeAndWait(() -> sbar.pressMouse()); >> 59: mousePressLatch.await(2, TimeUnit.SECONDS); > > Suggestion: > > if (!mousePressLatch.await(2, TimeUnit.SECONDS)) { > throw new RuntimeException("Timed out waiting for mouse press"); > } > > > If you don't throw the exception, the test will continue to run? Yet we're sure it is likely to fail. ok..modified.. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22783#discussion_r1890189015 From aivanov at openjdk.org Wed Dec 18 14:15:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 18 Dec 2024 14:15:40 GMT Subject: RFR: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI [v4] In-Reply-To: References: Message-ID: On Wed, 18 Dec 2024 12:55:50 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing >> >> java.lang.RuntimeException: The scrollbar block increment is incorrect >> at bug4865918.main(bug4865918.java:60) >> >> Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. >> Fix is passing in CI in several CI systems > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > throw excpn Marked as reviewed by aivanov (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22783#pullrequestreview-2511962025 From psadhukhan at openjdk.org Wed Dec 18 14:57:44 2024 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 18 Dec 2024 14:57:44 GMT Subject: Integrated: 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 07:44:11 GMT, Prasanta Sadhukhan wrote: > javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing > > java.lang.RuntimeException: The scrollbar block increment is incorrect > at bug4865918.main(bug4865918.java:60) > > Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic. > Fix is passing in CI in several CI systems This pull request has now been integrated. Changeset: a0b7c4f0 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/a0b7c4f015c694425893b8d21d2aecae71a3b604 Stats: 13 lines in 1 file changed: 12 ins; 0 del; 1 mod 8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI Reviewed-by: aivanov, abhiscxk ------------- PR: https://git.openjdk.org/jdk/pull/22783 From rriggs at openjdk.org Wed Dec 18 15:04:19 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 18 Dec 2024 15:04:19 GMT Subject: RFR: 8346570: SM cleanup of tests for Beans and Serialization Message-ID: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> Continuing SM removal cleanup of tests for test/jdk/java/beans and test/jdk/java/io/Serializable. Removing doPrivileged, Permissions, and SecurityException. ------------- Commit messages: - 8346570: SM cleanup of tests for Beans and Serialization Changes: https://git.openjdk.org/jdk/pull/22813/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22813&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346570 Stats: 198 lines in 7 files changed: 0 ins; 158 del; 40 mod Patch: https://git.openjdk.org/jdk/pull/22813.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22813/head:pull/22813 PR: https://git.openjdk.org/jdk/pull/22813 From ihse at openjdk.org Wed Dec 18 17:06:02 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 18 Dec 2024 17:06:02 GMT Subject: RFR: 8344191: Build code should not have classpath exception [v2] In-Reply-To: References: Message-ID: > In several (most? all?) of the build system files, the copyright header includes the classpath exception. This makes no sense, and should be removed. > > I have removed the classpath exception from makefiles, autoconf, shell scripts, properties files, configuration files, IDE support files, build tools and data. > > The only places where the classpath exception is still kept in the make directory is as text strings in some build tools, which generate source code that is bundled with `src.zip`, and thus *must* have the classpath exception. > > This is a huge and autogenerated, but content-wise trivial, PR, and I know such are hard to review. I recommend looking at the entire diff file instead of checking this file-by-file in the Github web GUI. (That's bound to be a painful experience) Magnus Ihse Bursie 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 remove-build-classpath-exception - Update build tools, data and IDE support - Update makefiles, autoconf, shell scripts, properties files and configuration files ------------- Changes: https://git.openjdk.org/jdk/pull/22104/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22104&range=01 Stats: 1994 lines in 555 files changed: 0 ins; 1120 del; 874 mod Patch: https://git.openjdk.org/jdk/pull/22104.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22104/head:pull/22104 PR: https://git.openjdk.org/jdk/pull/22104 From lancea at openjdk.org Wed Dec 18 18:34:37 2024 From: lancea at openjdk.org (Lance Andersen) Date: Wed, 18 Dec 2024 18:34:37 GMT Subject: RFR: 8346570: SM cleanup of tests for Beans and Serialization In-Reply-To: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> References: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> Message-ID: On Wed, 18 Dec 2024 14:58:26 GMT, Roger Riggs wrote: > Continuing SM removal cleanup of tests for test/jdk/java/beans and test/jdk/java/io/Serializable. > Removing doPrivileged, Permissions, and SecurityException. Marked as reviewed by lancea (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22813#pullrequestreview-2512574890 From asemenyuk at openjdk.org Wed Dec 18 18:58:40 2024 From: asemenyuk at openjdk.org (Alexey Semenyuk) Date: Wed, 18 Dec 2024 18:58:40 GMT Subject: RFR: 8344191: Build code should not have classpath exception [v2] In-Reply-To: References: Message-ID: On Wed, 18 Dec 2024 17:06:02 GMT, Magnus Ihse Bursie wrote: >> In several (most? all?) of the build system files, the copyright header includes the classpath exception. This makes no sense, and should be removed. >> >> I have removed the classpath exception from makefiles, autoconf, shell scripts, properties files, configuration files, IDE support files, build tools and data. >> >> The only places where the classpath exception is still kept in the make directory is as text strings in some build tools, which generate source code that is bundled with `src.zip`, and thus *must* have the classpath exception. >> >> This is a huge and autogenerated, but content-wise trivial, PR, and I know such are hard to review. I recommend looking at the entire diff file instead of checking this file-by-file in the Github web GUI. (That's bound to be a painful experience) > > Magnus Ihse Bursie 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 remove-build-classpath-exception > - Update build tools, data and IDE support > - Update makefiles, autoconf, shell scripts, properties files and configuration files jpackage changes look good. $0.02 ------------- Marked as reviewed by asemenyuk (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22104#pullrequestreview-2512625117 From prr at openjdk.org Wed Dec 18 18:59:37 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 18 Dec 2024 18:59:37 GMT Subject: RFR: 8346570: SM cleanup of tests for Beans and Serialization In-Reply-To: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> References: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> Message-ID: On Wed, 18 Dec 2024 14:58:26 GMT, Roger Riggs wrote: > Continuing SM removal cleanup of tests for test/jdk/java/beans and test/jdk/java/io/Serializable. > Removing doPrivileged, Permissions, and SecurityException. Beans changes look fine ------------- Marked as reviewed by prr (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22813#pullrequestreview-2512626486 From mickleness at gmail.com Wed Dec 18 19:30:14 2024 From: mickleness at gmail.com (Jeremy Wood) Date: Wed, 18 Dec 2024 19:30:14 +0000 Subject: JDK-8344697 Heavy Performance Cost For Obsolete Aqua Button Repaints Message-ID: Bug 8344697 points out that the Aqua L&F (in Swing) has logic to constantly repaint the JRootPane?s default button. I?m pretty sure that feature is now obsolete. Back with Mac OS Mavericks (Mac OS 10.9) the default button continually pulsed (see example ), but Apple stopped supporting Mavericks around 2016. All subsequent OS?s do not repaint that button. However: The resolution to JDK-8342782 changes things. The repaint logic is still obsolete, but it no longer results in a demonstrable performance problem. My questions are: 1. Is obsolescence enough of a reason to submit a PR to remove this feature? (Can I submit a PR like this without a test case?) 2. And/or can anyone help me brainstorm a realistic/compelling test case that demonstrates this feature is still problematic? (It adds a AncestorListener to *every* AbstractButton.) Additional context: I wrote a test to demonstrate how the code responsible for pulsing the button used to be very expensive (see test ). It scrolls a large panel with 5000 JCheckBoxes, and performance varies wildly based on whether Aqua?s default button logic is used. When I first wrote it the output included: > The time it took by default was: 35923 > The time it took when suppressing AncestorListeners was: 112 However now having merged the recent changes for 8342782 , this performance gap appears satisfactorily fixed: > The time it took by default was: 287 > The time it took when suppressing AncestorListeners was: 215 -------------- next part -------------- An HTML attachment was scrubbed... URL: From prr at openjdk.org Wed Dec 18 19:37:36 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 18 Dec 2024 19:37:36 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: References: Message-ID: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> On Tue, 17 Dec 2024 11:51:51 GMT, Magnus Ihse Bursie wrote: > There are multiple DllMain definitions throughout the JDK native libraries, causing name collisions. DllMain is a default name, not a required name. You could just rename them and add /entry to the linker command line, eg /entry:AwtDllMain https://learn.microsoft.com/en-us/cpp/build/reference/entry-entry-point-symbol?view=msvc-170&viewFallbackFrom=vs-2019 I'm not sure it seems right to have every static destructor need to know what needs to be done to exit the DLL. I do read your comment about not knowing when the static destructors are called vs the DllMain on shutdown, but surely this *is* well defined ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2552120496 From ihse at openjdk.org Wed Dec 18 19:55:36 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 18 Dec 2024 19:55:36 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> References: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> Message-ID: <207GaVwqkbHLIBuQAZTkdBXRwPN5huv-8FMgaVNRFwI=.306ffc92-749e-4e09-b575-e0f1f39b5481@github.com> On Wed, 18 Dec 2024 19:35:09 GMT, Phil Race wrote: > DllMain is a default name, not a required name. You could just rename them and add /entry to the linker command line, eg /entry:AwtDllMain That was an interesting piece of information I did not know. That could be used to resolve issue 2. However, it does not resolve issue 1, which is that this code must be called somehow for static libraries nevertheless. > I do read your comment about not knowing when the static destructors are called vs the DllMain on shutdown, but surely this _is_ well defined ? That is possible. It could be just that I have failed to locate the documentation about this. I did find about the static initializer fiasco, and I have studied when JNI_OnUnload happens (answer: basically it doesn't), and what I have found about DllMain has not been very specific, so I'm not too hopeful that it is indeed well defined. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2552150929 From ihse at openjdk.org Wed Dec 18 20:04:37 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 18 Dec 2024 20:04:37 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> References: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> Message-ID: On Wed, 18 Dec 2024 19:35:09 GMT, Phil Race wrote: > I'm not sure it seems right to have every static destructor need to know what needs to be done to exit the DLL. That is an over-generalization of the problem at hand that is not really true. What we have is an unfortunate coupling between the API from one DLL (JVM.DLL) and another (AWT.DLL), and that only happens in three specific static objects, each of which are very specialized. Another way of describing the problem is that the AWT debug system should not use JVM raw monitors, since they could happen to be used when the JVM is unloaded and the calls will fail. In fact, my first solution attempt for this bug was to replace the locking mechanism with an own implementation of pthread mutexes/critical sections. (Basically a simple re-implementation of JVM raw monitors.) The current code tries to solve this by "disabling" the locks when awt.dll is unloaded, but technically it should be disabled when the jvm.dll module is unloaded -- the fact that this work is just due to the circumstance that they typically are unloaded together when the process ends. I don't know if it would be possible to trigger some kind of race, where jvm.dll is unloaded but some thread is still running the awt debug code, like some of the `operator delete` stuff (which does take a lock). I think the entire design leaves a lot to be desired, but I thought this was the most elegant to the solution to the problem at hand. As a second hand alternative, I'd suggest replacing JVM raw monitors with a hand-rolled implementation. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2552165713 From mickleness at gmail.com Wed Dec 18 20:43:30 2024 From: mickleness at gmail.com (Jeremy Wood) Date: Wed, 18 Dec 2024 20:43:30 +0000 Subject: JDK-8165863 Retest Message-ID: mserb made this comment for JDK-8342782: https://github.com/openjdk/jdk/pull/21962#issuecomment-2463540556 I couldn?t reproduce JDK-8165863 in OpenJDK before the resolution to JDK-8342782; I think it will be even harder to reproduce now. I don?t have permission to comment in the bug database; is it possible to request someone retest JDK-8165863 ? I think it won?t reproduce anymore. -------------- next part -------------- An HTML attachment was scrubbed... URL: From achung at openjdk.org Wed Dec 18 20:43:37 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 18 Dec 2024 20:43:37 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: <445WoEcYIr37UhDEsA5ojjWfFF7eiGGtuTWuuGEavNU=.82c642db-61e7-4ff1-9129-9b48a2d76ff6@github.com> On Wed, 11 Dec 2024 20:48:51 GMT, Alisen Chung wrote: >> Soft hyphens should never render, regardless of the rendering path used internally. >> >> This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). >> >> Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. >> >> The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. > > Test currently fails with error `java.lang.RuntimeException: stringWidth for char 00ad using font Dialog: 101 != 333 > ` > @alisenchung What OS and architecture are you testing on where you see failures? > > The automated checks seem to have all passed (except for `macos-aarch64`, which has been broken for quite a few weeks due to an unrelated toolchain issue: `xcode-select: error: invalid developer directory '/Applications/Xcode_14.3.1.app/Contents/Developer'`). I'm running macOS Sonoma 14.7 and it's failing on my local machine ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2552229377 From dgredler at openjdk.org Wed Dec 18 21:02:35 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Wed, 18 Dec 2024 21:02:35 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 20:09:09 GMT, Daniel Gredler wrote: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. OK yeah, I didn't update the macOS glyph mapper because I don't have a Mac. Let me see if I can wrangle one up. I was hesitant to update the macOS `sun.font.CCharToGlyphMapper` without being able to test or even compile it locally. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2552257026 From achung at openjdk.org Wed Dec 18 21:07:37 2024 From: achung at openjdk.org (Alisen Chung) Date: Wed, 18 Dec 2024 21:07:37 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 20:09:09 GMT, Daniel Gredler wrote: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. Here's the full error if it helps you debug java.lang.RuntimeException: stringWidth for char 00ad using font Dialog: 101 != 333 at FormatCharAdvanceTest.assertEqual(FormatCharAdvanceTest.java:209) at FormatCharAdvanceTest.testChar(FormatCharAdvanceTest.java:124) at FormatCharAdvanceTest.testChars(FormatCharAdvanceTest.java:94) at FormatCharAdvanceTest.main(FormatCharAdvanceTest.java:83) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138) at java.base/java.lang.Thread.run(Thread.java:1576) ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2552266127 From rriggs at openjdk.org Wed Dec 18 21:08:40 2024 From: rriggs at openjdk.org (Roger Riggs) Date: Wed, 18 Dec 2024 21:08:40 GMT Subject: Integrated: 8346570: SM cleanup of tests for Beans and Serialization In-Reply-To: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> References: <2EjI8ArlSX4q17DAXxWp0KzWqrTXdYR-DSLBZAZvS80=.ab19013d-f685-48cc-9aa7-6db209bbe7a0@github.com> Message-ID: On Wed, 18 Dec 2024 14:58:26 GMT, Roger Riggs wrote: > Continuing SM removal cleanup of tests for test/jdk/java/beans and test/jdk/java/io/Serializable. > Removing doPrivileged, Permissions, and SecurityException. This pull request has now been integrated. Changeset: 55906692 Author: Roger Riggs URL: https://git.openjdk.org/jdk/commit/55906692e18d190a6655c7d473fe6f0e017f58fd Stats: 198 lines in 7 files changed: 0 ins; 158 del; 40 mod 8346570: SM cleanup of tests for Beans and Serialization Reviewed-by: lancea, prr ------------- PR: https://git.openjdk.org/jdk/pull/22813 From duke at openjdk.org Wed Dec 18 21:15:50 2024 From: duke at openjdk.org (duke) Date: Wed, 18 Dec 2024 21:15:50 GMT Subject: Withdrawn: 8326027: [TEST_BUG]Comparing buffered images of white background frame fails in Mac In-Reply-To: References: Message-ID: <6KdzGd0R_61MAaugRHRfvlxAjBvmLrmIayrH7x8dZRc=.2c37e2ad-0c49-4d7f-8f42-b4d022e26917@github.com> On Thu, 29 Aug 2024 04:38:29 GMT, Tejesh R wrote: > On analysis of captured image, it is observed that there are few pixels which vary slightly w.r.t to expected color. Hence tolerance is included in color comparison. > Tested in mach5 multiple time and its green. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/20760 From prr at openjdk.org Wed Dec 18 22:34:40 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 18 Dec 2024 22:34:40 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v3] In-Reply-To: References: Message-ID: On Wed, 11 Dec 2024 19:40:51 GMT, Alisen Chung wrote: >> When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. >> >> This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. > > Alisen Chung has updated the pull request incrementally with two additional commits since the last revision: > > - align spacing > - remove extra space src/java.desktop/share/classes/java/awt/Robot.java line 61: > 59: * the mouse cursor instead of just generating mouse move events. > 60: *

> 61: * Note: {@code waitForIdle()} must not be called on the AWT EDT, since The word "and" needs to be before "since" for this to make sense and then that needs more rewording later. Mulling it over, I suggest rewording like this

 * Note: When {@code autoWaitForIdle()} is enabled, mouse and key related methods
 * cannot be called on the AWT EDT.
 * This is because when {@code autoWaitForIdle()} is enabled,
 * the mouse and key methods implicitly call {@code waitForIdle()}
 * which will throw {@code IllegalThreadStateException} when called on the AWT EDT.
------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22564#discussion_r1890911896 From prr at openjdk.org Wed Dec 18 22:57:36 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 18 Dec 2024 22:57:36 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: <445WoEcYIr37UhDEsA5ojjWfFF7eiGGtuTWuuGEavNU=.82c642db-61e7-4ff1-9129-9b48a2d76ff6@github.com> References: <445WoEcYIr37UhDEsA5ojjWfFF7eiGGtuTWuuGEavNU=.82c642db-61e7-4ff1-9129-9b48a2d76ff6@github.com> Message-ID: <1V838QEH5xHfLGLqQFnMAWvrgyXfyggrF69eGwMF1tQ=.e0516dfa-fd6d-4fe7-99de-01e7dba4bfc6@github.com> On Wed, 18 Dec 2024 20:40:53 GMT, Alisen Chung wrote: > The automated checks seem to have all passed What automated checks ? If you mean github actions I can assure you it is not running the test you wrote. It runs a VERY limited set of tests which doesn't include ANY desktop/clientlibs related tests, not even those which do not require a display. So if you are updating any client code (including but not limited to) any code in java.desktop, you will need to find machines to run all the tests yourself, across all platforms. Or, ask someone who has access to those to do it for you. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2552422567 From prr at openjdk.org Wed Dec 18 23:32:37 2024 From: prr at openjdk.org (Phil Race) Date: Wed, 18 Dec 2024 23:32:37 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Tue, 10 Dec 2024 20:09:09 GMT, Daniel Gredler wrote: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. One thing this fix does is change the logic which we have today FROM - Let the font have first say. If it maps the code point, use what the font provides, the font should know what it is doing. And only map to zero if the font does not support the code point TO - Never mind what the font says, these are always invisible and zero width. I have no easy way to know how this is going to work out in practice. Is there a particular reason you adopted this model ? Also there are some changes in the code points being checked for. Eg you added 0x200B .. you no longer check for 0x2028-0x2029 you added a check for 0x2060-0x2069 The additions probably make sense but I'm not sure why you removed some .. it is not explained. Perhaps because unicode does not designate it a "Format" character .. but we should still be treating it as invisible. It would be helpful to add comments say what the characters are in the range, as there is now a lot ! If it is a range like 0x2060-0x206F, then a summary of the 16 code points would be enough Also, I'd like you to say something about the embedded fonts in the test. Superficially, it appears you generated these from scratch using fontforge and the glyphs all display as a simple line. But I do need to understand the complete provenance of these. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2552460091 From dholmes at openjdk.org Thu Dec 19 02:54:47 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 19 Dec 2024 02:54:47 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> Message-ID: On Wed, 18 Dec 2024 10:14:45 GMT, Magnus Ihse Bursie wrote: > The solution chosen by the original implementors of static builds was to look for a symbol JNI_OnLoad_someInternalLibrary, and if it was found, skip loading the dynamic library. Is that necessary? Presumably if you try to dynamically load a statically linked library it will fail. Does the failure indicate the reason? If so then just ignore it. > It does have the advantage that users can add static libraries of their own in this way. Is this intended to be a supported mechanism? That needs to be specified and documented somewhere if so. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2552666801 From abhiscxk at openjdk.org Thu Dec 19 05:22:17 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 19 Dec 2024 05:22:17 GMT Subject: RFR: 8339728 : [Accessibility,Windows,JAWS] Bug in the getKeyChar method of the AccessBridge class Message-ID: For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method. Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed. AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT. Manual test case is added to verify the shortcut for JMenuItems. ------------- Commit messages: - MenuItem shortcut accessibility fix Changes: https://git.openjdk.org/jdk/pull/22822/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22822&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8339728 Stats: 124 lines in 3 files changed: 117 ins; 2 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/22822.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22822/head:pull/22822 PR: https://git.openjdk.org/jdk/pull/22822 From abhiscxk at openjdk.org Thu Dec 19 05:28:17 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 19 Dec 2024 05:28:17 GMT Subject: RFR: 8339728 : [Accessibility, Windows, JAWS] Bug in the getKeyChar method of the AccessBridge class In-Reply-To: References: Message-ID: On Thu, 19 Dec 2024 05:17:07 GMT, Abhishek Kumar wrote: > For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method. > > Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed. > > AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT. > > Manual test case is added to verify the shortcut for JMenuItems. @azuev-java Please review. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22822#issuecomment-2552816687 From abhiscxk at openjdk.org Thu Dec 19 05:28:16 2024 From: abhiscxk at openjdk.org (Abhishek Kumar) Date: Thu, 19 Dec 2024 05:28:16 GMT Subject: RFR: 8339728 : [Accessibility, Windows, JAWS] Bug in the getKeyChar method of the AccessBridge class [v2] In-Reply-To: References: Message-ID: > For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method. > > Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed. > > AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT. > > Manual test case is added to verify the shortcut for JMenuItems. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Copyright year and test update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22822/files - new: https://git.openjdk.org/jdk/pull/22822/files/6ab3dbd7..a83aa98f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22822&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22822&range=00-01 Stats: 4 lines in 3 files changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22822.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22822/head:pull/22822 PR: https://git.openjdk.org/jdk/pull/22822 From jwaters at openjdk.org Thu Dec 19 06:48:35 2024 From: jwaters at openjdk.org (Julian Waters) Date: Thu, 19 Dec 2024 06:48:35 GMT Subject: RFR: 8346388: Cannot use DllMain in libawt for static builds In-Reply-To: <207GaVwqkbHLIBuQAZTkdBXRwPN5huv-8FMgaVNRFwI=.306ffc92-749e-4e09-b575-e0f1f39b5481@github.com> References: <-JVJPyA8NTl4D-TmJm9kolatk_WwMuR1-JXb-gef_gc=.22edd44c-f7c2-4451-938c-115c5e854e48@github.com> <207GaVwqkbHLIBuQAZTkdBXRwPN5huv-8FMgaVNRFwI=.306ffc92-749e-4e09-b575-e0f1f39b5481@github.com> Message-ID: On Wed, 18 Dec 2024 19:53:10 GMT, Magnus Ihse Bursie wrote: > > DllMain is a default name, not a required name. You could just rename them and add /entry to the linker command line, eg /entry:AwtDllMain > > That was an interesting piece of information I did not know. That could be used to resolve issue 2. However, it does not resolve issue 1, which is that this code must be called somehow for static libraries nevertheless. That would not be the correct solution to issue 2. Contrary to popular belief DllMain is _not_ the first piece of code that is called for a dll (That is, it is not the actual dll entry point), that would be DllMainCRTStartup (Or something similar, I forgot the exact name). -entry changes the default name of the initial loader from DllMainCRTStartup to whatever you specified, NOT the DllMain initialization function. Using -entry in this way would royally break AWT and make it non-functional. If that doesn't happen, it would mean we are monumentally lucky, but it would likely still not work properly ------------- PR Comment: https://git.openjdk.org/jdk/pull/22790#issuecomment-2552911127 From aturbanov at openjdk.org Thu Dec 19 08:38:07 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 19 Dec 2024 08:38:07 GMT Subject: RFR: 8346603: Cleanup Metacity.ThemeGetter class Message-ID: There is opportunity to remove redundant nested class `Metacity.ThemeGetter`. It was introduced in the SecurityManager era to handle privileged call. Now it's not the case and we can remove it. It simplifies and streamlines logic. ------------- Commit messages: - [PATCH] Cleanup Metacity.ThemeGetter Changes: https://git.openjdk.org/jdk/pull/22292/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22292&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346603 Stats: 148 lines in 1 file changed: 45 ins; 67 del; 36 mod Patch: https://git.openjdk.org/jdk/pull/22292.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22292/head:pull/22292 PR: https://git.openjdk.org/jdk/pull/22292 From aturbanov at openjdk.org Thu Dec 19 09:14:38 2024 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 19 Dec 2024 09:14:38 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: <098v6g_paPUmaA3u36PZJu8K6MIUiHDbLOS1R54OSlc=.b8ca85db-085e-4345-86a9-cfeb0b243744@github.com> On Tue, 17 Dec 2024 20:46:54 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 one additional commit since the last revision: > > fixed test to fail before fix and pass after fix test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 46: > 44: Point currLoc = MouseInfo.getPointerInfo().getLocation(); > 45: System.out.println("Current mouse location: " + currLoc); > 46: if(currLoc.equals(new Point(20000,200))) { Suggestion: if (currLoc.equals(new Point(20000, 200))) { ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1891405333 From ihse at openjdk.org Thu Dec 19 10:27:40 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 19 Dec 2024 10:27:40 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> Message-ID: On Thu, 19 Dec 2024 02:51:51 GMT, David Holmes wrote: > > The solution chosen by the original implementors of static builds was to look for a symbol JNI_OnLoad_someInternalLibrary, and if it was found, skip loading the dynamic library. > > Is that necessary? Presumably if you try to dynamically load a statically linked library it will fail. Does the failure indicate the reason? If so then just ignore it. It is perhaps not necessary, but this is the way it is implemented, and had been for years. Just as you like to be conservative and don't change things that's been working for years, so am I a bit reluctant to change this behavior. Doing so would be a massive undertaking, on a completely different scale than just fixing a few issues to get the Windows static launcher to work properly. > > It does have the advantage that users can add static libraries of their own in this way. > > Is this intended to be a supported mechanism? That needs to be specified and documented somewhere if so. Yes it is. It is documented in the JNI specification: https://docs.oracle.com/en/java/javase/23/docs/specs/jni/invocation.html#jni_onload_l ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2553349041 From dholmes at openjdk.org Thu Dec 19 12:28:57 2024 From: dholmes at openjdk.org (David Holmes) Date: Thu, 19 Dec 2024 12:28:57 GMT Subject: RFR: 8346394: Bundled freetype library needs to have JNI_OnLoad for static builds [v3] In-Reply-To: References: <5KBLAgwC-yq8RoimsdjLijhs2FcuqASOhY2jWCSUFYU=.8a361bab-799f-4091-9926-b76a4cf1b3ff@github.com> Message-ID: On Thu, 19 Dec 2024 10:24:29 GMT, Magnus Ihse Bursie wrote: > Yes it is. It is documented in the JNI specification: https://docs.oracle.com/en/java/javase/23/docs/specs/jni/invocation.html#jni_onload_l Thanks for the memory jolt, I had forgotten about that. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22791#issuecomment-2553678451 From achung at openjdk.org Thu Dec 19 19:51:21 2024 From: achung at openjdk.org (Alisen Chung) Date: Thu, 19 Dec 2024 19:51:21 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v4] In-Reply-To: References: Message-ID: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: update class spec ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22564/files - new: https://git.openjdk.org/jdk/pull/22564/files/4928e4b5..89a48d37 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=02-03 Stats: 5 lines in 1 file changed: 1 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/22564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22564/head:pull/22564 PR: https://git.openjdk.org/jdk/pull/22564 From prr at openjdk.org Thu Dec 19 20:23:37 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 19 Dec 2024 20:23:37 GMT Subject: RFR: 8346603: Cleanup Metacity.ThemeGetter class In-Reply-To: References: Message-ID: On Thu, 21 Nov 2024 06:38:26 GMT, Andrey Turbanov wrote: > There is opportunity to remove redundant nested class `Metacity.ThemeGetter`. It was introduced in the SecurityManager era to handle privileged call. Now (after https://github.com/openjdk/jdk/pull/22186/files#diff-5e3ecade1f409333dfba477b64039f86887d1febbff517407835fcac17a77b2a) it's not the case and we can remove it. > It simplifies and streamlines logic. I don't know off the top of my head exactly what should be done here, but it seems odd to refactor obsolete code. A much more interesting task here would be to figure out if this code is even needed anymore. Metcity and gconf are SFAIK obsolete and probably this code should have been deleted when we removed gnome 2 support. You'll need to identify which Linux desktops versions still support this and how they interacts with GTK 3 .. if there's no overlap, then probably this code is never called. In which case it can be removed. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22292#issuecomment-2555705187 From ihse at openjdk.org Thu Dec 19 21:21:08 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 19 Dec 2024 21:21:08 GMT Subject: RFR: 8346377: Properly support static builds for Windows Message-ID: When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. ------------- Commit messages: - 8346377: Properly support static builds for Windows Changes: https://git.openjdk.org/jdk/pull/22795/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22795&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346377 Stats: 59 lines in 5 files changed: 38 ins; 4 del; 17 mod Patch: https://git.openjdk.org/jdk/pull/22795.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22795/head:pull/22795 PR: https://git.openjdk.org/jdk/pull/22795 From ihse at openjdk.org Thu Dec 19 21:21:08 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Thu, 19 Dec 2024 21:21:08 GMT Subject: RFR: 8346377: Properly support static builds for Windows In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 15:41:51 GMT, Magnus Ihse Bursie wrote: > When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. > > Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. > > Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. make/StaticLibs.gmk line 71: > 69: BROKEN_STATIC_LIBS += sspi_bridge > 70: # dt_shmem define jdwpTransport_OnLoad which conflict with dt_socket > 71: BROKEN_STATIC_LIBS += dt_shmem This is actually a tricky problem to solve. We likely need to change the spec for jdwpTransport_OnLoad similar to how we have done for JNI_OnLoad etc. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893159240 From prr at openjdk.org Thu Dec 19 21:50:37 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 19 Dec 2024 21:50:37 GMT Subject: RFR: 8346377: Properly support static builds for Windows In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 15:41:51 GMT, Magnus Ihse Bursie wrote: > When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. > > Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. > > Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. src/java.base/windows/native/libjli/java_md.c line 233: > 231: if (JLI_IsStaticallyLinked()) { > 232: // For statically linked builds, we rely on the system msvcrt dlls > 233: loaded = 1; Well that's a limitation. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893184517 From prr at openjdk.org Thu Dec 19 21:54:35 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 19 Dec 2024 21:54:35 GMT Subject: RFR: 8346377: Properly support static builds for Windows In-Reply-To: References: Message-ID: <_CyKdj47wSsVKZkKLnVGGTCqyZ5BwnEf7NGFLkHydxs=.59067959-6f4a-4a28-ae09-99d9054335de@github.com> On Tue, 17 Dec 2024 15:41:51 GMT, Magnus Ihse Bursie wrote: > When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. > > Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. > > Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. src/java.desktop/windows/native/libawt/windows/awt_Mlib.cpp line 53: > 51: */ > 52: if (JVM_IsStaticallyLinked()) { > 53: hDLL = ::GetModuleHandle(NULL); So this returns a handle to the process instead ? I suppose this exists for apps that want the process, not for apps that can't get a handle to a DLL. I am not sure if this is always sufficiently equivalent to work for whatever the app needs it for .. I hope this doesn't create downstream problems that we need to fix. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893187626 From erikj at openjdk.org Thu Dec 19 22:18:41 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Thu, 19 Dec 2024 22:18:41 GMT Subject: RFR: 8346377: Properly support static builds for Windows In-Reply-To: References: Message-ID: <2KhUCUedmuMoIFuG7TRySj0u5YeJfztwZappQF9fSWU=.a80a0a3b-ee52-4b56-a050-bbe90d2519ea@github.com> On Tue, 17 Dec 2024 15:41:51 GMT, Magnus Ihse Bursie wrote: > When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. > > Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. > > Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. src/hotspot/os/windows/os_windows.cpp line 316: > 314: } > 315: > 316: // Get rid of \hotspot_variant>, if binary is libjvm.so, libjvm.so -> jvm.dll? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893202914 From achung at openjdk.org Thu Dec 19 22:19:21 2024 From: achung at openjdk.org (Alisen Chung) Date: Thu, 19 Dec 2024 22:19:21 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v5] In-Reply-To: References: Message-ID: > When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. > > This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: api note ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22564/files - new: https://git.openjdk.org/jdk/pull/22564/files/89a48d37..164e927f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22564&range=03-04 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/22564.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22564/head:pull/22564 PR: https://git.openjdk.org/jdk/pull/22564 From dgredler at openjdk.org Thu Dec 19 22:41:52 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Thu, 19 Dec 2024 22:41:52 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout [v2] In-Reply-To: References: Message-ID: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Add macOS-specific char mapper changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22670/files - new: https://git.openjdk.org/jdk/pull/22670/files/7f0a4bfb..e0d7f8c4 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22670&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22670&range=00-01 Stats: 16 lines in 1 file changed: 9 ins; 1 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/22670.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22670/head:pull/22670 PR: https://git.openjdk.org/jdk/pull/22670 From prr at openjdk.org Thu Dec 19 23:03:38 2024 From: prr at openjdk.org (Phil Race) Date: Thu, 19 Dec 2024 23:03:38 GMT Subject: RFR: 8345144: Robot does not specify all causes of IllegalThreadStateException [v5] In-Reply-To: References: Message-ID: On Thu, 19 Dec 2024 22:19:21 GMT, Alisen Chung wrote: >> When robot.autoWaitForIdle is set to true, all mouse and key-related methods when invoked on the EDT will throw java.lang.IllegalThreadStateException which is not in the Robot specification. >> >> This PR updates the specification by adding warnings to avoid calling lengthy and delay-type methods on EDT and including exceptions thrown when autoWaitForIdle is set to true and mouse/key-handling methods are called on the EDT. > > Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: > > api note Marked as reviewed by prr (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22564#pullrequestreview-2516383448 From dgredler at openjdk.org Fri Dec 20 00:17:54 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 20 Dec 2024 00:17:54 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout [v3] In-Reply-To: References: Message-ID: > Soft hyphens should never render, regardless of the rendering path used internally. > > This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). > > Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. > > The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: Add more info about test fonts and default-ignorable chars ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22670/files - new: https://git.openjdk.org/jdk/pull/22670/files/e0d7f8c4..f7a89cff Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22670&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22670&range=01-02 Stats: 109 lines in 2 files changed: 104 ins; 0 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/22670.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22670/head:pull/22670 PR: https://git.openjdk.org/jdk/pull/22670 From honkar at openjdk.org Fri Dec 20 00:49:35 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 00:49:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 20:46:54 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 one additional commit since the last revision: > > fixed test to fail before fix and pass after fix test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 44: > 42: robot.delay(500); > 43: > 44: Point currLoc = MouseInfo.getPointerInfo().getLocation(); Not directly related to this change, `MouseInfo.getPointerInfo().getLocation()` throws NPE for a multi-monitor extended display setup on windows for an off-screen location. It returns valid PointerInfo only if the point falls within the bounds of any of the screen device , else it returns null. This may be the expected behavior of MouseInfo.getPointerInfo() but the javadoc is not clear about how off-screen coordinates are handled. For this test you can add a null check before calling .getLocation() for sanity (although multimonitor setup is not the case for CI runs) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1893303023 From dgredler at openjdk.org Fri Dec 20 00:51:37 2024 From: dgredler at openjdk.org (Daniel Gredler) Date: Fri, 20 Dec 2024 00:51:37 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Wed, 18 Dec 2024 23:29:58 GMT, Phil Race wrote: >> Soft hyphens should never render, regardless of the rendering path used internally. >> >> This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). >> >> Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. >> >> The Type1 and TTF glyph mappers have been updated, but the macOS glyph mapper has not been updated. > > One thing this fix does is change the logic which we have today > FROM > - Let the font have first say. If it maps the code point, use what the font provides, > the font should know what it is doing. And only map to zero if the font does not support the code point > TO > - Never mind what the font says, these are always invisible and zero width. > > > I have no easy way to know how this is going to work out in practice. > Is there a particular reason you adopted this model ? > Also there are some changes in the code points being checked for. > Eg > you added 0x200B .. > you no longer check for 0x2028-0x2029 > you added a check for 0x2060-0x2069 > > The additions probably make sense but I'm not sure why you removed some .. it is not explained. > Perhaps because unicode does not designate it a "Format" character .. but we should still be treating > it as invisible. > > It would be helpful to add comments say what the characters are in the range, as there is now a lot ! > If it is a range like 0x2060-0x206F, then a summary of the 16 code points would be enough > > Also, I'd like you to say something about the embedded fonts in the test. > Superficially, it appears you generated these from scratch using fontforge and the glyphs all display as a simple line. > But I do need to understand the complete provenance of these. @prrace, @alisenchung Thanks for your comments! > What automated checks? You're right, I had vastly overestimated the scope of the automated tier1 test runs on GitHub. I'll keep that in mind. > you will need to find machines to run all the tests yourself, across all platforms I was able to get my hands on a Mac, and have updated the Mac-specific code as well. I'm now covered on Linux, Windows and Mac. But if I ever need to test on AIX, I'll know I took a wrong turn somewhere. > One thing this fix does is change the logic which we have today [...] TO Never mind what the font says, these are always invisible and zero width Correct, this is the core of the issue in this bug: there are fonts containing glyphs for e.g. soft hyphen, but these glyphs should not be displayed because these characters are never displayed in and of themselves. This seems to match how HarfBuzz behaves, but the current Java logic does not mirror it, leading to inconsistent results depending on the internal code paths used to render or measure text. See the Unicode description of "default-ignorable" characters (http://www.unicode.org/L2/L2002/02368-default-ignorable.html): > Default-ignorable code points are those that should be ignored by default in rendering (unless explicitly supported). They have no visible glyph or advance width in and of themselves, although they may affect the display, positioning, or adornment of adjacent or surrounding characters. [...] This does not imply that default-ignorable code points must always be invisible: an implementation can show a visible glyph on request, such as in a "Show Hidden" mode. A particular use of a "Show Hidden" mode is to show a visible indication of "misplaced" or "ineffectual" formatting codes. [...] There are other characters that have no visible glyphs: the white-space characters. These typically have advance-width, however. The line separation characters such as CR do not clearly exhibit this advance-width since they are always at the end of a line, but in most GUIs show a visible advance width when selected. The `FontUtilities.isDefaultIgnorable` function matches the HarfBuzz classification, including a few exceptions made for the sake of Uniscribe compatibility: https://github.com/openjdk/jdk/blob/b2811a0ccd9664d11770980c47424ab6723cbbc9/src/java.desktop/share/native/libharfbuzz/hb-unicode.hh#L128 > you added 0x200B Correct, zero-width space is defined as having the Default_Ignorable_Code_Point property, i.e. it should not be displayed (by default) even if the font has a glyph for it. See https://www.unicode.org/Public/16.0.0/ucd/DerivedCoreProperties.txt (search for the "Default_Ignorable_Code_Point" section). > you no longer check for 0x2028-0x2029 > you added a check for 0x2060-0x2069 Correct, based on the Unicode spec and the corresponding HarfBuzz implementation, which I think we want the Java layout code to be consistent with. I think 0x2028-0x2029 in particular (line separator, paragraph separator) are considered whitespace and not ignorable (see the last sentence in the quote above from the unicode.org website). > It would be helpful to add comments saying what the characters are in the range Done. > Also, I'd like you to say something about the embedded fonts in the test. > it appears you generated these from scratch using fontforge and the glyphs all display as a simple line Correct, I've added the script to the corresponding JavaDoc for full transparency. I did have one thought that I wanted to run by you guys: it could be argued that `FontUtilities.isDefaultIgnorable` should be native and should just delegate to HarfBuzz's `is_default_ignorable`. That's not the approach I decided to take, but let me know if you disagree. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2556033513 From honkar at openjdk.org Fri Dec 20 00:54:35 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 00:54:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 20:46:54 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 one additional commit since the last revision: > > fixed test to fail before fix and pass after fix test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 41: > 39: robot.mouseMove(200, 200); > 40: robot.delay(500); > 41: robot.mouseMove(20000, 200); Adds more clarity if you declare the off screen location as follows: private static final Point OFF_SCREEN_LOC = new Point(20000, 200); .... robot.mouseMove(OFF_SCREEN_LOC.x , OFF_SCREEN_LOC.y); ..... currLoc.equals(OFF_SCREEN_LOC) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1893305277 From duke at openjdk.org Fri Dec 20 10:12:39 2024 From: duke at openjdk.org (Karm Michal Babacek) Date: Fri, 20 Dec 2024 10:12:39 GMT Subject: RFR: 8336382: Fixes error reporting in loading AWT and fonts [v10] In-Reply-To: References: Message-ID: <57gBvQRObGEREHytlMc2OBJqspwSZNEKSxl0bevC0Dw=.99dc529b-9fc8-4e21-ae88-1dfc84ea35b8@github.com> On Tue, 26 Nov 2024 15:11:58 GMT, Karm Michal Babacek wrote: >> If there is a problem with finding and calling e.g. `java/awt/GraphicsEnvironment` in `AWTIsHeadless`, the env' Exception remains set and it is not cleared. Later, that manifests as: >> >> Fatal error reported via JNI: Could not allocate library name >> >> Which is misleading. The code path is perhaps rare in a normal JDK usage, but it has been complicating our users' bug reports in the GraalVM/native-image ecosystem for quite some time. >> >> Instead of failing later indicating that the user has incorrectly configured JNI, it bails out very soon with a message that seems as if a jstring could not have been allocated. It sends users on wild goose chases where it appears `JNU_NewStringPlatform` calls failed, e.g. >> >> * https://github.com/oracle/graal/issues/9138 >> * https://github.com/oracle/graal/issues/8475 >> * https://github.com/oracle/graal/issues/9300 >> * https://github.com/quarkusio/quarkus/issues/31596 >> * https://github.com/graalvm/mandrel/issues/292 >> * https://github.com/Karm/mandrel-integration-tests/issues/262 >> >> This commit fixes the error reporting in the AWTIsHeadless. >> >> Furthermore, when AOT compiled, there is little sense for having a JAVA_HOME, yet some parts of AWT code look for it to search fonts. In such case, an empty directory structure is enough to accommodate it, e.g. >> >> /tmp/JAVA_HOME/ >> /tmp/JAVA_HOME/conf >> /tmp/JAVA_HOME/conf/fonts >> /tmp/JAVA_HOME/lib >> >> The exception is somewhat cryptic for users again, merely stating: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 22.0.1/java.awt.Font.createFont0(Font.java:1205) >> at java.desktop at 22.0.1/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139 >> >> Adding the cause there makes it clearer, i.e. that JAVA_HOME might be missing: >> >> Exception in thread "main" java.io.IOException: Problem reading font data. >> at java.desktop at 23-internal/java.awt.Font.createFont0(Font.java:1206) >> at java.desktop at 23-internal/java.awt.Font.createFont(Font.java:1076) >> at imageio.Main.loadFonts(Main.java:139) >> at imageio.Main.paintRectangles(Main.java:97) >> at imageio.Main.main(Main.java:195) >> at java.base at 23-internal/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH) >> Caused by: java.lang.Error: java.home property not set >> at java.desktop at 23-internal/sun.awt.FontConfiguration.findFontConfigF... > > Karm Michal Babacek has updated the pull request incrementally with one additional commit since the last revision: > > Amended error message, doesn't clear exception RFR ping pls @mrserb @prrace @theRealAph ------------- PR Comment: https://git.openjdk.org/jdk/pull/20169#issuecomment-2556684686 From duke at openjdk.org Fri Dec 20 11:56:45 2024 From: duke at openjdk.org (=?UTF-8?B?5p+z6bKy6bmP?=) Date: Fri, 20 Dec 2024 11:56:45 GMT Subject: RFR: 8264728: When use chinese IME, the candidate box isn't moved with caret of JTextArea [v12] In-Reply-To: References: <4JjGitYNWd7jQbHa4_1M6awOvkgtpfd2AY5LKS3MnUM=.8126670d-c076-4756-98be-9b6c7b7a565d@github.com> Message-ID: On Thu, 12 Dec 2024 00:05:33 GMT, ??? wrote: >> Candidat box can moving with caret on windows version. Someone must wrote codes for linux(ubuntu), but it doesn't work, so he didn't commit the codes. Why it doesn't work, is the key problem. >> >> 1, I wrote a example for linux: >> https://github.com/quantum6/X11InputMethod >> >> I tried all parameters to test and as my research: >> If you use XIMPreeditCallbacks to initiate, the box can't be moved with caret. >> If you use XIMPreeditNothing, it works. >> All examples use XIMPreeditCallbacks to initiate input method and candidate box can't moving. So I understand why he didn't commit the codes. >> >> 2, I traced the route of transfering caret coordites on windows version, then add codes for linux. >> 3, Taishan Office(like Microsoft Office Word) is running on jdk, we tested for a long time, it works OK. >> 4, I am not sure for AIX( no environment). >> >> >> JDK-8264728 : When use chinese IME, the candidate box isn't moved with caret of JTextArea >> Type: Bug >> Component: client-libs >> Sub-Component: java.awt:i18n >> Affected Version: 8,9,15,16 >> Priority: P3 >> Status: Open >> Resolution: Unresolved >> OS: linux >> CPU: x86_64 > > ??? 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 11 additional commits since the last revision: > > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Update to lastest > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - Remove tab > - Update to latest and make code safer > - Merge branch 'master' of https://github.com/openjdk/jdk into quantum6 > - ... and 1 more: https://git.openjdk.org/jdk/compare/1c45d058...0ab7a467 I am work hard for better! Wait some days! ------------- PR Comment: https://git.openjdk.org/jdk/pull/13055#issuecomment-2556855170 From ihse at openjdk.org Fri Dec 20 13:02:36 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 20 Dec 2024 13:02:36 GMT Subject: RFR: 8346377: Properly support static builds for Windows In-Reply-To: References: Message-ID: On Thu, 19 Dec 2024 21:48:27 GMT, Phil Race wrote: >> When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. >> >> Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. >> >> Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. > > src/java.base/windows/native/libjli/java_md.c line 233: > >> 231: if (JLI_IsStaticallyLinked()) { >> 232: // For statically linked builds, we rely on the system msvcrt dlls >> 233: loaded = 1; > > Well that's a limitation. Yes, maybe. A quick googling gives that it appears possible, but not recommended, to statically link msvcrt libraries, so I don't think we should try to go down that route. However, the situation is not principally different from other situations where we rely on system libraries. I know that historically msvcrt libraries of incorrect versions (or entirely missing) have been more of an issue, but I wonder how much so it is in the present. I don't think we'll know for sure until this has been tested "in the wild". ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893913410 From ihse at openjdk.org Fri Dec 20 13:11:22 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 20 Dec 2024 13:11:22 GMT Subject: RFR: 8346377: Properly support static builds for Windows [v2] In-Reply-To: References: Message-ID: > When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. > > Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. > > Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: Fix comment ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22795/files - new: https://git.openjdk.org/jdk/pull/22795/files/8c249e71..a72a0050 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22795&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22795&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22795.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22795/head:pull/22795 PR: https://git.openjdk.org/jdk/pull/22795 From ihse at openjdk.org Fri Dec 20 13:11:22 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 20 Dec 2024 13:11:22 GMT Subject: RFR: 8346377: Properly support static builds for Windows [v2] In-Reply-To: <2KhUCUedmuMoIFuG7TRySj0u5YeJfztwZappQF9fSWU=.a80a0a3b-ee52-4b56-a050-bbe90d2519ea@github.com> References: <2KhUCUedmuMoIFuG7TRySj0u5YeJfztwZappQF9fSWU=.a80a0a3b-ee52-4b56-a050-bbe90d2519ea@github.com> Message-ID: On Thu, 19 Dec 2024 22:10:29 GMT, Erik Joelsson wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix comment > > src/hotspot/os/windows/os_windows.cpp line 316: > >> 314: } >> 315: >> 316: // Get rid of \hotspot_variant>, if binary is libjvm.so, > > libjvm.so -> jvm.dll? Good catch. I copied and adapted this code from the unix solution, but missed this. Fixed. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893921085 From ihse at openjdk.org Fri Dec 20 13:11:22 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 20 Dec 2024 13:11:22 GMT Subject: RFR: 8346377: Properly support static builds for Windows [v2] In-Reply-To: <_CyKdj47wSsVKZkKLnVGGTCqyZ5BwnEf7NGFLkHydxs=.59067959-6f4a-4a28-ae09-99d9054335de@github.com> References: <_CyKdj47wSsVKZkKLnVGGTCqyZ5BwnEf7NGFLkHydxs=.59067959-6f4a-4a28-ae09-99d9054335de@github.com> Message-ID: On Thu, 19 Dec 2024 21:52:10 GMT, Phil Race wrote: >> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix comment > > src/java.desktop/windows/native/libawt/windows/awt_Mlib.cpp line 53: > >> 51: */ >> 52: if (JVM_IsStaticallyLinked()) { >> 53: hDLL = ::GetModuleHandle(NULL); > > So this returns a handle to the process instead ? > I suppose this exists for apps that want the process, not for apps that can't get a handle to a DLL. > I am not sure if this is always sufficiently equivalent to work for whatever the app needs it for .. I hope this doesn't create downstream problems that we need to fix. `hDLL` is a static variable scoped inside `hDLL`, so it easy to see all places it is used in. They are all about doing `GetProcAddress` for the exported functions in `mlib_image`. This is following a pattern from how we've handled static/dynamic duality elsewhere in the JDK. What we're really after in the `hDLL` variable is getting a handle to something that can look up e.g. "j2d_mlib_ImageCreate". For a dynamic build, that is a DLL, but for a static build, it is the executable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893918833 From ihse at openjdk.org Fri Dec 20 13:11:22 2024 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Fri, 20 Dec 2024 13:11:22 GMT Subject: RFR: 8346377: Properly support static builds for Windows [v2] In-Reply-To: References: <_CyKdj47wSsVKZkKLnVGGTCqyZ5BwnEf7NGFLkHydxs=.59067959-6f4a-4a28-ae09-99d9054335de@github.com> Message-ID: On Fri, 20 Dec 2024 13:05:53 GMT, Magnus Ihse Bursie wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Mlib.cpp line 53: >> >>> 51: */ >>> 52: if (JVM_IsStaticallyLinked()) { >>> 53: hDLL = ::GetModuleHandle(NULL); >> >> So this returns a handle to the process instead ? >> I suppose this exists for apps that want the process, not for apps that can't get a handle to a DLL. >> I am not sure if this is always sufficiently equivalent to work for whatever the app needs it for .. I hope this doesn't create downstream problems that we need to fix. > > `hDLL` is a static variable scoped inside `hDLL`, so it easy to see all places it is used in. They are all about doing `GetProcAddress` for the exported functions in `mlib_image`. This is following a pattern from how we've handled static/dynamic duality elsewhere in the JDK. What we're really after in the `hDLL` variable is getting a handle to something that can look up e.g. "j2d_mlib_ImageCreate". For a dynamic build, that is a DLL, but for a static build, it is the executable. In passing it can be noted that a corresponding will are going to be needed on Linux as well. This has not been done, since the linux static build only supports headless-only builds as of yet. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22795#discussion_r1893919610 From erikj at openjdk.org Fri Dec 20 13:34:39 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Fri, 20 Dec 2024 13:34:39 GMT Subject: RFR: 8346377: Properly support static builds for Windows [v2] In-Reply-To: References: Message-ID: <1pDWnC_AlYMnv0cYMgK7uqddMj0-bfnBOyKVlNVH8Pw=.65639017-4446-48d5-89de-dd6589ff3b50@github.com> On Fri, 20 Dec 2024 13:11:22 GMT, Magnus Ihse Bursie wrote: >> When the static launcher was introduced in [JDK-8339480](https://bugs.openjdk.org/browse/JDK-8339480), due to time and resource constraints, it was only working properly on Linux and macOS, while the Windows port compiled but did not work. Now the time has come to fix that. >> >> Most of the changes mirrors the kind of changes that were made for Linux and macOS in JDK-8339480. There are still limitations to static builds on Windows (e.g. starting with a splashscreen), but these kind of limitations also exists on the other platforms. >> >> Note that this PR is blocked by [JDK-8346433](https://bugs.openjdk.org/browse/JDK-8346433), [JDK-8346195](https://bugs.openjdk.org/browse/JDK-8346195), [JDK-8346378](https://bugs.openjdk.org/browse/JDK-8346378), [JDK-8346383](https://bugs.openjdk.org/browse/JDK-8346383), [JDK-8346388](https://bugs.openjdk.org/browse/JDK-8346388) and [JDK-8346394](https://bugs.openjdk.org/browse/JDK-8346394), which must be integrated before this one. > > Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision: > > Fix comment Marked as reviewed by erikj (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/22795#pullrequestreview-2517562547 From aivanov at openjdk.org Fri Dec 20 13:58:37 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 13:58:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: <_ZcECw-XMUkUP4jHKV2fBALSAKABYCcQBkN-j_t-344=.11480a9d-34d5-4c3e-9500-c443dc116f8f@github.com> References: <_ZcECw-XMUkUP4jHKV2fBALSAKABYCcQBkN-j_t-344=.11480a9d-34d5-4c3e-9500-c443dc116f8f@github.com> Message-ID: <8h31s_D-xhSxDOclmXt8EIEI9GF9J8eZsPal7w6d8U4=.d07f9365-3de1-4198-8721-4f6a63b39b84@github.com> On Tue, 17 Dec 2024 18:48:43 GMT, Phil Race wrote: >> src/java.desktop/share/classes/java/awt/Robot.java line 225: >> >>> 223: // peer.mouseMove(x, y); >>> 224: peer.mouseMove(Math.min(Math.max(x, screenBounds.x), screenBounds.x + screenBounds.width), >>> 225: Math.min(Math.max(y, screenBounds.y), screenBounds.y + screenBounds.height)); >> >> But that will limit current robot's functionality on the multi-monitor setups. Right now i can move mouse using robot from one screen to another, With your change it seems to be impossible? > > Robot is already created with a screen .. ie GraphicsDevice .. the bounds are from that .. and it is already used elsewhere in Robot > If that can be across physical screens it will still work. > If screens are separate then Robot is constrained to that anyway. > > Can you show a specific case where this is a problem ? I agree with Alex. Currently, it's possible to use a Robot instance to move mouse across all the screens in a multi-monitor environment. According to the specification of [`Robot(GraphicsDevice screen)`](https://docs.oracle.com/en/java/javase/23/docs/api/java.desktop/java/awt/Robot.html#%3Cinit%3E(java.awt.GraphicsDevice)), Coordinates passed to `Robot` method calls like `mouseMove`, `getPixelColor` and `createScreenCapture` will be interpreted as being in the same coordinate system as the specified screen. I understand this statement correctly, it means that if I create a Robot instance with a screen that's not the main one, `Robot.mouse(0, 0)` should move the mouse to `(screenBounds.x, screenBounds.y)`. However, if ?share the same coordinate system to form a combined virtual screen?, `Robot` is expected to move mouse within the bounds of the virtual screen, isn't it? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1893970251 From aivanov at openjdk.org Fri Dec 20 14:02:37 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 14:02:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 00:47:18 GMT, Harshitha Onkar wrote: > For this test you can add a null check before calling .getLocation() for sanity (although multimonitor setup is not the case for CI runs) If `Robot.mouseMove` is expected to limit mouse to the valid (virtual screen) coordinates, `MouseInfo.getPointerInfo()` should never throw `NullPointerException` if mouse is available. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1893973923 From aivanov at openjdk.org Fri Dec 20 14:11:41 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 14:11:41 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 20:46:54 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 one additional commit since the last revision: > > fixed test to fail before fix and pass after fix I wonder if this is even a bug in `Robot`. The description says, 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. That is the OS didn't allow mouse cursor to move beyond the virtual screen bounds but `MouseInfo.getPointerInfo()` still reads the value that's outside of the screen. Is it expected that `MouseInfo.getPointerInfo()` is updated immediately? What does macOS API documentation say about passing mouseMove coordinates outside of the virtual screen? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557087118 From honkar at openjdk.org Fri Dec 20 18:23:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 18:23:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 13:59:40 GMT, Alexey Ivanov wrote: >> test/jdk/java/awt/Robot/MouseMoveOffScreen.java line 44: >> >>> 42: robot.delay(500); >>> 43: >>> 44: Point currLoc = MouseInfo.getPointerInfo().getLocation(); >> >> Not directly related to this change, `MouseInfo.getPointerInfo().getLocation()` throws NPE for a multi-monitor extended display setup on windows for an off-screen location (I haven't checked on other platforms). It returns valid PointerInfo only if the point falls within the bounds of any of the screen device , else it returns null. This may be the expected behavior of MouseInfo.getPointerInfo() but the javadoc is not clear about how off-screen coordinates are handled. >> >> For this test you can add a null check before calling .getLocation() for sanity (although multimonitor setup is not the case for CI runs) > >> For this test you can add a null check before calling .getLocation() for sanity (although multimonitor setup is not the case for CI runs) > > If `Robot.mouseMove` is expected to limit mouse to the valid (virtual screen) coordinates, `MouseInfo.getPointerInfo()` should never throw `NullPointerException` if mouse is available. @aivanov-jdk I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894251274 From prr at openjdk.org Fri Dec 20 18:58:47 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 18:58:47 GMT Subject: RFR: 8346436: Compilation with clang fails In-Reply-To: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> References: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> Message-ID: <1VQ7wu1-jpiXmGg2htmqRRIiad0qWkA-ZL4X8W7aRYE=.0f55c7ba-5d38-4a22-8c82-7938f954f52d@github.com> On Tue, 17 Dec 2024 14:57:42 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, ...) \ > | ^ This fix covers multiple areas. It needs at least 2 reviewers. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22794#issuecomment-2557553099 From prr at openjdk.org Fri Dec 20 19:02:41 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 19:02:41 GMT Subject: RFR: 8346436: Compilation with clang fails In-Reply-To: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> References: <2T1MSOZ5x2Aui8EwMvWvLEXeUGmty5PLl1nuAWSZZ74=.02465712-ad35-48c7-83e9-8e825b92f35a@github.com> Message-ID: On Tue, 17 Dec 2024 14:57:42 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, ...) \ > | ^ 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 ) != 1) { > 696: fprintf(stderr, "Cannot not write to AWT utility control: %s\n", strerror(errno)); what happens to the process if this call fails ? Can it continue ? You can check by commenting out the call and see what happens when you run AWT tests And assuming it is a continuable error, can you do the print only in a DEBUG build ? src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c line 377: > 375: if (write(splash->controlpipe[1], &code, 1) != 1) { > 376: fprintf(stderr, "Cannot not write to splash screen control: %s\n", strerror(errno)); > 377: } what happens to the process if this call fails ? Can it continue ? You can check by commenting out the call and see what happens when you run an app on Linux that uses splashScreen ? SwingSet2 would be sufficient. And assuming it is a continuable error, can you do the print only in a DEBUG build ? src/java.desktop/unix/native/libsplashscreen/splashscreen_sys.c line 716: > 714: SplashLock(splash); > 715: if (pipe(splash->controlpipe)) { > 716: fprintf(stderr, "Error creating pipe for splash screen control: %s\n", strerror(errno)); what happens to the process if this call fails ? Can it continue ? You can check by commenting out the call and see what happens when you run an app on Linux that uses splashScreen ? SwingSet2 would be sufficient. And assuming it is a continuable error, can you do the print only in a DEBUG build ? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22794#discussion_r1894285156 PR Review Comment: https://git.openjdk.org/jdk/pull/22794#discussion_r1894285800 PR Review Comment: https://git.openjdk.org/jdk/pull/22794#discussion_r1894285886 From achung at openjdk.org Fri Dec 20 19:25:35 2024 From: achung at openjdk.org (Alisen Chung) Date: Fri, 20 Dec 2024 19:25:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 18:17:26 GMT, Harshitha Onkar wrote: >>> For this test you can add a null check before calling .getLocation() for sanity (although multimonitor setup is not the case for CI runs) >> >> If `Robot.mouseMove` is expected to limit mouse to the valid (virtual screen) coordinates, `MouseInfo.getPointerInfo()` should never throw `NullPointerException` if mouse is available. > > @aivanov-jdk > I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) > > Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? > > PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894308586 From achung at openjdk.org Fri Dec 20 19:29:35 2024 From: achung at openjdk.org (Alisen Chung) Date: Fri, 20 Dec 2024 19:29:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 14:08:16 GMT, Alexey Ivanov wrote: > I wonder if this is even a bug in `Robot`. I think it makes sense for Robot to clamp mouseMove so that MouseInfo.getPointerInfo() will never return these junk coordinates, but I understand what you mean since the clamping (or updating) could be done in getPointerInfo() instead. Maybe @prrace has an opinion on this? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557601137 From honkar at openjdk.org Fri Dec 20 19:32:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 19:32:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:22:35 GMT, Alisen Chung wrote: >> @aivanov-jdk >> I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) >> >> Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? >> >> PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? > > Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? Yes, I'm running into NPE without as well as with the fix. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894314825 From achung at openjdk.org Fri Dec 20 19:36:20 2024 From: achung at openjdk.org (Alisen Chung) Date: Fri, 20 Dec 2024 19:36:20 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v4] In-Reply-To: References: Message-ID: > 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 one additional commit since the last revision: update test ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22781/files - new: https://git.openjdk.org/jdk/pull/22781/files/678712fb..f9b4d61f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22781&range=02-03 Stats: 7 lines in 1 file changed: 5 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 aivanov at openjdk.org Fri Dec 20 19:36:20 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 19:36:20 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:30:22 GMT, Harshitha Onkar wrote: >> Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? > > Yes, I'm running into NPE without as well as with the fix. Is the current behaviour even a bug? [`Robot.mouseMove`](https://docs.oracle.com/en/java/javase/23/docs/api/java.desktop/java/awt/Robot.html#mouseMove(int,int)) says nothing about invalid coordinates. > @aivanov-jdk I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) It's probably even better? > Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? > > PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? So, the mouse seems to be positioned outside of the virtual screen bounds. For this reason, `MouseInfo.getPointerInfo()` cannot return anything. This again raises the question, why does it return a non-null value on macOS? What do you see on the screen? Does the mouse cursor or its part remain visible on the screen? What happens when you start moving your mouse? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894317758 From aivanov at openjdk.org Fri Dec 20 19:45:35 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 19:45:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:27:14 GMT, Alisen Chung wrote: > > I wonder if this is even a bug in `Robot`. > > I think it makes sense for Robot to clamp mouseMove so that MouseInfo.getPointerInfo() will never return these junk coordinates, but I understand what you mean since the clamping (or updating) could be done in getPointerInfo() instead. I agree, to some extent, that these two things need to align? it makes perfect sense. Yet I worry that this current fix could break more scenarios? while fixing one corner case. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557621378 From prr at openjdk.org Fri Dec 20 19:50:36 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 19:50:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:33:24 GMT, Alexey Ivanov wrote: >> Yes, I'm running into NPE without as well as with the fix. > > Is the current behaviour even a bug? [`Robot.mouseMove`](https://docs.oracle.com/en/java/javase/23/docs/api/java.desktop/java/awt/Robot.html#mouseMove(int,int)) says nothing about invalid coordinates. > >> @aivanov-jdk I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) > > It's probably even better? > >> Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? >> >> PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? > > So, the mouse seems to be positioned outside of the virtual screen bounds. For this reason, `MouseInfo.getPointerInfo()` cannot return anything. > > This again raises the question, why does it return a non-null value on macOS? > > What do you see on the screen? Does the mouse cursor or its part remain visible on the screen? What happens when you start moving your mouse? > Yes, I'm running into NPE without as well as with the fix. Can you provide information on your multi-screen setup ? how many displays ? what is the relative placement of the monitors ? What are the virtual bounds of your setup ? And the stack trace of the exception you get too. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894333618 From aivanov at openjdk.org Fri Dec 20 20:09:37 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 20:09:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:48:24 GMT, Phil Race wrote: >> Is the current behaviour even a bug? [`Robot.mouseMove`](https://docs.oracle.com/en/java/javase/23/docs/api/java.desktop/java/awt/Robot.html#mouseMove(int,int)) says nothing about invalid coordinates. >> >>> @aivanov-jdk I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) >> >> It's probably even better? >> >>> Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? >>> >>> PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? >> >> So, the mouse seems to be positioned outside of the virtual screen bounds. For this reason, `MouseInfo.getPointerInfo()` cannot return anything. >> >> This again raises the question, why does it return a non-null value on macOS? >> >> What do you see on the screen? Does the mouse cursor or its part remain visible on the screen? What happens when you start moving your mouse? > >> Yes, I'm running into NPE without as well as with the fix. > > Can you provide information on your multi-screen setup ? > how many displays ? what is the relative placement of the monitors ? > What are the virtual bounds of your setup ? > > And the stack trace of the exception you get too. For me, the test *without the fix* prints Current mouse location: java.awt.Point[x=0,y=200] The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894348877 From honkar at openjdk.org Fri Dec 20 20:24:37 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 20:24:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:07:10 GMT, Alexey Ivanov wrote: >>> Yes, I'm running into NPE without as well as with the fix. >> >> Can you provide information on your multi-screen setup ? >> how many displays ? what is the relative placement of the monitors ? >> What are the virtual bounds of your setup ? >> >> And the stack trace of the exception you get too. > > For me, the test *without the fix* prints > > Current mouse location: java.awt.Point[x=0,y=200] > > The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. Displays: 2 Placement: Side-by-side, with the bottom edge aligned as below image Screen bounds: 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] Stack Trace: ----------System.err:(11/959)---------- java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null JavaTest Message: shutting down test ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894360205 From prr at openjdk.org Fri Dec 20 20:40:35 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 20:40:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:22:20 GMT, Harshitha Onkar wrote: >> For me, the test *without the fix* prints >> >> Current mouse location: java.awt.Point[x=0,y=200] >> >> The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. > > Displays: 2 > Placement: Side-by-side, with the bottom edge aligned as below > > image > > Screen bounds: > 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] > > Stack Trace: > ----------System.err:(11/959)---------- > java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null > at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) > 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null > JavaTest Message: shutting down test > For me, the test _without the fix_ prints > > ``` > Current mouse location: java.awt.Point[x=0,y=200] > ``` > > The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. What platform ? Alisen did say in the description that Windows & Linux clamp which presumably is either something elsewhere in the JDK implementation, or just how the platform works. I looked (briefly) at Linux and we just pass the values to XWarpPointer so I assumed it was the platform .. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894371103 From honkar at openjdk.org Fri Dec 20 20:46:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 20:46:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:37:58 GMT, Phil Race wrote: >> Displays: 2 >> Placement: Side-by-side, with the bottom edge aligned as below >> >> image >> >> Screen bounds: >> 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] >> >> Stack Trace: >> ----------System.err:(11/959)---------- >> java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null >> at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) >> 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null >> JavaTest Message: shutting down test > >> For me, the test _without the fix_ prints >> >> ``` >> Current mouse location: java.awt.Point[x=0,y=200] >> ``` >> >> The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. > > > What platform ? Alisen did say in the description that Windows & Linux clamp which presumably is either something elsewhere in the JDK implementation, or just how the platform works. I looked (briefly) at Linux and we just pass the values to XWarpPointer so I assumed it was the platform .. In MouseInfo.getPointerInfo() The point is updated here [fillPointWithCoords()](https://github.com/openjdk/jdk/blob/7ba969a576eb92446e40587fecf98e1e4aba8883/src/java.desktop/share/classes/java/awt/MouseInfo.java#L72) . and what follows after for (int i = 0; i < gds.length; i++) { GraphicsConfiguration gc = gds[i].getDefaultConfiguration(); Rectangle bounds = gc.getBounds(); if (bounds.contains(point)) { // checks if the point updated by fillPointWithCoords // is within the bounds of any of the screen device else it returns null retval = new PointerInfo(gds[i], point); } } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894373978 From aivanov at openjdk.org Fri Dec 20 20:46:36 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 20:46:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:42:05 GMT, Harshitha Onkar wrote: >>> For me, the test _without the fix_ prints >>> >>> ``` >>> Current mouse location: java.awt.Point[x=0,y=200] >>> ``` >>> >>> The mouse cursor moves to 200, 200 and then to 0, 200 on the screen. >> >> >> What platform ? Alisen did say in the description that Windows & Linux clamp which presumably is either something elsewhere in the JDK implementation, or just how the platform works. I looked (briefly) at Linux and we just pass the values to XWarpPointer so I assumed it was the platform .. > > In MouseInfo.getPointerInfo() > The point is updated here [fillPointWithCoords()](https://github.com/openjdk/jdk/blob/7ba969a576eb92446e40587fecf98e1e4aba8883/src/java.desktop/share/classes/java/awt/MouseInfo.java#L72) . > > and what follows after > > > for (int i = 0; i < gds.length; i++) { > GraphicsConfiguration gc = gds[i].getDefaultConfiguration(); > Rectangle bounds = gc.getBounds(); > if (bounds.contains(point)) { > // checks if the point updated by fillPointWithCoords > // is within the bounds of any of the screen device else it returns null > retval = new PointerInfo(gds[i], point); > } > } I ran it on Windows, sorry I should've said it explicitly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894374867 From prr at openjdk.org Fri Dec 20 20:53:38 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 20:53:38 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:43:37 GMT, Alexey Ivanov wrote: >> In MouseInfo.getPointerInfo() >> The point is updated here [fillPointWithCoords()](https://github.com/openjdk/jdk/blob/7ba969a576eb92446e40587fecf98e1e4aba8883/src/java.desktop/share/classes/java/awt/MouseInfo.java#L72) . >> >> and what follows after >> >> >> for (int i = 0; i < gds.length; i++) { >> GraphicsConfiguration gc = gds[i].getDefaultConfiguration(); >> Rectangle bounds = gc.getBounds(); >> if (bounds.contains(point)) { >> // checks if the point updated by fillPointWithCoords >> // is within the bounds of any of the screen device else it returns null >> retval = new PointerInfo(gds[i], point); >> } >> } > > I ran it on Windows, sorry I should've said it explicitly. > Displays: 2 Placement: Side-by-side, with the bottom edge aligned as below > > image > Screen bounds: 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] > > Stack Trace: ----------System.err:(11/959)---------- java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null JavaTest Message: shutting down test The stack trace wasn't as revealing as I hoped. But the monitor config may tell us something. (0, 200) is a location that is off the top of screen 1, so not within the virtual bounds. But it is interesting that you get NPE before the fix as well .. perhaps the windows clamping isn't happening as Alisen said. I think we need to understand that as the next step. After that , since it looks to me like the bounds of all screens need to be looked at to clamp because we can't rely on a single rectangle defining it even if there's a single virtual screen, and need to look at the union. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894379782 From aivanov at openjdk.org Fri Dec 20 21:02:35 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 21:02:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 20:51:09 GMT, Phil Race wrote: >> I ran it on Windows, sorry I should've said it explicitly. > >> Displays: 2 Placement: Side-by-side, with the bottom edge aligned as below >> >> image >> Screen bounds: 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] >> >> Stack Trace: ----------System.err:(11/959)---------- java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null JavaTest Message: shutting down test > > The stack trace wasn't as revealing as I hoped. But the monitor config may tell us something. > (0, 200) is a location that is off the top of screen 1, so not within the virtual bounds. > But it is interesting that you get NPE before the fix as well .. perhaps the windows clamping isn't happening as Alisen said. I think we need to understand that as the next step. > > After that , since it looks to me like the bounds of all screens need to be looked at to clamp because we can't rely on a single rectangle defining it even if there's a single virtual screen, and need to look at the union. Now I ran the test on macOS Sequoia 15.1.1. With the current `Robot` implementation, it's able to move mouse across both displays. With Alisen's updated implementation, the coordinates are limited to the main screen.
Updated test private static void moveMouseAndCheck(final Robot robot, final int x, final int y) { System.out.println(x + ", " + y); robot.mouseMove(x, y); robot.delay(1000); PointerInfo cursor = MouseInfo.getPointerInfo(); if (cursor != null) { System.out.println(cursor.getLocation() + " - " + cursor.getDevice().getIDstring()); } } public static void main(String[] args) throws Exception { Robot robot = new Robot(); GraphicsDevice[] screens = getLocalGraphicsEnvironment() .getScreenDevices(); for (GraphicsDevice screen : screens) { GraphicsConfiguration gc = screen.getDefaultConfiguration(); System.out.println(screen.getIDstring()); System.out.println("\t" + gc.getBounds()); System.out.println("\t" + gc.getDefaultTransform()); } System.out.println("\n"); for (GraphicsDevice screen : screens) { System.out.println(screen.getIDstring()); Rectangle bounds = screen.getDefaultConfiguration() .getBounds(); moveMouseAndCheck(robot, bounds.x, bounds.y); moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y); moveMouseAndCheck(robot, bounds.x, bounds.y + bounds.height); moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y + bounds.height); moveMouseAndCheck(robot, bounds.x + bounds.width / 2, bounds.y + bounds.height / 2); }
Displays are arranged side by side: the built-in Display is on the left, the main display is on the right.
JDK 21 without the fix **JDK 21 without the fix** Display 69734208 java.awt.Rectangle[x=-1440,y=0,width=1440,height=900] AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] Display 725353101 java.awt.Rectangle[x=0,y=0,width=1920,height=1080] AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] Display 69734208 -1440, 0 java.awt.Point[x=-1440,y=0] - Display 69734208 0, 0 java.awt.Point[x=0,y=0] - Display 725353101 -1440, 900 cursor == null 0, 900 java.awt.Point[x=0,y=900] - Display 725353101 -720, 450 java.awt.Point[x=-720,y=450] - Display 69734208 Display 725353101 0, 0 java.awt.Point[x=0,y=0] - Display 725353101 1920, 0 cursor == null 0, 1080 cursor == null 1920, 1080 cursor == null 960, 540 java.awt.Point[x=960,y=540] - Display 725353101 Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:90)
With the fix **With the fix** Display 69734208 java.awt.Rectangle[x=-1440,y=0,width=1440,height=900] AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] Display 725353101 java.awt.Rectangle[x=0,y=0,width=1920,height=1080] AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] Display 69734208 -1440, 0 2024-12-20 20:39:09.383 java[94658:1065578] +[IMKClient subclass]: chose IMKClient_Modern 2024-12-20 20:39:09.383 java[94658:1065578] +[IMKInputSession subclass]: chose IMKInputSession_Modern java.awt.Point[x=0,y=0] - Display 725353101 0, 0 java.awt.Point[x=0,y=0] - Display 725353101 -1440, 900 java.awt.Point[x=0,y=900] - Display 725353101 0, 900 java.awt.Point[x=0,y=900] - Display 725353101 -720, 450 java.awt.Point[x=0,y=450] - Display 725353101 Display 725353101 0, 0 java.awt.Point[x=0,y=0] - Display 725353101 1920, 0 cursor == null 0, 1080 cursor == null 1920, 1080 cursor == null 960, 540 java.awt.Point[x=960,y=540] - Display 725353101 Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:90)
In both cases, the points at the right and bottom edges of the screen aren't available, `MouseInfo.getPointerInfo()` returns `null`. I should've subtracted 1 when adding `bounds.width` or `bounds.height`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894385239 From aivanov at openjdk.org Fri Dec 20 21:12:35 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 21:12:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: <5RbUzvyRBH2ZVZckFznYlV2c4P3PDpOqBqgEMprmQ_A=.3642e626-7ffd-459d-8e05-69ddf7e4faf3@github.com> On Fri, 20 Dec 2024 20:59:52 GMT, Alexey Ivanov wrote: >>> Displays: 2 Placement: Side-by-side, with the bottom edge aligned as below >>> >>> image >>> Screen bounds: 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] >>> >>> Stack Trace: ----------System.err:(11/959)---------- java.lang.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null at MouseMoveOffScreen.main(MouseMoveOffScreen.java:57) 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.NullPointerException: Cannot invoke "java.awt.PointerInfo.getLocation()" because the return value of "java.awt.MouseInfo.getPointerInfo()" is null JavaTest Message: shutting down test >> >> The stack trace wasn't as revealing as I hoped. But the monitor config may tell us something. >> (0, 200) is a location that is off the top of screen 1, so not within the virtual bounds. >> But it is interesting that you get NPE before the fix as well .. perhaps the windows clamping isn't happening as Alisen said. I think we need to understand that as the next step. >> >> After that , since it looks to me like the bounds of all screens need to be looked at to clamp because we can't rely on a single rectangle defining it even if there's a single virtual screen, and need to look at the union. > > Now I ran the test on macOS Sequoia 15.1.1. With the current `Robot` implementation, it's able to move mouse across both displays. With Alisen's updated implementation, the coordinates are limited to the main screen. > >
> Updated test > > > private static void moveMouseAndCheck(final Robot robot, > final int x, final int y) { > System.out.println(x + ", " + y); > robot.mouseMove(x, y); > robot.delay(1000); > > PointerInfo cursor = MouseInfo.getPointerInfo(); > if (cursor != null) { > System.out.println(cursor.getLocation() + " - " > + cursor.getDevice().getIDstring()); > } > } > > public static void main(String[] args) throws Exception { > Robot robot = new Robot(); > > GraphicsDevice[] screens = getLocalGraphicsEnvironment() > .getScreenDevices(); > for (GraphicsDevice screen : screens) { > GraphicsConfiguration gc = screen.getDefaultConfiguration(); > System.out.println(screen.getIDstring()); > System.out.println("\t" + gc.getBounds()); > System.out.println("\t" + gc.getDefaultTransform()); > } > System.out.println("\n"); > > for (GraphicsDevice screen : screens) { > System.out.println(screen.getIDstring()); > Rectangle bounds = screen.getDefaultConfiguration() > .getBounds(); > > moveMouseAndCheck(robot, bounds.x, bounds.y); > moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y); > moveMouseAndCheck(robot, bounds.x, bounds.y + bounds.height); > moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y + bounds.height); > moveMouseAndCheck(robot, bounds.x + bounds.width / 2, bounds.y + bounds.height / 2); > } > >
> > Displays are arranged side by side: the built-in Display is on the left, the main display is on the right. > >
> JDK 21 without the fix > > **JDK 21 without the fix** > > Display 69734208 > java.awt.Rectangle[x=-1440,y=0,width=1440,height=900] > AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] > Display 725353101 > java.awt.Rectangle[x=0,y=0,width=1920,height=1080] > AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] > > > Display 69734208 > -1440, 0 > java.awt.Point[x=-1440,y=0] - Display 69734208 > 0, 0 > java.awt.Point[x=0,y=0] - Display 725353101 > -1440, 900 > cursor == null > ... Note that even with Alisen's fix, **the test fails to get the mouse pointer location after moving it off the screen!** The coordinates are expected to be within the screen bounds. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894391146 From aivanov at openjdk.org Fri Dec 20 21:28:39 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 21:28:39 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v4] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:36:20 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 one additional commit since the last revision: > > update test Off topic: Is *?clamp?* the right word for limiting mouse cursor coordinates to the virtual screen bounds? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557733988 From aivanov at openjdk.org Fri Dec 20 21:28:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 21:28:40 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: <5RbUzvyRBH2ZVZckFznYlV2c4P3PDpOqBqgEMprmQ_A=.3642e626-7ffd-459d-8e05-69ddf7e4faf3@github.com> References: <5RbUzvyRBH2ZVZckFznYlV2c4P3PDpOqBqgEMprmQ_A=.3642e626-7ffd-459d-8e05-69ddf7e4faf3@github.com> Message-ID: On Fri, 20 Dec 2024 21:09:28 GMT, Alexey Ivanov wrote: >> Now I ran the test on macOS Sequoia 15.1.1. With the current `Robot` implementation, it's able to move mouse across both displays. With Alisen's updated implementation, the coordinates are limited to the main screen. >> >>
>> Updated test >> >> >> private static void moveMouseAndCheck(final Robot robot, >> final int x, final int y) { >> System.out.println(x + ", " + y); >> robot.mouseMove(x, y); >> robot.delay(1000); >> >> PointerInfo cursor = MouseInfo.getPointerInfo(); >> if (cursor != null) { >> System.out.println(cursor.getLocation() + " - " >> + cursor.getDevice().getIDstring()); >> } >> } >> >> public static void main(String[] args) throws Exception { >> Robot robot = new Robot(); >> >> GraphicsDevice[] screens = getLocalGraphicsEnvironment() >> .getScreenDevices(); >> for (GraphicsDevice screen : screens) { >> GraphicsConfiguration gc = screen.getDefaultConfiguration(); >> System.out.println(screen.getIDstring()); >> System.out.println("\t" + gc.getBounds()); >> System.out.println("\t" + gc.getDefaultTransform()); >> } >> System.out.println("\n"); >> >> for (GraphicsDevice screen : screens) { >> System.out.println(screen.getIDstring()); >> Rectangle bounds = screen.getDefaultConfiguration() >> .getBounds(); >> >> moveMouseAndCheck(robot, bounds.x, bounds.y); >> moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y); >> moveMouseAndCheck(robot, bounds.x, bounds.y + bounds.height); >> moveMouseAndCheck(robot, bounds.x + bounds.width, bounds.y + bounds.height); >> moveMouseAndCheck(robot, bounds.x + bounds.width / 2, bounds.y + bounds.height / 2); >> } >> >>
>> >> Displays are arranged side by side: the built-in Display is on the left, the main display is on the right. >> >>
>> JDK 21 without the fix >> >> **JDK 21 without the fix** >> >> Display 69734208 >> java.awt.Rectangle[x=-1440,y=0,width=1440,height=900] >> AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] >> Display 725353101 >> java.awt.Rectangle[x=0,y=0,width=1920,height=1080] >> AffineTransform[[2.0, 0.0, 0.0], [0.0, 2.0, 0.0]] >> >> >> Display 69734208 >> -1440... > > Note that even with Alisen's fix, **the test fails to get the mouse pointer location after moving it off the screen!** > > The coordinates are expected to be within the screen bounds. > (0, 200) is a location that is off the top of screen 1, so not within the virtual bounds. @prrace Why is it? Harshitha's screen 1 bounds are: [x=0,y=0,width=2293,height=960], so (0, 200) lies within the bounds of the screen. Alisen's test moves mouse to (200, 200) and then to (20_000, 200). I expected to see mouse move to the right edge of the (virtual) screen but mouse pointer is instead at (0, 200) for me. I don't know where mouse pointer is in Harshitha's case. On Windows, I have a second monitor to the right of my main one, and main one has scale of 2.0. Harshitha has her secondary monitor on the left, I presume. Where is the mouse cursor on the screen? By looking at the numbers, I infer Harshitha has a scale on her screens. Scaling down what's received from Windows could trim a pixel on the right, and it could be the reason why the point isn't within the bounds of any screen in her case. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894398669 From prr at openjdk.org Fri Dec 20 21:36:35 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 21:36:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:42:53 GMT, Alexey Ivanov wrote: > > > I wonder if this is even a bug in `Robot`. > > > > > > I think it makes sense for Robot to clamp mouseMove so that MouseInfo.getPointerInfo() will never return these junk coordinates, but I understand what you mean since the clamping (or updating) could be done in getPointerInfo() instead. > > I agree, to some extent, that these two things need to align? it makes perfect sense. > > Yet I worry that this current fix could break more scenarios? while fixing one corner case. It is quite possible that we need to figure out what is going on with PointerInfo and fix something there first .. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557744566 From prr at openjdk.org Fri Dec 20 21:36:36 2024 From: prr at openjdk.org (Phil Race) Date: Fri, 20 Dec 2024 21:36:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v4] In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 19:36:20 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 one additional commit since the last revision: > > update test > Off topic: Is _?clamp?_ the right word for limiting mouse cursor coordinates to the virtual screen bounds? I think so, at least in programming it is used in this way. Did you have another word in mind ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2557745192 From aivanov at openjdk.org Fri Dec 20 21:36:37 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 20 Dec 2024 21:36:37 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: References: Message-ID: <6G8E_J3E1clRwg6WFpVRrLGyJhhWlCMxLpgQ8WW28ZY=.8cc78889-428f-4a89-a710-c1c9e114c0a3@github.com> On Fri, 20 Dec 2024 19:22:35 GMT, Alisen Chung wrote: >> @aivanov-jdk >> I see your point. But I'm running into NPE at `MouseInfo.getPointerInfo().getLocation()` without the fix as well (dual monitor, extended display setup) >> >> Is it expected of MouseInfo.getPointerInfo() to return null for off-screen coordinates (meaning does it consider it as mouse not available if it is outside the screen devices)? >> >> PointerInfo has two things associated with it - screen device and a location, so if it is not able to associate the coordinate with any of the screen device (off-screen coordinate) is it suppose to return null in this case? > > Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? @alisenchung @honkar-jdk @prrace Things align: if the main monitor is on the right, and the secondary monitor is to the left of the main one, `Robot.mouseMove(20_000, 200)`, the following call to `MouseInfo.getPointerInfo()` returns `null`. Both Harshitha and I see `null` in such a configuration both with and without the fix? on Windows and Mac. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894405687 From honkar at openjdk.org Fri Dec 20 22:14:36 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 22:14:36 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: <6G8E_J3E1clRwg6WFpVRrLGyJhhWlCMxLpgQ8WW28ZY=.8cc78889-428f-4a89-a710-c1c9e114c0a3@github.com> References: <6G8E_J3E1clRwg6WFpVRrLGyJhhWlCMxLpgQ8WW28ZY=.8cc78889-428f-4a89-a710-c1c9e114c0a3@github.com> Message-ID: <1f8e2LTeG20I6T9pWOICg9G0O3L3cV_E3BTbObNthsg=.aed7b4dc-594b-4f0f-a2dd-2dce86241eb9@github.com> On Fri, 20 Dec 2024 21:33:20 GMT, Alexey Ivanov wrote: >> Interesting. Does this also happen after the fix with Robot clamping coordinates in shared code? > > @alisenchung @honkar-jdk @prrace Things align: if the main monitor is on the right, and the secondary monitor is to the left of the main one, `Robot.mouseMove(20_000, 200)`, the following call to `MouseInfo.getPointerInfo()` returns `null`. > > Both Harshitha and I see `null` in such a configuration both with and without the fix? on Windows and Mac. @aivanov-jdk > Why is it? Harshitha's screen 1 bounds are: [x=0,y=0,width=2293,height=960], so (0, 200) lies within the bounds of the screen. You are right, I'm able to see the mouse pointer on my [screen=1] and it lies within screen bounds with this configuration. Left screen [screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1280,height=720] **[Primary]** Right side screen [screen=1]:java.awt.Rectangle[x=0,y=0,width=2293,height=960] > I don't know where mouse pointer is in Harshitha's case. > Harshitha has her secondary monitor on the left, I presume. Where is the mouse cursor on the screen? Yes, I have the secondary screen on left and primary on right. And with Robot.mouseMove(200, 200) , the mouse cursor is on the primary screen (right hand-side) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894428352 From honkar at openjdk.org Fri Dec 20 22:32:35 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 20 Dec 2024 22:32:35 GMT Subject: RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v3] In-Reply-To: <1f8e2LTeG20I6T9pWOICg9G0O3L3cV_E3BTbObNthsg=.aed7b4dc-594b-4f0f-a2dd-2dce86241eb9@github.com> References: <6G8E_J3E1clRwg6WFpVRrLGyJhhWlCMxLpgQ8WW28ZY=.8cc78889-428f-4a89-a710-c1c9e114c0a3@github.com> <1f8e2LTeG20I6T9pWOICg9G0O3L3cV_E3BTbObNthsg=.aed7b4dc-594b-4f0f-a2dd-2dce86241eb9@github.com> Message-ID: On Fri, 20 Dec 2024 22:12:25 GMT, Harshitha Onkar wrote: >> @alisenchung @honkar-jdk @prrace Things align: if the main monitor is on the right, and the secondary monitor is to the left of the main one, `Robot.mouseMove(20_000, 200)`, the following call to `MouseInfo.getPointerInfo()` returns `null`. >> >> Both Harshitha and I see `null` in such a configuration both with and without the fix? on Windows and Mac. > > @aivanov-jdk >> Why is it? Harshitha's screen 1 bounds are: [x=0,y=0,width=2293,height=960], so (0, 200) lies within the bounds of the screen. > > You are right, I'm able to see the mouse pointer on my [screen=1] and it lies within screen bounds with this configuration. > > Left screen [screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1280,height=720] > **[Primary]** Right side screen [screen=1]:java.awt.Rectangle[x=0,y=0,width=2293,height=960] > >> I don't know where mouse pointer is in Harshitha's case. >> Harshitha has her secondary monitor on the left, I presume. Where is the mouse cursor on the screen? > > Yes, I have the secondary screen on left and primary on right. And with Robot.mouseMove(200, 200) , the mouse cursor is on the primary screen (right hand-side) > Things align: if the main monitor is on the right, and the secondary monitor is to the left of the main one, Robot.mouseMove(20_000, 200), the following call to MouseInfo.getPointerInfo() returns null. @aivanov-jdk You are right. I tested by switching the primary monitor and the test passed. With Robot.mouseMove(20000, 200) **Left side: Secondary & Right side: Primary screen --> Test fails** Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=-1920,y=363,width=1280,height=720] **[Primary]** Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=0,y=0,width=2293,height=960] **Left side: Primary & Right: Secondary --> Test passes** **[Primary]** Win32GraphicsDevice[screen=0]:java.awt.Rectangle[x=0,y=0,width=1280,height=720] Win32GraphicsDevice[screen=1]:java.awt.Rectangle[x=1920,y=-363,width=2293,height=960] ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1894462619 From jwaters at openjdk.org Mon Dec 23 06:37:41 2024 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 23 Dec 2024 06:37:41 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/... I've put the build.log in the description to make it clearer on why this is being done. I will split it up in a short while ------------- PR Comment: https://git.openjdk.org/jdk/pull/21655#issuecomment-2559005481 From stuefe at openjdk.org Mon Dec 23 08:21:42 2024 From: stuefe at openjdk.org (Thomas Stuefe) Date: Mon, 23 Dec 2024 08:21:42 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:08:47 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/w... > > src/java.desktop/share/native/common/awt/debug/debug_trace.h line 66: > >> 64: /* each file includes this flag indicating module trace status */ >> 65: #ifdef __cplusplus >> 66: [[maybe_unused]] > > I don't really know what to do about this one. The solution is messy, but it's the only one I could come up with. A static global in a header is just begging for an unused-variable error to happen Can we move it to a cpp file and declare it extern here? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1895399636 From qxing at openjdk.org Mon Dec 23 09:50:10 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Mon, 23 Dec 2024 09:50:10 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files Message-ID: This patch fixes unmatched brackets in some source files. ------------- Commit messages: - Fix unmatched brackets in source files. Changes: https://git.openjdk.org/jdk/pull/22861/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22861&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346773 Stats: 2244 lines in 25 files changed: 2211 ins; 2 del; 31 mod Patch: https://git.openjdk.org/jdk/pull/22861.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22861/head:pull/22861 PR: https://git.openjdk.org/jdk/pull/22861 From jwaters at openjdk.org Mon Dec 23 12:27:43 2024 From: jwaters at openjdk.org (Julian Waters) Date: Mon, 23 Dec 2024 12:27:43 GMT Subject: RFR: 8342869: Errors related to unused code on Windows after 8339120 in awt In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 08:18:40 GMT, Thomas Stuefe wrote: >> src/java.desktop/share/native/common/awt/debug/debug_trace.h line 66: >> >>> 64: /* each file includes this flag indicating module trace status */ >>> 65: #ifdef __cplusplus >>> 66: [[maybe_unused]] >> >> I don't really know what to do about this one. The solution is messy, but it's the only one I could come up with. A static global in a header is just begging for an unused-variable error to happen > > Can we move it to a cpp file and declare it extern here? Hi Thomas, I don't think that is possible due to how it's used, from what I can tell from reading the code this global is meant to be unique to each file that the header is included in, as the comment says: > /* each file includes this flag indicating module trace status */ I've been trying to think of alternatives to the current "Global unique to each file defined inside a header" approach currently taken here, but alas I couldn't really think of anything ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21655#discussion_r1895694701 From erikj at openjdk.org Mon Dec 23 14:05:35 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Mon, 23 Dec 2024 14:05:35 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 09:45:00 GMT, Qizheng Xing wrote: > This patch fixes unmatched brackets in some source files. I can really only review the doc files and the Makefile. doc/hotspot-unit-tests.md line 175: > 173: there is no need to have them in error messages. Asserts print only > 174: compared values, they do not print any of interim variables, e.g. > 175: `ASSERT_TRUE(val1 == val2 && isFail(foo(8)) || i == 18)` prints only Looking at this expression, I believe the intention is this. Suggestion: `ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only ------------- PR Review: https://git.openjdk.org/jdk/pull/22861#pullrequestreview-2520648246 PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1895785097 From jlu at openjdk.org Mon Dec 23 17:13:36 2024 From: jlu at openjdk.org (Justin Lu) Date: Mon, 23 Dec 2024 17:13:36 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 09:45:00 GMT, Qizheng Xing wrote: > This patch fixes unmatched brackets in some source files. make/data/cldr/common/main/kn.xml line 1085: > 1083: ????????? ?????????? > 1084: ?????????-?????? ?????????? > 1085: ?????????? ??????????? (???? ???????, ????????) Hi, we would not modify the contents of upstream data from CLDR. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1895964999 From prr at openjdk.org Mon Dec 23 17:22:48 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 23 Dec 2024 17:22:48 GMT Subject: RFR: 8336654: [lworld] Tests depending on sun.awt.AppContext can fail when run with migrated classes Message-ID: <7_hiO6S4AOb-puw71FWgTLyXgCkz96jP0iQx_uQP7Q4=.1f0741e8-10b2-4216-b7cc-543174ea85a0@github.com> The problem is that Boolean will be a value type in the future (Project Valhalla) and so it can't be the referent of a Reference. In this code, the abstract class that creates the Reference accepts a generic type so isn't in control of what it receives. The concrete class that extends the generic class has no idea what the super class implementation does, so has no way to know that it might do something that is invalid for a value type. That's an interesting observation for Valhalla (that the code that does something inappropriate for a value type isn't the source of the value type) but I don't think we need to be concerned about that here because we can see reasons to do this anyway. The specific classes exist because a nominal singleton for the VM may need to be private to an AppContext. This is a concept from applets but also from webstart where we have a single JVM that may be running code from different origins that needs to be partitioned and sand boxed. This concept is obsolete now as applets and webstart are no longer supported, and the Security Manager is disabled, further undermining any way to support partitioning. This specific case of a Boolean created from the value of a Java System Property looks like it never needed this partitioning, so the minimal fix is to stop using RecyclableSingleton for it, and just cache the value of that. The next level of fix is to note that since AppContext is obsolete, there is no need for RecyclableSingleton to use AppContext specific values, making RecyclableSingleton just a lazy initialization mechanism for the singleton. Given that removing the obsolete AppContext is on the TBD list - and some JDK components have already removed per-AppContext code - and we'd probably come back to this in JDK 25 anyway it seems best to get it over with. That does mean that one other place in sun.awt.ImageCache needed to be updated too. Also one test that explicitly checked that AppContexts were used for UI instances is obsolete and removed. Note that RecyclableSingleton also offers some lazy initialisation benefit, and is widely used in Aqua, so going further and removing that probably isn't something we want to do at all, and certainly not here. ------------- Commit messages: - 8336654 Changes: https://git.openjdk.org/jdk/pull/22868/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22868&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8336654 Stats: 146 lines in 4 files changed: 7 ins; 134 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/22868.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22868/head:pull/22868 PR: https://git.openjdk.org/jdk/pull/22868 From kbarrett at openjdk.org Mon Dec 23 19:36:36 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Mon, 23 Dec 2024 19:36:36 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 09:45:00 GMT, Qizheng Xing wrote: > This patch fixes unmatched brackets in some source files. I strongly suggest avoiding omnibus changes like this when possible (which it is here). Just because it's all about one "kind" of change doesn't make it a cohesive change. This is touching many distinct areas of the JDK, and several different languages as well. That makes it harder to review and to manage the review, because it is large and affects a wide range of areas, so may need many reviewers. And the whole thing might get stalled by discussion of one piece. There is also no mention of what testing has been done for this PR. Some of the changes are in executable code, and need to be tested. I think that all of the files in make/data/cldr/common are from the Unicode Consortium, and should not be modified here. doc/hotspot-unit-tests.html line 248: > 246: so there is no need to have them in error messages. Asserts print only > 247: compared values, they do not print any of interim variables, e.g. > 248: ASSERT_TRUE(val1 == val2 && isFail(foo(8)) || i == 18) This file is generated from the .md file, and should not be edited directly. test/hotspot/jtreg/testlibrary/ctw/Makefile line 50: > 48: $(TESTLIBRARY_DIR)/jdk/test/lib/util \ > 49: $(TESTLIBRARY_DIR)/jtreg \ > 50: -maxdepth 1 -name '*.java') I wonder why this hasn't caused problems and been found long ago? Does make just drop that stray close-paren? test/jaxp/javax/xml/jaxp/unittest/transform/Bug8169112.xsl line 65: > 63: @page { margin: 0.1in; } > 64: > 65: } Does this affect the behavior of the test this is part of? test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/oscars.xml line 2: > 1: > 2: 1: > 2: References: Message-ID: On Mon, 23 Dec 2024 19:33:36 GMT, Kim Barrett wrote: > That makes it harder to review and to manage the review, because it is large and affects a wide range of areas, so may need many reviewers. And many of the appropriate reviewers might be unavailable for a while, since it's right before Christmas. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22861#issuecomment-2560215378 From honkar at openjdk.org Mon Dec 23 20:31:13 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 23 Dec 2024 20:31:13 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: References: Message-ID: <5aMCVNPYKVGefspy36ZLeilgpOjgqvNgJubW1SHaavA=.467f452f-560d-4669-84f0-ed4ec26ca1b6@github.com> > Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. > > > long hIcon = getSystemIcon(iconType.getIconID()); //Can return null > Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false > if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null > > > Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. > > getSystemIcon calls LoadIcon (User32.dll). This can return null. > https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: hIcon check added ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22776/files - new: https://git.openjdk.org/jdk/pull/22776/files/8062cc20..2307a4a1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22776&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22776&range=00-01 Stats: 8 lines in 1 file changed: 4 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/22776.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22776/head:pull/22776 PR: https://git.openjdk.org/jdk/pull/22776 From honkar at openjdk.org Mon Dec 23 20:31:13 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 23 Dec 2024 20:31:13 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: References: <05MkkfzbRX2lMEda-gJ4nifEfVvmRFtcSdKV1AV8tWA=.791003ac-8be1-4c74-a558-cddbbf39abd0@github.com> Message-ID: On Tue, 17 Dec 2024 14:16:53 GMT, Alexey Ivanov wrote: >> src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1203: >> >>> 1201: */ >>> 1202: static Image getSystemIcon(SystemIcon iconType) { >>> 1203: long hIcon = getSystemIcon(iconType.getIconID()); >> >> What is hIcon value here? If it is 0 we can simply add the same condition as in the getShell32Icon and avoid all the makeIcon and disposeIcon calls. Or we have a valid hIcon code but makeIcon is unable to construct an icon for it? > > Yes, I think you should add the condition `if (hIcon != 0)` before calling `makeIcon(hIcon)`. Updated ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896099961 From prr at openjdk.org Mon Dec 23 20:33:34 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 23 Dec 2024 20:33:34 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 19:42:34 GMT, Kim Barrett wrote: > > That makes it harder to review and to manage the review, because it is large and affects a wide range of areas, so may need many reviewers. > > And many of the appropriate reviewers might be unavailable for a while, since it's right before Christmas. I think at the very least this needs multiple reviewers. Even 2 isn't enough considering it is so cross-area. It went to 7 different mailing lists, so that should tell you something ! ------------- PR Comment: https://git.openjdk.org/jdk/pull/22861#issuecomment-2560263514 From prr at openjdk.org Mon Dec 23 20:33:36 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 23 Dec 2024 20:33:36 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 19:30:56 GMT, Kim Barrett wrote: >> This patch fixes unmatched brackets in some source files. > > test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/oscars.xml line 2: > >> 1: >> 2: > Does this change affect the behavior of the associated test(s)? I was also wondering how this was tested. > test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/oscars.xml line 2: > >> 1: >> 2: > I can't tell whether anything was changed in this file other than the modification of all the end of > line indicators. I've no idea whether changing those is appropriate or not, but this file came from > a 3rd party, so might not be appropriate to change here. +1 to all of that. This change is un-reviewable. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896100629 PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896100936 From honkar at openjdk.org Mon Dec 23 20:34:48 2024 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 23 Dec 2024 20:34:48 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: References: Message-ID: On Tue, 17 Dec 2024 17:11:05 GMT, Alexey Ivanov wrote: >> Then i would suggest doing both checks in both places. No need to even try to extract icon bits for hIcon == 0 but if we failed to extract icon for the correct handle we should handle it too. > > Yes, I did [suggest it](https://github.com/openjdk/jdk/pull/22776#discussion_r1888597821) too. > > On the other hand, `makeIcon` starts with this condition > > https://github.com/openjdk/jdk/blob/4f44cf6bf2423a57a841be817f348e3b1e88f0eb/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java#L1030-L1031 > > Anyway, not calling `makeIcon` when `hIcon == 0` is clearer. Do I retain or remove ` hIcon != 0L` check here ? Since now `hIcon != 0` is being checked before calling `mmakeIcon()`. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896101949 From prr at openjdk.org Mon Dec 23 22:18:35 2024 From: prr at openjdk.org (Phil Race) Date: Mon, 23 Dec 2024 22:18:35 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files In-Reply-To: References: Message-ID: <_AIqmu61ZK3rRO-44sivWfkuH1ceJm8bQ3MtL2cu8vs=.f4c3bb3b-3697-4ba4-8199-0f1cf9f2f047@github.com> On Mon, 23 Dec 2024 20:29:09 GMT, Phil Race wrote: >> test/jdk/sanity/client/lib/SwingSet3/src/com/sun/swingset3/demos/table/resources/oscars.xml line 2: >> >>> 1: >>> 2: > >> Does this change affect the behavior of the associated test(s)? > > I was also wondering how this was tested. FYI, the way to test this is .. cd test/jdk jtreg sanity/client/SwingSet/src/TableDemoTest.java I tried converting all ^M to \n in this file another repo and comparing with your patch but every line was different so I just can't review this. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896162028 From qxing at openjdk.org Tue Dec 24 03:26:23 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:26:23 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: Message-ID: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> > This patch fixes unmatched brackets in some source files. Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). - Do not touch files in test. - Do not touch upstream data from CLDR. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22861/files - new: https://git.openjdk.org/jdk/pull/22861/files/540312c4..ec3e6aa5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22861&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22861&range=00-01 Stats: 2235 lines in 19 files changed: 2 ins; 2211 del; 22 mod Patch: https://git.openjdk.org/jdk/pull/22861.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22861/head:pull/22861 PR: https://git.openjdk.org/jdk/pull/22861 From qxing at openjdk.org Tue Dec 24 03:26:24 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:26:24 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 18:57:39 GMT, Kim Barrett wrote: >> Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: >> >> - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). >> - Do not touch files in test. >> - Do not touch upstream data from CLDR. > > doc/hotspot-unit-tests.html line 248: > >> 246: so there is no need to have them in error messages. Asserts print only >> 247: compared values, they do not print any of interim variables, e.g. >> 248: ASSERT_TRUE(val1 == val2 && isFail(foo(8)) || i == 18) > > This file is generated from the .md file, and should not be edited directly. Updated both `.md` and `.html` using `make update-build-docs` in the latest commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896332803 From qxing at openjdk.org Tue Dec 24 03:26:24 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:26:24 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: Message-ID: <4QfTqVdt_-vwDpQQAaeiElZLvHDDBabcyBtISbLrmPo=.7aa033a5-d09b-4193-9d2e-1336167a10ce@github.com> On Mon, 23 Dec 2024 14:00:54 GMT, Erik Joelsson wrote: >> Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: >> >> - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). >> - Do not touch files in test. >> - Do not touch upstream data from CLDR. > > doc/hotspot-unit-tests.md line 175: > >> 173: there is no need to have them in error messages. Asserts print only >> 174: compared values, they do not print any of interim variables, e.g. >> 175: `ASSERT_TRUE(val1 == val2 && isFail(foo(8)) || i == 18)` prints only > > Looking at this expression, I believe the intention is this. > Suggestion: > > `ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only Thanks for the suggestion, updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896331528 From qxing at openjdk.org Tue Dec 24 03:26:24 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:26:24 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 17:11:14 GMT, Justin Lu wrote: >> Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: >> >> - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). >> - Do not touch files in test. >> - Do not touch upstream data from CLDR. > > make/data/cldr/common/main/kn.xml line 1085: > >> 1083: ????????? ?????????? >> 1084: ?????????-?????? ?????????? >> 1085: ?????????? ??????????? (???? ???????, ????????) > > Hi, we would not modify the contents of upstream data from CLDR. Sorry, I've reverted these changes in the latest commit. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896331971 From qxing at openjdk.org Tue Dec 24 03:32:36 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:32:36 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: Message-ID: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> On Mon, 23 Dec 2024 19:13:09 GMT, Kim Barrett wrote: >> Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: >> >> - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). >> - Do not touch files in test. >> - Do not touch upstream data from CLDR. > > test/hotspot/jtreg/testlibrary/ctw/Makefile line 50: > >> 48: $(TESTLIBRARY_DIR)/jdk/test/lib/util \ >> 49: $(TESTLIBRARY_DIR)/jtreg \ >> 50: -maxdepth 1 -name '*.java') > > I wonder why this hasn't caused problems and been found long ago? Does make just drop that stray > close-paren? I've tested this by running `make`, and the previous Makefile reports an error like file `test/lib/jtreg/SkippedException.java)` not found. So this fix is necessary. I also checked the git log, this change was introduced in https://github.com/openjdk/jdk/pull/22420, not that long ago. > test/jaxp/javax/xml/jaxp/unittest/transform/Bug8169112.xsl line 65: > >> 63: @page { margin: 0.1in; } >> 64: >> 65: } > > Does this affect the behavior of the test this is part of? Reverted. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896336118 PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896337303 From qxing at openjdk.org Tue Dec 24 03:35:47 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Tue, 24 Dec 2024 03:35:47 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: <_AIqmu61ZK3rRO-44sivWfkuH1ceJm8bQ3MtL2cu8vs=.f4c3bb3b-3697-4ba4-8199-0f1cf9f2f047@github.com> References: <_AIqmu61ZK3rRO-44sivWfkuH1ceJm8bQ3MtL2cu8vs=.f4c3bb3b-3697-4ba4-8199-0f1cf9f2f047@github.com> Message-ID: On Mon, 23 Dec 2024 22:16:01 GMT, Phil Race wrote: >> I was also wondering how this was tested. > > FYI, the way to test this is .. > cd test/jdk > jtreg sanity/client/SwingSet/src/TableDemoTest.java > > I tried converting all ^M to \n in this file another repo and comparing with your patch but every line was different so I just can't review this. For safety reasons I've restored this file as well as all the files in unit tests. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896338401 From aivanov at openjdk.org Tue Dec 24 12:59:39 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 24 Dec 2024 12:59:39 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: <5aMCVNPYKVGefspy36ZLeilgpOjgqvNgJubW1SHaavA=.467f452f-560d-4669-84f0-ed4ec26ca1b6@github.com> References: <5aMCVNPYKVGefspy36ZLeilgpOjgqvNgJubW1SHaavA=.467f452f-560d-4669-84f0-ed4ec26ca1b6@github.com> Message-ID: On Mon, 23 Dec 2024 20:31:13 GMT, Harshitha Onkar wrote: >> Win32ShellFolder2.getSystemIcon() can result in NPE if icon is null. Sanity null checks have been added. >> >> >> long hIcon = getSystemIcon(iconType.getIconID()); //Can return null >> Image icon = makeIcon(hIcon); // returns null if the condition (hIcon != 0L && hIcon != -1L) is false >> if (LARGE_ICON_SIZE != icon.getWidth(null)) { // NullPointerException -- icon is null >> >> >> Occurs when Windows is unable to provide a system icon and the code assumes an icon will **always** be returned, but the Windows API makes no such guarantee. >> >> getSystemIcon calls LoadIcon (User32.dll). This can return null. >> https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > hIcon check added Marked as reviewed by aivanov (Reviewer). src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1205: > 1203: Image icon = null; > 1204: long hIcon = getSystemIcon(iconType.getIconID()); > 1205: if (hIcon != 0) { I suggest inverting the condition: if (hIcon == 0) { return null; } Image icon = makeIcon(hIcon); The code has less indentation and has better readability, in my opinion. ------------- PR Review: https://git.openjdk.org/jdk/pull/22776#pullrequestreview-2521912692 PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896713653 From aivanov at openjdk.org Tue Dec 24 12:59:40 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 24 Dec 2024 12:59:40 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: References: <5aMCVNPYKVGefspy36ZLeilgpOjgqvNgJubW1SHaavA=.467f452f-560d-4669-84f0-ed4ec26ca1b6@github.com> Message-ID: On Tue, 24 Dec 2024 12:29:39 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> hIcon check added > > src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java line 1205: > >> 1203: Image icon = null; >> 1204: long hIcon = getSystemIcon(iconType.getIconID()); >> 1205: if (hIcon != 0) { > > I suggest inverting the condition: > > > if (hIcon == 0) { > return null; > } > > Image icon = makeIcon(hIcon); > > > The code has less indentation and has better readability, in my opinion. Ah, I see the current style that you use follows the code style in `getShell32Icon`. Either go with the current style, or change the condition in `getShell32Icon` so that both methods use the same code flow. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896730654 From aivanov at openjdk.org Tue Dec 24 12:59:41 2024 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 24 Dec 2024 12:59:41 GMT Subject: RFR: JDK-8344907 : NullPointerException in Win32ShellFolder2.getSystemIcon when "icon" is null [v2] In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 20:31:30 GMT, Harshitha Onkar wrote: > Do I retain or remove ` hIcon != 0L` check here ? Since now `hIcon != 0` is being checked before calling `mmakeIcon()`. I'm for keeping it. Not calling a method is faster than calling it and returning immediately because a precondition isn't met. Plus, it makes it clear that we don't even try to create an icon from an invalid icon handle. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22776#discussion_r1896728866 From erikj at openjdk.org Tue Dec 24 14:57:36 2024 From: erikj at openjdk.org (Erik Joelsson) Date: Tue, 24 Dec 2024 14:57:36 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> References: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> Message-ID: On Tue, 24 Dec 2024 03:26:23 GMT, Qizheng Xing wrote: >> This patch fixes unmatched brackets in some source files. > > Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: > > - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). > - Do not touch files in test. > - Do not touch upstream data from CLDR. I've reviewed doc/hotspot-unit-tests.* and the Makefile. ------------- Marked as reviewed by erikj (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22861#pullrequestreview-2522037503 From liach at openjdk.org Tue Dec 24 15:48:38 2024 From: liach at openjdk.org (Chen Liang) Date: Tue, 24 Dec 2024 15:48:38 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> References: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> Message-ID: On Tue, 24 Dec 2024 03:28:31 GMT, Qizheng Xing wrote: >> test/hotspot/jtreg/testlibrary/ctw/Makefile line 50: >> >>> 48: $(TESTLIBRARY_DIR)/jdk/test/lib/util \ >>> 49: $(TESTLIBRARY_DIR)/jtreg \ >>> 50: -maxdepth 1 -name '*.java') >> >> I wonder why this hasn't caused problems and been found long ago? Does make just drop that stray >> close-paren? > > I've tested this by running `make`, and the previous Makefile reports an error like file `test/lib/jtreg/SkippedException.java)` not found. So this fix is necessary. > > I also checked the git log, this change was introduced in https://github.com/openjdk/jdk/pull/22420, not that long ago. Hmm, apparently this is not run as part of tier 1-3, which I ran in my patch. I wonder how this test is run. And it means this patch needs to be backported to 24. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896838026 From liach at openjdk.org Tue Dec 24 15:48:37 2024 From: liach at openjdk.org (Chen Liang) Date: Tue, 24 Dec 2024 15:48:37 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> References: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> Message-ID: On Tue, 24 Dec 2024 03:26:23 GMT, Qizheng Xing wrote: >> This patch fixes unmatched brackets in some source files. > > Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: > > - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). > - Do not touch files in test. > - Do not touch upstream data from CLDR. Thanks for the ctw fix. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22861#pullrequestreview-2522077710 From kizune at openjdk.org Tue Dec 24 19:45:37 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 24 Dec 2024 19:45:37 GMT Subject: RFR: 8339728 : [Accessibility, Windows, JAWS] Bug in the getKeyChar method of the AccessBridge class [v2] In-Reply-To: References: Message-ID: On Thu, 19 Dec 2024 05:28:16 GMT, Abhishek Kumar wrote: >> For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method. >> >> Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed. >> >> AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT. >> >> Manual test case is added to verify the shortcut for JMenuItems. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Copyright year and test update test/jdk/javax/accessibility/TestJMenuItemShortcutAccessibility.java line 37: > 35: * @summary Tests that JAWS announce the shortcuts for JMenuItems. > 36: * @library /java/awt/regtesthelpers > 37: * @build PassFailJFrame Since instructions mention JAWS i would either make this test Windows specific or if you want to test t on mac too i would rephrase the instructions so they are not OS specific. Either way will work for me. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22822#discussion_r1896938323 From prr at openjdk.org Tue Dec 24 19:50:37 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 24 Dec 2024 19:50:37 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout [v3] In-Reply-To: References: Message-ID: <1oqys5goIrKZj-y2k6JqgApfncKx27MlfYkdFG7zIzU=.a41f71da-2caa-430e-8e51-95fa094d3531@github.com> On Fri, 20 Dec 2024 00:17:54 GMT, Daniel Gredler wrote: >> Soft hyphens should never render, regardless of the rendering path used internally. >> >> This PR does not expand the categorization of "complex" characters in `FontUtilities` in order to force the use of `TextLayout` rendering code paths (as was discussed in JBS). >> >> Instead, it takes the existing (limited) format-category checks in `sun.font.CMap` (a TrueType font helper class), expands it to a more general / complete default-ignorable check (`FontUtilities.isDefaultIgnorable(int)`), and then moves these checks out of `CMap` and up a level into the `CharToGlyphMapper` classes themselves. >> >> The Type1 glyph mapper, the TTF glyph mapper, and the macOS glyph mapper have all been updated. > > Daniel Gredler has updated the pull request incrementally with one additional commit since the last revision: > > Add more info about test fonts and default-ignorable chars src/java.desktop/share/classes/sun/font/FontUtilities.java line 366: > 364: case 0x20: return (charCode >= 0x200B && charCode <= 0x200F) || > 365: (charCode >= 0x202A && charCode <= 0x202E) || > 366: (charCode >= 0x2060 && charCode <= 0x206F); I just noticed this really old open bug https://bugs.openjdk.org/browse/JDK-6562489 : Font-Renderer should ignore invisible characters \u2062 and \u2063 ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22670#discussion_r1896940049 From kizune at openjdk.org Tue Dec 24 19:53:36 2024 From: kizune at openjdk.org (Alexander Zuev) Date: Tue, 24 Dec 2024 19:53:36 GMT Subject: RFR: 8339728 : [Accessibility, Windows, JAWS] Bug in the getKeyChar method of the AccessBridge class [v2] In-Reply-To: References: Message-ID: <3uoXnpkV7U20bFvhgINlfbo39HlvrrGeRXdBHxtE83A=.928bdafc-8ae6-47d9-b328-27c98a02edf8@github.com> On Thu, 19 Dec 2024 05:28:16 GMT, Abhishek Kumar wrote: >> For a JMenuItem with a shortcut like _Ctrl + Comma_, the `getKeyChar` method of the `AccessBridge` class cuts the _Comma_ text to the first character and hence transfers `C (instead of Comma)` via the `AccessBridge` API. For a shortcut _Ctrl + Comma_ in a menu item, screen readers announce _Ctrl + C_ instead of _Ctrl + Comma_ as shortcut. Same issue exists for **Enter, Period and other keys** as well where only the first character is returned from the getKeyChar method. >> >> Proposed fix is to ensure that the _char representation of the shortcuts_ is returned by the `getKeyChar` method and it worked fine except for **"Enter"** key. It is unclear to me why it has not announced by AT (JAWS) but I think that may be due to the char representation of the Enter key which is a Line Feed. >> >> AT was also not able to announce the _Tab and Space_ key as a shortcut. Adding these keys in the control key list in _AccessBridge_ and in supported control code list in _AccessBridgePackages_ files enabled them to be announced by AT. >> >> Manual test case is added to verify the shortcut for JMenuItems. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Copyright year and test update src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java line 3975: > 3973: keyCode = keyStroke.getKeyCode(); > 3974: debugString("[INFO]: Shortcut is: " + Integer.toHexString(keyCode)); > 3975: if (keyCode != 0) { Why do we need this check? If keyCode is not zero we return keyCode but if it is zero we will still return keyCode because we return zero after the condition. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22822#discussion_r1896941143 From prr at openjdk.org Tue Dec 24 19:54:36 2024 From: prr at openjdk.org (Phil Race) Date: Tue, 24 Dec 2024 19:54:36 GMT Subject: RFR: 8208377: Soft hyphens render if not using TextLayout In-Reply-To: References: Message-ID: On Fri, 20 Dec 2024 00:49:27 GMT, Daniel Gredler wrote: > I did have one thought that I wanted to run by you guys: it could be argued that FontUtilities.isDefaultIgnorable should be native and should just delegate to HarfBuzz's is_default_ignorable. That's not the approach I decided to take, but let me know if you disagree. ah I guess that's what the hb related comment was about. It wasn't clear. FYI I won't be able to finish reviewing this until January. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22670#issuecomment-2561372190 From kbarrett at openjdk.org Tue Dec 24 20:30:37 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Tue, 24 Dec 2024 20:30:37 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> Message-ID: On Tue, 24 Dec 2024 15:45:24 GMT, Chen Liang wrote: >> I've tested this by running `make`, and the previous Makefile reports an error like file `test/lib/jtreg/SkippedException.java)` not found. So this fix is necessary. >> >> I also checked the git log, this change was introduced in https://github.com/openjdk/jdk/pull/22420, not that long ago. > > Hmm, apparently this is not run as part of tier 1-3, which I ran in my patch. I wonder how this test is run. And it means this patch needs to be backported to 24. Only this small piece would be appropriate for backport to 24. I suggest splitting this out into its own bug, fixing it in isolation, and backporting that. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896952109 From kbarrett at openjdk.org Tue Dec 24 22:25:41 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Tue, 24 Dec 2024 22:25:41 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> Message-ID: On Tue, 24 Dec 2024 20:27:37 GMT, Kim Barrett wrote: >> Hmm, apparently this is not run as part of tier 1-3, which I ran in my patch. I wonder how this test is run. And it means this patch needs to be backported to 24. > > Only this small piece would be appropriate for backport to 24. I suggest splitting this out into its own bug, > fixing it in isolation, and backporting that. The purpose of this Makefile seems to be to build ctw.jar. So far as I can tell, nothing in the JDK uses that jar, or invokes that Makefile. There are some tests for the ctw component in hotspot/jtreg/testlibrary_tests/ctw. I think if you ran tier4 testing that you would hit those. Or you could use `TEST=hotspot:hotspot_misc`, or specify that directory. But those tests don't appear to use that jar. So I think there isn't a test that touches this Makefile. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1896981987 From kbarrett at openjdk.org Tue Dec 24 22:36:47 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Tue, 24 Dec 2024 22:36:47 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> References: <2MNSzuaI99GRQMqD4tbU5VMfHjwfm3KzzTBySopxKJM=.af677925-5588-456c-86c0-7bb262c2cec2@github.com> Message-ID: <5RJCjU8mibDWRUFIu_5QaivS78cZGFT1ECjS4_f2Z8E=.a8ff6fd5-cba0-40f5-b754-9bdb6f7e8d4b@github.com> On Tue, 24 Dec 2024 03:26:23 GMT, Qizheng Xing wrote: >> This patch fixes unmatched brackets in some source files. > > Qizheng Xing has updated the pull request incrementally with three additional commits since the last revision: > > - Update `hotspot-unit-tests.md` and HTML (using Pandoc 2.19.2). > - Do not touch files in test. > - Do not touch upstream data from CLDR. The fix for the ctw Makefile should not be included in this PR. It's a bug, and needs to be fixed separately and backported to 24 to fix the introduction there via the backport of JDK-8334733 from 25 to 24, without dragging the rest of this back to 24. ------------- Changes requested by kbarrett (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22861#pullrequestreview-2522228423 From lmesnik at openjdk.org Wed Dec 25 01:47:37 2024 From: lmesnik at openjdk.org (Leonid Mesnik) Date: Wed, 25 Dec 2024 01:47:37 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v2] In-Reply-To: References: <8pTor9oXFFHRouI1-vrAKdlTzPX9cHlU5s3RbqxBx34=.3b5db6b0-d8ee-4ac9-b29e-d3bbf21740d3@github.com> Message-ID: <7rkkA5WQNof4ipfVB0NnpXU1o_nHsPmW3rulRPp78ZU=.593fc62d-f6ae-4885-b6db-09822cfb45ef@github.com> On Tue, 24 Dec 2024 22:22:28 GMT, Kim Barrett wrote: >> Only this small piece would be appropriate for backport to 24. I suggest splitting this out into its own bug, >> fixing it in isolation, and backporting that. > > The purpose of this Makefile seems to be to build ctw.jar. So far as I can tell, nothing in the JDK uses that jar, > or invokes that Makefile. There are some tests for the ctw component in hotspot/jtreg/testlibrary_tests/ctw. I > think if you ran tier4 testing that you would hit those. Or you could use `TEST=hotspot:hotspot_misc`, or > specify that directory. But those tests don't appear to use that jar. So I think there isn't a test that touches > this Makefile. This makefile is not used by jtreg tests. The ctw code is compiled with `@library /test/lib / /testlibrary/ctw/src` so jtreg compiled the ctw library files itself. This makefile might be used for standalone build if needed. Thanks for fixing this! ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22861#discussion_r1897036236 From qxing at openjdk.org Wed Dec 25 02:34:16 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Wed, 25 Dec 2024 02:34:16 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v3] In-Reply-To: References: Message-ID: > This patch fixes unmatched brackets in some source files. Qizheng Xing has updated the pull request incrementally with one additional commit since the last revision: Revert fix in the CTW Makefile. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/22861/files - new: https://git.openjdk.org/jdk/pull/22861/files/ec3e6aa5..7f85c5e3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=22861&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22861&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/22861.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22861/head:pull/22861 PR: https://git.openjdk.org/jdk/pull/22861 From qxing at openjdk.org Wed Dec 25 02:37:41 2024 From: qxing at openjdk.org (Qizheng Xing) Date: Wed, 25 Dec 2024 02:37:41 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v3] In-Reply-To: References: Message-ID: On Mon, 23 Dec 2024 19:42:34 GMT, Kim Barrett wrote: >> I strongly suggest avoiding omnibus changes like this when possible (which it >> is here). Just because it's all about one "kind" of change doesn't make it a >> cohesive change. This is touching many distinct areas of the JDK, and several >> different languages as well. That makes it harder to review and to manage the >> review, because it is large and affects a wide range of areas, so may need >> many reviewers. And the whole thing might get stalled by discussion of one >> piece. >> >> There is also no mention of what testing has been done for this PR. Some of >> the changes are in executable code, and need to be tested. >> >> I think that all of the files in make/data/cldr/common are from the Unicode >> Consortium, and should not be modified here. > >> That makes it harder to review and to manage the review, because it is large and affects a wide range of areas, so may need many reviewers. > > And many of the appropriate reviewers might be unavailable for a while, since it's right before Christmas. @kimbarrett @liach Thanks for your suggestions! I've moved the fix for the CTW Makefile to a separate pull request: https://github.com/openjdk/jdk/pull/22878, please check it. ------------- PR Comment: https://git.openjdk.org/jdk/pull/22861#issuecomment-2561558033 From kbarrett at openjdk.org Wed Dec 25 04:57:39 2024 From: kbarrett at openjdk.org (Kim Barrett) Date: Wed, 25 Dec 2024 04:57:39 GMT Subject: RFR: 8346773: Fix unmatched brackets in source files [v3] In-Reply-To: References: Message-ID: On Wed, 25 Dec 2024 02:34:16 GMT, Qizheng Xing wrote: >> This patch fixes unmatched brackets in some source files. > > Qizheng Xing has updated the pull request incrementally with one additional commit since the last revision: > > Revert fix in the CTW Makefile. Looks good. ------------- Marked as reviewed by kbarrett (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/22861#pullrequestreview-2522326924 From duke at openjdk.org Fri Dec 27 11:05:30 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Fri, 27 Dec 2024 11:05:30 GMT Subject: RFR: 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS [v5] In-Reply-To: References: Message-ID: > This update allows users to print with grayscale using color printers. > Actually, it is not possible to use the "Monochrome" option from the "Color Appearance" panel. Also Chromaticity.MONOCHROME can't be used to print grayscale on color printers ([JDK-8315113](https://bugs.openjdk.org/browse/JDK-8315113)). > > **Fix description** > When a printer supports color printing and a user adds Chromaticity.MONOCHROME attribute to a PrintRequestAttributeSet, then the final printing raster is transformed to the grayscale color using java.awt.image.ColorConvertOp. When the job is a PostScript job, then the "setColor" and "setPaint" methods of the Graphics are overridden, and user colors (paints) are transformed to the grayscale form using the new proxy class GrayscaleProxyGraphics2D. > > This approach is assumed to be platform, CUPS, and IPP protocol independent. > > **Tests** > The fix was tested on Ubuntu 22.04 and MacOS 12.6.1. GennadiyKrivoshein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits: - Update copyright, fix typos, move the proxy to the macos - Merge branch 'master' into monochrome-printing - proxy mac only - Revert "grammar fixes" This reverts commit 355b2b8f1dbc71cef433e9a925dfb8a7fff56f99. - Revert "formatting" This reverts commit fde514baeadc2775fa502a2a2d312c6038880e7a. - Revert "update copyright" This reverts commit 60e9b4f024544cfac4ddaddc1ea3653bd4a2fe4c. - Revert "move grayscale methods to PSPathGraphics" This reverts commit 1ef135680645ad2647c4430e852095dda8aa7e0c. - Merge remote-tracking branch 'openjdk/master' into monochrome-printing # Conflicts: # src/java.desktop/share/classes/sun/print/RasterPrinterJob.java - Merge remote-tracking branch 'openjdk/master' into monochrome-printing - move grayscale methods to PSPathGraphics - ... and 5 more: https://git.openjdk.org/jdk/compare/6c591854...5486473b ------------- Changes: https://git.openjdk.org/jdk/pull/21930/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21930&range=04 Stats: 585 lines in 4 files changed: 583 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/21930.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21930/head:pull/21930 PR: https://git.openjdk.org/jdk/pull/21930 From duke at openjdk.org Fri Dec 27 11:12:48 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Fri, 27 Dec 2024 11:12:48 GMT Subject: RFR: 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS [v4] In-Reply-To: References: Message-ID: On Wed, 4 Dec 2024 19:19:04 GMT, Phil Race wrote: >> GennadiyKrivoshein has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits: >> >> - Merge remote-tracking branch 'openjdk/master' into monochrome-printing >> >> # Conflicts: >> # src/java.desktop/share/classes/sun/print/RasterPrinterJob.java >> - Merge remote-tracking branch 'openjdk/master' into monochrome-printing >> - move grayscale methods to PSPathGraphics >> - Update src/java.desktop/macosx/classes/sun/lwawt/macosx/CPrinterJob.java >> >> Co-authored-by: Andrey Turbanov >> - update copyright >> - formatting >> - grammar fixes >> - 8315113: Print request Chromaticity.MONOCHROME attribute does not work on macOS > > @prsadhuk please look at this @prrace, thanks, you are absolutely right. I've updated the branch according to your comments. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21930#issuecomment-2563590331 From duke at openjdk.org Fri Dec 27 23:23:47 2024 From: duke at openjdk.org (duke) Date: Fri, 27 Dec 2024 23:23:47 GMT Subject: Withdrawn: 8346036: Unnecessary Hashtable usage in javax.swing.text.html.parser.Entity In-Reply-To: References: Message-ID: On Fri, 1 Nov 2024 14:02:52 GMT, Andrey Turbanov wrote: > The Hashtable `javax.swing.text.html.parser.Entity#entityTypes` is modified only within `` block. > We can replace it with immutable map to avoid Hashtable synchronization overhead. > Similar to what we did in #21825. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/21831 From duke at openjdk.org Sat Dec 28 20:51:40 2024 From: duke at openjdk.org (GennadiyKrivoshein) Date: Sat, 28 Dec 2024 20:51:40 GMT Subject: Integrated: 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 In-Reply-To: References: Message-ID: On Thu, 28 Nov 2024 07:59:45 GMT, GennadiyKrivoshein wrote: > Fix for https://bugs.openjdk.org/browse/JDK-8343224, print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4. > > **Reason of the bug:** > The reason for the regression bug is a missed check for the standard media existence during CustomMediaSizeName creation. > After the JDK-7001133 new MediaSize is created, regardless of whether a standard media size exists. > > For example, if a printer's PPD has two media with the same size, close to "iso_A4," with a small difference. > *PaperDimension A4/A4: "595 842" > *PaperDimension BrA4_B/A4 (Borderless): "595 842" > After processing the first line, the MediaSize will contain the new size "A4" because of the missed check, and CustomMediaSize will match the "iso_a4" standard media size. > After processing the second line, the MediaSize will contain the new size "BrA4_B", and CustomMediaSize will match not the "iso_a4" but the previously added "A4", because it was added by mistake and its size is exactly the same as "BrA4_B". > > **Fix description:** > Create new MediaSize if there is no any other MediaSize with the same size. > > **Tests:** > OS: MacOS 12, Linux Ubuntu 22, Windows 11. > open/test/jdk/java/awt/print/Dialog/PaperSizeError.java > test/jdk/javax/print/CustomMediaSizeNameOOMETest.java > All tests from the test/jdk/javax/print/ This pull request has now been integrated. Changeset: b3e63631 Author: GennadiyKrivoshein <164895822+GennadiyKrivoshein at users.noreply.github.com> URL: https://git.openjdk.org/jdk/commit/b3e63631c735862ba00270636b4ef51c0e48a1af Stats: 21 lines in 2 files changed: 7 ins; 0 del; 14 mod 8343224: print/Dialog/PaperSizeError.java fails with MediaSizeName is not A4: A4 Reviewed-by: azvegint, alexsch, psadhukhan, achung ------------- PR: https://git.openjdk.org/jdk/pull/22429 From serb at openjdk.org Tue Dec 31 01:06:42 2024 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 31 Dec 2024 01:06:42 GMT Subject: RFR: 8336654: [lworld] Tests depending on sun.awt.AppContext can fail when run with migrated classes In-Reply-To: <7_hiO6S4AOb-puw71FWgTLyXgCkz96jP0iQx_uQP7Q4=.1f0741e8-10b2-4216-b7cc-543174ea85a0@github.com> References: <7_hiO6S4AOb-puw71FWgTLyXgCkz96jP0iQx_uQP7Q4=.1f0741e8-10b2-4216-b7cc-543174ea85a0@github.com> Message-ID: On Mon, 23 Dec 2024 17:18:15 GMT, Phil Race wrote: > The problem is that Boolean will be a value type in the future (Project Valhalla) > and so it can't be the referent of a Reference. > > In this code, the abstract class that creates the Reference accepts a generic type so isn't in control of what it receives. > > The concrete class that extends the generic class has no idea what the super class implementation does, > so has no way to know that it might do something that is invalid for a value type. > > That's an interesting observation for Valhalla (that the code that does something inappropriate for a value type > isn't the source of the value type) but I don't think we need to be concerned > about that here because we can see reasons to do this anyway. > > The specific classes exist because a nominal singleton for the VM may need to be private to an AppContext. > This is a concept from applets but also from webstart where we have a single JVM that may be running code > from different origins that needs to be partitioned and sand boxed. > > This concept is obsolete now as applets and webstart are no longer supported, and the Security Manager > is disabled, further undermining any way to support partitioning. > > This specific case of a Boolean created from the value of a Java System Property looks like it never needed > this partitioning, so the minimal fix is to stop using RecyclableSingleton for it, and just cache the value of that. > > The next level of fix is to note that since AppContext is obsolete, there is no need for RecyclableSingleton > to use AppContext specific values, making RecyclableSingleton just a lazy initialization mechanism for the singleton. > > Given that removing the obsolete AppContext is on the TBD list - and some JDK components have already > removed per-AppContext code - and we'd probably come back to this in JDK 25 anyway it seems best > to get it over with. > > That does mean that one other place in sun.awt.ImageCache needed to be updated too. > > Also one test that explicitly checked that AppContexts were used for UI instances is obsolete and removed. > > Note that RecyclableSingleton also offers some lazy initialisation benefit, and is widely used in Aqua, > so going further and removing that probably isn't something we want to do at all, and certainly not here. src/java.desktop/macosx/classes/com/apple/laf/AquaUtils.java line 155: > 153: T instance; > 154: > 155: final T get() { It is used in a few places to cache the fonts/images/etc, so to be a "Recyclable" + "Singleton" it should store/return soft reference, and somehow handle the value types properly. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22868#discussion_r1899868384 From jwaters at openjdk.org Tue Dec 31 06:59:47 2024 From: jwaters at openjdk.org (Julian Waters) Date: Tue, 31 Dec 2024 06:59:47 GMT Subject: RFR: 8306579: Consider building with /Zc:throwingNew [v2] In-Reply-To: References: Message-ID: On Mon, 18 Nov 2024 05:48:57 GMT, Julian Waters wrote: >> [JDK-8305590](https://bugs.openjdk.org/browse/JDK-8305590) removed `-fcheck-new` when building with gcc. It turns out Visual Studio has a similar option, though inverted in behavior and default. >> >> It seems like /Zc:throwingNew- (the default) corresponds to gcc -fcheck-new, and /Zc:throwingNew corresponds to -fno-check-new (the default). >> >> The Visual Studio documentation strongly recommends using /Zc:throwingNew if possible, as turning it off (the default) seriously bloats code and inhibits optimizations. >> https://learn.microsoft.com/en-us/cpp/build/reference/zc-throwingnew-assume-operator-new-throws?view=msvc-170 >> >> As mentioned in [JDK-8305590](https://bugs.openjdk.org/browse/JDK-8305590), the standard says that an allocation function can report allocation failure either by returning null (when it must have a nothrow exception specification), or by throwing `std::bad_alloc` (so obviously must not be declared as non-throwing). HotSpot allocation functions terminate the program instead of throwing on allocation failure, so similarly don't need the result checked for null. >> >> The documentation for /Zc:throwingNew is somewhat vague and confusing, so some investigation is probably needed to verify it really has the desired effect for us. > > Julian Waters 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 patch-15 > - -Zc:throwingNew in flags-cflags.m4 > - 8306579 Keep open please ------------- PR Comment: https://git.openjdk.org/jdk/pull/22039#issuecomment-2566184752 From tanksherman27 at gmail.com Fri Dec 13 08:10:21 2024 From: tanksherman27 at gmail.com (Julian Waters) Date: Fri, 13 Dec 2024 08:10:21 -0000 Subject: Where to submit a bug to A11Y and AWT for people to take a look at? In-Reply-To: <090f55ce-1e31-48c8-8cc3-c289a168fe7c@oracle.com> References: <920afe63-6bdc-4c58-82cb-47de50746c4c@oracle.com> <090f55ce-1e31-48c8-8cc3-c289a168fe7c@oracle.com> Message-ID: I can add the build log that lists all the errors found, if that helps. I think my main concern now is that unlike with HotSpot and the build system, I don't actually know that many people who review AWT and A11Y (Nor how to get the attention of said client maintainers) aside from Phil, who is very busy and doesn't have much time to take a good look at the changesets. If desired, I will move this discussion to client-libs. I will await further instructions in the meantime. Thanks all! best regards, Julian On Thu, Dec 12, 2024 at 1:42?AM Alexey Ivanov wrote: > Hi Phil, > > Both JDK-8342869 and JDK-8342870 [1][2] which correspond to the PRs have > subcomponent set to javax.accessibility, which is correct. > > Do you mean that these bugs need to be assigned to someone from > clientlibs? In Oracle? > > Do you mean Julian needs to submit new bugs and leave them unassigned? > > > What could help is adding a log of the build, an excerpt thereof, which > lists all the errors found. > > Should this problem be discussed on client-libs-dev mailing list instead? > > [1] https://bugs.openjdk.org/browse/JDK-8342869 > [2] https://bugs.openjdk.org/browse/JDK-8342870 > > On 11/12/2024 17:24, Philip Race wrote: > > Yes, there are JBS sub-components for these. > > > > -phil. > > > > > > On 12/11/24 5:25 AM, Julian Waters wrote: > >> Hi all, > >> > >> In review of 2 of my Pull Requests the following recommendations came > >> up: > >> > >>> I think it would be better to withdraw it and submit a bug against > >>> A11Y for people to look at what should really be done about these > >>> cases. > >>> I think it would be better to withdraw it and submit a bug against > >>> AWT for people to look at what should really be done about these cases. > >> I'm not sure where this suggestion is referring to, though. Is it just > >> referring to the JBS under AWT and A11Y subcomponents? Or is there a > >> separate place for AWT and A11Y bugs and issues that I'm not aware of? > >> I'm a little perplexed on where to go to draw attention from the > >> relevant AWT or A11Y Reviewers to see what to do next in any case. > >> Where should I go to have the problem areas in the Pull Requests > >> looked at, as per the instructions given to me? > >> > >> best regards, > >> Julian > >> > >> P.S. The Pull Requests in question are > >> https://github.com/openjdk/jdk/pull/21656#issuecomment-2486392776 and > >> https://github.com/openjdk/jdk/pull/21655#issuecomment-2486391417 > -- > Alexey > -------------- next part -------------- An HTML attachment was scrubbed... URL: