From weijun at openjdk.org Sat Oct 1 15:02:04 2022 From: weijun at openjdk.org (Weijun Wang) Date: Sat, 1 Oct 2022 15:02:04 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4] In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 17:38:54 GMT, Phil Race wrote: >> Why do we need to link to a URL? Why not `../../bridge/AccessBridgeCalls.c`? > > This is correct. > AccessBridge.h is published with the include/header files of the JDK and anyone reading it there can't exactly make use of "../" Thanks @prrace. And yes, git link is better. ------------- PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Sun Oct 2 22:06:20 2022 From: darcy at openjdk.org (Joe Darcy) Date: Sun, 2 Oct 2022 22:06:20 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK In-Reply-To: References: Message-ID: On Thu, 29 Sep 2022 13:11:03 GMT, Raffaello Giulietti wrote: > This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. Marked as reviewed by darcy (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10487 From jdv at openjdk.org Mon Oct 3 06:43:20 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 06:43:20 GMT Subject: RFR: 8278086: [REDO] ImageIO.write() method will throw IndexOutOfBoundsException [v2] In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 20:50:15 GMT, Phil Race wrote: >> Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: >> >> Remove biType variable > > src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java line 1463: > >> 1461: return false; >> 1462: } >> 1463: if (compressionType == BI_RLE4 && bpp != 4) { > > I'm confused. You say you are relaxing the test to allow 15bpp, but I don't see where you're removing > anything that would have rejected 15bpp. > > And how does this prevent the un-specified exception being thrown ? Hi Phil, We never had any bpp check to verify what standard bpp's should be allowed in BMP. Because of this when we tried to decode 2 bpp PNG img and write it to BMP we used to get IOOBE as captured in https://bugs.openjdk.org/browse/JDK-8262297. So under this bug, check was added to allow only standard bpp's for BMP encoding : https://github.com/openjdk/jdk/commit/c73319354399596ab2b9aab0a7f62e8fa0ab9365. But this caused regression of many jtreg tests which were using USHORT_555_RGB to encode BMP image(we round off this 15bpp to 16bpp and at later stage : https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java#L472 and store it in 16bit data buffer). So i relaxed this check which caused jtreg regressions to allow 15bpp also. ------------- PR: https://git.openjdk.org/jdk/pull/10419 From tr at openjdk.org Mon Oct 3 09:06:18 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 09:06:18 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 07:44:31 GMT, Abhishek Kumar wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > The instruction are not quite clear. Can you please modify it as we discussed over call? @kumarabhi006 - Reviewer ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 09:14:12 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 09:14:12 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Fri, 30 Sep 2022 10:57:37 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments @azuev-java Can you please review this PR. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 11:12:36 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 11:12:36 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Fri, 30 Sep 2022 10:57:37 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments You say that the current directory in `JFileChooser` gets set to `null` because of forbidden navigation to a folder which is not traversable. You avoid the NPE by a null-check. However, you should prevent the current directory to be set to `null`. If navigation is not allowed, the current directory should remain unchanged _instead of being reset to `null`_. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java line 1271: > 1269: File curDir = getFileChooser().getCurrentDirectory(); > 1270: > 1271: if (curDir != null && !curDir.equals(f)) { If `f` is always not null, you can you use `!f.equals(curDir)`. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 84: > 82: String path = ""; > 83: if (Platform.isWindows()) { > 84: path = "C:" + File.separator + "temp"; It's rare but possible that Windows is installed not on `C:` drive. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 114: > 112: } else { > 113: return false; > 114: } I can be simplified to: Suggestion: return ((filePath != null) && (filePath.isDirectory()) && filePath.getAbsolutePath().startsWith(basePath)); I'm not insisting though. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 11:31:49 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 11:31:49 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:02:32 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java line 1271: > >> 1269: File curDir = getFileChooser().getCurrentDirectory(); >> 1270: >> 1271: if (curDir != null && !curDir.equals(f)) { > > If `f` is always not null, you can you use `!f.equals(curDir)`. > Prevention of not setting to null means I have to modify `JFileChooser` class itself, so just handling here. And yeah` f `can't be null, can do that. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 114: > >> 112: } else { >> 113: return false; >> 114: } > > I can be simplified to: > Suggestion: > > return ((filePath != null) && (filePath.isDirectory()) > && filePath.getAbsolutePath().startsWith(basePath)); > > I'm not insisting though. Can be done, no issues. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 11:34:46 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 11:34:46 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:06:14 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 84: > >> 82: String path = ""; >> 83: if (Platform.isWindows()) { >> 84: path = "C:" + File.separator + "temp"; > > It's rare but possible that Windows is installed not on `C:` drive. Since temp will be better option without creating any new directory for the test, I didn't change it (it was reused from JBS report). Any other alternative......? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 11:39:36 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 11:39:36 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:28:09 GMT, Tejesh R wrote: >> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java line 1271: >> >>> 1269: File curDir = getFileChooser().getCurrentDirectory(); >>> 1270: >>> 1271: if (curDir != null && !curDir.equals(f)) { >> >> If `f` is always not null, you can you use `!f.equals(curDir)`. > >> > > Prevention of not setting to null means I have to modify `JFileChooser` class itself, so just handling here. And yeah` f `can't be null, can do that. Why is it bad to modify `JFileChooser` class itself? I think setting the current directory to `null` while it displays a directory kind of breaks the invariant. `JFileChooser` navigated to a directory and the current directory is set to it. You tried navigating to another directory, `FileSystem` didn't allow the navigation, so `JFileChooser` continues to display the files in the directory that is showed before. Thus, the current directory hasn't changed. From this point of view, the current directory should remain unchanged. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 11:46:23 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 11:46:23 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:37:07 GMT, Alexey Ivanov wrote: >>> >> >> Prevention of not setting to null means I have to modify `JFileChooser` class itself, so just handling here. And yeah` f `can't be null, can do that. > > Why is it bad to modify `JFileChooser` class itself? > > I think setting the current directory to `null` while it displays a directory kind of breaks the invariant. > > `JFileChooser` navigated to a directory and the current directory is set to it. You tried navigating to another directory, `FileSystem` didn't allow the navigation, so `JFileChooser` continues to display the files in the directory that is showed before. Thus, the current directory hasn't changed. From this point of view, the current directory should remain unchanged. https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L608 Here the above logic checks if the current selected directory is traversable and if not it goes up to parent directory till top level and when every check fails then null is set to `currentDirectory`. Should we think of modifying this logic to not to set to null, rather remain in previously valid folder......? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 11:49:24 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 11:49:24 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:32:17 GMT, Tejesh R wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 84: >> >>> 82: String path = ""; >>> 83: if (Platform.isWindows()) { >>> 84: path = "C:" + File.separator + "temp"; >> >> It's rare but possible that Windows is installed not on `C:` drive. > > Since temp will be better option without creating any new directory for the test, I didn't change it (it was reused from JBS report). Any other alternative......? Why not request the path to the system temporary directory? Temporary directory on Windows is not located in `C:\temp`. Likely this folder does not exist. You should use `TMP` or `TEMP` environment variable. Alternatively, you can use `createTempFile` from from [`java.io.File`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html#createTempFile(java.lang.String,java.lang.String)) or [`java.nio.Files`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Files.html#createTempFile(java.lang.String,java.lang.String,java.nio.file.attribute.FileAttribute...)) to create a file in the temp directory, its parent is the path to the temp directory. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 11:53:24 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 11:53:24 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:47:20 GMT, Alexey Ivanov wrote: >> Since temp will be better option without creating any new directory for the test, I didn't change it (it was reused from JBS report). Any other alternative......? > > Why not request the path to the system temporary directory? > > Temporary directory on Windows is not located in `C:\temp`. Likely this folder does not exist. You should use `TMP` or `TEMP` environment variable. Alternatively, you can use `createTempFile` from from [`java.io.File`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html#createTempFile(java.lang.String,java.lang.String)) or [`java.nio.Files`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Files.html#createTempFile(java.lang.String,java.lang.String,java.nio.file.attribute.FileAttribute...)) to create a file in the temp directory, its parent is the path to the temp directory. User's home could be a better option. It's guaranteed to exist, `user.home` system property points to it. And it's a more real-life scenario. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 12:00:20 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 12:00:20 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:49:41 GMT, Alexey Ivanov wrote: >> Why not request the path to the system temporary directory? >> >> Temporary directory on Windows is not located in `C:\temp`. Likely this folder does not exist. You should use `TMP` or `TEMP` environment variable. Alternatively, you can use `createTempFile` from from [`java.io.File`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/File.html#createTempFile(java.lang.String,java.lang.String)) or [`java.nio.Files`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/file/Files.html#createTempFile(java.lang.String,java.lang.String,java.nio.file.attribute.FileAttribute...)) to create a file in the temp directory, its parent is the path to the temp directory. > > User's home could be a better option. It's guaranteed to exist, `user.home` system property points to it. And it's a more real-life scenario. Then I can just make user.home directory as the only traversable.......? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 12:05:19 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 12:05:19 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:42:36 GMT, Tejesh R wrote: >> Why is it bad to modify `JFileChooser` class itself? >> >> I think setting the current directory to `null` while it displays a directory kind of breaks the invariant. >> >> `JFileChooser` navigated to a directory and the current directory is set to it. You tried navigating to another directory, `FileSystem` didn't allow the navigation, so `JFileChooser` continues to display the files in the directory that is showed before. Thus, the current directory hasn't changed. From this point of view, the current directory should remain unchanged. > > https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L608 > Here the above logic checks if the current selected directory is traversable and if not it goes up to parent directory till top level and when every check fails then null is set to `currentDirectory`. Should we think of modifying this logic to not to set to null, rather remain in previously valid folder......? Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? Then, you can handle the situation here: if `getFileChooser().getCurrentDirectory()` returns `null`, restore the previous current directory. And what about other L&F? If the same code runs in Windows L&F, Nimbus L&F, any other? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 12:05:21 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 12:05:21 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:56:25 GMT, Tejesh R wrote: >> User's home could be a better option. It's guaranteed to exist, `user.home` system property points to it. And it's a more real-life scenario. > > Then I can just make user.home directory as the only traversable.......? Makes sense to me. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 3 12:09:22 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 12:09:22 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 12:00:52 GMT, Alexey Ivanov wrote: >> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L608 >> Here the above logic checks if the current selected directory is traversable and if not it goes up to parent directory till top level and when every check fails then null is set to `currentDirectory`. Should we think of modifying this logic to not to set to null, rather remain in previously valid folder......? > > Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: > https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 > > Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? > > Then, you can handle the situation here: if `getFileChooser().getCurrentDirectory()` returns `null`, restore the previous current directory. > > And what about other L&F? If the same code runs in Windows L&F, Nimbus L&F, any other? In other L&F the same problem exist, but NPE is does not occurs because previous state check is not done, directly the clicked file is been set. https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java#L1328 ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 12:13:24 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 12:13:24 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: <8ObsdiR4UJkawXd_FXCXrKyjwvq6tFneOrF5CkTU8po=.9526541a-44a8-46f7-8f13-147e7d8dad71@github.com> On Mon, 3 Oct 2022 12:07:10 GMT, Tejesh R wrote: >> Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: >> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 >> >> Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? >> >> Then, you can handle the situation here: if `getFileChooser().getCurrentDirectory()` returns `null`, restore the previous current directory. >> >> And what about other L&F? If the same code runs in Windows L&F, Nimbus L&F, any other? > > In other L&F the same problem exist, but NPE is does not occurs because previous state check is not done, directly the clicked file is been set. > https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java#L1328 > Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: > > https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 > > Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? This behaviour is specified. https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L576-L580 Yet it doesn't take into account a custom implementation of `FileSystem` which does not allow navigating up. It may be a problem in `FileSystem` implementation. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 12:17:32 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 12:17:32 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: <8ObsdiR4UJkawXd_FXCXrKyjwvq6tFneOrF5CkTU8po=.9526541a-44a8-46f7-8f13-147e7d8dad71@github.com> References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> <8ObsdiR4UJkawXd_FXCXrKyjwvq6tFneOrF5CkTU8po=.9526541a-44a8-46f7-8f13-147e7d8dad71@github.com> Message-ID: On Mon, 3 Oct 2022 12:09:26 GMT, Alexey Ivanov wrote: >> In other L&F the same problem exist, but NPE is does not occurs because previous state check is not done, directly the clicked file is been set. >> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java#L1328 > >> Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: >> >> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 >> >> Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? > > This behaviour is specified. https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L576-L580 > > Yet it doesn't take into account a custom implementation of `FileSystem` which does not allow navigating up. It may be a problem in `FileSystem` implementation. > In other L&F the same problem exist, but NPE is does not occurs because previous state check is not done, directly the clicked file is been set. > > https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java#L1328 Maybe it's the way to go for Metal too? I mean call `setCurrentDirectory` unconditionally. What do other L&Fs do? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 12:28:46 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 12:28:46 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert In-Reply-To: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: <2bRWmn9tz1W2Hc6L-EQgVmw7UzVz38XMGoo71uA1HEc=.6a744d13-98cd-4a9b-9a43-7bbc09ed7be1@github.com> On Tue, 27 Sep 2022 11:16:36 GMT, Prasanta Sadhukhan wrote: > javax.swing.text.AbstractDocument$BranchElement.replace(...) method throws an `ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative` when using an UndoManager on the default document of a JTextArea and you try to undo the insertion of a LEFT-TO-RIGHT language (e.g. Arabic) that is immediately followed by setting the component orientation on the JTextArea. > > This is because System.arrayCopy() is called with -ve length because of the calculation done in AbstractDocment.replace where `src` is of 2bytes because of unicode text causing `nmove` to become -ve if `nchildren` is 1 (an unicode character is inserted) > > System.arrayCopy throws `IndexOutOfBoundsException if: > > The srcPos argument is negative. > The destPos argument is negative. > The length argument is negative > > > so the fix is made to make nmove, src, dest +ve > Also, Element.getElement() can return null which is not checked, causing NPE, if deletion of text is done which results in no element, which is also fixed in the PR > > All jtreg testsuite tests are run without any regression. src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java line 958: > 956: int index = bidiRoot.getElementIndex(p0); > 957: Element bidiElem = bidiRoot.getElement(index); > 958: if (bidiElem != null && bidiElem.getEndOffset() >= p1) { Is it possible that `bidiElem` is `null`? It should never be. If it is, it is a bug in the code and throwing NPE seems good ? it will be the indication of the bug. Since the NPE has never been thrown from this code, I'd rather leave it unchanged here. src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java line 2325: > 2323: int src = Math.abs(offset + length); > 2324: int nmove = Math.abs(nchildren - src); > 2325: int dest = Math.abs(src + delta); I'm rather unsure why any of these could become negative. Would it be possible that using `Math.abs` corrupts the document or leads to a data loss? The thing is the `UndoableEdit` was produced while the document and the component didn't have `bidi` set to `true`. Inserting a right-to-left text changes that situation, and `bidiRoot` starts to contain elements. I assume changing the component orientation also modifies the contents of `bidiRoot`. As such, performing the undo operation may become impossible because the recorded state in the `UndoableEdit` is inconsistent with the current state of the document. test/jdk/javax/swing/text/AbstractDocument/TestUndoError.java line 39: > 37: import javax.swing.undo.UndoManager; > 38: > 39: public class TestUndoError { `TestUndoInsertArabicText`? It's more specific this way. test/jdk/javax/swing/text/AbstractDocument/TestUndoError.java line 42: > 40: > 41: private static JTextArea textArea_; > 42: private static UndoManager manager_; Is the underscore necessary at the end of the field names? test/jdk/javax/swing/text/AbstractDocument/TestUndoError.java line 51: > 49: textArea_ = new JTextArea(); > 50: manager_ = new UndoManager(); > 51: frame = new JFrame("Undo - Redo Error"); Is `frame` even required? Using `textArea` should be enough. ------------- PR: https://git.openjdk.org/jdk/pull/10446 From jdv at openjdk.org Mon Oct 3 14:09:05 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 14:09:05 GMT Subject: RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion Message-ID: In https://bugs.openjdk.org/browse/JDK-8270915 we have a valid GIF image which was generated using a third party app, but it contains large amount of Metadata(numerous Application extension blocks). Also GIFImageReader doesn't use ignoreMetadata flag set by user while reading Metadata which causes heavy memory usage in this scenario. We need to provide support for ignoring metadata in GIFImageReader, so readMetadata() is updated to use the "ignoreMetadata" flag and ignore all blocks except "Image Descriptor" and "Graphics Control Extension". I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() where we are allocating upfront memory based on parameters from metadata. Also this PR has small refactoring of import statements. To replicate the bug we need byte stream with large amount of valid metadata, so i am not able to add regression test case. ------------- Commit messages: - Fix indentation - Use Staggered read instead of readFully in readMetadata() - Fix extra blocksize logic - Update concatenateBlocks logic - Initial working change Changes: https://git.openjdk.org/jdk/pull/10536/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10536&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8270915 Stats: 88 lines in 1 file changed: 39 ins; 10 del; 39 mod Patch: https://git.openjdk.org/jdk/pull/10536.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10536/head:pull/10536 PR: https://git.openjdk.org/jdk/pull/10536 From tr at openjdk.org Mon Oct 3 14:50:18 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 14:50:18 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> <8ObsdiR4UJkawXd_FXCXrKyjwvq6tFneOrF5CkTU8po=.9526541a-44a8-46f7-8f13-147e7d8dad71@github.com> Message-ID: On Mon, 3 Oct 2022 12:13:23 GMT, Alexey Ivanov wrote: >>> Well, the logic there tries to prevent the current directory from becoming `null`. Yet it traverses up the tree: >>> >>> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L603-L607 >>> >>> Probably, if `dir` becomes `null` in the end, it should resort to its default behaviour: `getFileSystemView().getDefaultDirectory()`. Or not change at all? >> >> This behaviour is specified. https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/share/classes/javax/swing/JFileChooser.java#L576-L580 >> >> Yet it doesn't take into account a custom implementation of `FileSystem` which does not allow navigating up. It may be a problem in `FileSystem` implementation. > >> In other L&F the same problem exist, but NPE is does not occurs because previous state check is not done, directly the clicked file is been set. >> >> https://github.com/openjdk/jdk/blob/ccc1d3169691d066c08e294f5d989b007bfab114/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java#L1328 > > Maybe it's the way to go for Metal too? I mean call `setCurrentDirectory` unconditionally. > > What do other L&Fs do? In other L&F, null gets assigned to `currentDirectory` and NPE doesn't occur since that previous directory check is not done. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 15:00:17 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 15:00:17 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> <8ObsdiR4UJkawXd_FXCXrKyjwvq6tFneOrF5CkTU8po=.9526541a-44a8-46f7-8f13-147e7d8dad71@github.com> Message-ID: <59MrYlRrNbNfDkq5YDrXTxf-S-enC_P0dltSBc0BPUc=.8241456c-6efe-4a63-a589-9bf8a0c507e0@github.com> On Mon, 3 Oct 2022 14:48:04 GMT, Tejesh R wrote: > ? NPE doesn't occur since that previous directory check is not done. Then I suggest going this way and just drop the checks from Metal L&F. The test should set Metal L&F explicitly. Or better yet, it should be run in all L&Fs to ensure NPE isn't thrown.
As for preserving the current value of `currentDirectory` if the passed in folder cannot be navigated to. I think it should be done yet it's a separate issue from this one. Shall I submit a new bug? Does anyone have an opinion on this? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 15:28:16 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 15:28:16 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Fri, 30 Sep 2022 10:57:37 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 40: > 38: * @bug 6616245 > 39: * @key headful > 40: * @requires (os.family == "windows" | os.family == "linux") Is there a specific reason to exclude macOS? Is it only because the default L&F isn't Metal? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 3 15:55:22 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 15:55:22 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert In-Reply-To: References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: On Fri, 30 Sep 2022 20:44:03 GMT, Phil Race wrote: > And test - which appears to be a straight copy of the sample code in the bug report is sufficient to show there's a bug here and that you are fixing it for that one case of ONE unicode code point but I think the test needs to be more comprehensive - inserting and then undoing at the beginning and end of some existing text. I suspect we have no existing test which would uncover a regression being introduced here, so this test needs to be more comprehensive. And with some text being inserted in the middle of existing text in the document. I also wonder if changing component orientation breaks undo/redo with left-to-right text only since RTL component orientation enables bidi support. ------------- PR: https://git.openjdk.org/jdk/pull/10446 From aivanov at openjdk.org Mon Oct 3 16:09:20 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 16:09:20 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails In-Reply-To: References: Message-ID: On Wed, 28 Sep 2022 09:51:08 GMT, Alexey Ivanov wrote: >> To remove an index, I guess we need to first do setSelection where we will already throw IOOBE so I guess that's why this method does not mention or handle it explicitly > >> To remove an index, I guess we need to first do setSelection where we will already throw IOOBE so I guess that's why this method does not mention or handle it explicitly > > It's not required by the implementation. > > > selectionModel.setSelectionInterval(0, 1); > selectionModel.removeIndexInterval(Integer.MIN_VALUE, -1); > > > works ? that is the call to `removeIndexInterval` throws the `IndexOutOfBoundsException` because it tries to copy the bits in the removed interval. If `rmMinIndex` is negative, the implementation may throw IOOBE before doing other work as an optimisation or rely on it being thrown from the code below as it does now. > > Other methods specify the behaviour for negative parameters, this method would benefit from it too. I suggest amending `setSelectionInterval` to throw IOOBE if `Integer.MAX_VALUE` is passed. Then I suggest amending `removeIndexInterval` to throw IOOBE if a negative value is passed or an index is `Integer.MAX_VALUE`. Explicit handling of negative values could be an optimisation made in addition to handling `MAX_VALUE`. In both cases, the spec needs to be updated, and therefore the CSR will be required. ------------- PR: https://git.openjdk.org/jdk/pull/10409 From tr at openjdk.org Mon Oct 3 16:36:23 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 3 Oct 2022 16:36:23 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 15:24:43 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 40: > >> 38: * @bug 6616245 >> 39: * @key headful >> 40: * @requires (os.family == "windows" | os.family == "linux") > > Is there a specific reason to exclude macOS? Is it only because the default L&F isn't Metal? Yeah, was not able to reproduce in macOS. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From jdv at openjdk.org Mon Oct 3 16:42:21 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 16:42:21 GMT Subject: RFR: 8292280: Unused field 'keyListener' in BasicRadioButtonUI [v2] In-Reply-To: References: Message-ID: <_WbjCmOnO-1uxsCJWFWqfmbTXzG33DJc7Uyc7wgP1MA=.5d4e8258-c888-495b-9927-21db218e0002@github.com> On Sun, 21 Aug 2022 21:40:43 GMT, Andrey Turbanov wrote: >> Field `keyListener` was added under [JDK-8033699](https://bugs.openjdk.org/browse/JDK-8033699). But then all its usages were removed in [JDK-8249548](https://bugs.openjdk.org/browse/JDK-8249548) > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8292280: Unused field 'keyListener' in BasicRadioButtonUI > > reverted unrelated changes Verified build with change. LGTM. ------------- Marked as reviewed by jdv (Reviewer). PR: https://git.openjdk.org/jdk/pull/9832 From dnguyen at openjdk.org Mon Oct 3 17:00:22 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 3 Oct 2022 17:00:22 GMT Subject: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v2] In-Reply-To: References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: On Fri, 30 Sep 2022 14:46:35 GMT, Alexander Zvegintsev wrote: >> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: >> >> changed loop end condition to ind-1 > > src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c line 575: > >> 573: cleanup: >> 574: if (success != JNI_TRUE) { >> 575: for (int i = 0; i < ind-1; i++) { > > New `int i` declaration shadows previously declared `i`, I think it can be reused. I tried building without the new int i and it does seem to be fine. Probably worth it to follow the rest of the class's format and reuse the i var for getAllConfigs. ------------- PR: https://git.openjdk.org/jdk/pull/10378 From jdv at openjdk.org Mon Oct 3 17:18:29 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 17:18:29 GMT Subject: RFR: 8292309 : Fix java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java test [v3] In-Reply-To: References: Message-ID: On Tue, 20 Sep 2022 21:38:48 GMT, lawrence.andrews wrote: >> 1) Fixed Parse Exception by removing yesno >> test result: Error. Parse Exception: Arguments to `manual' option not supported: yesno >> 2) Throw jtreg.SkippedException when printer is not configured on the test host >> 3) Replaced Sysout & TestDialog with ManualTestFrame, which allows to the user to better decide test results and to take screen shot if test fails. >> >> @shurymury > > lawrence.andrews has updated the pull request incrementally with one additional commit since the last revision: > > Removed @key printer keyword since this is a manual test Looks like concern related to jtreg.SkippedException and its probably solution captured at : https://github.com/openjdk/jdk/pull/8412#issuecomment-1113522265 Since updated test follows https://openjdk.org/jtreg/faq.html#what-if-a-test-does-not-apply-in-a-given-situation and test is able to run in an environment where printer is configured. And throws SkippedException with appropriate message when printer is not configured, change looks okay to me. But as captured at https://github.com/openjdk/jdk/pull/8412#issuecomment-1113522265, we may need to update PassFailJFrame to handle these manual test case scenarios and show UI message that test is not run because of bad environment. ------------- Marked as reviewed by jdv (Reviewer). PR: https://git.openjdk.org/jdk/pull/9865 From darcy at openjdk.org Mon Oct 3 17:20:53 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 17:20:53 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4] In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 20:25:28 GMT, Joe Darcy wrote: > Also, FWIW, there are 100+ hits in `test` as well. But that is so many it might warrant a separate PR..? Filed a few follow-up bugs: JDK-8294724: Update openjdk.java.net => openjdk.org in tests (umbrella) JDK-8294725: Update openjdk.java.net => openjdk.org in java command man page ------------- PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Mon Oct 3 17:25:30 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 17:25:30 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v6] In-Reply-To: References: Message-ID: <_UYUckHSBcJizYd7JBVbr6evdOrHu9h2MopGUlzrLR8=.b5c6d747-800b-462b-a19a-73a0f5096e3e@github.com> > With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. > > Updates were made using a shell script. I"ll run a copyright updater before any push. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update doc directory files. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10501/files - new: https://git.openjdk.org/jdk/pull/10501/files/fbaf3d4c..6bf7bf61 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=04-05 Stats: 38 lines in 4 files changed: 0 ins; 0 del; 38 mod Patch: https://git.openjdk.org/jdk/pull/10501.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10501/head:pull/10501 PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Mon Oct 3 17:29:45 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 17:29:45 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7] In-Reply-To: References: Message-ID: <-_gZsyDFTlHjj-7UiLaIjMBikGCJU8M2Kz9D7dm-20I=.7eacd8cd-6f3c-4a9d-9bbb-18291146b58e@github.com> > With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. > > Updates were made using a shell script. I"ll run a copyright updater before any push. Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: Update make directory. ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10501/files - new: https://git.openjdk.org/jdk/pull/10501/files/6bf7bf61..224ed7a0 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=05-06 Stats: 6 lines in 4 files changed: 0 ins; 0 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/10501.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10501/head:pull/10501 PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Mon Oct 3 17:38:14 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 17:38:14 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4] In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 17:17:39 GMT, Joe Darcy wrote: > > Also, FWIW, there are 100+ hits in `test` as well. But that is so many it might warrant a separate PR..? > > Filed a few follow-up bugs: > > JDK-8294724: Update openjdk.java.net => openjdk.org in tests (umbrella) JDK-8294725: Update openjdk.java.net => openjdk.org in java command man page And also filed JDK-8294728: Update openjdk.java.net => openjdk.org in hotspot unit test docs ------------- PR: https://git.openjdk.org/jdk/pull/10501 From jdv at openjdk.org Mon Oct 3 18:05:05 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 18:05:05 GMT Subject: RFR: 8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0 In-Reply-To: References: Message-ID: On Tue, 20 Sep 2022 18:24:26 GMT, Alisen Chung wrote: > Fixed test bug where mouse location was being calculated before robot mouseMove operation was complete This test fails for me everytime at Robot.mouseMove test with/without fix at Screen #0(built-in display). I have built-in display as main display and external monitor. It is not moving forward to verify PixelColor with/without fix. I think we dont run these tests in CI and the fix needs to be verified in local machines. ------------- PR: https://git.openjdk.org/jdk/pull/10363 From jdv at openjdk.org Mon Oct 3 18:36:21 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Mon, 3 Oct 2022 18:36:21 GMT Subject: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6] In-Reply-To: References: Message-ID: On Thu, 29 Sep 2022 15:36:32 GMT, Emmanuel Bourg wrote: >> When a list of icons is set on a window, the most appropiate icon is selected depending on the graphics configuration. But if the graphics configuration changes (because the window is moved to a different screen, or because the DPI settings of the screen is changed), the frame icon isn't updated. >> >> Here is an example illustrating the issue: >> >> public static void main(String[] args) throws Exception { >> SwingUtilities.invokeLater(() -> { >> JFrame frame = new JFrame("Window Icon Test"); >> frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); >> frame.setSize(400, 300); >> frame.setVisible(true); >> >> List images = new ArrayList<>(); >> for (int size = 16; size <= 32; size++) { >> // create an image displaying the size used >> BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); >> Graphics2D g = image.createGraphics(); >> g.setFont(new Font("dialog", Font.BOLD, 12)); >> g.setColor(Color.BLACK); >> g.drawString(String.valueOf(size), 0, size - (size - g.getFont().getSize()) / 2); >> images.add(image); >> } >> >> frame.setIconImages(images); >> }); >> } >> >> On Windows if the screen scaling is set to 100% the 16x16 icon is picked from the list. If the scaling of the screen is set to 150% while the application is running, the 16x16 icon is upscaled and looks blurry. >> >> A way to work around this issue is to listen for graphics configuration changes with: >> >> frame.addPropertyChangeListener("graphicsConfiguration", event -> frame.setIconImages(frame.getIconImages())); >> >> >> Ideally this should be done automatically by the JDK. Maybe the `WindowPeer` could call `updateIconImages()` when `updateGraphicsData()` or `displayChanged()` is invoked? > > Emmanuel Bourg has updated the pull request incrementally with two additional commits since the last revision: > > - Run WindowIconUpdateOnDPIChangingTest on Windows only > - Don't refresh the frame icon on graphics configuration changes on Linux (needs more testing with various desktop environments) Current change is specific to Windows. LGTM. ------------- Marked as reviewed by jdv (Reviewer). PR: https://git.openjdk.org/jdk/pull/6180 From duke at openjdk.org Mon Oct 3 18:45:37 2022 From: duke at openjdk.org (Emmanuel Bourg) Date: Mon, 3 Oct 2022 18:45:37 GMT Subject: Integrated: 8276849: Refresh the window icon on graphics configuration changes In-Reply-To: References: Message-ID: <64FEdblJKcNQH2l11EsEZaBdUjCXfZhxqFDV957D7W8=.f428e643-51f6-4577-a3d3-8ae29819921a@github.com> On Sun, 31 Oct 2021 08:21:58 GMT, Emmanuel Bourg wrote: > When a list of icons is set on a window, the most appropiate icon is selected depending on the graphics configuration. But if the graphics configuration changes (because the window is moved to a different screen, or because the DPI settings of the screen is changed), the frame icon isn't updated. > > Here is an example illustrating the issue: > > public static void main(String[] args) throws Exception { > SwingUtilities.invokeLater(() -> { > JFrame frame = new JFrame("Window Icon Test"); > frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); > frame.setSize(400, 300); > frame.setVisible(true); > > List images = new ArrayList<>(); > for (int size = 16; size <= 32; size++) { > // create an image displaying the size used > BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); > Graphics2D g = image.createGraphics(); > g.setFont(new Font("dialog", Font.BOLD, 12)); > g.setColor(Color.BLACK); > g.drawString(String.valueOf(size), 0, size - (size - g.getFont().getSize()) / 2); > images.add(image); > } > > frame.setIconImages(images); > }); > } > > On Windows if the screen scaling is set to 100% the 16x16 icon is picked from the list. If the scaling of the screen is set to 150% while the application is running, the 16x16 icon is upscaled and looks blurry. > > A way to work around this issue is to listen for graphics configuration changes with: > > frame.addPropertyChangeListener("graphicsConfiguration", event -> frame.setIconImages(frame.getIconImages())); > > > Ideally this should be done automatically by the JDK. Maybe the `WindowPeer` could call `updateIconImages()` when `updateGraphicsData()` or `displayChanged()` is invoked? This pull request has now been integrated. Changeset: ed40d88f Author: Emmanuel Bourg Committer: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/ed40d88f29d97347c101793f5aa9747061a36902 Stats: 150 lines in 2 files changed: 150 ins; 0 del; 0 mod 8276849: Refresh the window icon on graphics configuration changes Reviewed-by: prr, jdv ------------- PR: https://git.openjdk.org/jdk/pull/6180 From achung at openjdk.org Mon Oct 3 20:04:32 2022 From: achung at openjdk.org (Alisen Chung) Date: Mon, 3 Oct 2022 20:04:32 GMT Subject: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v3] In-Reply-To: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: > changed return to cleanup in getAllConfigs > changed cleanup to loop thru and free all allocated memory adjacent to graphicsConfig pointer Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: changed loop end condition, removed unnecessary conditional check to free graphicsConfigs ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10378/files - new: https://git.openjdk.org/jdk/pull/10378/files/687c55db..a885893c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10378&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10378&range=01-02 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10378.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10378/head:pull/10378 PR: https://git.openjdk.org/jdk/pull/10378 From prr at openjdk.org Mon Oct 3 20:08:19 2022 From: prr at openjdk.org (Phil Race) Date: Mon, 3 Oct 2022 20:08:19 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7] In-Reply-To: <-_gZsyDFTlHjj-7UiLaIjMBikGCJU8M2Kz9D7dm-20I=.7eacd8cd-6f3c-4a9d-9bbb-18291146b58e@github.com> References: <-_gZsyDFTlHjj-7UiLaIjMBikGCJU8M2Kz9D7dm-20I=.7eacd8cd-6f3c-4a9d-9bbb-18291146b58e@github.com> Message-ID: On Mon, 3 Oct 2022 17:29:45 GMT, Joe Darcy wrote: >> With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. >> >> Updates were made using a shell script. I"ll run a copyright updater before any push. > > Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: > > Update make directory. src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.h line 36: > 34: * https://git.openjdk.org/jdk/blob/master/src/jdk.accessibility/windows/native/bridge/AccessBridgeCalls.c > 35: * > 36: * Also note that the API is used in the jaccessinspector and jaccesswalker tools. The problem with this is, is that anyone who gets JDK 20 (or 21 the LTS) will be forever more then pointed at the OpenJDK "tip" and if we made an incompatible ABI change, that would be a problem. At this point I'd prefer that this be updated to point to JDK 17, as in https://github.com/openjdk/jdk17/blob/master/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp So it is a defined, known, compatible version. ------------- PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Mon Oct 3 20:37:11 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 20:37:11 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v8] In-Reply-To: References: Message-ID: > With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. > > Updates were made using a shell script. I"ll run a copyright updater before any push. Joe Darcy 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: - Update accessibility URLs. - Merge branch 'master' into JDK-8294618 - Update make directory. - Update doc directory files. - Update hg URLs to git. - Merge branch 'master' into JDK-8294618 - http -> https - Undo manpage update. - Update copyright. - Revert unintended update to binary file. - ... and 1 more: https://git.openjdk.org/jdk/compare/7a8d31f3...4055f1a6 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10501/files - new: https://git.openjdk.org/jdk/pull/10501/files/224ed7a0..4055f1a6 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=06-07 Stats: 5510 lines in 75 files changed: 3554 ins; 1669 del; 287 mod Patch: https://git.openjdk.org/jdk/pull/10501.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10501/head:pull/10501 PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Mon Oct 3 20:37:14 2022 From: darcy at openjdk.org (Joe Darcy) Date: Mon, 3 Oct 2022 20:37:14 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7] In-Reply-To: References: <-_gZsyDFTlHjj-7UiLaIjMBikGCJU8M2Kz9D7dm-20I=.7eacd8cd-6f3c-4a9d-9bbb-18291146b58e@github.com> Message-ID: On Mon, 3 Oct 2022 20:04:38 GMT, Phil Race wrote: >> Joe Darcy has updated the pull request incrementally with one additional commit since the last revision: >> >> Update make directory. > > src/jdk.accessibility/windows/native/include/bridge/AccessBridgeCalls.h line 36: > >> 34: * https://git.openjdk.org/jdk/blob/master/src/jdk.accessibility/windows/native/bridge/AccessBridgeCalls.c >> 35: * >> 36: * Also note that the API is used in the jaccessinspector and jaccesswalker tools. > > The problem with this is, is that anyone who gets JDK 20 (or 21 the LTS) will be forever more then pointed at the OpenJDK "tip" and if we made an incompatible ABI change, that would be a problem. > At this point I'd prefer that this be updated to point to JDK 17, as in > https://github.com/openjdk/jdk17/blob/master/src/jdk.accessibility/windows/native/jaccesswalker/jaccesswalker.cpp > So it is a defined, known, compatible version. Updated to refer to JDK 17 specifically. ------------- PR: https://git.openjdk.org/jdk/pull/10501 From prr at openjdk.org Mon Oct 3 20:42:11 2022 From: prr at openjdk.org (Phil Race) Date: Mon, 3 Oct 2022 20:42:11 GMT Subject: RFR: 8294426: Two fingers tap generates wrong mouse modifiers on M2 MacBooks In-Reply-To: References: Message-ID: On Mon, 26 Sep 2022 17:36:04 GMT, Nikita Provotorov wrote: > Hi there! > JetBrains has faced with a bug on Apple M2 MacBooks when tapping (_not_ pressing) with two fingers on a trackpad generates wrong mouse modifiers (which are returned by [MouseEvent.getModifiersEx](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/event/InputEvent.html#getModifiersEx())). > > As far as I see, OpenJDK bug tracker still doesn't contain such a bug and I don't have rights to create a new one, so the PR doesn't refer any id UPD: fixed. Here is the bug link from the JetBrains own tracker: [JBR-4765](https://youtrack.jetbrains.com/issue/JBR-4765/Cannot-invoke-context-menu-by-two-fingers-tapping-on-MacBook-with-M2-chip). > > The bug is 100% reproducible on M2 MacBooks (at least under macOS 12.5). It's also reproducible on M1 MacBooks, but much more rarely (about 10-15% of reproducibility). > > ## Steps to reproduce > 1. Enable `System Preferences` -> `Trackpad` -> `Tap to click` > 2. Tap with two fingers in the following app: > > import javax.swing.*; > import java.awt.event.MouseAdapter; > import java.awt.event.MouseEvent; > > class MouseWindow { > final JFrame frame; > > MouseWindow() { > frame = new JFrame(); > frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); > > frame.setTitle("Mouse window"); > > frame.addMouseListener(new MouseAdapter() { > @Override > public void mousePressed(MouseEvent e) { > System.out.println(e); > } > }); > > frame.pack(); > > frame.setSize(300, 300); > > frame.setVisible(true); > } > > public static void main(String[] args) { > SwingUtilities.invokeLater(MouseWindow::new); > } > } > > > ### Expected > Printed mouse event has `modifiersEx` is `4096` (which is `InputEvent.BUTTON3_DOWN_MASK`) > > ### Actual > Printed mouse event has `modifiersEx` is `4352` (which is `InputEvent.BUTTON3_DOWN_MASK | InputEvent.META_DOWN_MASK`) > > ## Evaluation > The following happens when a native mouse event reaches Java: > 1. `NSEvent.nsToJavaModifiers(0)` called inside [CPlatformResponder.handleMouseEvent():81](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformResponder.java#L81) returns `0`. Earlier it always returned `4096` (`InputEvent.BUTTON3_DOWN_MASK`) but not in the cases of M2 tapping. For a trackpad press (not a tap) it still returns `4096`; > 2. So, the `0` modifier comes into MouseEvent constructor which then [goes into MouseEvent.setOldModifiers()](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/event/MouseEvent.java#L800) which [initializes the field MouseEvent.modifiers to the value 4](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/event/MouseEvent.java#L1159) (it's `InputEvent.BUTTON3_MASK`); > 3. Next, this constructed `MouseEvent` object is pushed into EDT queue. > 4. Next, when a EDT thread pulls the event from the queue and starts to process it, it goes into `java.awt.LightweightDispatcher.retargetMouseEvent` and [creates a new MouseEvent based on the pulled one](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/Container.java#L4920) with the new value of the modifiers == `getModifiersEx() | getModifiers()`. From the p.2 we know, that `MouseEvent.modifiers` of the pulled event is `4`, so `getModifiersEx() | getModifiers()` is evaluated to `4`. > 5. Next, the constructor of the new MouseEvent [goes into setNewModifiers()](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/event/MouseEvent.java#L795) (instead of `setOldModifiers` as in p.2) and initializes its own field modifiers to the value `4356` (`InputEvent.BUTTON3_MASK | InputEvent.BUTTON3_DOWN_MASK | InputEvent.META_DOWN_MASK`, see [setNewModifiers():1099](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/event/MouseEvent.java#L1099), [setNewModifiers():1129](https://github.com/openjdk/jdk/blob/5ae6bc23e857535532b59aae674e2b917bbf7284/src/java.desktop/share/classes/java/awt/event/MouseEvent.java#L1129)). > 6. Thus, an app receives the instance of MouseEvent with `getModifiers()` == `4` and `getModifiersEx()` == `4352` so it thinks there is a `Command` keystroke. > > ## Fixing > Let's set manually inside `CPlatformResponder.handleMouseEvent` a mouse modifier which corresponds to the pressed button. > > ## What about a regression test > I've failed to write a regression test using Robot because it somehow forces the correct mouse modifiers (`NSEvent.nsToJavaModifiers()` correctly returns `InputEvent.BUTTON3_DOWN_MASK`), so I wrote a test that directly invokes `CPlatformResponder.handleMouseEvent` via reflection. Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10429 From prr at openjdk.org Mon Oct 3 20:42:12 2022 From: prr at openjdk.org (Phil Race) Date: Mon, 3 Oct 2022 20:42:12 GMT Subject: RFR: 8294426: Two fingers tap generates wrong mouse modifiers on M2 MacBooks In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 22:26:44 GMT, Nikita Provotorov wrote: >> Actually I mean that it returns 0 if you're tapping without holding any modifiers e.g. keyboard modifiers. >> But if you're tapping holding a keyboard modifier it will probably return only this keyboard modifier without `InputEvent.BUTTON3_DOWN_MASK`. I didn't test this case but I would expect it that looking at the implementation of the `NSEvent.nsToJavaModifiers`. > > I don't have an M2 device to check, but I think (judging to the code) if we add `jmodifiers == 0` check here then users making a tap holding the Control will receive the mouse events with `modifiers` == `CTRL_DOWN_MASK | BUTTON3_MASK | CTRL_MASK`, i.e. without modern `BUTTON3_DOWN_MASK` which is at least unusual and inconvenient. OK .. well I've at least run all our automated tests and no regressions were found, so I'll approve this. ------------- PR: https://git.openjdk.org/jdk/pull/10429 From achung at openjdk.org Mon Oct 3 20:56:48 2022 From: achung at openjdk.org (Alisen Chung) Date: Mon, 3 Oct 2022 20:56:48 GMT Subject: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v4] In-Reply-To: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: > changed return to cleanup in getAllConfigs > changed cleanup to loop thru and free all allocated memory adjacent to graphicsConfig pointer Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: reused i variable for loop ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10378/files - new: https://git.openjdk.org/jdk/pull/10378/files/a885893c..f49c0342 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10378&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10378&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10378.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10378/head:pull/10378 PR: https://git.openjdk.org/jdk/pull/10378 From dnguyen at openjdk.org Mon Oct 3 20:56:48 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 3 Oct 2022 20:56:48 GMT Subject: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v4] In-Reply-To: References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: On Mon, 3 Oct 2022 20:52:18 GMT, Alisen Chung wrote: >> changed return to cleanup in getAllConfigs >> changed cleanup to loop thru and free all allocated memory adjacent to graphicsConfig pointer > > Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: > > reused i variable for loop Marked as reviewed by dnguyen (Author). ------------- PR: https://git.openjdk.org/jdk/pull/10378 From duke at openjdk.org Mon Oct 3 21:33:05 2022 From: duke at openjdk.org (Emmanuel Bourg) Date: Mon, 3 Oct 2022 21:33:05 GMT Subject: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6] In-Reply-To: References: Message-ID: On Thu, 29 Sep 2022 15:36:32 GMT, Emmanuel Bourg wrote: >> When a list of icons is set on a window, the most appropiate icon is selected depending on the graphics configuration. But if the graphics configuration changes (because the window is moved to a different screen, or because the DPI settings of the screen is changed), the frame icon isn't updated. >> >> Here is an example illustrating the issue: >> >> public static void main(String[] args) throws Exception { >> SwingUtilities.invokeLater(() -> { >> JFrame frame = new JFrame("Window Icon Test"); >> frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); >> frame.setSize(400, 300); >> frame.setVisible(true); >> >> List images = new ArrayList<>(); >> for (int size = 16; size <= 32; size++) { >> // create an image displaying the size used >> BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); >> Graphics2D g = image.createGraphics(); >> g.setFont(new Font("dialog", Font.BOLD, 12)); >> g.setColor(Color.BLACK); >> g.drawString(String.valueOf(size), 0, size - (size - g.getFont().getSize()) / 2); >> images.add(image); >> } >> >> frame.setIconImages(images); >> }); >> } >> >> On Windows if the screen scaling is set to 100% the 16x16 icon is picked from the list. If the scaling of the screen is set to 150% while the application is running, the 16x16 icon is upscaled and looks blurry. >> >> A way to work around this issue is to listen for graphics configuration changes with: >> >> frame.addPropertyChangeListener("graphicsConfiguration", event -> frame.setIconImages(frame.getIconImages())); >> >> >> Ideally this should be done automatically by the JDK. Maybe the `WindowPeer` could call `updateIconImages()` when `updateGraphicsData()` or `displayChanged()` is invoked? > > Emmanuel Bourg has updated the pull request incrementally with two additional commits since the last revision: > > - Run WindowIconUpdateOnDPIChangingTest on Windows only > - Don't refresh the frame icon on graphics configuration changes on Linux (needs more testing with various desktop environments) Thanks ! ------------- PR: https://git.openjdk.org/jdk/pull/6180 From aivanov at openjdk.org Mon Oct 3 21:56:54 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 21:56:54 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: On Fri, 30 Sep 2022 00:19:46 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant jtreg header src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 32: > 30: > 31: import javax.swing.AbstractButton; > 32: import javax.swing.ButtonModel; I'm unsure if we all agree on the order of imports in client area, however, the common order is import java.*; // optional blank line import javax.*; // blank line import sun.*; // other packages // blank line import static *; // if applicable src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 313: > 311: > 312: // border and corner scaling > 313: int scaledCorner = (int) Math.round(corner * at.getScaleX()); Just a suggestion, you can call this variable `corner` but make the constant above upper case `CORNER`. This way the old code would remain basically the same and continue using `corner` (which was previously a field). src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 326: > 324: g.drawLine( 0, 1, 0, height-1); > 325: g.drawLine( width-1, 1, width-1, height-1); > 326: g.drawLine( 1, height-1, width-1, height-1); I suggest removing the space after the opening parenthesis. There's usually a space on either side of binary operators, the `-` in this case. I believe this is existing code which was just moved around, so maybe its style is not worth touching. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 343: > 341: width-midPoint, height- scaledCorner); //right > 342: g.drawLine(scaledCorner + 1, height-midPoint, > 343: width- scaledCorner, height-midPoint); //bottom This looks a bit weird to me. The old code used no spaces around the binary operators, the new code is inconsistent: some cases do, some don't, some have space only after the operator. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 74: > 72: private static final int FRAME_SIZE = 300; > 73: private static final int INTFRAME_SIZE = 200; > 74: private static final int MIDPOINT = INTFRAME_SIZE/2; Suggestion: private static final int MIDPOINT = INTFRAME_SIZE / 2; test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 112: > 110: > 111: // Check Borders > 112: SwingUtilities.invokeAndWait(() -> { None of the `check*` are required to be run on EDT. They use `robot` to read pixels from the screen, it can be done on the main thread. It's probably to call `jFrame.getBounds()`. However, you can pre-save the bounds of the frame in the block above. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 139: > 137: > 138: private static void checkBorderMidPoints(String borderDirection) { > 139: int x = 0, y = 0, start = 0, stop = 0; The initialisers are redundant. It's not recommended to have several local variable declarations on one line. When using two lines int x, y; int start, stop; the coordinates and loop control variables are on separate lines, easier to parse. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 180: > 178: isHorizontal ? i : (iFrameLoc.y + MIDPOINT)))) { > 179: saveScreenCapture(borderDirection + "_" + uiScale + ".png"); > 180: errorLog.append("uiScale: "+ uiScale + The body of `if` shouldn't be indented compared to the indentation of the condition, it should start at the regular four-column indent. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 181: > 179: saveScreenCapture(borderDirection + "_" + uiScale + ".png"); > 180: errorLog.append("uiScale: "+ uiScale + > 181: " Red background color" + " detected at " Another nit: Suggestion: errorLog.append("uiScale: " + uiScale + " Red background color detected at " test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 189: > 187: > 188: private static void checkCorners(String cornerLocation) { > 189: int x, y = 0; Suggestion: int x, y; Initialising `y` _only_ is redundant. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 211: > 209: + cornerLocation); > 210: } > 211: robot.mouseMove(x, y); Moving the mouse cursor is not required. However, it gives a visual feedback of where the check is happening. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 240: > 238: } > 239: // for debugging purpose, saves screen capture when test fails. > 240: private static void saveScreenCapture(String filename) { The comment is probably redundant. Yet a blank line between methods is recommended. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 241: > 239: // for debugging purpose, saves screen capture when test fails. > 240: private static void saveScreenCapture(String filename) { > 241: BufferedImage image = robot.createScreenCapture(jFrame.getBounds()); I guess we lose pixel details here. If uiScale > 1, `createScreenCapture` scales down the captured image. Do we want to preserve the original image too? [`Robot.createMultiResolutionScreenCapture`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Robot.html#createMultiResolutionScreenCapture(java.awt.Rectangle)) can be useful. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 243: > 241: BufferedImage image = robot.createScreenCapture(jFrame.getBounds()); > 242: try { > 243: ImageIO.write(image,"png", new File(filename)); Suggestion: ImageIO.write(image, "png", new File(filename)); ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Mon Oct 3 22:01:06 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 22:01:06 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> On Fri, 30 Sep 2022 00:19:46 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant jtreg header Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Mon Oct 3 22:05:10 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 3 Oct 2022 22:05:10 GMT Subject: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6] In-Reply-To: References: Message-ID: <0xRKnWuskSRDDowHBIwMTiWdq8-eTmM-OeABP2lNGaE=.e10f8f97-00e9-43c8-b22d-7d2ea3b2ec41@github.com> On Mon, 3 Oct 2022 21:31:04 GMT, Emmanuel Bourg wrote: >> Emmanuel Bourg has updated the pull request incrementally with two additional commits since the last revision: >> >> - Run WindowIconUpdateOnDPIChangingTest on Windows only >> - Don't refresh the frame icon on graphics configuration changes on Linux (needs more testing with various desktop environments) > > Thanks ! Thank you, @ebourg, for your contribution. It looks good to me too. I didn't have time to look at your latest update though before you integrated it. Anyway. ------------- PR: https://git.openjdk.org/jdk/pull/6180 From achung at openjdk.org Mon Oct 3 22:07:13 2022 From: achung at openjdk.org (Alisen Chung) Date: Mon, 3 Oct 2022 22:07:13 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: On Fri, 30 Sep 2022 00:19:46 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > removed redundant jtreg header Changes requested by achung (Author). src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 255: > 253: * @return a {@code int} which is the rounded value of provided number > 254: */ > 255: private static int roundDown(double d) The name of this method is a bit misleading, the operation doesn't actually round down, but rounds the number normally except for the x.5 case right? Does this operation exist somewhere else? src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 329: > 327: > 328: // Draw the bulk of the border > 329: for (int i = 1; i <= loopCount; i++) { Should we redo the drawing of this border to use Graphics2D fillRect instead? src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 336: > 334: // Draw the Long highlight lines > 335: g.setColor(highlight); > 336: g.drawLine(scaledCorner + 1, midPoint+stkWidth, The spacing here and when drawing shadow lines is a bit inconsistent ------------- PR: https://git.openjdk.org/jdk/pull/10274 From serb at openjdk.org Mon Oct 3 22:09:17 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 3 Oct 2022 22:09:17 GMT Subject: RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 13:59:25 GMT, Jayathirth D V wrote: > I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() where we are allocating upfront memory based on parameters from metadata. Probably it is possible to create a small test just for this change? ------------- PR: https://git.openjdk.org/jdk/pull/10536 From honkar at openjdk.org Mon Oct 3 22:20:09 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 3 Oct 2022 22:20:09 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Mon, 3 Oct 2022 21:57:17 GMT, Alexey Ivanov wrote: > Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? @aivanov-jdk Thank you for reviewing. I wanted to clarify whether you meant saving just the JInternalFrame into BufferedImage? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Mon Oct 3 22:46:54 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 3 Oct 2022 22:46:54 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> On Mon, 3 Oct 2022 22:02:34 GMT, Alisen Chung wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant jtreg header > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 329: > >> 327: >> 328: // Draw the bulk of the border >> 329: for (int i = 1; i <= loopCount; i++) { > > Should we redo the drawing of this border to use Graphics2D fillRect instead? Since loopCount won't be really large,(it is 15 for 300% scaling) and it wouldn't affect the performance drastically,I have retained the original code. > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 336: > >> 334: // Draw the Long highlight lines >> 335: g.setColor(highlight); >> 336: g.drawLine(scaledCorner + 1, midPoint+stkWidth, > > The spacing here and when drawing shadow lines is a bit inconsistent @alisenchung I tried by increasing and decreasing the line position a bit, the current combination provided the optimal positioning of both the shadow and highlight line within the border for all the scales. The slight inconsistency in spacing is probably due to rounding losses in loop count, stroke width and corner. I'll check it again. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From serb at openjdk.org Tue Oct 4 02:44:50 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 4 Oct 2022 02:44:50 GMT Subject: RFR: 8294488: Delete KCMS transforms wrappers Message-ID: This is a request to cleanup the shared code for the colors conversions. That code still uses some wrappers which can be simplified and/or deleted after KCMS removal. For example each conversion from one color space to another creates 3 wrappers - for the first color profile, the second color profile and one to combine the first two. But for the lcms library we only need the list of color profiles and rendering intent -> only one transform object can be used. The new constructor for the LCMSTransform is [added](https://github.com/openjdk/jdk/pull/10459/files#diff-7448ea8346eb08c6ec1a518e3c3399d7d078a514c07956ee7e8e2b5be3d082e1R77) and now used everywhere: `LCMSTransform(int renderingIntent, ICC_Profile... profiles)` It will wrap the `cmsCreateMultiprofileTransform` [function ](https://github.com/openjdk/jdk/pull/10459/files#diff-eed6ddb15e9c5bdab9fc3b3930d5d959966165d9622ddd293e8572489adea98bR202) in LCMS library: I tried to preserve the current behavior, as a result two "workarounds" are used for the next bugs. * [JDK-8216369](https://bugs.openjdk.org/browse/JDK-8216369): after the cleanup it became obvious that we use a hardcoded value for the first rendering [intent](https://github.com/openjdk/jdk/pull/10459/files#diff-e3d6eea060882cab00827c00e1a83b0e0a5b2a31fa9a9aa2122841bbd57c4a6dR473). There is a code to fetch the intent from the color profile but I postponed use it for now because some of our built-in profiles use different default intents.. * [JDK-8272860](https://bugs.openjdk.org/browse/JDK-8272860): the old code always fetched some information from the color profile header a result we cache the headers for any profiles we used. This cache workaround the JDK-8272860 while the direct access to the profile via LCMS library could fail.The new code intentionally cache the [header](https://github.com/openjdk/jdk/pull/10459/files#diff-7448ea8346eb08c6ec1a518e3c3399d7d078a514c07956ee7e8e2b5be3d082e1R91). Notes: * The old wrappers used a rendering intent for each intermediate transform, the LCMS use only one intent * The old wrappers could throw the cmm exception if the rendering intent was not supported. The LCMS ignores unsupported intents and use some [default](https://github.com/LuaDist/lcms/blob/master/doc/TUTORIAL.TXT#L1094) * The old wrappers had a way to specifiy the input and output profiles, the LCMS library use the first profile as input and the last profile as output. That parameters are [removed](https://github.com/openjdk/jdk/pull/10459/files#diff-81b49f067b32296497e9e727bda25efe0b7f84fb2c05645eb6b272bfc32469f1L38) * If at some point the new CMS library will be added it will be easy to integrate it using XXCMS plugin, instead of using some specific library logic in the shared code ------------- Commit messages: - rename renderType to renderingIntent - Merge remote-tracking branch 'upstream/master' into tfmCleanup - Add a dot. - cleanup Changes: https://git.openjdk.org/jdk/pull/10459/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10459&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8294488 Stats: 282 lines in 9 files changed: 18 ins; 175 del; 89 mod Patch: https://git.openjdk.org/jdk/pull/10459.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10459/head:pull/10459 PR: https://git.openjdk.org/jdk/pull/10459 From tr at openjdk.org Tue Oct 4 05:50:13 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 4 Oct 2022 05:50:13 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v3] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/54ddc88b..a0299038 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=01-02 Stats: 32 lines in 2 files changed: 3 ins; 16 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 4 05:50:15 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 4 Oct 2022 05:50:15 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:10:27 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > You say that the current directory in `JFileChooser` gets set to `null` because of forbidden navigation to a folder which is not traversable. You avoid the NPE by a null-check. > > However, you should prevent the current directory to be set to `null`. If navigation is not allowed, the current directory should remain unchanged _instead of being reset to `null`_. @aivanov-jdk I have updated as per the review comments. Please let me know if its fine. I have put up the mach5 test link in JBS for reference. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 4 05:50:15 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 4 Oct 2022 05:50:15 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: <5HJJWyKp9jq-3ZzEJWGNS2ajQZhVUN2QwUS04eZRMCk=.82631fdd-2b8d-465b-a614-0cecf10cfe5e@github.com> On Mon, 3 Oct 2022 12:01:55 GMT, Alexey Ivanov wrote: >> Then I can just make user.home directory as the only traversable.......? > > Makes sense to me. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 4 05:50:17 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 4 Oct 2022 05:50:17 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 11:29:14 GMT, Tejesh R wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 114: >> >>> 112: } else { >>> 113: return false; >>> 114: } >> >> It can be simplified to: >> Suggestion: >> >> return ((filePath != null) && (filePath.isDirectory()) >> && filePath.getAbsolutePath().startsWith(basePath)); >> >> I'm not insisting though. > > Can be done, no issues. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 4 08:06:24 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 4 Oct 2022 08:06:24 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Test case update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/a0299038..62f6c307 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=02-03 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 4 11:40:27 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 11:40:27 GMT Subject: RFR: 8294255: Add link to DEFAULT_WAIT_TIME in javadoc for SunToolKit.realsSync In-Reply-To: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> References: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> Message-ID: On Fri, 23 Sep 2022 01:11:14 GMT, SWinxy wrote: > I also took the opportunity to link to `realSync(long)`. > > /** > * Parameterless version of realsync which uses default timout (see DEFAUL_WAIT_TIME). > */ > > > /** > * Parameterless version of {@link #realSync(long)} which uses > * the default timeout of {@link #DEFAULT_WAIT_TIME}. > */ Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10399 From azvegint at openjdk.org Tue Oct 4 15:22:02 2022 From: azvegint at openjdk.org (Alexander Zvegintsev) Date: Tue, 4 Oct 2022 15:22:02 GMT Subject: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v4] In-Reply-To: References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: On Mon, 3 Oct 2022 20:56:48 GMT, Alisen Chung wrote: >> changed return to cleanup in getAllConfigs >> changed cleanup to loop thru and free all allocated memory adjacent to graphicsConfig pointer > > Alisen Chung has updated the pull request incrementally with one additional commit since the last revision: > > reused i variable for loop Marked as reviewed by azvegint (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10378 From achung at openjdk.org Tue Oct 4 15:26:32 2022 From: achung at openjdk.org (Alisen Chung) Date: Tue, 4 Oct 2022 15:26:32 GMT Subject: Integrated: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 In-Reply-To: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> References: <1gj0XMmbPLGkiWBwJ09LeKvujGCrLa45Qm5utSp-dCI=.1c9f3e8d-4ef4-4e4e-8a57-cd288645b961@github.com> Message-ID: On Wed, 21 Sep 2022 20:15:48 GMT, Alisen Chung wrote: > changed return to cleanup in getAllConfigs > changed cleanup to loop thru and free all allocated memory adjacent to graphicsConfig pointer This pull request has now been integrated. Changeset: 1166a8ab Author: Alisen Chung Committer: Alexander Zvegintsev URL: https://git.openjdk.org/jdk/commit/1166a8abd2e5fba16b5cd29431de2628a52a8e08 Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 Reviewed-by: azvegint, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/10378 From dnguyen at openjdk.org Tue Oct 4 17:39:09 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 4 Oct 2022 17:39:09 GMT Subject: RFR: 8293672: Update freetype md file Message-ID: Update the freetype md file with the newly generated md file from attribution tool. The new format slightly differs from the previous version when separating different licenses. Added logic for combining of copyright lines and support for other licenses such as MIT. ------------- Commit messages: - Update md file Changes: https://git.openjdk.org/jdk/pull/10561/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10561&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8293672 Stats: 96 lines in 1 file changed: 54 ins; 13 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/10561.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10561/head:pull/10561 PR: https://git.openjdk.org/jdk/pull/10561 From honkar at openjdk.org Tue Oct 4 17:48:55 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 17:48:55 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: > JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) > > The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. > > ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: review changes, saving a scaled version of image ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10274/files - new: https://git.openjdk.org/jdk/pull/10274/files/4047f9d7..6efd8417 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=03-04 Stats: 107 lines in 2 files changed: 35 ins; 22 del; 50 mod Patch: https://git.openjdk.org/jdk/pull/10274.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10274/head:pull/10274 PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Tue Oct 4 17:53:31 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 17:53:31 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: On Mon, 3 Oct 2022 21:18:55 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant jtreg header > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 313: > >> 311: >> 312: // border and corner scaling >> 313: int scaledCorner = (int) Math.round(corner * at.getScaleX()); > > Just a suggestion, you can call this variable `corner` but make the constant above upper case `CORNER`. This way the old code would remain basically the same and continue using `corner` (which was previously a field). Updated > test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 211: > >> 209: + cornerLocation); >> 210: } >> 211: robot.mouseMove(x, y); > > Moving the mouse cursor is not required. However, it gives a visual feedback of where the check is happening. @aivanov-jdk I have retained the mouseMove for visual confirmation ------------- PR: https://git.openjdk.org/jdk/pull/10274 From dnguyen at openjdk.org Tue Oct 4 18:03:39 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 4 Oct 2022 18:03:39 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: References: Message-ID: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> > Update the freetype md file with the newly generated md file from attribution tool. The new format slightly differs from the previous version when separating different licenses. Added logic for combining of copyright lines and support for other licenses such as MIT. Damon Nguyen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: - Merge branch 'openjdk:master' into 8293672/updateFreeTypeMd - Update md file ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10561/files - new: https://git.openjdk.org/jdk/pull/10561/files/2bb32afc..16c4ed07 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10561&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10561&range=00-01 Stats: 208500 lines in 3586 files changed: 104542 ins; 82118 del; 21840 mod Patch: https://git.openjdk.org/jdk/pull/10561.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10561/head:pull/10561 PR: https://git.openjdk.org/jdk/pull/10561 From prr at openjdk.org Tue Oct 4 18:03:40 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:03:40 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> Message-ID: On Tue, 4 Oct 2022 18:00:32 GMT, Damon Nguyen wrote: >> Update the freetype md file with the newly generated md file from attribution tool. The new format slightly differs from the previous version when separating different licenses. Added logic for combining of copyright lines and support for other licenses such as MIT. > > Damon Nguyen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: > > - Merge branch 'openjdk:master' into 8293672/updateFreeTypeMd > - Update md file src/java.desktop/share/legal/freetype.md line 2: > 1: ## The FreeType Project: Freetype v2.12.1 > 2: Why does this show a .0 -> .1 update ? The currently checked in file was updated in July so it already has .1 .. so that is very puzzling to me. src/java.desktop/share/legal/freetype.md line 542: > 540: /* > 541: * Copyright 2000 Computing Research Labs, New Mexico State University > 542: * Copyright 2001-2015 Why did this notice need to be moved down to the end of the file ? It makes the diff look bigger than it actually is and I can't imagine any reason we would need to change the order. ------------- PR: https://git.openjdk.org/jdk/pull/10561 From prr at openjdk.org Tue Oct 4 18:03:40 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:03:40 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> Message-ID: On Tue, 4 Oct 2022 17:49:40 GMT, Phil Race wrote: >> Damon Nguyen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into 8293672/updateFreeTypeMd >> - Update md file > > src/java.desktop/share/legal/freetype.md line 2: > >> 1: ## The FreeType Project: Freetype v2.12.1 >> 2: > > Why does this show a .0 -> .1 update ? > The currently checked in file was updated in July so it already has .1 .. so that is very puzzling to me. Hmm .. it has disappeared with your 2nd commit. I can only suppose you were using a VERY out of date repo .. ------------- PR: https://git.openjdk.org/jdk/pull/10561 From dnguyen at openjdk.org Tue Oct 4 18:03:40 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 4 Oct 2022 18:03:40 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> Message-ID: On Tue, 4 Oct 2022 17:55:51 GMT, Phil Race wrote: >> src/java.desktop/share/legal/freetype.md line 2: >> >>> 1: ## The FreeType Project: Freetype v2.12.1 >>> 2: >> >> Why does this show a .0 -> .1 update ? >> The currently checked in file was updated in July so it already has .1 .. so that is very puzzling to me. > > Hmm .. it has disappeared with your 2nd commit. I can only suppose you were using a VERY out of date repo .. Needed to resync branch. Resolved! ------------- PR: https://git.openjdk.org/jdk/pull/10561 From dnguyen at openjdk.org Tue Oct 4 18:03:41 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 4 Oct 2022 18:03:41 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> Message-ID: <0-gwG-fhyvLXp4LWBNnJPj-WR2cItRn73VsV1SSeJNw=.f7f6ba4b-a5fe-48f5-8ac6-5c4473a0d07d@github.com> On Tue, 4 Oct 2022 17:52:05 GMT, Phil Race wrote: >> Damon Nguyen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: >> >> - Merge branch 'openjdk:master' into 8293672/updateFreeTypeMd >> - Update md file > > src/java.desktop/share/legal/freetype.md line 542: > >> 540: /* >> 541: * Copyright 2000 Computing Research Labs, New Mexico State University >> 542: * Copyright 2001-2015 > > Why did this notice need to be moved down to the end of the file ? > It makes the diff look bigger than it actually is and I can't imagine any reason we would need to change the order. This is due to the addition of the MIT license being treated as a separate license from the freetype license. In the modified tool, licenses are separated by license type. The additional freetype licenses seems more logically related to freetype licenses so it follows the freetype & GPL license. Then, other licenses (such as MIT in this case) follow afterwards. This can be manually modified to maintain the old order but I believed it made more sense this way in the tool since "variants" of the primary license (freetype) would follow the primary license. ------------- PR: https://git.openjdk.org/jdk/pull/10561 From duke at openjdk.org Tue Oct 4 18:05:50 2022 From: duke at openjdk.org (lawrence.andrews) Date: Tue, 4 Oct 2022 18:05:50 GMT Subject: Integrated: 8292309 : Fix java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java test In-Reply-To: References: Message-ID: <3HTZ7Gc-spLQwHxlrvVyQVA6X0wvrnJWhJ0F4lRQbl8=.52156f0a-319b-452c-94db-3fcd010dea33@github.com> On Fri, 12 Aug 2022 23:10:01 GMT, lawrence.andrews wrote: > 1) Fixed Parse Exception by removing yesno > test result: Error. Parse Exception: Arguments to `manual' option not supported: yesno > 2) Throw jtreg.SkippedException when printer is not configured on the test host > 3) Replaced Sysout & TestDialog with ManualTestFrame, which allows to the user to better decide test results and to take screen shot if test fails. > > @shurymury This pull request has now been integrated. Changeset: b22a38de Author: lawrence.andrews Committer: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/b22a38dedb06199f2cba3b6f8962ddf2f9f4f16d Stats: 336 lines in 1 file changed: 52 ins; 224 del; 60 mod 8292309: Fix java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java test Reviewed-by: jdv ------------- PR: https://git.openjdk.org/jdk/pull/9865 From honkar at openjdk.org Tue Oct 4 18:14:28 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 18:14:28 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Mon, 3 Oct 2022 21:57:17 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant jtreg header > > Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? @aivanov-jdk Regarding saving the screen capture - - When JIF bounds are used, a partial image of JInternalFrame (JIF) is saved. Hence I'm using the entire JFrame bounds to capture the screenshot. - For the screenCapture I wanted to use **BufferedImage's getScaledInstance()** to create the scaled version (code snippet below), but experiencing issues while saving it. Currently I'm scaling the original image and re-drawing it using graphics object. BufferedImage bufferedImage= robot.createScreenCapture(jFrameBounds); Image image= bufferedImage.getScaledInstance((int) (scale * bufferedImage.getWidth(null)), (int) (scale * bufferedImage.getHeight(null)), Image.SCALE_DEFAULT); ------------- PR: https://git.openjdk.org/jdk/pull/10274 From prr at openjdk.org Tue Oct 4 18:22:34 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:22:34 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> Message-ID: <3_6yDaTEJ8Ryd-5GKZQ0PXLgYd-hpYzmQoi35d_Gwqo=.9939c3ab-751d-48a2-b9e2-9807d166bcfa@github.com> On Tue, 4 Oct 2022 18:03:39 GMT, Damon Nguyen wrote: >> Update the freetype md file with the newly generated md file from attribution tool. The new format slightly differs from the previous version when separating different licenses. Added logic for combining of copyright lines and support for other licenses such as MIT. > > Damon Nguyen has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision: > > - Merge branch 'openjdk:master' into 8293672/updateFreeTypeMd > - Update md file Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10561 From prr at openjdk.org Tue Oct 4 18:22:36 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:22:36 GMT Subject: RFR: 8293672: Update freetype md file [v2] In-Reply-To: <0-gwG-fhyvLXp4LWBNnJPj-WR2cItRn73VsV1SSeJNw=.f7f6ba4b-a5fe-48f5-8ac6-5c4473a0d07d@github.com> References: <24bzyIC2B6IuXlyByb_dSzOwT0GjtPN2YhxbY2uzsUo=.02c0d507-aacc-41a7-9492-44944f483bf0@github.com> <0-gwG-fhyvLXp4LWBNnJPj-WR2cItRn73VsV1SSeJNw=.f7f6ba4b-a5fe-48f5-8ac6-5c4473a0d07d@github.com> Message-ID: On Tue, 4 Oct 2022 17:57:46 GMT, Damon Nguyen wrote: >> src/java.desktop/share/legal/freetype.md line 542: >> >>> 540: /* >>> 541: * Copyright 2000 Computing Research Labs, New Mexico State University >>> 542: * Copyright 2001-2015 >> >> Why did this notice need to be moved down to the end of the file ? >> It makes the diff look bigger than it actually is and I can't imagine any reason we would need to change the order. > > This is due to the addition of the MIT license being treated as a separate license from the freetype license. In the modified tool, licenses are separated by license type. The additional freetype licenses are "variants" of the primary license (freetype) so it seemed to make sense for it to follow the freetype & GPL license. Then, other licenses (such as MIT in this case) follow afterwards. > > This can be manually modified to maintain the old order but I believed it made more sense this way in the tool since variants of the primary license would follow the primary license. Well if it is only a one-off... BTW phrases such as "the modified tool" etc are very out of place here .. I don't see a tool in this PR, do you ? I believe you are referring to some script(s) that not part of OpenJDK that you are using to produce these updates. ------------- PR: https://git.openjdk.org/jdk/pull/10561 From cjplummer at openjdk.org Tue Oct 4 18:23:32 2022 From: cjplummer at openjdk.org (Chris Plummer) Date: Tue, 4 Oct 2022 18:23:32 GMT Subject: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni [v2] In-Reply-To: References: Message-ID: On Wed, 28 Sep 2022 15:32:11 GMT, Michael Ernst wrote: > The title was edited by someone other than me, as you can see from the PR history. The PR title needs to match the CR synopsis, so update the CR first, and then update the PR. ------------- PR: https://git.openjdk.org/jdk/pull/10029 From honkar at openjdk.org Tue Oct 4 18:28:53 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 18:28:53 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: On Mon, 3 Oct 2022 22:02:28 GMT, Alisen Chung wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> removed redundant jtreg header > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 255: > >> 253: * @return a {@code int} which is the rounded value of provided number >> 254: */ >> 255: private static int roundDown(double d) > > The name of this method is a bit misleading, the operation doesn't actually round down, but rounds the number normally except for the x.5 case right? Does this operation exist somewhere else? Yes, that is correct. The method doc does clarify the purpose. But I see your point - probably `roundOff()` would sound less ambiguous and neutral? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From duke at openjdk.org Tue Oct 4 18:28:53 2022 From: duke at openjdk.org (Stanimir Stamenkov) Date: Tue, 4 Oct 2022 18:28:53 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: On Tue, 4 Oct 2022 18:23:17 GMT, Harshitha Onkar wrote: >> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 255: >> >>> 253: * @return a {@code int} which is the rounded value of provided number >>> 254: */ >>> 255: private static int roundDown(double d) >> >> The name of this method is a bit misleading, the operation doesn't actually round down, but rounds the number normally except for the x.5 case right? Does this operation exist somewhere else? > > Yes, that is correct. The method doc does clarify the purpose. But I see your point - probably `roundOff()` would sound less ambiguous and neutral? [`roundHalfDown`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/RoundingMode.html#HALF_DOWN)? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 18:40:19 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 18:40:19 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Mon, 3 Oct 2022 22:16:56 GMT, Harshitha Onkar wrote: > > Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? > > @aivanov-jdk Thank you for reviewing. I wanted to clarify whether you meant saving just the JInternalFrame into BufferedImage? Yes, just `JInternalFrame`. Yet I was talking about rendering rather than capturing from the screen. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Tue Oct 4 18:40:21 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 18:40:21 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> Message-ID: <13z2p5wpCDecwKztf2NtsxGisqYYZ5FPhPdds0WDdyw=.f289ded7-c81b-4f27-8e4e-a8eda81728db@github.com> On Tue, 4 Oct 2022 18:26:26 GMT, Stanimir Stamenkov wrote: >> Yes, that is correct. The method doc does clarify the purpose. But I see your point - probably `roundOff()` would sound less ambiguous and neutral? > > [`roundHalfDown`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/RoundingMode.html#HALF_DOWN)? @stanio Thank you for the suggestion- roundHalfDown fits the rounding functionality I was looking for. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 18:40:24 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 18:40:24 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> Message-ID: On Mon, 3 Oct 2022 22:43:40 GMT, Harshitha Onkar wrote: >> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 329: >> >>> 327: >>> 328: // Draw the bulk of the border >>> 329: for (int i = 1; i <= loopCount; i++) { >> >> Should we redo the drawing of this border to use Graphics2D fillRect instead? > > That was my initial thought too. But, as the loopCount won't be really large (Eg. it is 15 for 300% scaling) and it wouldn't affect the performance drastically, I have retained the original approach to draw the bulk of the border. Let us leave it as is at this time. There are enough changes. At the same time, it's a good suggestion for optimization. We should consider it in a separate CR. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From achung at openjdk.org Tue Oct 4 18:40:25 2022 From: achung at openjdk.org (Alisen Chung) Date: Tue, 4 Oct 2022 18:40:25 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> Message-ID: On Mon, 3 Oct 2022 22:29:06 GMT, Harshitha Onkar wrote: >> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 336: >> >>> 334: // Draw the Long highlight lines >>> 335: g.setColor(highlight); >>> 336: g.drawLine(scaledCorner + 1, midPoint+stkWidth, >> >> The spacing here and when drawing shadow lines is a bit inconsistent > > @alisenchung I tried by increasing and decreasing the line position a bit, the current combination provided optimal positioning of both the shadow and highlight line within the border for all the scales. The slight inconsistency in spacing is probably due to rounding losses in loop count, stroke width and corner. I'll check it again. Oh, I meant the actual code spacing, theres a space between scaledCorner and 1, but not space between midPoint and stkWidth ------------- PR: https://git.openjdk.org/jdk/pull/10274 From prr at openjdk.org Tue Oct 4 18:42:44 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:42:44 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v8] In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 20:37:11 GMT, Joe Darcy wrote: >> With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. >> >> Updates were made using a shell script. I"ll run a copyright updater before any push. > > Joe Darcy 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: > > - Update accessibility URLs. > - Merge branch 'master' into JDK-8294618 > - Update make directory. > - Update doc directory files. > - Update hg URLs to git. > - Merge branch 'master' into JDK-8294618 > - http -> https > - Undo manpage update. > - Update copyright. > - Revert unintended update to binary file. > - ... and 1 more: https://git.openjdk.org/jdk/compare/571e4932...4055f1a6 Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10501 From prr at openjdk.org Tue Oct 4 18:43:26 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 18:43:26 GMT Subject: RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 13:59:25 GMT, Jayathirth D V wrote: > In https://bugs.openjdk.org/browse/JDK-8270915 we have a valid GIF image which was generated using a third party app, but it contains large amount of Metadata(numerous Application extension blocks). > > Also GIFImageReader doesn't use ignoreMetadata flag set by user while reading Metadata which causes heavy memory usage in this scenario. We need to provide support for ignoring metadata in GIFImageReader, so readMetadata() is updated to use the "ignoreMetadata" flag and ignore all blocks except "Image Descriptor" and "Graphics Control Extension". > > I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() where we are allocating upfront memory based on parameters from metadata. Also this PR has small refactoring of import statements. > > To replicate the bug we need byte stream with large amount of valid metadata, so i am not able to add regression test case. I have run all javax/imageio jtreg tests and there are no issues. LGTM ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.org/jdk/pull/10536 From aivanov at openjdk.org Tue Oct 4 18:52:34 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 18:52:34 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Tue, 4 Oct 2022 18:32:33 GMT, Alexey Ivanov wrote: >>> Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? >> >> @aivanov-jdk Thank you for reviewing. I wanted to clarify whether you meant saving just the JInternalFrame into BufferedImage? > >> > Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? >> >> @aivanov-jdk Thank you for reviewing. I wanted to clarify whether you meant saving just the JInternalFrame into BufferedImage? > > Yes, just `JInternalFrame`. Yet I was talking about rendering rather than capturing from the screen. > @aivanov-jdk Regarding saving the screen capture - > > When JIF bounds are used, a partial image of JInternalFrame (JIF) is saved. Hence I'm using the entire outer JFrame bounds to capture the screenshot. Could be? It shouldn't. Anyway, I have no problem with capturing the entire `JFrame`. > > For the screenCapture I wanted to use **BufferedImage's getScaledInstance()** to create the scaled version (code snippet below), but experiencing issues while saving it. Currently I'm scaling the original image and re-drawing it using graphics object. This is definitely not what we want. It just up-scales or down-scales the current image stored in `BufferedImage`. When you run in a HiDPI environment or with `uiScale` set explicitly to a value greater than 1.0, the number of pixels is higher. `Robot.createScreenCapture` up-scales the passed in rectangle, captures all the pixels and then down-scales the captured screenshot to the user's space coordinates. At the same time, [`createMultiResolutionScreenCapture`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Robot.html#createScreenCapture(java.awt.Rectangle)) returns a `MultiResolutionImage` which contains two variants: (1) the base image with the user specified size, down-scaled from the screen; (2) native resolution image with the device size pixels. The second variant will preserve all the pixels seen on the screen. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From prr at openjdk.org Tue Oct 4 19:14:21 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 19:14:21 GMT Subject: RFR: 8278086: [REDO] ImageIO.write() method will throw IndexOutOfBoundsException [v2] In-Reply-To: References: Message-ID: On Mon, 26 Sep 2022 13:20:36 GMT, Jayathirth D V wrote: >> This is redo of https://bugs.openjdk.org/browse/JDK-8262297 >> In https://bugs.openjdk.org/browse/JDK-8262297 we added similar change but we didnt allow 15bpp image in BMP, because of which many tests which were using USHORT_555_RGB format were failing as reported at https://bugs.openjdk.org/browse/JDK-8278047 >> >> There is ambiguity on whether we should support 15bpp BMP encoding also or not as captured in JBS : https://bugs.openjdk.org/browse/JDK-8278086?focusedCommentId=14521952&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14521952 >> >> Since adding tighter condition to only allow 0, 1, 4, 8, 16, 24 and 32 bpp is causing many failures. I have modified the check to allow 15bpp also. > > Jayathirth D V has updated the pull request incrementally with one additional commit since the last revision: > > Remove biType variable Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10419 From prr at openjdk.org Tue Oct 4 19:14:23 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 19:14:23 GMT Subject: RFR: 8278086: [REDO] ImageIO.write() method will throw IndexOutOfBoundsException [v2] In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 06:41:03 GMT, Jayathirth D V wrote: >> src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java line 1463: >> >>> 1461: return false; >>> 1462: } >>> 1463: if (compressionType == BI_RLE4 && bpp != 4) { >> >> I'm confused. You say you are relaxing the test to allow 15bpp, but I don't see where you're removing >> anything that would have rejected 15bpp. >> >> And how does this prevent the un-specified exception being thrown ? > > Hi Phil, > > We never had any bpp check to verify what standard bpp's should be allowed in BMP. > Because of this when we tried to decode 2 bpp PNG img and write it to BMP we used to get IOOBE as captured in https://bugs.openjdk.org/browse/JDK-8262297. So under this bug, check was added to allow only standard bpp's for BMP encoding : https://github.com/openjdk/jdk/commit/c73319354399596ab2b9aab0a7f62e8fa0ab9365. > > But this caused regression of many jtreg tests which were using USHORT_555_RGB to encode BMP image(we round off this 15bpp to 16bpp and at later stage : https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/com/sun/imageio/plugins/bmp/BMPImageWriter.java#L472 and store it in 16bit data buffer). So i relaxed this check which caused jtreg regressions to allow 15bpp also. > > Since we straight away reject non-standard bits per pixel (like 2 bpp) for BMP encoding, we will throw IOException instead to going ahead and throwing non-documented exceptions like IOOBE. Ah, the bit you weren't / aren't explaining is that the reason I'm not seeing the check which would have dis-allowed 15bpp is that you backed it out ages ago https://github.com/openjdk/jdk/commit/84aa0a191b085a3d7cb338fd5e67281d0e4b57be because of the failures it caused. So now that code is being re-added but this time allowing 15bpp ------------- PR: https://git.openjdk.org/jdk/pull/10419 From prr at openjdk.org Tue Oct 4 19:16:21 2022 From: prr at openjdk.org (Phil Race) Date: Tue, 4 Oct 2022 19:16:21 GMT Subject: RFR: 8294255: Add link to DEFAULT_WAIT_TIME in javadoc for SunToolKit.realsSync In-Reply-To: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> References: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> Message-ID: <3iMLLP1QnhYtKJkESRtwil_McyMF7wDjVhxF9CWbBTE=.16fa8abd-c70b-4e4e-8607-4a229197ab51@github.com> On Fri, 23 Sep 2022 01:11:14 GMT, SWinxy wrote: > I also took the opportunity to link to `realSync(long)`. > > /** > * Parameterless version of realsync which uses default timout (see DEFAUL_WAIT_TIME). > */ > > > /** > * Parameterless version of {@link #realSync(long)} which uses > * the default timeout of {@link #DEFAULT_WAIT_TIME}. > */ Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10399 From duke at openjdk.org Tue Oct 4 19:19:10 2022 From: duke at openjdk.org (SWinxy) Date: Tue, 4 Oct 2022 19:19:10 GMT Subject: Integrated: 8294255: Add link to DEFAULT_WAIT_TIME in javadoc for SunToolKit.realsSync In-Reply-To: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> References: <5IKSHb5lsL9So0XoN2YDv7GhGjL0j_gi9FWtpZ0IykE=.f315a62e-1d87-4ed5-a6a7-f86d6db34b7f@github.com> Message-ID: On Fri, 23 Sep 2022 01:11:14 GMT, SWinxy wrote: > I also took the opportunity to link to `realSync(long)`. > > /** > * Parameterless version of realsync which uses default timout (see DEFAUL_WAIT_TIME). > */ > > > /** > * Parameterless version of {@link #realSync(long)} which uses > * the default timeout of {@link #DEFAULT_WAIT_TIME}. > */ This pull request has now been integrated. Changeset: b2e86a62 Author: SWinxy Committer: Phil Race URL: https://git.openjdk.org/jdk/commit/b2e86a620936cc0d65ca884ff2b6644998530354 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod 8294255: Add link to DEFAULT_WAIT_TIME in javadoc for SunToolKit.realsSync Reviewed-by: aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/10399 From aivanov at openjdk.org Tue Oct 4 19:52:27 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 19:52:27 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Tue, 4 Oct 2022 17:48:55 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > review changes, saving a scaled version of image It looks good to me, except for the comments I left on the coding style. Yet there's one thing which I noticed in the rendered border. The top left corner has one pixel which is painted over the title bar. It's present in the original painting code. The top right corner has such a pixel too. The updated code paints the top left corner with that pixel. Yet in the top right corner, it moved to left. ![top right corner of the JInternalFrame](https://user-images.githubusercontent.com/70774172/193912190-8faf432e-0bc2-4906-8811-e3780da86b9b.png) test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 29: > 27: import javax.swing.JLabel; > 28: import javax.swing.SwingUtilities; > 29: import javax.swing.UIManager; I'd rather stick to the same order of imports in sources and tests. However, swing components used are more important. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 185: > 183: errorLog.append("At uiScale: "+ uiScale + > 184: ", Red background color detected at " > 185: + borderDirection + " border\n"); This doesn't look right either. The old code had only the body of `if` incorrectly indented. if (Color.RED.equals(robot.getPixelColor( isVertical ? i : (iFrameLoc.x + MIDPOINT), isHorizontal ? i : (iFrameLoc.y + MIDPOINT)))) { saveScreenCapture(borderDirection + "_" + uiScale + ".png"); errorLog.append("uiScale: " + uiScale + " Red background color detected at " + borderDirection + " border\n"); Continuation lines are indented twice as much or to align with a level they're wrapped at. The example for the second case: errorLog.append("uiScale: " + uiScale + " Red background color detected at " + borderDirection + " border\n"); Here, the operators on the wrapped lines align to the following column of the opening parenthesis for parameters of `append`. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 217: > 215: if (Color.RED.equals(robot.getPixelColor(x, y))) { > 216: saveScreenCapture(cornerLocation + "_" + uiScale + ".png", uiScale); > 217: errorLog.append("At uiScale: "+ uiScale + ", Red background color" + Suggestion: errorLog.append("At uiScale: " + uiScale + ", Red background color" + test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 229: > 227: jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); > 228: > 229: JLabel scale = new JLabel("UI Scale: "+ uiScale); Suggestion: JLabel scale = new JLabel("UI Scale: " + uiScale); test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 252: > 250: g2d.scale(scale, scale); > 251: g2d.drawImage(image, 0, 0, null); > 252: g2d.dispose(); This does not make sense, it up-scales a down-scaled image. Either revert to the previous version or use `createMultiResolutionScreenCapture` and save all resolution variants from the `MultiResolutionImage`. ------------- Changes requested by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 20:01:28 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:01:28 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Tue, 4 Oct 2022 19:37:32 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> review changes, saving a scaled version of image > > test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 185: > >> 183: errorLog.append("At uiScale: "+ uiScale + >> 184: ", Red background color detected at " >> 185: + borderDirection + " border\n"); > > This doesn't look right either. The old code had only the body of `if` incorrectly indented. > > > if (Color.RED.equals(robot.getPixelColor( > isVertical ? i : (iFrameLoc.x + MIDPOINT), > isHorizontal ? i : (iFrameLoc.y + MIDPOINT)))) { > saveScreenCapture(borderDirection + "_" + uiScale + ".png"); > errorLog.append("uiScale: " + uiScale > + " Red background color detected at " > + borderDirection + " border\n"); > > > Continuation lines are indented twice as much or to align with a level they're wrapped at. The example for the second case: > > errorLog.append("uiScale: " + uiScale > + " Red background color detected at " > + borderDirection + " border\n"); > > Here, the operators on the wrapped lines align to the following column of the opening parenthesis for parameters of `append`. In my example, I put the operators on the continuation line, it's what Java Coding Style recommends. However, leaving the operators on the previous line is very common. Here, you're mixing two styles: the first continuation line with `append` parameter had `+` at the end of the line, but the second line wrapped the `+` operator to the next line. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 20:09:42 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:09:42 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: <13z2p5wpCDecwKztf2NtsxGisqYYZ5FPhPdds0WDdyw=.f289ded7-c81b-4f27-8e4e-a8eda81728db@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <13z2p5wpCDecwKztf2NtsxGisqYYZ5FPhPdds0WDdyw=.f289ded7-c81b-4f27-8e4e-a8eda81728db@github.com> Message-ID: On Tue, 4 Oct 2022 18:35:34 GMT, Harshitha Onkar wrote: >> [`roundHalfDown`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/RoundingMode.html#HALF_DOWN)? > > @stanio Thank you for the suggestion- roundHalfDown fits the rounding functionality I was looking for. Since you'll be changing the name of the method, please place the opening brace on the same line as the method declaration. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 20:09:43 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:09:43 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Tue, 4 Oct 2022 17:48:55 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > review changes, saving a scaled version of image src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 320: > 318: // midpoint at which highlight & shadow lines > 319: // are positioned on the border > 320: int midPoint = loopCount / 2; This variable is used only if the internal frame is resizable. It should be declared inside the corresponding `if` statement. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 20:28:27 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:28:27 GMT Subject: RFR: 8294807: Fix typos and clarify javadoc for SunToolKit.realsSync Message-ID: I fixed the typo ?serie? ? "series" which was highlighted by a spellchecker. I also simplified the description, fixed the grammar, added `{@code}` around types, added link to `requestFocus` in the example. ------------- Commit messages: - Amend the javadoc for SunToolkit.realSync(long) Changes: https://git.openjdk.org/jdk/pull/10563/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10563&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8294807 Stats: 16 lines in 1 file changed: 1 ins; 0 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/10563.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10563/head:pull/10563 PR: https://git.openjdk.org/jdk/pull/10563 From aivanov at openjdk.org Tue Oct 4 20:28:28 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:28:28 GMT Subject: RFR: 8294807: Fix typos and clarify javadoc for SunToolKit.realsSync In-Reply-To: References: Message-ID: <5GlfDtRnHLa7PIslOaYDEg8g0M2oB2-YNAatMtJbDWU=.6d381cb4-c329-4b83-a5d6-29dc96521edb@github.com> On Tue, 4 Oct 2022 20:21:10 GMT, Alexey Ivanov wrote: > I fixed the typo ?serie? ? "series" which was highlighted by a spellchecker. > > I also simplified the description, fixed the grammar, added `{@code}` around types, added link to `requestFocus` in the example. src/java.desktop/share/classes/sun/awt/SunToolkit.java line 1451: > 1449: * > 1450: *

This method allows writing tests without explicit timeouts > 1451: * or waiting for some event. Example: Should it be ?without _using_ ? or waiting ??? Does ?for an event? sound better? ------------- PR: https://git.openjdk.org/jdk/pull/10563 From aivanov at openjdk.org Tue Oct 4 20:29:56 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 20:29:56 GMT Subject: RFR: 8294807: Fix typos and clarify javadoc for SunToolKit.realsSync In-Reply-To: References: Message-ID: On Tue, 4 Oct 2022 20:21:10 GMT, Alexey Ivanov wrote: > I fixed the typo ?serie? ? "series" which was highlighted by a spellchecker. > > I also simplified the description, fixed the grammar, added `{@code}` around types, added link to `requestFocus` in the example. src/java.desktop/share/classes/sun/awt/SunToolkit.java line 1481: > 1479: * focus events, which then generate a series of paint events, > 1480: * a series of Java focus events, which then generate > 1481: * a series of paint events which then are processed — The only change here is I added the link to `requestFocus` and replaced hyphen with mdash. I re-flowed the text for easier reading in the source code. Probably, this text could be improved? ------------- PR: https://git.openjdk.org/jdk/pull/10563 From honkar at openjdk.org Tue Oct 4 20:37:35 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 20:37:35 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v6] In-Reply-To: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: > JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) > > The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. > > ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: MRI changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10274/files - new: https://git.openjdk.org/jdk/pull/10274/files/6efd8417..d72d6d16 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=04-05 Stats: 41 lines in 2 files changed: 14 ins; 7 del; 20 mod Patch: https://git.openjdk.org/jdk/pull/10274.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10274/head:pull/10274 PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Tue Oct 4 21:34:38 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 4 Oct 2022 21:34:38 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v6] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: <5XLuv9NDunqVdUSXNO_UsMKLVyc0EYfAwOEfzS-wdRo=.0fa69cfd-318e-456b-bdfd-21f35100988f@github.com> On Tue, 4 Oct 2022 20:37:35 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > MRI changes test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 256: > 254: } else { > 255: nativeResImage = resolutionVariants.get(0); > 256: } Suggestion: RenderedImage image = (RenderedImage) resolutionVariants.get(resolutionVariants.size() > 1 ? 1 : 0); or rather simpler: Suggestion: RenderedImage image = (RenderedImage) resolutionVariants.get(resolutionVariants.size() - 1); ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Tue Oct 4 22:06:07 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Tue, 4 Oct 2022 22:06:07 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v7] In-Reply-To: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: <5LBhU0Tkp2GngUkCt1tAAEe1f8qxzP2I4CVMAQhW8zw=.9c520957-5aa6-4431-83d5-0f76119e39b9@github.com> > JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) > > The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. > > ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: review changes ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10274/files - new: https://git.openjdk.org/jdk/pull/10274/files/d72d6d16..827a3484 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=05-06 Stats: 45 lines in 2 files changed: 12 ins; 19 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/10274.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10274/head:pull/10274 PR: https://git.openjdk.org/jdk/pull/10274 From duke at openjdk.org Tue Oct 4 23:00:00 2022 From: duke at openjdk.org (SWinxy) Date: Tue, 4 Oct 2022 23:00:00 GMT Subject: RFR: 8278620: properties installed by javax.swing.LookAndFeel installColors and installColorsAndFont are not uninstalled Message-ID: Many `installDefaults` methods set the font, foreground, and background on objects but their inverse methods `uninstallDefaults` do not remove them. I've added an inverse method to remove the colors and font to call for the `uninstallDefaults` methods that install defaults. `AquaButtonUI` can call its super since it would otherwise be repeated code. `BasicComboBoxUI` (weirdly) installs the properties again when it should be uninstalling them, so I changed. I noticed that, in a few subclasses, only one of calls to the super of `installDefaults` and `uninstallDefaults` are made. That is, an overridden `installDefaults` may call its super while the overridden `uninstallDefaults` does not call its super (or vise versa). These classes are: `AquaTabbedPaneUI`, `SynthMenuItemUI`, `SynthSplitPaneUI`, and `XTextAreaPeer`. Sorry I couldn't write a test; I wasn't sure how I should have accessed the protected variable aside from creating extending classes for each class that changed. See also #6603, where this issue was discovered. ------------- Commit messages: - Accidental imports added - 8278620: properties installed by javax.swing.LookAndFeel installColors and installColorsAndFont are not uninstalled Changes: https://git.openjdk.org/jdk/pull/10565/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10565&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8278620 Stats: 112 lines in 28 files changed: 74 ins; 12 del; 26 mod Patch: https://git.openjdk.org/jdk/pull/10565.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10565/head:pull/10565 PR: https://git.openjdk.org/jdk/pull/10565 From honkar at openjdk.org Wed Oct 5 00:31:55 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 5 Oct 2022 00:31:55 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Tue, 4 Oct 2022 19:50:15 GMT, Alexey Ivanov wrote: > It looks good to me, except for the comments I left on the coding style. > > Yet there's one thing which I noticed in the rendered border. The top left corner has one pixel which is painted over the title bar. It's present in the original painting code. The top right corner has such a pixel too. > > The updated code paints the top left corner with that pixel. Yet in the top right corner, it moved to left. ![top right corner of the JInternalFrame](https://user-images.githubusercontent.com/70774172/193912190-8faf432e-0bc2-4906-8811-e3780da86b9b.png) @aivanov-jdk The extra pixel seems to be added due to JInternalFrame titlebar and not from the paintBorder() code changes. Below is the screenshot of JIF (at 300% scale) rendered when the paintBorder() code is commented out completely. It seems to match the pixel of the pattern on the title bar. ![image](https://user-images.githubusercontent.com/95945681/193954011-fefc967b-62fb-4035-8fba-7ae7db471f23.png) ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Wed Oct 5 01:18:06 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 5 Oct 2022 01:18:06 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <4zanUg4ogg5XN71yR_lVWw3-2Cww15jC9ey_IBeT1lI=.552f826c-e870-454f-b187-0fbb8419f429@github.com> Message-ID: <3p4Nc9qBWBWXHvrfX7NaS-F6k2i8gKPd981RPBOmSWo=.2041124e-435f-4aa0-8a56-967ac594b22e@github.com> On Tue, 4 Oct 2022 18:31:01 GMT, Alexey Ivanov wrote: >> That was my initial thought too. But, as the loopCount won't be really large (Eg. it is 15 for 300% scaling) and it wouldn't affect the performance drastically, I have retained the original approach to draw the bulk of the border. > > Let us leave it as is at this time. There are enough changes. > > At the same time, it's a good suggestion for optimization. We should consider it in a separate CR. I agree, this code can be improved further using fillRect(). ------------- PR: https://git.openjdk.org/jdk/pull/10274 From ihse at openjdk.org Wed Oct 5 07:43:19 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 5 Oct 2022 07:43:19 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v8] In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 20:37:11 GMT, Joe Darcy wrote: >> With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. >> >> Updates were made using a shell script. I"ll run a copyright updater before any push. > > Joe Darcy 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: > > - Update accessibility URLs. > - Merge branch 'master' into JDK-8294618 > - Update make directory. > - Update doc directory files. > - Update hg URLs to git. > - Merge branch 'master' into JDK-8294618 > - http -> https > - Undo manpage update. > - Update copyright. > - Revert unintended update to binary file. > - ... and 1 more: https://git.openjdk.org/jdk/compare/72d7bf5d...4055f1a6 Marked as reviewed by ihse (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10501 From rgiulietti at openjdk.org Wed Oct 5 10:02:49 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 10:02:49 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: References: Message-ID: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> > This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: - 8294456: Fix misleading-indentation warnings in JDK Merge branch 'master' into JDK-8294456 - 8294456: Fix misleading-indentation warnings in JDK ------------- Changes: https://git.openjdk.org/jdk/pull/10487/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10487&range=01 Stats: 9 lines in 4 files changed: 1 ins; 1 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/10487.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10487/head:pull/10487 PR: https://git.openjdk.org/jdk/pull/10487 From rgiulietti at openjdk.org Wed Oct 5 10:08:31 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 10:08:31 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> Message-ID: <56bmZbja-KHTjSDqWCsX7s2RwGkpyWIDwGLBua1d5FA=.063111f6-4ad4-4508-9ae1-7e55a9810261@github.com> On Wed, 5 Oct 2022 10:02:49 GMT, Raffaello Giulietti wrote: >> This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. > > Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - 8294456: Fix misleading-indentation warnings in JDK > > Merge branch 'master' into JDK-8294456 > - 8294456: Fix misleading-indentation warnings in JDK I had to solve a merge conflict after https://github.com/openjdk/jdk/pull/10426 was integrated. I think my changes need another review on the conflicting file. ------------- PR: https://git.openjdk.org/jdk/pull/10487 From shade at openjdk.org Wed Oct 5 10:20:33 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 5 Oct 2022 10:20:33 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> Message-ID: On Wed, 5 Oct 2022 10:02:49 GMT, Raffaello Giulietti wrote: >> This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. > > Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - 8294456: Fix misleading-indentation warnings in JDK > > Merge branch 'master' into JDK-8294456 > - 8294456: Fix misleading-indentation warnings in JDK make/modules/java.desktop/lib/Awt2dLibraries.gmk line 298: > 296: HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \ > 297: DISABLED_WARNINGS_gcc := format-nonliteral type-limits \ > 298: undef unused-function stringop-truncation, \ Ok, let's not touch this global warning and rename the issue to "Fix misleading-indentation warnings in core JDK libraries". Leave the Awt2d change to another day. ------------- PR: https://git.openjdk.org/jdk/pull/10487 From aivanov at openjdk.org Wed Oct 5 10:49:24 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 10:49:24 GMT Subject: RFR: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB [v31] In-Reply-To: <84Tcbg0LrWSfpvD0bb2Ca6y4T-CNhYVZHVGeTCo0Ef4=.b63d26a1-817f-498d-84b8-39ed3a987dbe@github.com> References: <84Tcbg0LrWSfpvD0bb2Ca6y4T-CNhYVZHVGeTCo0Ef4=.b63d26a1-817f-498d-84b8-39ed3a987dbe@github.com> Message-ID: On Thu, 29 Sep 2022 14:39:04 GMT, Abhishek Kumar wrote: >> JFileChooser - empty file size issue fixed. >> For empty file, now the size 0 KB. >> Manual Test Case "FileSizeCheck.java" created. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Review comment fix Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/9327 From rgiulietti at openjdk.org Wed Oct 5 12:03:22 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 12:03:22 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> Message-ID: <1UQyX79zIVU7mGxkOTSULe7S7DZNDUjOy6NPnSP8V1c=.ddb4d2f9-f784-4fe2-9eb1-bb29349ecb55@github.com> On Wed, 5 Oct 2022 10:16:10 GMT, Aleksey Shipilev wrote: >> Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: >> >> - 8294456: Fix misleading-indentation warnings in JDK >> >> Merge branch 'master' into JDK-8294456 >> - 8294456: Fix misleading-indentation warnings in JDK > > make/modules/java.desktop/lib/Awt2dLibraries.gmk line 298: > >> 296: HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \ >> 297: DISABLED_WARNINGS_gcc := format-nonliteral type-limits \ >> 298: undef unused-function stringop-truncation, \ > > Ok, let's not touch this global warning and rename the issue to "Fix misleading-indentation warnings in core JDK libraries". Leave the Awt2d change to another day. What is the problem with Awt2d? Other conflicts? ------------- PR: https://git.openjdk.org/jdk/pull/10487 From shade at openjdk.org Wed Oct 5 12:11:21 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 5 Oct 2022 12:11:21 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: <1UQyX79zIVU7mGxkOTSULe7S7DZNDUjOy6NPnSP8V1c=.ddb4d2f9-f784-4fe2-9eb1-bb29349ecb55@github.com> References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> <1UQyX79zIVU7mGxkOTSULe7S7DZNDUjOy6NPnSP8V1c=.ddb4d2f9-f784-4fe2-9eb1-bb29349ecb55@github.com> Message-ID: On Wed, 5 Oct 2022 12:01:00 GMT, Raffaello Giulietti wrote: >> make/modules/java.desktop/lib/Awt2dLibraries.gmk line 298: >> >>> 296: HEADERS_FROM_SRC := $(LIBLCMS_HEADERS_FROM_SRC), \ >>> 297: DISABLED_WARNINGS_gcc := format-nonliteral type-limits \ >>> 298: undef unused-function stringop-truncation, \ >> >> Ok, let's not touch this global warning and rename the issue to "Fix misleading-indentation warnings in core JDK libraries". Leave the Awt2d change to another day. > > What is the problem with Awt2d? Other conflicts? I am not completely sure all `misleading-indentation` warnings are fixed in Awt2d, this would require some more testing. I'd defer that to #10453. ------------- PR: https://git.openjdk.org/jdk/pull/10487 From aivanov at openjdk.org Wed Oct 5 13:27:29 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 13:27:29 GMT Subject: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni [v2] In-Reply-To: References: Message-ID: On Mon, 26 Sep 2022 16:51:36 GMT, Michael Ernst wrote: >> 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni > > Michael Ernst has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: > > - Reinstate typos in Apache code that is copied into the JDK > - Merge ../jdk-openjdk into typos-typos > - Remove file that was removed upstream > - Fix inconsistency in capitalization > - Undo change in zlip > - Fix typos Changes requested by aivanov (Reviewer). src/hotspot/share/opto/memnode.cpp line 2365: > 2363: if (x != this) return x; > 2364: > 2365: // Take apart the address into an oop and offset. ?and _an_ offset?? src/java.xml/share/classes/org/w3c/dom/Document.java line 293: > 291: * systemId, and notationName attributes are > 292: * copied. If a deep import is requested, the descendants > 293: * of the source Entity are recursively imported and This class may come from a 3rd party library. Anyone from `java.xml` can confirm it? test/hotspot/jtreg/vmTestbase/nsk/share/locks/DeadlockMaker.java line 31: > 29: /* > 30: * Class used to create deadlocked threads. It is possible create 2 or more deadlocked thread, also > 31: * is possible to specify resource of which type should lock each deadlocked thread Suggestion: * it is possible to specify resource of which type should lock each deadlocked thread It doesn't sound right without _?it?_. test/jdk/com/sun/jdi/connect/spi/GeneratedConnectors.java line 28: > 26: * @summary Unit test for "Pluggable Connectors and Transports" feature. > 27: * > 28: * When a transport service is deployed the virtual machine Suggestion: * When a transport service is deployed, the virtual machine Let's add a comma for clarity. test/jdk/java/security/testlibrary/SimpleOCSPServer.java line 445: > 443: > 444: /** > 445: * Check the status database for revocation information on one or more Suggestion: * Check the status database for revocation information of one or more test/jdk/sun/jvmstat/testlibrary/utils.sh line 181: > 179: if [ $? -eq 0 ] > 180: then > 181: # it's still lingering, now it is hard Suggestion: # it's still lingering, now hit it hard ------------- PR: https://git.openjdk.org/jdk/pull/10029 From rgiulietti at openjdk.org Wed Oct 5 13:50:23 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 13:50:23 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> <1UQyX79zIVU7mGxkOTSULe7S7DZNDUjOy6NPnSP8V1c=.ddb4d2f9-f784-4fe2-9eb1-bb29349ecb55@github.com> Message-ID: <-dZ60_xB0xnIsH6YI7kFMQgtyaeLyYn60Ik0aK4ctzE=.66561a3c-2f68-40a2-a256-3f30b66ff444@github.com> On Wed, 5 Oct 2022 12:07:13 GMT, Aleksey Shipilev wrote: >> What is the problem with Awt2d? Other conflicts? > > I am not completely sure all `misleading-indentation` warnings are fixed in Awt2d, this would require some more testing. I'd defer that to #10453. Awt2dLibraries.gmk in https://github.com/openjdk/jdk/pull/10453 seems more about clang if I'm not mistaken, while this change is about gcc. The JDK successfully builds on several platforms with this change. What else could go wrong? I'm asking because I'm not a build engineering expert at all. ------------- PR: https://git.openjdk.org/jdk/pull/10487 From shade at openjdk.org Wed Oct 5 13:54:10 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 5 Oct 2022 13:54:10 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in JDK [v2] In-Reply-To: <-dZ60_xB0xnIsH6YI7kFMQgtyaeLyYn60Ik0aK4ctzE=.66561a3c-2f68-40a2-a256-3f30b66ff444@github.com> References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> <1UQyX79zIVU7mGxkOTSULe7S7DZNDUjOy6NPnSP8V1c=.ddb4d2f9-f784-4fe2-9eb1-bb29349ecb55@github.com> <-dZ60_xB0xnIsH6YI7kFMQgtyaeLyYn60Ik0aK4ctzE=.66561a3c-2f68-40a2-a256-3f30b66ff444@github.com> Message-ID: <0vEUzzox7stDb-K4l3Tlj3p5dyUDCKYcm3LcJC9DAd0=.1d0d5f0b-ec4e-40d0-9e6f-7ffae1e9d875@github.com> On Wed, 5 Oct 2022 13:46:23 GMT, Raffaello Giulietti wrote: >> I am not completely sure all `misleading-indentation` warnings are fixed in Awt2d, this would require some more testing. I'd defer that to #10453. > > Awt2dLibraries.gmk in https://github.com/openjdk/jdk/pull/10453 seems more about clang if I'm not mistaken, while this change is about gcc. > The JDK successfully builds on several platforms with this change. > > What else could go wrong? I'm asking because I'm not a build engineering expert at all. This could fail the build on some toolchains. Cleanliness and least surprise: this PR changes the particular files, and so it should remove the warnings for those specific files. ------------- PR: https://git.openjdk.org/jdk/pull/10487 From rgiulietti at openjdk.org Wed Oct 5 14:06:21 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 14:06:21 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in core JDK libraries [v3] In-Reply-To: References: Message-ID: <61eXki6R0QjODAaLPVm1PrjNlPD5LCjbvzeG9Iz12o8=.8f33b181-7ced-4ed8-bdd2-037e43fa56ec@github.com> > This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: 8294456: Fix misleading-indentation warnings in JDK ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10487/files - new: https://git.openjdk.org/jdk/pull/10487/files/4581b7dd..7b455e5a Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10487&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10487&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10487.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10487/head:pull/10487 PR: https://git.openjdk.org/jdk/pull/10487 From rgiulietti at openjdk.org Wed Oct 5 14:06:24 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Wed, 5 Oct 2022 14:06:24 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in core JDK libraries [v2] In-Reply-To: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> References: <7giapr_DpXaQA6Y8-_wOpgpeFoxE_HlUWemRVVUapD8=.2d98a8d1-1802-4cda-9936-9c4eefd0f1d0@github.com> Message-ID: On Wed, 5 Oct 2022 10:02:49 GMT, Raffaello Giulietti wrote: >> This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. > > Raffaello Giulietti has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits: > > - 8294456: Fix misleading-indentation warnings in JDK > > Merge branch 'master' into JDK-8294456 > - 8294456: Fix misleading-indentation warnings in JDK Restored `misleading-indentation` warning in `Awt2dLibraries.gmk` ------------- PR: https://git.openjdk.org/jdk/pull/10487 From aivanov at openjdk.org Wed Oct 5 14:17:13 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 14:17:13 GMT Subject: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni [v2] In-Reply-To: References: Message-ID: On Mon, 26 Sep 2022 16:51:36 GMT, Michael Ernst wrote: >> 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni > > Michael Ernst has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: > > - Reinstate typos in Apache code that is copied into the JDK > - Merge ../jdk-openjdk into typos-typos > - Remove file that was removed upstream > - Fix inconsistency in capitalization > - Undo change in zlip > - Fix typos I agree with everyone who said the PR should be broken to smaller pieces so that it touches code / tests in one or two packages, modules. It would be easier to review, you would need to get an approval from reviewers in a one or two specific areas. At this time, this PR touches files in 11 areas according the number of labels which correspond to a specific mailing list where discussions for the area are held. ------------- PR: https://git.openjdk.org/jdk/pull/10029 From duke at openjdk.org Wed Oct 5 14:50:15 2022 From: duke at openjdk.org (ScientificWare) Date: Wed, 5 Oct 2022 14:50:15 GMT Subject: RFR: JDK-8292276 : Add named colors from CSS Color Module Level 4 [v23] In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 17:42:43 GMT, Alexey Ivanov wrote: >>> Shall I edit the subject of the issue to be more specific? ?Add named colors from CSS Color Module Level 4?? >> >> Yes, you may. Thanks. >> >>> ... please create a [CSR](https://wiki.openjdk.org/display/csr/Main) request for issue [JDK-8292276](https://bugs.openjdk.org/browse/JDK-8292276) with the correct fix version. This pull request cannot be integrated until the CSR request is approved. >> >> Do I need an access to JBS ? I don't have a JBS user account. > >> > Shall I edit the subject of the issue to be more specific? ?Add named colors from CSS Color Module Level 4?? >> >> Yes, you may. Thanks. > > I have updated the subject in JBS. Please edit the title of this PR accordingly. @aivanov-jdk A proposition to update the specification of `StyleSheet.stringToColor`. /** * Converts a color string such as "RED" or "#NNN", "#NNNN", "#NNNNNN", * "#NNNNNNNN" N digits in radix-16 or "rgb(r, g, b)" or * "rgba(r, g, b, a)" to a Color. *

* Note : This will only convert string colors using names or 3, 4, 6, 8 * digit hexadecimal notations as they are listed and described in * the CSS Color Module Level 4; * otherwise, it will return null. * This method is case-insensitive. *

* The following code defines instances of the same color : * {@snippet lang="java" : * import java.awt.Color; * import javax.swing.text.html.StyleSheet; * StyleSheet styleSheet = new StyleSheet(); * // An opaque lightseagreen * Color color1 = styleSheet.stringToColor("Lightseagreen"); * Color color2 = styleSheet.stringToColor("LIGHTSEAGREEN"); * Color color3 = styleSheet.stringToColor("rgb(32 178 170)"); * Color color4 = styleSheet.stringToColor("#20b2aa"); * // A slightly-transparent lightseagreen * Color color5 = styleSheet.stringToColor("rgba(32 178 170 0.8)"); * Color color6 = styleSheet.stringToColor("#20b2aacc"); * } *

* @param string color, string such as "RED" or "#NNNNNNNN" or * "rgb(r, g, b)" or "rgba(r, g, b, a)" * @return the color */ ------------- PR: https://git.openjdk.org/jdk/pull/9825 From shade at openjdk.org Wed Oct 5 15:05:22 2022 From: shade at openjdk.org (Aleksey Shipilev) Date: Wed, 5 Oct 2022 15:05:22 GMT Subject: RFR: 8294456: Fix misleading-indentation warnings in core JDK libraries [v3] In-Reply-To: <61eXki6R0QjODAaLPVm1PrjNlPD5LCjbvzeG9Iz12o8=.8f33b181-7ced-4ed8-bdd2-037e43fa56ec@github.com> References: <61eXki6R0QjODAaLPVm1PrjNlPD5LCjbvzeG9Iz12o8=.8f33b181-7ced-4ed8-bdd2-037e43fa56ec@github.com> Message-ID: On Wed, 5 Oct 2022 14:06:21 GMT, Raffaello Giulietti wrote: >> This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. > > Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: > > 8294456: Fix misleading-indentation warnings in JDK Marked as reviewed by shade (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10487 From aivanov at openjdk.org Wed Oct 5 16:32:22 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 16:32:22 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Tue, 4 Oct 2022 18:48:19 GMT, Alexey Ivanov wrote: >>> > Out of curiosity, can this test use `BufferedImage` to render `JInternalFrame` into? >>> >>> @aivanov-jdk Thank you for reviewing. I wanted to clarify whether you meant saving just the JInternalFrame into BufferedImage? >> >> Yes, just `JInternalFrame`. Yet I was talking about rendering rather than capturing from the screen. > >> @aivanov-jdk Regarding saving the screen capture - >> >> When JIF bounds are used, a partial image of JInternalFrame (JIF) is saved. Hence I'm using the entire outer JFrame bounds to capture the screenshot. > > Could be? It shouldn't. Anyway, I have no problem with capturing the entire `JFrame`. > >> >> For the screenCapture I wanted to use **BufferedImage's getScaledInstance()** to create the scaled version (code snippet below), but experiencing issues while saving it. Currently I'm scaling the original image and re-drawing it using graphics object. > > This is definitely not what we want. It just up-scales or down-scales the current image stored in `BufferedImage`. > > When you run in a HiDPI environment or with `uiScale` set explicitly to a value greater than 1.0, the number of pixels is higher. `Robot.createScreenCapture` up-scales the passed in rectangle, captures all the pixels and then down-scales the captured screenshot to the user's space coordinates. > > At the same time, [`createMultiResolutionScreenCapture`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Robot.html#createScreenCapture(java.awt.Rectangle)) returns a `MultiResolutionImage` which contains two variants: (1) the base image with the user specified size, down-scaled from the screen; (2) native resolution image with the device size pixels. The second variant will preserve all the pixels seen on the screen. > @aivanov-jdk The extra pixel seems to be added due to JInternalFrame titlebar and not from the paintBorder() code changes. Good then. It's not from the border. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From darcy at openjdk.org Wed Oct 5 16:39:32 2022 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 5 Oct 2022 16:39:32 GMT Subject: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v9] In-Reply-To: References: Message-ID: > With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. > > Updates were made using a shell script. I"ll run a copyright updater before any push. Joe Darcy 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 12 additional commits since the last revision: - Merge branch 'master' into JDK-8294618 - Update accessibility URLs. - Merge branch 'master' into JDK-8294618 - Update make directory. - Update doc directory files. - Update hg URLs to git. - Merge branch 'master' into JDK-8294618 - http -> https - Undo manpage update. - Update copyright. - ... and 2 more: https://git.openjdk.org/jdk/compare/8aa24fec...eba2bd4b ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10501/files - new: https://git.openjdk.org/jdk/pull/10501/files/4055f1a6..eba2bd4b Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10501&range=07-08 Stats: 1452 lines in 87 files changed: 912 ins; 312 del; 228 mod Patch: https://git.openjdk.org/jdk/pull/10501.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10501/head:pull/10501 PR: https://git.openjdk.org/jdk/pull/10501 From darcy at openjdk.org Wed Oct 5 16:52:27 2022 From: darcy at openjdk.org (Joe Darcy) Date: Wed, 5 Oct 2022 16:52:27 GMT Subject: Integrated: JDK-8294618: Update openjdk.java.net => openjdk.org In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 00:33:57 GMT, Joe Darcy wrote: > With the domain change from openjdk.java.net to openjdk.org, references to URLs in the sources should be updated. > > Updates were made using a shell script. I"ll run a copyright updater before any push. This pull request has now been integrated. Changeset: 536c9a51 Author: Joe Darcy URL: https://git.openjdk.org/jdk/commit/536c9a512ea90d97a1ae5310453410d55db98bdd Stats: 128 lines in 45 files changed: 0 ins; 0 del; 128 mod 8294618: Update openjdk.java.net => openjdk.org Reviewed-by: mikael, iris, joehw, prr, ihse ------------- PR: https://git.openjdk.org/jdk/pull/10501 From aivanov at openjdk.org Wed Oct 5 17:06:25 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 17:06:25 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v7] In-Reply-To: <5LBhU0Tkp2GngUkCt1tAAEe1f8qxzP2I4CVMAQhW8zw=.9c520957-5aa6-4431-83d5-0f76119e39b9@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <5LBhU0Tkp2GngUkCt1tAAEe1f8qxzP2I4CVMAQhW8zw=.9c520957-5aa6-4431-83d5-0f76119e39b9@github.com> Message-ID: On Tue, 4 Oct 2022 22:06:07 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > review changes Other that a couple of nits, it looks good to me. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 254: > 252: * > 253: * @param d number to be rounded > 254: * @return a {@code int} which is the rounded value of provided number Suggestion: * Rounds a double to the nearest integer. It rounds 0.5 down, * for example 1.5 is rounded to 1.0. * * @param d number to be rounded * @return the rounded value src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 257: > 255: */ > 256: private static int roundHalfDown(double d) > 257: { Suggestion: private static int roundHalfDown(double d) { test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 42: > 40: import javax.swing.SwingUtilities; > 41: import javax.swing.UIManager; > 42: import javax.imageio.ImageIO; `ImageIO` shouldn't have moved. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 81: > 79: private static final int BORDER_THICKNESS = 5; > 80: > 81: private static StringBuffer errorLog = new StringBuffer(); Suggestion: private static final StringBuffer errorLog = new StringBuffer(); IDE issues a warning that `errorLog` can be final and it should. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 89: > 87: > 88: private static Point iFrameLoc; > 89: private static int iFrameMaxX; I think `jFrameBounds` logically belongs in this block. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 105: > 103: robot = new Robot(); > 104: robot.setAutoDelay(200); > 105: uiScale =System.getProperty("sun.java2d.uiScale"); Suggestion: uiScale = System.getProperty("sun.java2d.uiScale"); A space is missing. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 178: > 176: || borderDirection.equals("LEFT"); > 177: boolean isHorizontal = borderDirection.equals("TOP") > 178: || borderDirection.equals("BOTTOM"); Suggestion: boolean isVertical = borderDirection.equals("RIGHT") || borderDirection.equals("LEFT"); boolean isHorizontal = borderDirection.equals("TOP") || borderDirection.equals("BOTTOM"); No need for additional space after `=` sign. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 222: > 220: createMRIScreenCapture(cornerLocation + "_uiScale" > 221: + uiScale + ".png"); > 222: errorLog.append("At uiScale: "+ uiScale + ", Red background color" Suggestion: errorLog.append("At uiScale: " + uiScale + ", Red background color" A space before `+`. test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 255: > 253: try { > 254: ImageIO.write(image, > 255: "png", new File(filename)); Wrapping is redundant now. ------------- Marked as reviewed by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Wed Oct 5 17:06:28 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 17:06:28 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v5] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Tue, 4 Oct 2022 19:39:23 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> review changes, saving a scaled version of image > > test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 229: > >> 227: jFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); >> 228: >> 229: JLabel scale = new JLabel("UI Scale: "+ uiScale); > > Suggestion: > > JLabel scale = new JLabel("UI Scale: " + uiScale); The space is still missing before `+`. Yes, there's space inside the string literal but it's inside, binary operators should still have spaces on either side. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Wed Oct 5 21:00:11 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 5 Oct 2022 21:00:11 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: > JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) > > The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. > > ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: test updated ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10274/files - new: https://git.openjdk.org/jdk/pull/10274/files/827a3484..2e3b7af1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=06-07 Stats: 49 lines in 2 files changed: 16 ins; 9 del; 24 mod Patch: https://git.openjdk.org/jdk/pull/10274.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10274/head:pull/10274 PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Wed Oct 5 21:15:18 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Wed, 5 Oct 2022 21:15:18 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> <2Ggd01dT_0gfaZs3dTxNyJk0p38CaWYYg_HnsaGBGJg=.7929cd84-78dc-4c21-80c4-770d4316b051@github.com> <0SIw07r--T4zF6fgkVRw0UY9qv0duIELblGCuxqcuZc=.f0d01224-6d2b-4e25-882b-cf0f0205004f@github.com> Message-ID: On Wed, 5 Oct 2022 16:28:40 GMT, Alexey Ivanov wrote: >>> @aivanov-jdk Regarding saving the screen capture - >>> >>> When JIF bounds are used, a partial image of JInternalFrame (JIF) is saved. Hence I'm using the entire outer JFrame bounds to capture the screenshot. >> >> Could be? It shouldn't. Anyway, I have no problem with capturing the entire `JFrame`. >> >>> >>> For the screenCapture I wanted to use **BufferedImage's getScaledInstance()** to create the scaled version (code snippet below), but experiencing issues while saving it. Currently I'm scaling the original image and re-drawing it using graphics object. >> >> This is definitely not what we want. It just up-scales or down-scales the current image stored in `BufferedImage`. >> >> When you run in a HiDPI environment or with `uiScale` set explicitly to a value greater than 1.0, the number of pixels is higher. `Robot.createScreenCapture` up-scales the passed in rectangle, captures all the pixels and then down-scales the captured screenshot to the user's space coordinates. >> >> At the same time, [`createMultiResolutionScreenCapture`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/Robot.html#createScreenCapture(java.awt.Rectangle)) returns a `MultiResolutionImage` which contains two variants: (1) the base image with the user specified size, down-scaled from the screen; (2) native resolution image with the device size pixels. The second variant will preserve all the pixels seen on the screen. > >> @aivanov-jdk The extra pixel seems to be added due to JInternalFrame titlebar and not from the paintBorder() code changes. > > Good then. It's not from the border. @aivanov-jdk In addition to review changes, the following changes were made to the test case: - To make the test more robust, corner check has been changed from corner pixel check to checking multiple pixels along the corner diagonals. - Added break statements to the loop to avoid appending multiple error messages. - Saving a single screenshot per uiScale after all the checks are done. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Wed Oct 5 21:50:14 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 5 Oct 2022 21:50:14 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Wed, 5 Oct 2022 21:00:11 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > test updated test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 226: > 224: robot.mouseMove(x, y); > 225: > 226: for (int i = 0; i < 5; i++) { Suggestion: for (int i = 0; i < BORDER_THICKNESS; i++) { Is it the intention? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From dnguyen at openjdk.org Wed Oct 5 23:29:22 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Wed, 5 Oct 2022 23:29:22 GMT Subject: RFR: 8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0 In-Reply-To: References: Message-ID: <2JMfR5LPnaps6mypICTmVJ06Wvz-aM8TZCUCGFtPfRI=.a2f95c1a-08e4-484d-b9bd-d2e2de8b7a93@github.com> On Mon, 26 Sep 2022 11:03:40 GMT, Tejesh R wrote: > Can we move the test file to one directory back as we are doing it in swing test fix. Means moving the test to Multscreen folder, instead of MultiScreenLocationTest.....? I second this. The test can sit inside the Multiscreen folder without the need for a subfolder to match the way new tests are added. > This test fails for me everytime at Robot.mouseMove test with/without fix at Screen #0(built-in display). I have built-in display as main display and external monitor. It is not moving forward to verify PixelColor with/without fix. I plugged in an external monitor aand had my built-in display as the main display and can confirm that the test still fails every time I ran it (tested 5 times each) with and without the fix. I'm on macOS 12.3.1. ------------- PR: https://git.openjdk.org/jdk/pull/10363 From jdv at openjdk.org Thu Oct 6 05:26:52 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Thu, 6 Oct 2022 05:26:52 GMT Subject: Integrated: 8278086: [REDO] ImageIO.write() method will throw IndexOutOfBoundsException In-Reply-To: References: Message-ID: On Mon, 26 Sep 2022 06:45:58 GMT, Jayathirth D V wrote: > This is redo of https://bugs.openjdk.org/browse/JDK-8262297 > In https://bugs.openjdk.org/browse/JDK-8262297 we added similar change but we didnt allow 15bpp image in BMP, because of which many tests which were using USHORT_555_RGB format were failing as reported at https://bugs.openjdk.org/browse/JDK-8278047 > > There is ambiguity on whether we should support 15bpp BMP encoding also or not as captured in JBS : https://bugs.openjdk.org/browse/JDK-8278086?focusedCommentId=14521952&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14521952 > > Since adding tighter condition to only allow 0, 1, 4, 8, 16, 24 and 32 bpp is causing many failures. I have modified the check to allow 15bpp also. This pull request has now been integrated. Changeset: 6029120a Author: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/6029120a5f53061f386d5dc72c76adf03ab28840 Stats: 93 lines in 2 files changed: 89 ins; 1 del; 3 mod 8278086: [REDO] ImageIO.write() method will throw IndexOutOfBoundsException Co-authored-by: Masanori Yano Reviewed-by: tr, prr ------------- PR: https://git.openjdk.org/jdk/pull/10419 From jdv at openjdk.org Thu Oct 6 05:43:40 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Thu, 6 Oct 2022 05:43:40 GMT Subject: RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion In-Reply-To: References: Message-ID: <6RXQGQBrVG3wZWwwXcAyLYPvU5lvVnvE4k3YKk3lC5Y=.75295909-c280-4b0b-90e8-27117ae537b2@github.com> On Mon, 3 Oct 2022 22:05:14 GMT, Sergey Bylokhov wrote: > > I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() where we are allocating upfront memory based on parameters from metadata. > > Probably it is possible to create a small test just for this change? Thanks for your review Sergey. If i need to add tests for staggered read in this PR i need to create 3 different byte streams to capture all the scenarios and these streams will not be related to this bug. I just added staggered read approach in readMetadata() as it is now time tested and acts as a barrier for corrupt header parameters. ------------- PR: https://git.openjdk.org/jdk/pull/10536 From jdv at openjdk.org Thu Oct 6 05:47:40 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Thu, 6 Oct 2022 05:47:40 GMT Subject: Integrated: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 13:59:25 GMT, Jayathirth D V wrote: > In https://bugs.openjdk.org/browse/JDK-8270915 we have a valid GIF image which was generated using a third party app, but it contains large amount of Metadata(numerous Application extension blocks). > > Also GIFImageReader doesn't use ignoreMetadata flag set by user while reading Metadata which causes heavy memory usage in this scenario. We need to provide support for ignoring metadata in GIFImageReader, so readMetadata() is updated to use the "ignoreMetadata" flag and ignore all blocks except "Image Descriptor" and "Graphics Control Extension". > > I have updated readMedata() to also use ReaderUtil.staggeredReadByteStream() where we are allocating upfront memory based on parameters from metadata. Also this PR has small refactoring of import statements. > > To replicate the bug we need byte stream with large amount of valid metadata, so i am not able to add regression test case. I have run all javax/imageio jtreg tests and there are no issues. This pull request has now been integrated. Changeset: 8c15f77a Author: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/8c15f77abac0beb7f39a90fdfc5efb245b09ca32 Stats: 88 lines in 1 file changed: 39 ins; 10 del; 39 mod 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion Reviewed-by: prr ------------- PR: https://git.openjdk.org/jdk/pull/10536 From rgiulietti at openjdk.org Thu Oct 6 09:35:09 2022 From: rgiulietti at openjdk.org (Raffaello Giulietti) Date: Thu, 6 Oct 2022 09:35:09 GMT Subject: Integrated: 8294456: Fix misleading-indentation warnings in core JDK libraries In-Reply-To: References: Message-ID: On Thu, 29 Sep 2022 13:11:03 GMT, Raffaello Giulietti wrote: > This fixes misleading indentations, which allows enabling the (currently disabled) `misleading-indentation` warning flag on two `.gmk` files. This pull request has now been integrated. Changeset: 2ceebf68 Author: Raffaello Giulietti URL: https://git.openjdk.org/jdk/commit/2ceebf681ffd6f9bf6967fd81b30d721bc010b94 Stats: 8 lines in 3 files changed: 1 ins; 1 del; 6 mod 8294456: Fix misleading-indentation warnings in core JDK libraries Reviewed-by: shade, rriggs, iris, darcy ------------- PR: https://git.openjdk.org/jdk/pull/10487 From honkar at openjdk.org Thu Oct 6 14:15:28 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 6 Oct 2022 14:15:28 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Wed, 5 Oct 2022 21:44:45 GMT, Alexey Ivanov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> test updated > > test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 226: > >> 224: robot.mouseMove(x, y); >> 225: >> 226: for (int i = 0; i < 5; i++) { > > Suggestion: > > for (int i = 0; i < BORDER_THICKNESS; i++) { > > Is it the intention? Yes, that is correct. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Thu Oct 6 14:15:29 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 6 Oct 2022 14:15:29 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Wed, 5 Oct 2022 21:49:10 GMT, Harshitha Onkar wrote: >> test/jdk/javax/swing/JInternalFrame/InternalFrameBorderTest.java line 226: >> >>> 224: robot.mouseMove(x, y); >>> 225: >>> 226: for (int i = 0; i < 5; i++) { >> >> Suggestion: >> >> for (int i = 0; i < BORDER_THICKNESS; i++) { >> >> Is it the intention? > > Yes, that is correct. Will you update it to use `BORDER_THICKNESS`? ------------- PR: https://git.openjdk.org/jdk/pull/10274 From prappo at openjdk.org Thu Oct 6 14:35:20 2022 From: prappo at openjdk.org (Pavel Rappo) Date: Thu, 6 Oct 2022 14:35:20 GMT Subject: RFR: 8294377: Prepare to stop auto-inheriting documentation for subclasses of exceptions whose documentation is inherited [v2] In-Reply-To: References: Message-ID: On Fri, 30 Sep 2022 19:15:17 GMT, Phil Race wrote: > If the docs end up the same as you say that is fine by me since for the two ImageIO classes that seems to be what we'd want. Since this change does not affect HTML pages for java.desktop, I take it as "approved". > But inheritDoc behaviour is still "surprising". I've never been sure I understood it and now I'm just sure I don't. > > 1. The two ImageIO methods don't have @OverRide or _anything_ and yet javadoc infers > they'd want to inherit the docs from the interface .. clever javadoc .. I guess I can see > that some doc is better than none so this is OK > 2. When it does inherit I'd expected that it copies the EXACT and ENTIRE javadoc > from the super-interface, which for your change to work can't be all its doing. > You've added JUST > /** > > * @throws SomeExceptionSubType blah-blah > */ > > and yet javadoc somehow figures out this is to be ADDED to the super-type doc for the method and not replace it .. ??? > > 3. What the old code was doing seems to me to be "natural" to the extent any of > this does and the fix you are preparing would add to the surprising behaviours .. Let me try to clarify exception documentation inheritance for you. A method **never** inherits exception documentation unless that method explicitly requests to do so. A method that wants to inherit documentation for a particular exception has two options: use a doc comment or use a method declaration. Let's see how those options work. Suppose, a method wants to inherit documentation for an exception `X`. To inherit documentation through a doc comment, the method adds the following exception tag (`@throws` or `@exception`) to that method's doc comment: ? @throws X {@inheritDoc} To inherit documentation through a method declaration, the method lists `X` in that method's `throws` clause: ? throws ..., X, ... If a method chooses neither of those options, then that method won't inherit exception documentation for `X` (assuming that exception documentation for `X` exists in the supermethod). Here's an informal, simplified, but conceptually correct version of the algorithm that javadoc uses to document exceptions thrown by a method: Step 1. For each exception tag, do the following. If an exception tag does not have `{@inheritDoc}` in its description, add an entry for the exception that this tag describes to the "Throws:" section. Otherwise, look for corresponding documentation in the supermethod, to which apply this step (Step 1) recursively. Step 2. For each exception from the `throws` clause, do the following. If an exception has not been documented on the previous step, document it using corresponding documentation in the supermethod, to which apply this algorithm (both steps in order) recursively. A few notes on the algorithm: * Exception tags are examined prior to the `throws` clause. This allows a method to **override** documentation that could be otherwise inherited from the supermethod: if the method provides exception tags for a particular exception, then documentation for that exception will be found on Step 1 and, hence, won't be looked for in the supermethod on Step 2. ? @throws X * If a method wants to **add** documentation for a particular exception, rather than **override** it, the method should both add documentation and inherit it using tags: ? @throws X ? @throws X {@inheritDoc} The above model might explain a common **misconception** according to which methods inherit documentation for checked exceptions and do not inherit it for unchecked exceptions. In reality, javadoc treats all exceptions equally. It's just that if a method throws a checked exception, that exception (or its superclass) must be listed in that method's `throws` clause. Now, if such an exception is not documented by that method but documented by the supermethod, that exception documentation is inherited. That gives a false impression that the documentation is inherited because the exception is checked. In fact, the documentation would still be inherited if that exception, listed in the `throws` clause, were unchecked. The above is how it has been working (barring bugs) since documentation comment inheritance appeared in its current form. Implicit inheritance (filling in missing text) appeared in JDK 1.3, explicit inheritance (`{@inheritDoc}`) appeared in JDK 1.4, auto-inheriting documentation for subclasses of exceptions whose documentation is inherited (JDK-4947455) appeared in JDK 5. Back to this PR change in `java.desktop`. `ImageInputStreamImpl.readBoolean` inherits `EOFException` documentation not because that method doesn't have a doc comment of its own and, thus, inherits "the exact and entire" doc comment from its supermethod (`ImageInputStream.readBoolean`). It's because that when the algorithm reaches Step 2 and tries to find documentation for `IOException` (because it is listed in the `throws` clause), JDK-4947455 kicks in. And JDK-4947455 says that if a method inherits documentation for a particular exception, it should also inherit documentation for that exception's subclasses. So, javadoc goes ahead and inherits documentation for `IOException`, because it's a direct match, and for `EOFException`, because it's a subclass of `IOException`. To inherit `EOFException` documentation after JDK-4947455 has been reverted and, thus, the subclassing :magic_wand: has gone, `ImageInputStreamImpl.readBoolean` has two options: * list `EOFException` in the `throws` clause * `@throws EOFException {@inheritDoc}` Thanks to the current implementation of documentation inheritance, any of the above can be done **before** JDK-4947455 is reverted. For now doing so just adds a redundant but harmless inheritance route, which will become the only route in time. For this PR to be less disruptive and qualify as "noreg-doc" I chose to add an exception tag rather than amend the `throws` clause. I hope that my reply clarifies the matter. Documentation inheritance can be surprising. We're trying hard to capture its model and simplify it where possible. We are constantly improving the Documentation Comment Specification for the Standard Doclet[^1] (spec), but since documentation inheritance is a popular topic which is often misunderstood, along with improving the spec in this area, we might also provide a less formal document dedicated to documentation inheritance. [^1]: https://docs.oracle.com/en/java/javase/19/docs/specs/javadoc/doc-comment-spec.html ------------- PR: https://git.openjdk.org/jdk/pull/10449 From jjg at openjdk.org Thu Oct 6 15:05:56 2022 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 6 Oct 2022 15:05:56 GMT Subject: RFR: 8294377: Prepare to stop auto-inheriting documentation for subclasses of exceptions whose documentation is inherited [v2] In-Reply-To: References: Message-ID: On Tue, 27 Sep 2022 12:14:23 GMT, Pavel Rappo wrote: >> This adds exception documentation to JDK methods that would otherwise lose that documentation once JDK-8287796 is integrated. While adding this exception documentation now does not change [^1] the JDK API Documentation, it will automatically counterbalance the effect that JDK-8287796 will have. >> >> JDK-8287796 seeks to remove an old, undocumented, and esoteric javadoc feature that cannot be suppressed [^2]. The feature is so little known about that IDEs either do not implement it correctly or do not implement it at all, thus rendering documentation differently from how the javadoc tool renders it. >> >> That feature was introduced in JDK-4947455 and manifests as follows. If a method inherits documentation for an exception, along with that documentation the method automatically inherits documentation for all exceptions that are subclasses of that former exception and are documented in an overridden method. >> >> To illustrate that behavior, consider the following example. A method `Subtype.m` inherits documentation for `SuperException`, while the overridden method `Supertype.m` documents `SuperException`, `SubExceptionA` and `SubExceptionB`, where the latter two exceptions are subclasses of the former exception: >> >> public class Subtype extends Supertype { >> >> @Override >> public void m() throws SuperException { >> ... >> >> public class Supertype { >> >> /** >> * @throws SuperException general problem >> * @throws SubExceptionA specific problem A >> * @throws SubExceptionB specific problem B >> */ >> public void m() throws SuperException { >> ... >> >> public class SuperException extends Exception { >> ... >> >> public class SubExceptionA extends SuperException { >> ... >> >> public class SubExceptionB extends SuperException { >> ... >> >> For the above example, the API Documentation for `Subtype.m` will contain documentation for all three exceptions; the page fragment for `Subtype.m` in "Method Details" will look like this: >> >> public void m() >> throws SuperException >> >> Overrides: >> m in class Supertype >> Throws: >> SuperException - general problem >> SubExceptionA - specific problem A >> SubExceptionB - specific problem B >> >> It works for checked and unchecked exceptions, for methods in classes and interfaces. >> >> >> If it's the first time you hear about that behavior and this change affects your area, it's a good opportunity to reflect on whether the exception documentation this change adds is really needed or you were simply unaware of the fact that it was automatically added before. If exception documentation is not needed, please comment on this PR. Otherwise, consider approving it. >> >> Keep in mind that if some exception documentation is not needed, **leaving it out** from this PR might require a CSR. >> >> >> [^1]: Aside from insignificant changes on class-use and index pages. There's one relatively significant change. This change is in jdk.jshell, where some methods disappeared from "Methods declared in ..." section and other irregularities. We are aware of this and have filed JDK-8291803 to fix the root cause. >> [^2]: In reality, the feature can be suppressed, but it looks like a bug rather than intentional design. If we legitimize the feature and its suppression behavior, the model for exception documentation inheritance might become much more complicated. > > Pavel Rappo has updated the pull request incrementally with one additional commit since the last revision: > > revert an extraneous change to jdk.javadoc I'm marking the change as approved, in terms of the cumulative efforts of those who have commented. I've browsed all the changes and read the jshell files in more detail, since no once else has so far. I understand the reason for the change, and generally approve of undoing the magic of the old feature in JDK-8287796. That being said, the proposed state is "not great", and feels like the interim stage of "one step back, to take two steps forward", even though I do not have a good sense at this time of what that future direction might be. So, looks OK for now, but I hope we revisit this issue again sometime. Thanks, in general, for taking on this topic. ------------- Marked as reviewed by jjg (Reviewer). PR: https://git.openjdk.org/jdk/pull/10449 From aivanov at openjdk.org Thu Oct 6 15:08:26 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 6 Oct 2022 15:08:26 GMT Subject: RFR: 8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0 In-Reply-To: <2JMfR5LPnaps6mypICTmVJ06Wvz-aM8TZCUCGFtPfRI=.a2f95c1a-08e4-484d-b9bd-d2e2de8b7a93@github.com> References: <2JMfR5LPnaps6mypICTmVJ06Wvz-aM8TZCUCGFtPfRI=.a2f95c1a-08e4-484d-b9bd-d2e2de8b7a93@github.com> Message-ID: On Wed, 5 Oct 2022 23:22:28 GMT, Damon Nguyen wrote: > > Can we move the test file to one directory back as we are doing it in swing test fix. Means moving the test to Multscreen folder, instead of MultiScreenLocationTest.....? > > I second this. The test can sit inside the Multiscreen folder without the need for a subfolder to match the way new tests are added. I prefer leaving the test at its original location. It's not a new test, it has a history in CI. Although, if everyone else thinks the test should be moved up, it's okay with me. Previously, each test had its own folder. Now, we tend to use flatter structure. ------------- PR: https://git.openjdk.org/jdk/pull/10363 From honkar at openjdk.org Thu Oct 6 15:47:21 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Thu, 6 Oct 2022 15:47:21 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Thu, 6 Oct 2022 14:13:25 GMT, Alexey Ivanov wrote: >> Yes, that is correct. > > Will you update it to use `BORDER_THICKNESS`? @aivanov-jdk I was waiting on testing results to make the final update along with the above change. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From duke at openjdk.org Thu Oct 6 16:06:56 2022 From: duke at openjdk.org (Martin Desruisseaux) Date: Thu, 6 Oct 2022 16:06:56 GMT Subject: Integrated: 8290973: In AffineTransform, equals(Object) is inconsistent with hashCode() In-Reply-To: References: Message-ID: On Fri, 10 Jun 2022 09:39:48 GMT, Martin Desruisseaux wrote: > `AffineTransform.equals(Object)` and `hashCode()` break two contracts: > > * `A.equals(A)` returns `false` if at least one affine transform coefficient is NaN. > * `A.equals(B)` should imply `A.hashCode() == B.hashCode()`, but it is not the case if a coefficient is zero with an opposite sign in A and B. > > This patch preserves the current behaviour regarding 0 (i.e. -0 is considered equal to +0) for backward compatibility reason. Instead the `hashCode()` method is updated for being consistent with `equals(Object)` behaviour. This pull request has now been integrated. Changeset: 5c030ccc Author: Martin Desruisseaux Committer: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/5c030cccae6cd7862b7ecc563fde4b7670f25c10 Stats: 108 lines in 2 files changed: 100 ins; 0 del; 8 mod 8290973: In AffineTransform, equals(Object) is inconsistent with hashCode() Reviewed-by: prr ------------- PR: https://git.openjdk.org/jdk/pull/9121 From dnguyen at openjdk.org Thu Oct 6 16:11:29 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Thu, 6 Oct 2022 16:11:29 GMT Subject: Integrated: 8293672: Update freetype md file In-Reply-To: References: Message-ID: On Tue, 4 Oct 2022 17:32:23 GMT, Damon Nguyen wrote: > Update the freetype md file with the newly generated md file. The new format slightly differs from the previous version when separating different licenses. Added logic for combining of copyright lines and support for other licenses such as MIT. This pull request has now been integrated. Changeset: fef345b1 Author: Damon Nguyen Committer: Phil Race URL: https://git.openjdk.org/jdk/commit/fef345b19f74f5d706b173b1af87bcda98dc6ff2 Stats: 95 lines in 1 file changed: 54 ins; 13 del; 28 mod 8293672: Update freetype md file Reviewed-by: prr ------------- PR: https://git.openjdk.org/jdk/pull/10561 From dnguyen at openjdk.org Thu Oct 6 23:27:24 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Thu, 6 Oct 2022 23:27:24 GMT Subject: RFR: 8294807: Fix typos and clarify javadoc for SunToolKit.realsSync In-Reply-To: <5GlfDtRnHLa7PIslOaYDEg8g0M2oB2-YNAatMtJbDWU=.6d381cb4-c329-4b83-a5d6-29dc96521edb@github.com> References: <5GlfDtRnHLa7PIslOaYDEg8g0M2oB2-YNAatMtJbDWU=.6d381cb4-c329-4b83-a5d6-29dc96521edb@github.com> Message-ID: On Tue, 4 Oct 2022 20:23:28 GMT, Alexey Ivanov wrote: >> I fixed the typo ?serie? ? "series" which was highlighted by a spellchecker. >> >> I also simplified the description, fixed the grammar, added `{@code}` around types, added link to `requestFocus` in the example. > > src/java.desktop/share/classes/sun/awt/SunToolkit.java line 1451: > >> 1449: * >> 1450: *

This method allows writing tests without explicit timeouts >> 1451: * or waiting for some event. Example: > > Should it be ?without _using_ ? or waiting ??? > Does ?for an event? sound better? In my opinion, "without using ... or waiting ..." seems better to match the tense of "waiting" to show more clearly what the "or" is intended for (assuming the OR is meant for the explicit timeouts and the waiting for an event). Otherwise, the "or" may be confused to be between "writing ... or waiting ...". For the "event" portion, I think either here is OK. I don't think either would cause confusion and both sound reasonable. ------------- PR: https://git.openjdk.org/jdk/pull/10563 From serb at openjdk.org Fri Oct 7 00:11:24 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 7 Oct 2022 00:11:24 GMT Subject: RFR: 8293984: Unnecessary Vector usage in PropertyEditorSupport In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 06:55:50 GMT, Andrey Turbanov wrote: > Field PropertyEditorSupport.listeners is accessed only under `synchronized(this)`. > It means extra synchronization by Vector is not needed. src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java line 301: > 299: @SuppressWarnings("unchecked") > 300: private ArrayList unsafeClone(ArrayList v) { > 301: return (ArrayList)v.clone(); I think this can be simplified by using the new list in place of "unsafeClone". ------------- PR: https://git.openjdk.org/jdk/pull/10331 From serb at openjdk.org Fri Oct 7 02:03:28 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 7 Oct 2022 02:03:28 GMT Subject: RFR: 8292280: Unused field 'keyListener' in BasicRadioButtonUI [v2] In-Reply-To: References: Message-ID: <8f3uOVdQYVeRlnnH033dT5BzUb0pYCCzHbY_H6vrIyc=.6db1a9c7-72d2-4d0c-a045-747c0d98ca90@github.com> On Sun, 21 Aug 2022 21:40:43 GMT, Andrey Turbanov wrote: >> Field `keyListener` was added under [JDK-8033699](https://bugs.openjdk.org/browse/JDK-8033699). But then all its usages were removed in [JDK-8249548](https://bugs.openjdk.org/browse/JDK-8249548) > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8292280: Unused field 'keyListener' in BasicRadioButtonUI > > reverted unrelated changes Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/9832 From serb at openjdk.org Fri Oct 7 02:09:34 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 7 Oct 2022 02:09:34 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Wed, 5 Oct 2022 21:00:11 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > test updated src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 256: > 254: * @return the rounded value > 255: */ > 256: private static int roundHalfDown(double d) { The sun.java2d.pipe.Region#clipRound() seems have the same purpose, but it also clip the double to int. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From psadhukhan at openjdk.org Fri Oct 7 03:05:34 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 03:05:34 GMT Subject: Integrated: 6852577: Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null In-Reply-To: References: Message-ID: On Fri, 26 Aug 2022 04:47:08 GMT, Prasanta Sadhukhan wrote: > Default echo character obtained through `PasswordField.echoChar` UIProperty returns null for Nimbus L&F, > which is fixed by adding the default character * in the UIDefault table. This pull request has now been integrated. Changeset: 37bd4fbe Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/37bd4fbe3031fd7793ab947e7f58aefd9c021c44 Stats: 78 lines in 3 files changed: 78 ins; 0 del; 0 mod 6852577: Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null Reviewed-by: tr, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/10035 From psadhukhan at openjdk.org Fri Oct 7 03:13:28 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 03:13:28 GMT Subject: Integrated: 8075916: The regression-swing case failed as colored text is not shown on disabled checkbox and radio button with Nimbus LAF In-Reply-To: <_Pu4ZIceztdCjw5gy3bOR39Y0Jvz_TEiHdGMN0rKu-M=.9843abff-48d9-4a66-95f3-198e897c1399@github.com> References: <_Pu4ZIceztdCjw5gy3bOR39Y0Jvz_TEiHdGMN0rKu-M=.9843abff-48d9-4a66-95f3-198e897c1399@github.com> Message-ID: On Tue, 6 Sep 2022 05:57:09 GMT, Prasanta Sadhukhan wrote: > CheckBox.disabledText and RadioButton.disabledText color UIProperty is not honoured by Nimbus L&F when disabled text is drawn for JCheckBox and JRadioButton, so disabled text color was rendered incorrectly. > Fix is to honour these UIProperty color if they are set by user, else use the color from the component or via getColorForState(). > > Closed test as mentioned in JBS is used to check the fix. This pull request has now been integrated. Changeset: f3a44a48 Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/f3a44a48359a4390b13549ce70de3a04710a1d21 Stats: 151 lines in 2 files changed: 151 ins; 0 del; 0 mod 8075916: The regression-swing case failed as colored text is not shown on disabled checkbox and radio button with Nimbus LAF Reviewed-by: tr, aivanov ------------- PR: https://git.openjdk.org/jdk/pull/10177 From serb at openjdk.org Fri Oct 7 04:32:28 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Fri, 7 Oct 2022 04:32:28 GMT Subject: RFR: 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo In-Reply-To: References: Message-ID: On Wed, 21 Sep 2022 08:03:24 GMT, Andrey Turbanov wrote: > Fields `methods`, `properties`, `eventSets` are not volatile and read multiple times. This makes it an incorrect DCL. Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10372 From psadhukhan at openjdk.org Fri Oct 7 04:57:00 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 04:57:00 GMT Subject: RFR: JDK-6229853: BasicTextAreaUI:create incompletely documents the possible returned View types [v5] In-Reply-To: References: Message-ID: > API specification says about BasicTextAreaUI.create "Returns a WrappedPlainView or PlainView". > But for [bidi](https://github.com/openjdk/jdk/blob/d14e96d9701dae951aa365029f58afb6687a646a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java#L168) text, this method returns BoxView and other views , so the documentation needs to be updated. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Javadoc update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10376/files - new: https://git.openjdk.org/jdk/pull/10376/files/4a1afda9..87f7e36c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10376&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10376&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10376.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10376/head:pull/10376 PR: https://git.openjdk.org/jdk/pull/10376 From psadhukhan at openjdk.org Fri Oct 7 04:57:03 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 04:57:03 GMT Subject: RFR: JDK-6229853: BasicTextAreaUI:create incompletely documents the possible returned View types [v4] In-Reply-To: <6lI70mIUrPlclGDoFcSYkYasrOBlCxX4irw_4rQrWjY=.a1d32e29-b521-4ea9-8ebb-42eca6c04d4a@github.com> References: <6lI70mIUrPlclGDoFcSYkYasrOBlCxX4irw_4rQrWjY=.a1d32e29-b521-4ea9-8ebb-42eca6c04d4a@github.com> Message-ID: <0vVsWLEr2vN4qqjhO8caxuHHiBueq_I0xDkewpDDurc=.bafa1986-d6bb-408c-a6eb-31cdaf5672fe@github.com> On Wed, 28 Sep 2022 12:23:59 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> javadoc fix > > src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextFieldUI.java line 86: > >> 84: >> 85: /** >> 86: * Creates a view based on an element. > > Should we use the wording from `BasicTextUI` for consistency? > > Suggestion: > > * Creates a view for an element. > > > The description in [`ViewFactory.create`](https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/javax/swing/text/ViewFactory.html#create(javax.swing.text.Element)) is more detailed, a short sentence as above is enough for `TextUI`. Seems ok for consistency.. Have updated the PR and CSR...Can you please review CSR https://bugs.openjdk.org/browse/JDK-8294114 ------------- PR: https://git.openjdk.org/jdk/pull/10376 From aturbanov at openjdk.org Fri Oct 7 06:23:32 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Fri, 7 Oct 2022 06:23:32 GMT Subject: Integrated: 8292280: Unused field 'keyListener' in BasicRadioButtonUI In-Reply-To: References: Message-ID: On Thu, 11 Aug 2022 06:53:16 GMT, Andrey Turbanov wrote: > Field `keyListener` was added under [JDK-8033699](https://bugs.openjdk.org/browse/JDK-8033699). But then all its usages were removed in [JDK-8249548](https://bugs.openjdk.org/browse/JDK-8249548) This pull request has now been integrated. Changeset: 2d25c0a3 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/2d25c0a31c608ecddaa084d795a060598b3e0589 Stats: 8 lines in 1 file changed: 0 ins; 7 del; 1 mod 8292280: Unused field 'keyListener' in BasicRadioButtonUI Reviewed-by: jdv, serb ------------- PR: https://git.openjdk.org/jdk/pull/9832 From duke at openjdk.org Fri Oct 7 07:35:06 2022 From: duke at openjdk.org (duke) Date: Fri, 7 Oct 2022 07:35:06 GMT Subject: Withdrawn: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Thu, 16 Jun 2022 15:01:12 GMT, Manukumar V S wrote: > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 machines. It seems to be a testbug as adding some stability improvements fix the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. I have removed the problem listing and tested it in windows platform also, it works fine there. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/9187 From psadhukhan at openjdk.org Fri Oct 7 08:40:42 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 08:40:42 GMT Subject: RFR: 7175396: The text on label is not painted red for Nimbus LaF. [v6] In-Reply-To: References: Message-ID: > Label.foreground UIProperty is not honored by Nimbus L&F. > Added support for setting JLabel foreground color for Nimbus L&F Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Set foreground in installDefaults ------------- Changes: - all: https://git.openjdk.org/jdk/pull/9900/files - new: https://git.openjdk.org/jdk/pull/9900/files/fd80f96a..af4cca92 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=9900&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9900&range=04-05 Stats: 14 lines in 1 file changed: 8 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/9900.diff Fetch: git fetch https://git.openjdk.org/jdk pull/9900/head:pull/9900 PR: https://git.openjdk.org/jdk/pull/9900 From psadhukhan at openjdk.org Fri Oct 7 08:40:43 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 08:40:43 GMT Subject: RFR: 7175396: The text on label is not painted red for Nimbus LaF. [v3] In-Reply-To: References: <4VvhgKSAGDnjWdmTfvaNCcTsSmOmCQR8UsYNOSmRO5w=.be1165bd-2d1f-44bc-8027-3ae9923617ce@github.com> <0L_qtZSknxD6lrlKTqn3f3U2WGYlCIIN2psEZ-dp0Yw=.6ae3b3ad-909d-4959-94ff-59759e79e799@github.com> Message-ID: On Thu, 29 Sep 2022 12:15:43 GMT, Alexey Ivanov wrote: >> There are 2 ways JLabel can be used, one via html label and another normal label. Normal label text will work if we do `g.setColor(fgColor)` but html label will use [StyleSheet.paint](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java#L1939) which does not take into account foreground Color (guess unless it's provided by html tags which is not the case here) so I need to explicitly set the foreground color of label > > Do other L&Fs respect the `Label.foreground` color if the label text contains HTML? > > Why is it set in each paint then? It should be set once in `installDefaults` and it should be removed in `uninstallDefaults`. In addition to that, it is to be installed if and only if `label.setForeground` is `null` or `instanceof UIResource`, and uninstalled if it is `instanceof UIResource`. If the user explicitly set foreground color of the label, it must not be overridden by the L&Fs. Fair point..Updated to set in installDefaults ------------- PR: https://git.openjdk.org/jdk/pull/9900 From psadhukhan at openjdk.org Fri Oct 7 08:54:29 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 08:54:29 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v2] In-Reply-To: References: Message-ID: <5Vher43DGbdGinN4oUvmYdj4iXSSLFACUqFPvOhpLT0=.7eaa0540-d7e7-45b9-8acb-242998fefafe@github.com> > DefaultListSelectionModel.removeIndexInterva accepts `int` value which allows it to take in Integer.MAX_VALUE theoratically but it does calculation with that value which can results in IOOBE. > Fix is to make sure the calculation stays within bounds. Prasanta Sadhukhan has updated the pull request incrementally with two additional commits since the last revision: - Test fix - Take care of integer overflow in setSelectionInterval ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10409/files - new: https://git.openjdk.org/jdk/pull/10409/files/94fdf905..e42f2afd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=00-01 Stats: 99 lines in 3 files changed: 59 ins; 39 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10409.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10409/head:pull/10409 PR: https://git.openjdk.org/jdk/pull/10409 From psadhukhan at openjdk.org Fri Oct 7 08:54:30 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 08:54:30 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v2] In-Reply-To: References: Message-ID: On Mon, 3 Oct 2022 16:07:15 GMT, Alexey Ivanov wrote: >>> To remove an index, I guess we need to first do setSelection where we will already throw IOOBE so I guess that's why this method does not mention or handle it explicitly >> >> It's not required by the implementation. >> >> >> selectionModel.setSelectionInterval(0, 1); >> selectionModel.removeIndexInterval(Integer.MIN_VALUE, -1); >> >> >> works ? that is the call to `removeIndexInterval` throws the `IndexOutOfBoundsException` because it tries to copy the bits in the removed interval. If `rmMinIndex` is negative, the implementation may throw IOOBE before doing other work as an optimisation or rely on it being thrown from the code below as it does now. >> >> Other methods specify the behaviour for negative parameters, this method would benefit from it too. > > I suggest amending `setSelectionInterval` to throw IOOBE if `Integer.MAX_VALUE` is passed. > > Then I suggest amending `removeIndexInterval` to throw IOOBE if a negative value is passed or an index is `Integer.MAX_VALUE`. Explicit handling of negative values could be an optimisation made in addition to handling `MAX_VALUE`. > > In both cases, the spec needs to be updated, and therefore the CSR will be required. I guess Integer.MAX_VALUE should be valid "int" value, its because of internal calculation which is causing it to overflow so I guess we should not update the spec for wrongful calculation. I have fixed the overflow in setSelectionInterval. ------------- PR: https://git.openjdk.org/jdk/pull/10409 From psadhukhan at openjdk.org Fri Oct 7 09:00:32 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 09:00:32 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: > javax.swing.text.AbstractDocument$BranchElement.replace(...) method throws an `ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative` when using an UndoManager on the default document of a JTextArea and you try to undo the insertion of a LEFT-TO-RIGHT language (e.g. Arabic) that is immediately followed by setting the component orientation on the JTextArea. > > This is because System.arrayCopy() is called with -ve length because of the calculation done in AbstractDocment.replace where `src` is of 2bytes because of unicode text causing `nmove` to become -ve if `nchildren` is 1 (an unicode character is inserted) > > System.arrayCopy throws `IndexOutOfBoundsException if: > > The srcPos argument is negative. > The destPos argument is negative. > The length argument is negative > > > so the fix is made to make nmove, src, dest +ve > Also, Element.getElement() can return null which is not checked, causing NPE, if deletion of text is done which results in no element, which is also fixed in the PR > > All jtreg testsuite tests are run without any regression. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Test fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10446/files - new: https://git.openjdk.org/jdk/pull/10446/files/c1020f15..8e07fdc3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10446&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10446&range=00-01 Stats: 198 lines in 2 files changed: 114 ins; 84 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/10446.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10446/head:pull/10446 PR: https://git.openjdk.org/jdk/pull/10446 From psadhukhan at openjdk.org Fri Oct 7 09:05:35 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 09:05:35 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: <2bRWmn9tz1W2Hc6L-EQgVmw7UzVz38XMGoo71uA1HEc=.6a744d13-98cd-4a9b-9a43-7bbc09ed7be1@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> <2bRWmn9tz1W2Hc6L-EQgVmw7UzVz38XMGoo71uA1HEc=.6a744d13-98cd-4a9b-9a43-7bbc09ed7be1@github.com> Message-ID: <2Yg2YfWHVULkQ5Flrxs-BHGIhx5Ej7ebbyR6D2SeKa0=.b035c42c-9966-4f41-9cc2-8aa0f72a1571@github.com> On Mon, 3 Oct 2022 11:20:17 GMT, Alexey Ivanov wrote: >> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: >> >> Test fix > > src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java line 958: > >> 956: int index = bidiRoot.getElementIndex(p0); >> 957: Element bidiElem = bidiRoot.getElement(index); >> 958: if (bidiElem != null && bidiElem.getEndOffset() >= p1) { > > Is it possible that `bidiElem` is `null`? It should never be. If it is, it is a bug in the code and throwing NPE seems good ? it will be the indication of the bug. > > Since the NPE has never been thrown from this code, I'd rather leave it unchanged here. `getElement()` can return null [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2619) and [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2398) so it should not be enitrely impossible not to get null, so it should be a ok > test/jdk/javax/swing/text/AbstractDocument/TestUndoError.java line 39: > >> 37: import javax.swing.undo.UndoManager; >> 38: >> 39: public class TestUndoError { > > `TestUndoInsertArabicText`? It's more specific this way. ok ------------- PR: https://git.openjdk.org/jdk/pull/10446 From psadhukhan at openjdk.org Fri Oct 7 09:08:37 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 09:08:37 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v3] In-Reply-To: References: Message-ID: > DefaultListSelectionModel.removeIndexInterva accepts `int` value which allows it to take in Integer.MAX_VALUE theoratically but it does calculation with that value which can results in IOOBE. > Fix is to make sure the calculation stays within bounds. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: test fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10409/files - new: https://git.openjdk.org/jdk/pull/10409/files/e42f2afd..b70c6ad7 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=01-02 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10409.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10409/head:pull/10409 PR: https://git.openjdk.org/jdk/pull/10409 From psadhukhan at openjdk.org Fri Oct 7 09:14:16 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 7 Oct 2022 09:14:16 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: On Fri, 7 Oct 2022 09:00:32 GMT, Prasanta Sadhukhan wrote: >> javax.swing.text.AbstractDocument$BranchElement.replace(...) method throws an `ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative` when using an UndoManager on the default document of a JTextArea and you try to undo the insertion of a LEFT-TO-RIGHT language (e.g. Arabic) that is immediately followed by setting the component orientation on the JTextArea. >> >> This is because System.arrayCopy() is called with -ve length because of the calculation done in AbstractDocment.replace where `src` is of 2bytes because of unicode text causing `nmove` to become -ve if `nchildren` is 1 (an unicode character is inserted) >> >> System.arrayCopy throws `IndexOutOfBoundsException if: >> >> The srcPos argument is negative. >> The destPos argument is negative. >> The length argument is negative >> >> >> so the fix is made to make nmove, src, dest +ve >> Also, Element.getElement() can return null which is not checked, causing NPE, if deletion of text is done which results in no element, which is also fixed in the PR >> >> All jtreg testsuite tests are run without any regression. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix test/jdk/javax/swing/text/AbstractDocument/TestUndoInsertArabicText.java line 38: > 36: import javax.swing.undo.UndoManager; > 37: > 38: public class TestUndoInsertArabicText { Updated test to test insertion and undoing at beginning and middle, in addition to end of text ------------- PR: https://git.openjdk.org/jdk/pull/10446 From aivanov at openjdk.org Fri Oct 7 12:47:25 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 7 Oct 2022 12:47:25 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: <2Yg2YfWHVULkQ5Flrxs-BHGIhx5Ej7ebbyR6D2SeKa0=.b035c42c-9966-4f41-9cc2-8aa0f72a1571@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> <2bRWmn9tz1W2Hc6L-EQgVmw7UzVz38XMGoo71uA1HEc=.6a744d13-98cd-4a9b-9a43-7bbc09ed7be1@github.com> <2Yg2YfWHVULkQ5Flrxs-BHGIhx5Ej7ebbyR6D2SeKa0=.b035c42c-9966-4f41-9cc2-8aa0f72a1571@github.com> Message-ID: On Fri, 7 Oct 2022 09:01:35 GMT, Prasanta Sadhukhan wrote: > `getElement()` can return null [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2619) and [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2398) so it should not be enitrely impossible not to get null, so it should be a ok I know it is possible _theoretically_. My point is for a valid offset in the document, this particular line must _never_ return `null`. If it does, the element tree is invalid. As such, we should rather catch the case of bad bidi element tree by throwing NPE rather than pretending nothing bad happened. `BidiRootElement` is a `BranchElement`: https://github.com/openjdk/jdk/blob/096bca4a9c5e8ac2668dd965df92153ea1d80add/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2700-L2713 And [`BranchElement.getElementIndex`](https://github.com/openjdk/jdk/blob/096bca4a9c5e8ac2668dd965df92153ea1d80add/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2416-L2474) always returns a *valid* index. So, I am against adding the `null`-check. It is not necessary here. ------------- PR: https://git.openjdk.org/jdk/pull/10446 From aivanov at openjdk.org Fri Oct 7 12:50:09 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 7 Oct 2022 12:50:09 GMT Subject: RFR: JDK-6229853: BasicTextAreaUI:create incompletely documents the possible returned View types [v5] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 04:57:00 GMT, Prasanta Sadhukhan wrote: >> API specification says about BasicTextAreaUI.create "Returns a WrappedPlainView or PlainView". >> But for [bidi](https://github.com/openjdk/jdk/blob/d14e96d9701dae951aa365029f58afb6687a646a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java#L168) text, this method returns BoxView and other views , so the documentation needs to be updated. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Javadoc update Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10376 From alanb at openjdk.org Fri Oct 7 12:53:30 2022 From: alanb at openjdk.org (Alan Bateman) Date: Fri, 7 Oct 2022 12:53:30 GMT Subject: RFR: 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni [v2] In-Reply-To: References: Message-ID: <-0yo8KceENmJ48YPNoHCUkx_iEWpIE0mPJn_-BkjbWY=.76a8dcb8-f43a-4c8b-8912-43c7225c183d@github.com> On Mon, 26 Sep 2022 16:51:36 GMT, Michael Ernst wrote: >> 8294321: Fix typos in files under test/jdk/java, test/jdk/jdk, test/jdk/jni > > Michael Ernst has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits: > > - Reinstate typos in Apache code that is copied into the JDK > - Merge ../jdk-openjdk into typos-typos > - Remove file that was removed upstream > - Fix inconsistency in capitalization > - Undo change in zlip > - Fix typos src/java.se/share/data/jdwp/jdwp.spec line 101: > 99: "platform thread " > 100: "in the target VM. This includes platform threads created with the Thread " > 101: "API and all native threads attached to the target VM with JNI code." The spec for the JDWP AllThreads command was significantly reworded in Java 19 so this is where this typo crept in. We have JDK-8294672 tracking it to fix for Java 20, maybe you should take it? ------------- PR: https://git.openjdk.org/jdk/pull/10029 From mvs at openjdk.org Fri Oct 7 13:45:45 2022 From: mvs at openjdk.org (Manukumar V S) Date: Fri, 7 Oct 2022 13:45:45 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines Message-ID: java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. Fix: Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. ------------- Commit messages: - 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines Changes: https://git.openjdk.org/jdk/pull/10606/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10606&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8288415 Stats: 43 lines in 1 file changed: 31 ins; 3 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/10606.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10606/head:pull/10606 PR: https://git.openjdk.org/jdk/pull/10606 From aivanov at openjdk.org Fri Oct 7 16:34:23 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 7 Oct 2022 16:34:23 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Fri, 7 Oct 2022 02:07:28 GMT, Sergey Bylokhov wrote: > The sun.java2d.pipe.Region#clipRound() seems have the same purpose, but it also clip the double to int. Thank you, @mrserb. It's better to re-use the existing implementation. I tested with it, it gives the same result. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Fri Oct 7 17:28:35 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 7 Oct 2022 17:28:35 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Wed, 5 Oct 2022 21:00:11 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > test updated Two edge cases issues were identified while testing with different frame sizes and on different platforms- - One was due to the inherent issue of robot.getPixelColor() which sometimes returns a different pixel color returned at the edge of border. This is a test issue and is fixed by adding a offset of 1 pixel to the border and corner checks. - The other issue occurs only in specific scenario - when the internal frame size is set to 125, 150, 225, 250...etc on uiScale of 1.25 (on Windows). A thin red line is seen at the bottom of the border. This is might be due the `loopCount` value. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Fri Oct 7 17:28:37 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 7 Oct 2022 17:28:37 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v8] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: <1hPZXAFjEQ-JH2bQ_ZPAQt2ZR--EABys-P_KLP6eg7Q=.e4c4ef5d-4a84-4ca9-948a-1289cca7eb4b@github.com> On Fri, 7 Oct 2022 02:07:28 GMT, Sergey Bylokhov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> test updated > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 256: > >> 254: * @return the rounded value >> 255: */ >> 256: private static int roundHalfDown(double d) { > > The sun.java2d.pipe.Region#clipRound() seems have the same purpose, but it also clip the double to int. @mrserb Thank you for the suggestion. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Fri Oct 7 18:02:34 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 7 Oct 2022 18:02:34 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: > JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) > > The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. > > ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: fix for pixel color at edge, outermost border lines drawn as part of bulk of border ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10274/files - new: https://git.openjdk.org/jdk/pull/10274/files/2e3b7af1..da54767f Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10274&range=07-08 Stats: 36 lines in 2 files changed: 1 ins; 20 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/10274.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10274/head:pull/10274 PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Fri Oct 7 18:07:21 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Fri, 7 Oct 2022 18:07:21 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Fri, 7 Oct 2022 18:02:34 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > fix for pixel color at edge, outermost border lines drawn as part of bulk of border With the current update, on some scales the highlight and shadow lines are not positioned exactly at the middle of the border. This is being investigated currently. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From aivanov at openjdk.org Fri Oct 7 18:37:19 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 7 Oct 2022 18:37:19 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: <6Kqr4negWpT1Lzc01V3v-Uwa6aQZqdLptL-6RXFiRIw=.ed5df3db-39a2-40f6-92cf-bfbd563db66d@github.com> On Fri, 7 Oct 2022 09:00:32 GMT, Prasanta Sadhukhan wrote: >> javax.swing.text.AbstractDocument$BranchElement.replace(...) method throws an `ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative` when using an UndoManager on the default document of a JTextArea and you try to undo the insertion of a LEFT-TO-RIGHT language (e.g. Arabic) that is immediately followed by setting the component orientation on the JTextArea. >> >> This is because System.arrayCopy() is called with -ve length because of the calculation done in AbstractDocment.replace where `src` is of 2bytes because of unicode text causing `nmove` to become -ve if `nchildren` is 1 (an unicode character is inserted) >> >> System.arrayCopy throws `IndexOutOfBoundsException if: >> >> The srcPos argument is negative. >> The destPos argument is negative. >> The length argument is negative >> >> >> so the fix is made to make nmove, src, dest +ve >> Also, Element.getElement() can return null which is not checked, causing NPE, if deletion of text is done which results in no element, which is also fixed in the PR >> >> All jtreg testsuite tests are run without any regression. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix I do not think this makes a difference. Well, the first insertion does make a difference: it changes the text component state so from left-to-right only to bidirectional. The following manipulations just add more Arabic text, so that the entire text run is right-to-left. You want to test the situation where the change from left-to-right to bidirectional and component orientation occurs for the first time, and the text is inserted in the middle of a text run, in the end of text. You should probably, re-create `JTextArea` and `UndoManager` to test such scenarios. You should also verify the result of undo. If you insert text by one character, each undo should remove that character from the text. If you don't test the result of undo, you don't know whether the text was modified as expected or not. ------------- Changes requested by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10446 From aivanov at openjdk.org Fri Oct 7 19:52:22 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Fri, 7 Oct 2022 19:52:22 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v3] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 08:49:09 GMT, Prasanta Sadhukhan wrote: >> I suggest amending `setSelectionInterval` to throw IOOBE if `Integer.MAX_VALUE` is passed. >> >> Then I suggest amending `removeIndexInterval` to throw IOOBE if a negative value is passed or an index is `Integer.MAX_VALUE`. Explicit handling of negative values could be an optimisation made in addition to handling `MAX_VALUE`. >> >> In both cases, the spec needs to be updated, and therefore the CSR will be required. > > I guess Integer.MAX_VALUE should be valid "int" value, its because of internal calculation which is causing it to overflow so I guess we should not update the spec for wrongful calculation. > I have fixed the overflow in setSelectionInterval. This is not a generic class, its main purpose is to handle list selection in UI components, such as `JList`. Excluding `Integer.MAX_VALUE` makes sense to me, it simplifies the code: no additional check in the loop and no special handling `removeIndexInterval` which also adds a condition to the loop. ------------- PR: https://git.openjdk.org/jdk/pull/10409 From prr at openjdk.org Fri Oct 7 20:27:25 2022 From: prr at openjdk.org (Phil Race) Date: Fri, 7 Oct 2022 20:27:25 GMT Subject: RFR: JDK-6229853: BasicTextAreaUI:create incompletely documents the possible returned View types [v5] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 04:57:00 GMT, Prasanta Sadhukhan wrote: >> API specification says about BasicTextAreaUI.create "Returns a WrappedPlainView or PlainView". >> But for [bidi](https://github.com/openjdk/jdk/blob/d14e96d9701dae951aa365029f58afb6687a646a/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextAreaUI.java#L168) text, this method returns BoxView and other views , so the documentation needs to be updated. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Javadoc update Marked as reviewed by prr (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10376 From serb at openjdk.org Sat Oct 8 15:32:18 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 8 Oct 2022 15:32:18 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 13:36:17 GMT, Manukumar V S wrote: > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 148: > 146: try { > 147: ImageIO.write(robot.createScreenCapture( > 148: new Rectangle(0, 0, screenSize.width, screenSize.height)), This may capture the default screen while the frame is currently visible on another one. ------------- PR: https://git.openjdk.org/jdk/pull/10606 From serb at openjdk.org Sat Oct 8 15:33:36 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 8 Oct 2022 15:33:36 GMT Subject: RFR: 8294807: Fix typos and clarify javadoc for SunToolKit.realsSync In-Reply-To: References: <5GlfDtRnHLa7PIslOaYDEg8g0M2oB2-YNAatMtJbDWU=.6d381cb4-c329-4b83-a5d6-29dc96521edb@github.com> Message-ID: On Thu, 6 Oct 2022 23:23:21 GMT, Damon Nguyen wrote: >> src/java.desktop/share/classes/sun/awt/SunToolkit.java line 1451: >> >>> 1449: * >>> 1450: *

This method allows writing tests without explicit timeouts >>> 1451: * or waiting for some event. Example: >> >> Should it be ?without _using_ ? or waiting ??? >> Does ?for an event? sound better? > > In my opinion, "without using ... or waiting ..." seems better to match the tense of "waiting" to show more clearly what the "or" is intended for (assuming the OR is meant for the explicit timeouts and the waiting for an event). > > Otherwise, the "or" may be confused to be between "writing ... or waiting ...". > > For the "event" portion, I think either here is OK. I don't think either would cause confusion and both sound reasonable. I do not think we should recommend as of now the usage of the internal API in the tests. ------------- PR: https://git.openjdk.org/jdk/pull/10563 From prr at openjdk.org Sat Oct 8 15:34:43 2022 From: prr at openjdk.org (Phil Race) Date: Sat, 8 Oct 2022 15:34:43 GMT Subject: RFR: 8294488: Delete KCMS transforms wrappers In-Reply-To: References: Message-ID: On Wed, 28 Sep 2022 03:12:55 GMT, Sergey Bylokhov wrote: > This is a request to cleanup the shared code for the colors conversions. That code still uses some wrappers which can be simplified and/or deleted after KCMS removal. For example, each conversion from one color space to another creates 3 wrappers - for the first color profile, the second color profile, and one to combine the first two. But for the lcms library we only need the list of color profiles and rendering intent -> only one transform object can be used. > > The new constructor for the LCMSTransform is [added](https://github.com/openjdk/jdk/pull/10459/files#diff-7448ea8346eb08c6ec1a518e3c3399d7d078a514c07956ee7e8e2b5be3d082e1R77) and now used everywhere: > `LCMSTransform(int renderingIntent, ICC_Profile... profiles)` > It will wrap the `cmsCreateMultiprofileTransform` [function ](https://github.com/openjdk/jdk/pull/10459/files#diff-eed6ddb15e9c5bdab9fc3b3930d5d959966165d9622ddd293e8572489adea98bR202) in LCMS library: > > I tried to preserve the current behavior, and as a result, two "workarounds" are used for the next bugs. > * [JDK-8216369](https://bugs.openjdk.org/browse/JDK-8216369): after the cleanup it became obvious that we use a hardcoded value for the first rendering [intent](https://github.com/openjdk/jdk/pull/10459/files#diff-e3d6eea060882cab00827c00e1a83b0e0a5b2a31fa9a9aa2122841bbd57c4a6dR473). There is a code to fetch the intent from the color profile but I postponed use it for now because some of our built-in profiles use different default intents. > * [JDK-8272860](https://bugs.openjdk.org/browse/JDK-8272860): the old code always fetched some information from the color profile header as result we cache the headers for any profiles we used. This cache workaround the JDK-8272860 while the direct access to the profile via LCMS library could fail. The new code intentionally caches the [header](https://github.com/openjdk/jdk/pull/10459/files#diff-7448ea8346eb08c6ec1a518e3c3399d7d078a514c07956ee7e8e2b5be3d082e1R91). > > Notes: > * The old wrappers used a rendering intent for each intermediate transform, the LCMS use only one intent > * The old wrappers could throw the cmm exception if the rendering intent was not supported. The LCMS ignores unsupported intents and uses some [default](https://github.com/LuaDist/lcms/blob/master/doc/TUTORIAL.TXT#L1094) > * The old wrappers had a way to specify the input and output profiles, the LCMS library uses the first profile as input and the last profile as output. Those parameters are [removed](https://github.com/openjdk/jdk/pull/10459/files#diff-81b49f067b32296497e9e727bda25efe0b7f84fb2c05645eb6b272bfc32469f1L38) > * If at some point the new CMS library will be added it will be easy to integrate it using XXCMS plugin, instead of using some specific library logic in the shared code It looks Ok. I ran all our automated tests and there was only one failure - of a closed (for no particular reason) jtreg test that tests the pluggable interface. It will need to be problem listed until such time as it can be updated - or perhaps deleted. ------------- PR: https://git.openjdk.org/jdk/pull/10459 From serb at openjdk.org Sat Oct 8 15:37:18 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 8 Oct 2022 15:37:18 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Fri, 7 Oct 2022 18:02:34 GMT, Harshitha Onkar wrote: >> JInternalFrame background color seems to overflow into the border region. This issue is more prominently seen on Windows - Metal LAF (with fractional scaling, as shown below). The primary reason is border scaling issue as observed in - [JDK-8279614](https://bugs.openjdk.org/browse/JDK-8279614) >> >> The fix involves a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. The test checks the midpoint and corners of borders to check if the internal frame's background color is located out of JInternalFrame. >> >> ![image](https://user-images.githubusercontent.com/95945681/190233555-a7e00f2c-9003-4c11-84fb-207957838c2f.png) > > Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: > > fix for pixel color at edge, outermost border lines drawn as part of bulk of border src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 266: > 264: } > 265: > 266: Graphics2D g2d = (Graphics2D) g; It could be a DebugGraphics which is not a Graphics2D src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 277: > 275: resetTransform = (at.getShearX() == 0) && (at.getShearY() == 0); > 276: > 277: if (resetTransform) { Please clarify why we should reset the current transform? How it will work if the user sets a transform and render this to the BufferedImage. src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 292: > 290: height = Region.clipRound(at.getScaleY() * h); > 291: xtranslation = Region.clipRound(at.getScaleX() * x + at.getTranslateX()); > 292: ytranslation = Region.clipRound(at.getScaleY() * y + at.getTranslateY()); This probably should be refactored to something like this: https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L375 ------------- PR: https://git.openjdk.org/jdk/pull/10274 From honkar at openjdk.org Sat Oct 8 15:37:18 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Sat, 8 Oct 2022 15:37:18 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Fri, 7 Oct 2022 21:43:44 GMT, Sergey Bylokhov wrote: >> Harshitha Onkar has updated the pull request incrementally with one additional commit since the last revision: >> >> fix for pixel color at edge, outermost border lines drawn as part of bulk of border > > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 277: > >> 275: resetTransform = (at.getShearX() == 0) && (at.getShearY() == 0); >> 276: >> 277: if (resetTransform) { > > Please clarify why we should reset the current transform? How it will work if the user sets a transform and render this to the BufferedImage. On fractional scaling, painting of lines and borders have issues (lines seem to be separated or look uneven) as shown above, https://github.com/openjdk/jdk/pull/10274#issue-1373421530. In order to paint them uniformly and next to each other, the idea is to render at 1x scaling, apply the required thickness/scaling to the lines at this point (when transform is reset) and then the original (old) transform is restored at the end. This idea was referenced from a similar issue https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. > src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 292: > >> 290: height = Region.clipRound(at.getScaleY() * h); >> 291: xtranslation = Region.clipRound(at.getScaleX() * x + at.getTranslateX()); >> 292: ytranslation = Region.clipRound(at.getScaleY() * y + at.getTranslateY()); > > This probably should be refactored to something like this: > https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L375 @mrserb Thank for the suggestion. Are you suggesting that same transformations be applied for width, height and additionally to x&y translations? https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L373 ------------- PR: https://git.openjdk.org/jdk/pull/10274 From serb at openjdk.org Sat Oct 8 15:57:46 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 8 Oct 2022 15:57:46 GMT Subject: RFR: 6852577: Only for Nimbus LAF UIManager.get("PasswordField.echoChar") is null [v3] In-Reply-To: References: <8_EXfD0W-aphoJsroB4e0r8hsMrcxpfATTWDGHXP_Es=.c22772e4-447a-48b2-b5de-1918059670f2@github.com> <-qOkFQnlLYWH_LFc0JpgxLICPgTG1mtzXG7xrnRppns=.cf90f4bc-bec9-4f99-aa5c-ee867c585f95@github.com> <1Y0OKsbNSaopRmrW3VQF8rh6RrClWmjbycO4qgfIY7I=.34c463c5-ccec-4bb5-981b-23e2a5bbab24@github.com> Message-ID: On Tue, 27 Sep 2022 18:03:41 GMT, Alexey Ivanov wrote: >> Properties are **already** being stored in two parts so I am not inventing it for this fix. I am just adding an entry to the already created UIDefaults. Also, as I told, storing a character in skin.laf involves changing the generator tool which might not be scalable and prone to regressions, not to mention what/where should be changed in the tool for this is not known to me. >> >> Also, as Synth is a skinnable look and feel, I think it would have been an issue if the property to be added affects "skin" in anyways, like **color, font, dimension** property etc, in which case it would have made sense to be mandatorily put in skin.laf which is the "visual designer" >> but this Password echo character property will not affect the skin in anyway, like the other properties added in UIDefaults table in SynthLookAndFeel, so I think it should be ok. > > I agree with @prsadhuk here. The `echoChar` isn't skin, it can be defined directly as is done for other properties. Most of that "other" properties are specified by the "skin" file for the Nimbus L&F. Take a look to the "NimbusDefaults.java", it has many-many properties which are usually hardcoded in other L&F. Inital idea of the "skin" was the ability to swicth the UI appiarance, the style of "echo" is part of it. It is of course possible to set/update that field directly by the application, but for the Nimbus L&F default value should be set by the skin. ------------- PR: https://git.openjdk.org/jdk/pull/10035 From psadhukhan at openjdk.org Sat Oct 8 19:42:43 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Sat, 8 Oct 2022 19:42:43 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel Message-ID: javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% so adjusted % tolerance check to 10 Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now ------------- Commit messages: - 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel Changes: https://git.openjdk.org/jdk/pull/10618/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10618&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295007 Stats: 3 lines in 2 files changed: 2 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10618.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10618/head:pull/10618 PR: https://git.openjdk.org/jdk/pull/10618 From serb at openjdk.org Sat Oct 8 19:44:48 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Sat, 8 Oct 2022 19:44:48 GMT Subject: RFR: 8295003: Do not mention applets in the "java.awt.color" package Message-ID: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> The usage of "applets" are replaced by the "applications" in the "java.awt.color" package. If there are no objections I'll skip the CSR for this small cleanup. ------------- Commit messages: - 8295003: Do not mention applets in the "java.awt.color" package Changes: https://git.openjdk.org/jdk/pull/10616/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10616&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295003 Stats: 9 lines in 2 files changed: 0 ins; 0 del; 9 mod Patch: https://git.openjdk.org/jdk/pull/10616.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10616/head:pull/10616 PR: https://git.openjdk.org/jdk/pull/10616 From duke at openjdk.org Sun Oct 9 08:55:05 2022 From: duke at openjdk.org (duke) Date: Sun, 9 Oct 2022 08:55:05 GMT Subject: Withdrawn: 8288428: javax/swing/JInternalFrame/Test6505027.java fails frequently in MacOS 12 machines In-Reply-To: <6YC8w4_hoAm0h7IlClKsyBdz0aJj2G_Z3hfQSifEpcM=.f720f5a5-565d-452c-8cd6-527ed4fc50ef@github.com> References: <6YC8w4_hoAm0h7IlClKsyBdz0aJj2G_Z3hfQSifEpcM=.f720f5a5-565d-452c-8cd6-527ed4fc50ef@github.com> Message-ID: On Fri, 17 Jun 2022 14:28:15 GMT, Manukumar V S wrote: > javax/swing/JInternalFrame/Test6505027.java seems to be unstable in MacOS machines, especially in MacOSX 12 machines and it fails intermittently in CI causing some noise. > It seems to be a testbug as adding some stability improvements fix the issue. > > Fix: > Some stability improvements have been done and the test has been run 10 times per platform in mach5 and got full PASS. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/9202 From magare31 at gmail.com Sun Oct 9 14:57:12 2022 From: magare31 at gmail.com (magare31 at gmail.com) Date: Sun, 9 Oct 2022 10:57:12 -0400 Subject: professional (24-bit) sampled audio support in the Windows native implementation of libjsound In-Reply-To: <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> References: <02e901d8d4c0$7dd12ee0$79738ca0$@gmail.com> <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> Message-ID: <028e01d8dbef$69b25070$3d16f150$@gmail.com> Since I am new to this, and apologies for the broad email, could someone explain the following for the corresponding bug (JDK-8294904)? * This bug is listed as one for a generic OS, whereas I specified Windows (I can confirm that it is Windows only). * This bug is listed as "resolved" with an "incomplete resolution". I did provide the full solution, so I am not sure what this means. (Also, Oracle asked for a standalone test, which I also provided over email) And thanks. From: Kevin Rushforth Sent: Friday, September 30, 2022 8:29 AM To: magare31 at gmail.com; client-libs-dev at openjdk.org; core-libs-dev at openjdk.org Subject: Re: professional (24-bit) sampled audio support in the Windows native implementation of libjsound Java Sound is in the client-libs area. You can file the bug yourself at https://bugreport.java.com/ if you like, or ask the sponsor of your bug (when one steps forward) to do it. If you want to contribute your fix, please see the contributing a patch section [1] in the JDK Developers Guide for the next steps. -- Kevin [1] https://openjdk.org/guide/#i-have-a-patch-what-do-i-do On 9/30/2022 4:33 AM, magare31 at gmail.com wrote: Would anyone want to sponsor the following simple bug fix? - The purpose is to enable playback and recording of 24-bit sampled audio on Windows. This is already supported on other systems. - There is no associated bug in the bug database. I noted it as a "bug" as the code misunderstands the WAVE RIFF format standards. - There will be two very small changes to one Windows native cpp file under libjsound - I have tested the changes on a jdk build of the latest code. Also, please advise which of these two groups this belongs to: client libs or core libs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aivanov at openjdk.org Sun Oct 9 15:29:55 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Sun, 9 Oct 2022 15:29:55 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel In-Reply-To: References: Message-ID: On Sat, 8 Oct 2022 05:04:57 GMT, Prasanta Sadhukhan wrote: > javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% > so adjusted % tolerance check to 10 > Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now I propose using the ?full block? character (U+2588 ?) which results in a text filled with the selected color. _The tolerance_ could be even increased in this case. checkBox = new JCheckBox("\u2588".repeat(5)); radioButton = new JRadioButton("\u2588".repeat(5)); Otherwise, the test depends on the font used, if the strokes are thin, it may fail. As I posted in the comment, the test should disable antialiasing and count the pixels of the correct color, it should ignore the pixels of the background color. To accommodate for anti-aliasing on macOS and rendering of the control itself, the tolerance which is already in place could be used. I can take on this improvement. Changing the text of the controls should already make the test robust enough. ------------- Changes requested by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10618 From aturbanov at openjdk.org Sun Oct 9 21:03:52 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sun, 9 Oct 2022 21:03:52 GMT Subject: RFR: 8293984: Unnecessary Vector usage in PropertyEditorSupport [v2] In-Reply-To: References: Message-ID: > Field PropertyEditorSupport.listeners is accessed only under `synchronized(this)`. > It means extra synchronization by Vector is not needed. Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 8293984: Unnecessary Vector usage in PropertyEditorSupport use ArrayList constructor instead of clone ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10331/files - new: https://git.openjdk.org/jdk/pull/10331/files/b15462b4..303e4fbd Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10331&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10331&range=00-01 Stats: 6 lines in 1 file changed: 0 ins; 5 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10331.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10331/head:pull/10331 PR: https://git.openjdk.org/jdk/pull/10331 From aturbanov at openjdk.org Sun Oct 9 21:03:54 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sun, 9 Oct 2022 21:03:54 GMT Subject: RFR: 8293984: Unnecessary Vector usage in PropertyEditorSupport [v2] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 00:07:31 GMT, Sergey Bylokhov wrote: >> Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: >> >> 8293984: Unnecessary Vector usage in PropertyEditorSupport >> >> use ArrayList constructor instead of clone > > src/java.desktop/share/classes/java/beans/PropertyEditorSupport.java line 301: > >> 299: @SuppressWarnings("unchecked") >> 300: private ArrayList unsafeClone(ArrayList v) { >> 301: return (ArrayList)v.clone(); > > I think this can be simplified by using the new list in place of "unsafeClone". Updated ------------- PR: https://git.openjdk.org/jdk/pull/10331 From aturbanov at openjdk.org Sun Oct 9 21:31:20 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Sun, 9 Oct 2022 21:31:20 GMT Subject: RFR: 8295026: Remove unused fields in StyleSheet Message-ID: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> There are 3 unused fields in single `StyleSheet` file: 1. `static final Border noBorder = new EmptyBorder(0,0,0,0);` 2. `static final int DEFAULT_FONT_SIZE = 3;` 3. `URL imageurl;` in nested `javax.swing.text.html.StyleSheet.ListPainter` class ------------- Commit messages: - [PATCH] Remove unused fields in StyleSheet Changes: https://git.openjdk.org/jdk/pull/10523/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10523&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295026 Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/10523.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10523/head:pull/10523 PR: https://git.openjdk.org/jdk/pull/10523 From duke at openjdk.org Sun Oct 9 21:31:20 2022 From: duke at openjdk.org (SWinxy) Date: Sun, 9 Oct 2022 21:31:20 GMT Subject: RFR: 8295026: Remove unused fields in StyleSheet In-Reply-To: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> References: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> Message-ID: On Sat, 1 Oct 2022 17:05:11 GMT, Andrey Turbanov wrote: > There are 3 unused fields in single `StyleSheet` file: > 1. `static final Border noBorder = new EmptyBorder(0,0,0,0);` > 2. `static final int DEFAULT_FONT_SIZE = 3;` > 3. `URL imageurl;` in nested `javax.swing.text.html.StyleSheet.ListPainter` class Nice little ~~spring~~ fall cleaning :) ------------- Marked as reviewed by SWinxy at github.com (no known OpenJDK username). PR: https://git.openjdk.org/jdk/pull/10523 From swinxythecat at gmail.com Sun Oct 9 21:45:43 2022 From: swinxythecat at gmail.com (SWinxy) Date: Sun, 9 Oct 2022 17:45:43 -0400 Subject: professional (24-bit) sampled audio support in the Windows native implementation of libjsound In-Reply-To: <028e01d8dbef$69b25070$3d16f150$@gmail.com> References: <02e901d8d4c0$7dd12ee0$79738ca0$@gmail.com> <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> <028e01d8dbef$69b25070$3d16f150$@gmail.com> Message-ID: JDK-8294904 [1] should be updated with your sample. I'm not exactly sure why it was marked as resolved this past Friday, but the resolution of 'incomplete' makes me think they didn't feel you provided enough information. Also I think the OS was set to 'generic' because the lack of support might affect other operating systems' support for 24bit sampled audio. The caveat is that I'm not well-versed in this area. [1] https://bugs.openjdk.org/browse/JDK-8294904 On Sun, Oct 9, 2022 at 10:57 AM wrote: > Since I am new to this, and apologies for the broad email, could someone > explain the following for the corresponding bug (JDK-8294904)? > > > > - This bug is listed as one for a generic OS, whereas I specified > Windows (I can confirm that it is Windows only). > - This bug is listed as "resolved" with an "incomplete resolution". I > did provide the full solution, so I am not sure what this means. (Also, > Oracle asked for a standalone test, which I also provided over email) > > > > And thanks. > > > > *From:* Kevin Rushforth > *Sent:* Friday, September 30, 2022 8:29 AM > *To:* magare31 at gmail.com; client-libs-dev at openjdk.org; > core-libs-dev at openjdk.org > *Subject:* Re: professional (24-bit) sampled audio support in the Windows > native implementation of libjsound > > > > Java Sound is in the client-libs area. You can file the bug yourself at > https://bugreport.java.com/ if you like, or ask the sponsor of your bug > (when one steps forward) to do it. > > If you want to contribute your fix, please see the contributing a patch > section [1] in the JDK Developers Guide for the next steps. > > -- Kevin > > [1] https://openjdk.org/guide/#i-have-a-patch-what-do-i-do > > On 9/30/2022 4:33 AM, magare31 at gmail.com wrote: > > Would anyone want to sponsor the following simple bug fix? > > > > - The purpose is to enable playback and recording of 24-bit sampled audio > on Windows. This is already supported on other systems. > > - There is no associated bug in the bug database. I noted it as a "bug" > as the code misunderstands the WAVE RIFF format standards. > > - There will be two very small changes to one Windows native cpp file > under libjsound > > - I have tested the changes on a jdk build of the latest code. > > > > Also, please advise which of these two groups this belongs to: client libs > or core libs? > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dnguyen at openjdk.org Mon Oct 10 05:35:28 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 10 Oct 2022 05:35:28 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure Message-ID: The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. Also removing the test from the problem list. ------------- Commit messages: - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox - Remove test from problem list - Adjust rect width to remove overlap Changes: https://git.openjdk.org/jdk/pull/10626/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10626&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8294254 Stats: 3 lines in 2 files changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10626.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10626/head:pull/10626 PR: https://git.openjdk.org/jdk/pull/10626 From tr at openjdk.org Mon Oct 10 05:47:25 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 05:47:25 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel In-Reply-To: References: Message-ID: On Sat, 8 Oct 2022 05:04:57 GMT, Prasanta Sadhukhan wrote: > javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% > so adjusted % tolerance check to 10 > Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now Marked as reviewed by tr (Author). ------------- PR: https://git.openjdk.org/jdk/pull/10618 From duke at openjdk.org Mon Oct 10 05:57:45 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Mon, 10 Oct 2022 05:57:45 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: <93M7cIGLivT6u6rB-zalFnL38lEFpFHigcbHvPLZeGA=.187d1a3d-7d88-44e5-a622-755e057efac5@github.com> On Tue, 4 Oct 2022 05:45:50 GMT, Tejesh R wrote: >> You say that the current directory in `JFileChooser` gets set to `null` because of forbidden navigation to a folder which is not traversable. You avoid the NPE by a null-check. >> >> However, you should prevent the current directory to be set to `null`. If navigation is not allowed, the current directory should remain unchanged _instead of being reset to `null`_. > > @aivanov-jdk I have updated as per the review comments. Please let me know if its fine. I have put up the mach5 test link in JBS for reference. @TejeshR13 Verified latest fix on ubuntu and fix is working fine. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From serb at openjdk.org Mon Oct 10 06:29:51 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 10 Oct 2022 06:29:51 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel In-Reply-To: References: Message-ID: On Sat, 8 Oct 2022 05:04:57 GMT, Prasanta Sadhukhan wrote: > javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% > so adjusted % tolerance check to 10 > Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now I suggest to recheck that the final version of this change will be able to verify an initial bug. ------------- PR: https://git.openjdk.org/jdk/pull/10618 From serb at openjdk.org Mon Oct 10 06:36:52 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 10 Oct 2022 06:36:52 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Tue, 4 Oct 2022 08:06:24 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Test case update test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 67: > 65: //Initialize the components > 66: final String INSTRUCTIONS = """ > 67: Instructions to Test: JFileChooser extends JComponent, probably we can create a frame with embedded JFileChooser and programmatically change the value of that "Look-In ComboBox"-> and catch an exception. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 06:44:57 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 06:44:57 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 06:32:44 GMT, Sergey Bylokhov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Test case update > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 67: > >> 65: //Initialize the components >> 66: final String INSTRUCTIONS = """ >> 67: Instructions to Test: > > JFileChooser extends JComponent, probably we can create a frame with embedded JFileChooser and programmatically change the value of that "Look-In ComboBox"-> and catch an exception. Means in _Test INSTRUCTIONS_ a link to `Look-In` can be attached......? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From mvs at openjdk.org Mon Oct 10 06:55:02 2022 From: mvs at openjdk.org (Manukumar V S) Date: Mon, 10 Oct 2022 06:55:02 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 21:15:02 GMT, Sergey Bylokhov wrote: >> java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. >> >> Fix: >> Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. > > test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 148: > >> 146: try { >> 147: ImageIO.write(robot.createScreenCapture( >> 148: new Rectangle(0, 0, screenSize.width, screenSize.height)), > > This may capture the default screen while the frame is currently visible on another one. But, is there any way we can capture the current screen where the frame is displayed? ------------- PR: https://git.openjdk.org/jdk/pull/10606 From psadhukhan at openjdk.org Mon Oct 10 07:21:45 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 10 Oct 2022 07:21:45 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: > javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% > so adjusted % tolerance check to 10 > Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Use full block char ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10618/files - new: https://git.openjdk.org/jdk/pull/10618/files/a50ad3eb..a275e607 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10618&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10618&range=00-01 Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/10618.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10618/head:pull/10618 PR: https://git.openjdk.org/jdk/pull/10618 From psadhukhan at openjdk.org Mon Oct 10 07:25:52 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 10 Oct 2022 07:25:52 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: On Sun, 9 Oct 2022 15:26:07 GMT, Alexey Ivanov wrote: > propose using the ?full block? character (U+2588 ?) OK, modified...Seems good, also regression can still be tested..Have kept the tolerance same, although it could have been increased. Maybe during improvement PR.... ------------- PR: https://git.openjdk.org/jdk/pull/10618 From tr at openjdk.org Mon Oct 10 10:01:56 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 10:01:56 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 06:41:24 GMT, Tejesh R wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 67: >> >>> 65: //Initialize the components >>> 66: final String INSTRUCTIONS = """ >>> 67: Instructions to Test: >> >> JFileChooser extends JComponent, probably we can create a frame with embedded JFileChooser and programmatically change the value of that "Look-In ComboBox"-> and catch an exception. > > Means in _Test INSTRUCTIONS_ a link to `Look-In` can be attached......? Or suggesting to make the test automatic......? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 10:22:47 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 10:22:47 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 06:32:44 GMT, Sergey Bylokhov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Test case update > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 67: > >> 65: //Initialize the components >> 66: final String INSTRUCTIONS = """ >> 67: Instructions to Test: > > JFileChooser extends JComponent, probably we can create a frame with embedded JFileChooser and programmatically change the value of that "Look-In ComboBox"-> and catch an exception. @mrserb is suggesting making the test automatic. `JFileChooser` is embedded in a frame in the test. It should be possible? I'm fine with manual test though? for now. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 10:26:00 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 10:26:00 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 10:19:11 GMT, Alexey Ivanov wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 67: >> >>> 65: //Initialize the components >>> 66: final String INSTRUCTIONS = """ >>> 67: Instructions to Test: >> >> JFileChooser extends JComponent, probably we can create a frame with embedded JFileChooser and programmatically change the value of that "Look-In ComboBox"-> and catch an exception. > > @mrserb is suggesting making the test automatic. `JFileChooser` is embedded in a frame in the test. It should be possible? I'm fine with manual test though? for now. Ok, since the test has to select non traversable folders in both windows and linux I had thought that making it as manual would be better. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 11:32:00 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:32:00 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Tue, 4 Oct 2022 08:06:24 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Test case update Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 81: > 79: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); > 80: jfc = new JFileChooser(); > 81: String path = System.getProperty("user.home"); The test does not work for me on Windows. It starts with `user.home` as the current folder as expected; when select `C:`, it goes to Desktop which is the root of the Shell namespace. I guess, you have to change it to `System.getProperty("user.home") + File.separator + "Documents"` as you and I discussed. It'll make Desktop unreachable. On Linux, the test works correctly. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 97: > 95: > 96: class CustomFileView extends FileView { > 97: private String basePath; Suggestion: private final String basePath; test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 105: > 103: public Boolean isTraversable(File filePath) { > 104: return ((filePath != null) && (filePath.isDirectory())) && > 105: filePath.getAbsolutePath().startsWith(basePath); Suggestion: return ((filePath != null) && (filePath.isDirectory())) && filePath.getAbsolutePath().startsWith(basePath); I prefer wrapping before the operator, it makes it clear that it's a continuation line. Java Coding Style suggests wrapping this way. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 11:32:00 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:32:00 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 10:23:58 GMT, Tejesh R wrote: >> @mrserb is suggesting making the test automatic. `JFileChooser` is embedded in a frame in the test. It should be possible? I'm fine with manual test though? for now. > > Ok, since the test has to select non traversable folders in both windows and linux I had thought that making it as manual would be better. Yet you control which folders are non-traversable. Anyway? A test is better than no test; an automatic test is better than a manual one. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 11:36:35 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:36:35 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 07:21:45 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% >> so adjusted % tolerance check to 10 >> Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Use full block char Looks good to me. The only question is the value of `tolerance`: the original one vs. the updated one. ------------- Marked as reviewed by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10618 From aivanov at openjdk.org Mon Oct 10 11:36:36 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:36:36 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 07:21:56 GMT, Prasanta Sadhukhan wrote: > Have kept the tolerance same You've kept the updated value of 10 compared to the original one of 20. I propose keeping 20 as it was before. The use of the ?full block? character ensures there are many pixels of the correct color. ------------- PR: https://git.openjdk.org/jdk/pull/10618 From aivanov at openjdk.org Mon Oct 10 11:36:37 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:36:37 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 06:27:34 GMT, Sergey Bylokhov wrote: > I suggest to recheck that the final version of this change will be able to verify an initial bug. I believe this is implied, isn't it? ------------- PR: https://git.openjdk.org/jdk/pull/10618 From psadhukhan at openjdk.org Mon Oct 10 11:54:33 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 10 Oct 2022 11:54:33 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 07:21:45 GMT, Prasanta Sadhukhan wrote: >> javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% >> so adjusted % tolerance check to 10 >> Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Use full block char Tolerance has been kept same as in the original closed test ------------- PR: https://git.openjdk.org/jdk/pull/10618 From aivanov at openjdk.org Mon Oct 10 11:54:34 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 11:54:34 GMT Subject: RFR: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel [v2] In-Reply-To: References: Message-ID: <_3vinG8gnVJQ_pRv1mBds2iArGBF56-BycfEG22Fdx0=.1f5f0a03-f7a0-4d0a-b0d1-288bd9d00969@github.com> On Mon, 10 Oct 2022 11:50:19 GMT, Prasanta Sadhukhan wrote: > Tolerance has been kept same as in the original closed test Yes, I'm sorry I didn't notice that change has been removed. Thank you. ------------- PR: https://git.openjdk.org/jdk/pull/10618 From psadhukhan at openjdk.org Mon Oct 10 11:54:36 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Mon, 10 Oct 2022 11:54:36 GMT Subject: Integrated: 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel In-Reply-To: References: Message-ID: On Sat, 8 Oct 2022 05:04:57 GMT, Prasanta Sadhukhan wrote: > javax/swing/JRadioButton/4314194/bug4314194.java correct color pixels pixel % varies between 30% for Metal to about 20% for Nimbus to about 19% for Windows L&F. But Nimbus in linux correct color pixel % falls to about 14% > so adjusted % tolerance check to 10 > Also, JDK-8075916 is fixed for NimbusL&F but same issue is present for GTK L&F which is to be addressed separately as JDK-8295006 so problemlisted for now This pull request has now been integrated. Changeset: 269252aa Author: Prasanta Sadhukhan URL: https://git.openjdk.org/jdk/commit/269252aa3d5d72859c907a032110d482cf475560 Stats: 4 lines in 2 files changed: 2 ins; 0 del; 2 mod 8295007: javax/swing/JRadioButton/4314194/bug4314194.java fails in mach5 for WIndowLookAndFeel Reviewed-by: aivanov, tr ------------- PR: https://git.openjdk.org/jdk/pull/10618 From aivanov at openjdk.org Mon Oct 10 12:12:52 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 12:12:52 GMT Subject: RFR: 8295026: Remove unused fields in StyleSheet In-Reply-To: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> References: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> Message-ID: On Sat, 1 Oct 2022 17:05:11 GMT, Andrey Turbanov wrote: > There are 3 unused fields in single `StyleSheet` file: > 1. `static final Border noBorder = new EmptyBorder(0,0,0,0);` > 2. `static final int DEFAULT_FONT_SIZE = 3;` > 3. `URL imageurl;` in nested `javax.swing.text.html.StyleSheet.ListPainter` class Looks good to me. ------------- Marked as reviewed by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10523 From aivanov at openjdk.org Mon Oct 10 12:19:52 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 12:19:52 GMT Subject: RFR: 8295003: Do not mention applets in the "java.awt.color" package In-Reply-To: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> References: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> Message-ID: On Fri, 7 Oct 2022 23:18:58 GMT, Sergey Bylokhov wrote: > The usage of "applets" are replaced by the "applications" in the "java.awt.color" package. > If there are no objections I'll skip the CSR for this small cleanup. Looks good to me. As for CSR, applets are deprecated, it looks fine to me to remove the reference to them. Yet I suggest that you wait for other opinions. ------------- Marked as reviewed by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10616 From tr at openjdk.org Mon Oct 10 13:58:30 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 13:58:30 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v5] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/62f6c307..11a697ea Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=03-04 Stats: 4 lines in 1 file changed: 0 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 13:58:35 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 13:58:35 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 11:24:43 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Test case update > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 81: > >> 79: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); >> 80: jfc = new JFileChooser(); >> 81: String path = System.getProperty("user.home"); > > The test does not work for me on Windows. It starts with `user.home` as the current folder as expected; when select `C:`, it goes to Desktop which is the root of the Shell namespace. > > I guess, you have to change it to `System.getProperty("user.home") + File.separator + "Documents"` as you and I discussed. It'll make Desktop unreachable. > > On Linux, the test works correctly. Updated. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 97: > >> 95: >> 96: class CustomFileView extends FileView { >> 97: private String basePath; > > Suggestion: > > private final String basePath; Updated. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 105: > >> 103: public Boolean isTraversable(File filePath) { >> 104: return ((filePath != null) && (filePath.isDirectory())) && >> 105: filePath.getAbsolutePath().startsWith(basePath); > > Suggestion: > > return ((filePath != null) && (filePath.isDirectory())) > && filePath.getAbsolutePath().startsWith(basePath); > > I prefer wrapping before the operator, it makes it clear that it's a continuation line. Java Coding Style suggests wrapping this way. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 16:29:42 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 16:29:42 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v5] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 13:58:30 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Changes requested by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 35: > 33: > 34: import javax.swing.filechooser.FileView; > 35: import jdk.test.lib.Platform; It's not used any more, please remove. Leave one blank line after the last import and the following comment with the jtreg tags. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 42: > 40: * @requires (os.family == "windows" | os.family == "linux") > 41: * @library /java/awt/regtesthelpers /test/lib > 42: * @build PassFailJFrame jdk.test.lib.Platform Suggestion: * @library /java/awt/regtesthelpers * @build PassFailJFrame `Platform` class from `/test/lib` is not used any more. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 65: > 63: JFileChooser jfc; > 64: > 65: //Initialize the components I believe the comment is redundant. Being placed before the instruction text, it's confusing. The method name `initialize` is self-explanatory. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 77: > 75: 3. If NPE occurs on second selection then test FAILS, else test > 76: is PASS. > 77: """; I propose the following text: Instructions to Test: 1. The traversable folder is set to the Documents folder, if it exists, in the user's home folder, otherwise it's the user's home. Other folders are non-traversable. 2. When the file chooser appears on the screen, select any non-traversable folder from "Look-In" combo box, for example the user's folder or a folder above it. (The folder will not be opened since it's non-traversable). 3. Select the Documents folder again. 4. If NullPointerException occurs in the step 3, click Fail, otherwise click Pass. It consistently uses _?folder?_, no mention of ?directory?. It explains that the user's home could be the root of the traversable tree. The instructions use imperative to select either _Fail_ or _Pass_. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 81: > 79: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); > 80: jfc = new JFileChooser(); > 81: String path = System.getProperty("user.home") + File.separator + "Documents"; Suggestion: String userHome = System.getProperty("user.home"); String docs = userHome + File.separator + "Documents"; String path = (new File(docs).exists()) ? docs : userHome; This will make the test more robust, it can continue to run even if `Documents` folder does not exist. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 84: > 82: > 83: jfc.setCurrentDirectory(new File(path)); > 84: jfc.setFileView(new CustomFileView(path)); Suggestion: jfc.setFileView(new CustomFileView(path)); jfc.setControlButtonsAreShown(false); Hide _Open_ and _Cancel_ buttons in the file chooser. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Mon Oct 10 16:29:45 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 16:29:45 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2] In-Reply-To: References: <6rp5CFsnwWEFcZIPVtNzQ4X31svC1XhaKVP1kM2lTKQ=.89f0a7c0-969f-4b9d-9df1-e53caaac115b@github.com> Message-ID: On Mon, 3 Oct 2022 16:33:59 GMT, Tejesh R wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 40: >> >>> 38: * @bug 6616245 >>> 39: * @key headful >>> 40: * @requires (os.family == "windows" | os.family == "linux") >> >> Is there a specific reason to exclude macOS? Is it only because the default L&F isn't Metal? > > Yeah, was not able to reproduce in macOS. You can set Metal L&F explicitly on macOS. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 16:36:54 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 16:36:54 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v5] In-Reply-To: References: Message-ID: <6-2jJdaYubAdgfgVO53efiFDYOFTgYI7NWAmIg-3p-E=.31f1ae77-7327-4f11-b329-b2f6f130875e@github.com> On Mon, 10 Oct 2022 16:17:49 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 42: > >> 40: * @requires (os.family == "windows" | os.family == "linux") >> 41: * @library /java/awt/regtesthelpers /test/lib >> 42: * @build PassFailJFrame jdk.test.lib.Platform > > Suggestion: > > * @library /java/awt/regtesthelpers > * @build PassFailJFrame > > > `Platform` class from `/test/lib` is not used any more. In mac the issue was not reproducible..... ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 16:52:48 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 16:52:48 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v6] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/11a697ea..cbc3ba1e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=04-05 Stats: 17 lines in 1 file changed: 4 ins; 0 del; 13 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Mon Oct 10 16:52:54 2022 From: tr at openjdk.org (Tejesh R) Date: Mon, 10 Oct 2022 16:52:54 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v5] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 16:14:56 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 35: > >> 33: >> 34: import javax.swing.filechooser.FileView; >> 35: import jdk.test.lib.Platform; > > It's not used any more, please remove. > > Leave one blank line after the last import and the following comment with the jtreg tags. Updated. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 65: > >> 63: JFileChooser jfc; >> 64: >> 65: //Initialize the components > > I believe the comment is redundant. Being placed before the instruction text, it's confusing. The method name `initialize` is self-explanatory. Updated. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 77: > >> 75: 3. If NPE occurs on second selection then test FAILS, else test >> 76: is PASS. >> 77: """; > > I propose the following text: > > > Instructions to Test: > 1. The traversable folder is set to the Documents folder, > if it exists, in the user's home folder, otherwise > it's the user's home. Other folders are non-traversable. > 2. When the file chooser appears on the screen, select any > non-traversable folder from "Look-In" combo box, > for example the user's folder or a folder above it. > (The folder will not be opened since it's non-traversable). > 3. Select the Documents folder again. > 4. If NullPointerException occurs in the step 3, click Fail, > otherwise click Pass. > > It consistently uses _?folder?_, no mention of ?directory?. It explains that the user's home could be the root of the traversable tree. The instructions use imperative to select either _Fail_ or _Pass_. 4th point has been modified, since user can only select Pass, otherwise the test itself fails. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 81: > >> 79: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); >> 80: jfc = new JFileChooser(); >> 81: String path = System.getProperty("user.home") + File.separator + "Documents"; > > Suggestion: > > > String userHome = System.getProperty("user.home"); > String docs = userHome + File.separator + "Documents"; > String path = (new File(docs).exists()) ? docs : userHome; > > This will make the test more robust, it can continue to run even if `Documents` folder does not exist. Updated. > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 84: > >> 82: >> 83: jfc.setCurrentDirectory(new File(path)); >> 84: jfc.setFileView(new CustomFileView(path)); > > Suggestion: > > jfc.setFileView(new CustomFileView(path)); > jfc.setControlButtonsAreShown(false); > > Hide _Open_ and _Cancel_ buttons in the file chooser. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From prappo at openjdk.org Mon Oct 10 16:57:21 2022 From: prappo at openjdk.org (Pavel Rappo) Date: Mon, 10 Oct 2022 16:57:21 GMT Subject: Integrated: 8294377: Prepare to stop auto-inheriting documentation for subclasses of exceptions whose documentation is inherited In-Reply-To: References: Message-ID: <5x7fG0iSo2qnkGEPeTumleeWMpV15E_qSXdIrdVHoUY=.369c8b00-4a6e-4f50-9ca7-62be5556be8e@github.com> On Tue, 27 Sep 2022 11:43:08 GMT, Pavel Rappo wrote: > This adds exception documentation to JDK methods that would otherwise lose that documentation once JDK-8287796 is integrated. While adding this exception documentation now does not change [^1] the JDK API Documentation, it will automatically counterbalance the effect that JDK-8287796 will have. > > JDK-8287796 seeks to remove an old, undocumented, and esoteric javadoc feature that cannot be suppressed [^2]. The feature is so little known about that IDEs either do not implement it correctly or do not implement it at all, thus rendering documentation differently from how the javadoc tool renders it. > > That feature was introduced in JDK-4947455 and manifests as follows. If a method inherits documentation for an exception, along with that documentation the method automatically inherits documentation for all exceptions that are subclasses of that former exception and are documented in an overridden method. > > To illustrate that behavior, consider the following example. A method `Subtype.m` inherits documentation for `SuperException`, while the overridden method `Supertype.m` documents `SuperException`, `SubExceptionA` and `SubExceptionB`, where the latter two exceptions are subclasses of the former exception: > > public class Subtype extends Supertype { > > @Override > public void m() throws SuperException { > ... > > public class Supertype { > > /** > * @throws SuperException general problem > * @throws SubExceptionA specific problem A > * @throws SubExceptionB specific problem B > */ > public void m() throws SuperException { > ... > > public class SuperException extends Exception { > ... > > public class SubExceptionA extends SuperException { > ... > > public class SubExceptionB extends SuperException { > ... > > For the above example, the API Documentation for `Subtype.m` will contain documentation for all three exceptions; the page fragment for `Subtype.m` in "Method Details" will look like this: > > public void m() > throws SuperException > > Overrides: > m in class Supertype > Throws: > SuperException - general problem > SubExceptionA - specific problem A > SubExceptionB - specific problem B > > It works for checked and unchecked exceptions, for methods in classes and interfaces. > > > If it's the first time you hear about that behavior and this change affects your area, it's a good opportunity to reflect on whether the exception documentation this change adds is really needed or you were simply unaware of the fact that it was automatically added before. If exception documentation is not needed, please comment on this PR. Otherwise, consider approving it. > > Keep in mind that if some exception documentation is not needed, **leaving it out** from this PR might require a CSR. > > > [^1]: Aside from insignificant changes on class-use and index pages. There's one relatively significant change. This change is in jdk.jshell, where some methods disappeared from "Methods declared in ..." section and other irregularities. We are aware of this and have filed JDK-8291803 to fix the root cause. > [^2]: In reality, the feature can be suppressed, but it looks like a bug rather than intentional design. If we legitimize the feature and its suppression behavior, the model for exception documentation inheritance might become much more complicated. This pull request has now been integrated. Changeset: eb90c4fc Author: Pavel Rappo URL: https://git.openjdk.org/jdk/commit/eb90c4fc0479379c8c1452afca8f37746c762e18 Stats: 320 lines in 14 files changed: 310 ins; 0 del; 10 mod 8294377: Prepare to stop auto-inheriting documentation for subclasses of exceptions whose documentation is inherited Reviewed-by: jjg ------------- PR: https://git.openjdk.org/jdk/pull/10449 From serb at openjdk.org Mon Oct 10 18:02:52 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Mon, 10 Oct 2022 18:02:52 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 06:50:41 GMT, Manukumar V S wrote: >> test/jdk/java/awt/PopupMenu/PopupMenuLocation.java line 148: >> >>> 146: try { >>> 147: ImageIO.write(robot.createScreenCapture( >>> 148: new Rectangle(0, 0, screenSize.width, screenSize.height)), >> >> This may capture the default screen while the frame is currently visible on another one. > > But, is there any way we can capture the current screen where the frame is displayed? You can pass coordinates/bounds of that screen to the createScreenCapture. ------------- PR: https://git.openjdk.org/jdk/pull/10606 From dnguyen at openjdk.org Mon Oct 10 18:41:24 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Mon, 10 Oct 2022 18:41:24 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: > The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. > > Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. > > Also removing the test from the problem list. Damon Nguyen 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 8294254/overlapFixEditableCombobox - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox - Remove test from problem list - Adjust rect width to remove overlap ------------- Changes: https://git.openjdk.org/jdk/pull/10626/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10626&range=01 Stats: 3 lines in 2 files changed: 0 ins; 1 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10626.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10626/head:pull/10626 PR: https://git.openjdk.org/jdk/pull/10626 From aivanov at openjdk.org Mon Oct 10 18:47:57 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Mon, 10 Oct 2022 18:47:57 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v6] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 16:52:48 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Looks good to me now. test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 82: > 80: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); > 81: jfc = new JFileChooser(); > 82: String userHome = System.getProperty("user.home"); I prefer a blank line here to logically separate dealing with paths from creating the components. But it's a nit. ------------- Marked as reviewed by aivanov (Reviewer). PR: https://git.openjdk.org/jdk/pull/10485 From honkar at openjdk.org Mon Oct 10 19:10:05 2022 From: honkar at openjdk.org (Harshitha Onkar) Date: Mon, 10 Oct 2022 19:10:05 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 18:41:24 GMT, Damon Nguyen wrote: >> The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. >> >> Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. >> >> Also removing the test from the problem list. > > Damon Nguyen 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 8294254/overlapFixEditableCombobox > - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox > - Remove test from problem list > - Adjust rect width to remove overlap Suggestion: Does running the test - CustomComboBoxFocusTest.java with uiScale always set to 1 make it more robust? ------------- PR: https://git.openjdk.org/jdk/pull/10626 From alexey.ivanov at oracle.com Mon Oct 10 21:03:07 2022 From: alexey.ivanov at oracle.com (Aleksei Ivanov) Date: Mon, 10 Oct 2022 22:03:07 +0100 Subject: professional (24-bit) sampled audio support in the Windows native implementation of libjsound In-Reply-To: <028e01d8dbef$69b25070$3d16f150$@gmail.com> References: <02e901d8d4c0$7dd12ee0$79738ca0$@gmail.com> <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> <028e01d8dbef$69b25070$3d16f150$@gmail.com> Message-ID: <5ca697e2-fd4f-8a4b-9f98-b536ed5bb2a7@oracle.com> Hi, JDK-8294904 [1] was resolved as Incomplete because there's no sample code which demonstrates the problem. A comment was added: Mail to submitter: ============= Please share standalone test case/ reproducible step/ scenario to analyze the issue better. I should have received an email with request for clarification. I looked through the description but it's still unclear to me how to reproduce the problem and how to incorporate the fix you're proposing and what the fix is. If you could provide the test case and better yet the fix along with a regression test, it would be greatly appreciated. The fix in the form of the diff would also help. -- Regards, Alexey [1] https://bugs.openjdk.org/browse/JDK-8294904 On 09/10/2022 15:57, magare31 at gmail.com wrote: > > Since I am new to this, and apologies for the broad email, could > someone explain the following for the corresponding bug (JDK-8294904)? > > * This bug is listed as one for a generic OS, whereas I specified > Windows (I can confirm that it is Windows only). > * This bug is listed as "resolved" with an "incomplete resolution". > ?I did provide the full solution, so I am not sure what this > means. ?(Also, Oracle asked for a standalone test, which I also > provided over email) > > And thanks. > > *From:* Kevin Rushforth > *Sent:* Friday, September 30, 2022 8:29 AM > *To:* magare31 at gmail.com; client-libs-dev at openjdk.org; > core-libs-dev at openjdk.org > *Subject:* Re: professional (24-bit) sampled audio support in the > Windows native implementation of libjsound > > Java Sound is in the client-libs area. You can file the bug yourself > at https://bugreport.java.com/ if you like, or ask the sponsor of your > bug (when one steps forward) to do it. > > If you want to contribute your fix, please see the contributing a > patch section [1] in the JDK Developers Guide for the next steps. > > -- Kevin > > [1] https://openjdk.org/guide/#i-have-a-patch-what-do-i-do > > On 9/30/2022 4:33 AM, magare31 at gmail.com wrote: > > Would anyone want to sponsor the following simple bug fix? > > - The purpose is to enable playback and recording of 24-bit > sampled audio on Windows.? This is already supported on other systems. > > - There is no associated bug in the bug database.? I noted it as a > "bug" as the code misunderstands the WAVE RIFF format standards. > > - There will be two very small changes to one Windows native cpp > file under libjsound > > - I have tested the changes on a jdk build of the latest code. > > Also, please advise which of these two groups this belongs to: > client libs or core libs? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From prr at openjdk.org Mon Oct 10 23:51:21 2022 From: prr at openjdk.org (Phil Race) Date: Mon, 10 Oct 2022 23:51:21 GMT Subject: RFR: 8295003: Do not mention applets in the "java.awt.color" package In-Reply-To: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> References: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> Message-ID: On Fri, 7 Oct 2022 23:18:58 GMT, Sergey Bylokhov wrote: > The usage of "applets" are replaced by the "applications" in the "java.awt.color" package. > If there are no objections I'll skip the CSR for this small cleanup. It sounds fine to me. ------------- Marked as reviewed by prr (Reviewer). PR: https://git.openjdk.org/jdk/pull/10616 From dnguyen at openjdk.org Tue Oct 11 00:27:35 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 11 Oct 2022 00:27:35 GMT Subject: RFR: 8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0 In-Reply-To: References: <2JMfR5LPnaps6mypICTmVJ06Wvz-aM8TZCUCGFtPfRI=.a2f95c1a-08e4-484d-b9bd-d2e2de8b7a93@github.com> Message-ID: On Thu, 6 Oct 2022 15:04:25 GMT, Alexey Ivanov wrote: > > > Can we move the test file to one directory back as we are doing it in swing test fix. Means moving the test to Multscreen folder, instead of MultiScreenLocationTest.....? > > > > > > I second this. The test can sit inside the Multiscreen folder without the need for a subfolder to match the way new tests are added. > > I prefer leaving the test at its original location. It's not a new test, it has a history in CI. Although, if everyone else thinks the test should be moved up, it's okay with me. > > Previously, each test had its own folder. Now, we tend to use flatter structure. If that's the case, I have nothing else against keeping it in its current location. I had the impression to update tests (such as syntax) as they're updated, but I can understand why updating its location may be useful. ------------- PR: https://git.openjdk.org/jdk/pull/10363 From serb at openjdk.org Tue Oct 11 00:44:35 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 11 Oct 2022 00:44:35 GMT Subject: Integrated: 8295003: Do not mention applets in the "java.awt.color" package In-Reply-To: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> References: <-5VrLrHDBrYLd9a67snxU5jQYywXQmaKh8o702F0mY0=.dc60f1ff-40a1-4427-b5cc-e872f2cf44bb@github.com> Message-ID: On Fri, 7 Oct 2022 23:18:58 GMT, Sergey Bylokhov wrote: > The usage of "applets" are replaced by the "applications" in the "java.awt.color" package. > If there are no objections I'll skip the CSR for this small cleanup. This pull request has now been integrated. Changeset: 891156a7 Author: Sergey Bylokhov URL: https://git.openjdk.org/jdk/commit/891156a744e706e2d8da5082b2ee3e63ff6fab76 Stats: 9 lines in 2 files changed: 0 ins; 0 del; 9 mod 8295003: Do not mention applets in the "java.awt.color" package Reviewed-by: aivanov, prr ------------- PR: https://git.openjdk.org/jdk/pull/10616 From serb at openjdk.org Tue Oct 11 01:40:21 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Tue, 11 Oct 2022 01:40:21 GMT Subject: RFR: 8293984: Unnecessary Vector usage in PropertyEditorSupport [v2] In-Reply-To: References: Message-ID: On Sun, 9 Oct 2022 21:03:52 GMT, Andrey Turbanov wrote: >> Field PropertyEditorSupport.listeners is accessed only under `synchronized(this)`. >> It means extra synchronization by Vector is not needed. > > Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: > > 8293984: Unnecessary Vector usage in PropertyEditorSupport > > use ArrayList constructor instead of clone Marked as reviewed by serb (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10331 From philip.race at oracle.com Tue Oct 11 02:21:28 2022 From: philip.race at oracle.com (Philip Race) Date: Mon, 10 Oct 2022 19:21:28 -0700 Subject: professional (24-bit) sampled audio support in the Windows native implementation of libjsound In-Reply-To: <5ca697e2-fd4f-8a4b-9f98-b536ed5bb2a7@oracle.com> References: <02e901d8d4c0$7dd12ee0$79738ca0$@gmail.com> <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> <028e01d8dbef$69b25070$3d16f150$@gmail.com> <5ca697e2-fd4f-8a4b-9f98-b536ed5bb2a7@oracle.com> Message-ID: <0de52bab-dab9-a536-bd15-0df2b69f28a9@oracle.com> So Magare (what is your actual name ?), As admin for this list I saw your? latest email but due to size etc it was rejected by OpenJDK mail servers. I don't think I can do anything about that. In fact it wasn't even a patch. It was a full copy of a file. And I believe you misunderstood that Alexey was quoting what you should have sent in reply to the person who is triaging your bug submission. NOT to be sent to this list. Go look in your inbox+spam. Regardless OpenJDK does not take patches in email. They need to be github PRs *after* following process below. Have you read the OpenJDK Developer's Guide ? https://openjdk.org/guide/ Start here https://openjdk.org/guide/#contributing-to-an-openjdk-project and make sure to sign and return the OCA mentioned there. The OCA must be accepted in order to take code from you. Do you have a github account ? You'll need one and it'll have to be linked to an approved OCA. You can then submit a PR against https://github.com/openjdk/jdk I can help you "sponsor" this change, but you need to absorb the process and do the OCA first. -phil. On 10/10/22 2:03 PM, Aleksei Ivanov wrote: > Hi, > > JDK-8294904 [1] was resolved as Incomplete because there's no sample > code which demonstrates the problem. A comment was added: > > Mail to submitter: > ============= > Please share standalone test case/ reproducible step/ scenario to > analyze the issue better. > > I should have received an email with request for clarification. > > I looked through the description but it's still unclear to me how to > reproduce the problem and how to incorporate the fix you're proposing > and what the fix is. If you could provide the test case and better yet > the fix along with a regression test, it would be greatly appreciated. > > The fix in the form of the diff would also help. > > -- > Regards, > Alexey > > [1] https://bugs.openjdk.org/browse/JDK-8294904 > > On 09/10/2022 15:57, magare31 at gmail.com wrote: >> >> Since I am new to this, and apologies for the broad email, could >> someone explain the following for the corresponding bug (JDK-8294904)? >> >> * This bug is listed as one for a generic OS, whereas I specified >> Windows (I can confirm that it is Windows only). >> * This bug is listed as "resolved" with an "incomplete resolution". >> ?I did provide the full solution, so I am not sure what this >> means. ?(Also, Oracle asked for a standalone test, which I also >> provided over email) >> >> And thanks. >> >> *From:* Kevin Rushforth >> *Sent:* Friday, September 30, 2022 8:29 AM >> *To:* magare31 at gmail.com; client-libs-dev at openjdk.org; >> core-libs-dev at openjdk.org >> *Subject:* Re: professional (24-bit) sampled audio support in the >> Windows native implementation of libjsound >> >> Java Sound is in the client-libs area. You can file the bug yourself >> at https://bugreport.java.com/ if you like, or ask the sponsor of >> your bug (when one steps forward) to do it. >> >> If you want to contribute your fix, please see the contributing a >> patch section [1] in the JDK Developers Guide for the next steps. >> >> -- Kevin >> >> [1] https://openjdk.org/guide/#i-have-a-patch-what-do-i-do >> >> On 9/30/2022 4:33 AM, magare31 at gmail.com wrote: >> >> Would anyone want to sponsor the following simple bug fix? >> >> - The purpose is to enable playback and recording of 24-bit >> sampled audio on Windows.? This is already supported on other >> systems. >> >> - There is no associated bug in the bug database.? I noted it as >> a "bug" as the code misunderstands the WAVE RIFF format standards. >> >> - There will be two very small changes to one Windows native cpp >> file under libjsound >> >> - I have tested the changes on a jdk build of the latest code. >> >> Also, please advise which of these two groups this belongs to: >> client libs or core libs? >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tr at openjdk.org Tue Oct 11 04:54:14 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 04:54:14 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/cbc3ba1e..f5d345e5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=05-06 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From psadhukhan at openjdk.org Tue Oct 11 05:40:40 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 05:40:40 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v3] In-Reply-To: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> Message-ID: > javax.swing.text.AbstractDocument$BranchElement.replace(...) method throws an `ArrayIndexOutOfBoundsException: arraycopy: length -1 is negative` when using an UndoManager on the default document of a JTextArea and you try to undo the insertion of a LEFT-TO-RIGHT language (e.g. Arabic) that is immediately followed by setting the component orientation on the JTextArea. > > This is because System.arrayCopy() is called with -ve length because of the calculation done in AbstractDocment.replace where `src` is of 2bytes because of unicode text causing `nmove` to become -ve if `nchildren` is 1 (an unicode character is inserted) > > System.arrayCopy throws `IndexOutOfBoundsException if: > > The srcPos argument is negative. > The destPos argument is negative. > The length argument is negative > > > so the fix is made to make nmove, src, dest +ve > Also, Element.getElement() can return null which is not checked, causing NPE, if deletion of text is done which results in no element, which is also fixed in the PR > > All jtreg testsuite tests are run without any regression. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Test update ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10446/files - new: https://git.openjdk.org/jdk/pull/10446/files/8e07fdc3..6414cdb3 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10446&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10446&range=01-02 Stats: 81 lines in 1 file changed: 54 ins; 5 del; 22 mod Patch: https://git.openjdk.org/jdk/pull/10446.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10446/head:pull/10446 PR: https://git.openjdk.org/jdk/pull/10446 From psadhukhan at openjdk.org Tue Oct 11 05:40:40 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 05:40:40 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v3] In-Reply-To: References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> <2bRWmn9tz1W2Hc6L-EQgVmw7UzVz38XMGoo71uA1HEc=.6a744d13-98cd-4a9b-9a43-7bbc09ed7be1@github.com> <2Yg2YfWHVULkQ5Flrxs-BHGIhx5Ej7ebbyR6D2SeKa0=.b035c42c-9966-4f41-9cc2-8aa0f72a1571@github.com> Message-ID: <2qkbFDjRNL4LNVCLvwJYUUW0eOy7MFJq7lN8a_bR3Aw=.336eac22-62f6-4bf2-afeb-37f2267e5029@github.com> On Fri, 7 Oct 2022 12:45:04 GMT, Alexey Ivanov wrote: >> `getElement()` can return null [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2619) and [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2398) >> so it should not be enitrely impossible not to get null, so it should be a ok > >> `getElement()` can return null [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2619) and [here](https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2398) so it should not be enitrely impossible not to get null, so it should be a ok > > I know it is possible _theoretically_. My point is for a valid offset in the document, this particular line must _never_ return `null`. If it does, the element tree is invalid. As such, we should rather catch the case of bad bidi element tree by throwing NPE rather than pretending nothing bad happened. > > `BidiRootElement` is a `BranchElement`: https://github.com/openjdk/jdk/blob/096bca4a9c5e8ac2668dd965df92153ea1d80add/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2700-L2713 > > And [`BranchElement.getElementIndex`](https://github.com/openjdk/jdk/blob/096bca4a9c5e8ac2668dd965df92153ea1d80add/src/java.desktop/share/classes/javax/swing/text/AbstractDocument.java#L2416-L2474) always returns a *valid* index. > > So, I am against adding the `null`-check. It is not necessary here. If there is only one character inserted/present in the document and then undo-ed, then there is no character/bidiElement so getElement() will return null and then getEndOffset() on that null element will return NPE, for which I have added the null check. ------------- PR: https://git.openjdk.org/jdk/pull/10446 From psadhukhan at openjdk.org Tue Oct 11 05:42:30 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 05:42:30 GMT Subject: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert [v2] In-Reply-To: <6Kqr4negWpT1Lzc01V3v-Uwa6aQZqdLptL-6RXFiRIw=.ed5df3db-39a2-40f6-92cf-bfbd563db66d@github.com> References: <6RcEPyVsdn3GAryyi2QYk3OGfPDUGxFD-W0c_2s8iH4=.b10fa89b-07b7-4e8b-858f-1311d0ffeaae@github.com> <6Kqr4negWpT1Lzc01V3v-Uwa6aQZqdLptL-6RXFiRIw=.ed5df3db-39a2-40f6-92cf-bfbd563db66d@github.com> Message-ID: On Fri, 7 Oct 2022 18:33:52 GMT, Alexey Ivanov wrote: > I do not think this makes a difference. Well, the first insertion does make a difference: it changes the text component state so from left-to-right only to bidirectional. > > The following manipulations just add more Arabic text, so that the entire text run is right-to-left. > > You want to test the situation where the change from left-to-right to bidirectional and component orientation occurs for the first time, and the text is inserted in the middle of a text run, in the end of text. You should probably, re-create `JTextArea` and `UndoManager` to test such scenarios. > > You should also verify the result of undo. If you insert text by one character, each undo should remove that character from the text. > > If you don't test the result of undo, you don't know whether the text was modified as expected or not. Test updated to test insertion individually at end, middle and beginning and also test results of undo. ------------- PR: https://git.openjdk.org/jdk/pull/10446 From tr at openjdk.org Tue Oct 11 06:01:36 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 06:01:36 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v6] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 17:23:16 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 82: > >> 80: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); >> 81: jfc = new JFileChooser(); >> 82: String userHome = System.getProperty("user.home"); > > I prefer a blank line here to logically separate dealing with paths from creating the components. But it's a nit. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aturbanov at openjdk.org Tue Oct 11 06:03:29 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Tue, 11 Oct 2022 06:03:29 GMT Subject: Integrated: 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo In-Reply-To: References: Message-ID: On Wed, 21 Sep 2022 08:03:24 GMT, Andrey Turbanov wrote: > Fields `methods`, `properties`, `eventSets` are not volatile and read multiple times. This makes it an incorrect DCL. This pull request has now been integrated. Changeset: e775acf8 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/e775acf889cde6f5bb463d4ecfe6eb035d18bdda Stats: 25 lines in 1 file changed: 9 ins; 0 del; 16 mod 8293986: Incorrect double-checked locking in com.sun.beans.introspect.ClassInfo Reviewed-by: serb ------------- PR: https://git.openjdk.org/jdk/pull/10372 From jdv at openjdk.org Tue Oct 11 06:30:25 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Tue, 11 Oct 2022 06:30:25 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 18:41:24 GMT, Damon Nguyen wrote: >> The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. >> >> Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. >> >> Also removing the test from the problem list. > > Damon Nguyen 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 8294254/overlapFixEditableCombobox > - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox > - Remove test from problem list > - Adjust rect width to remove overlap Its good that JComboBox misalignment issue is resolved under : https://bugs.openjdk.org/browse/JDK-8054572(I used to observe this at all places in SwingSet2 while testing Lanai) I ran javax/swing/plaf/aqua/CustomComboBoxFocusTest.java without this change in built-in display and external display: Built-in display(uiScale 2) : Fails 1/5 times External display(uiScale 1) : Fails 3/5 times Initially i was also under the impression that display scaling in test might be the root cause and making it run at some default scaling will solve the issue. But looks like this is a product regression introduced with fix under https://bugs.openjdk.org/browse/JDK-8054572. Since the current fix takes care of both https://bugs.openjdk.org/browse/JDK-8054572 & https://bugs.openjdk.org/browse/JDK-8073001. This product change looks good to me. ------------- Marked as reviewed by jdv (Reviewer). PR: https://git.openjdk.org/jdk/pull/10626 From jdv at openjdk.org Tue Oct 11 06:33:21 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Tue, 11 Oct 2022 06:33:21 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 18:41:24 GMT, Damon Nguyen wrote: >> The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. >> >> Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. >> >> Also removing the test from the problem list. > > Damon Nguyen 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 8294254/overlapFixEditableCombobox > - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox > - Remove test from problem list > - Adjust rect width to remove overlap Additionally if we want to make javax/swing/plaf/aqua/CustomComboBoxFocusTest.java run at some default uiScale that also should be fine. ------------- PR: https://git.openjdk.org/jdk/pull/10626 From duke at openjdk.org Tue Oct 11 06:42:37 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 06:42:37 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: > When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. > > Fix for the issue is to check if current directory is root then don't process the selection of ' ../ '. > > Test case has been added and checked in CI pipeline. Link is attached in JBS. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Review comment fix and test case changed to manual ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10390/files - new: https://git.openjdk.org/jdk/pull/10390/files/ff3bce2c..698a1202 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=01-02 Stats: 98 lines in 2 files changed: 29 ins; 55 del; 14 mod Patch: https://git.openjdk.org/jdk/pull/10390.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10390/head:pull/10390 PR: https://git.openjdk.org/jdk/pull/10390 From jdv at openjdk.org Tue Oct 11 06:52:41 2022 From: jdv at openjdk.org (Jayathirth D V) Date: Tue, 11 Oct 2022 06:52:41 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 06:42:37 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Review comment fix and test case changed to manual Its good that now we are handling entries in directory list at appropriate place instead of modifying it at some event listeners. LGTM. ------------- Marked as reviewed by jdv (Reviewer). PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 06:52:41 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 06:52:41 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v2] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Mon, 26 Sep 2022 14:05:04 GMT, Jayathirth D V wrote: >> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: >> >> Comment added and test case condotion update > > What is the behaviour in other LAF's? > Also lets change title of this bug to something like "GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea" @jayathirthrao @TejeshR13 As compared to previous fix where the condition was handled at listener level (mouse double click event), has been changed in current fix. Now as per the current fix the proposed solution is to remove the "../" from directory list if the current directory is root in GTK LAF. Test case has been updated to manual test as compared to previous fix. CI link is added in JBS for latest commit. > test/jdk/javax/swing/JFileChooser/TestFileChooserDirectorySelection.java line 102: > >> 100: >> 101: private static void doubleClickMouse(Point p) { >> 102: robot.mouseMove(p.x+75, p.y+frame.getHeight()/2 - 90); > > We should not use magic numbers to determine location on screen. Will these coordinates hold true at different uiScales? Test case has been changed to manual now. So, there is no need of getting location on screen now. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 07:04:21 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 07:04:21 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 06:42:37 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Review comment fix and test case changed to manual src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 997: > 995: File crntDir = getFileChooser().getCurrentDirectory(); > 996: if (crntDir != null && crntDir.getParentFile() == null && > 997: files.contains(new File("/.."))) { Is it not possible to use "FileSystemView.isFileSystemRoot(File)" for this? ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 07:11:27 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 07:11:27 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 18:41:24 GMT, Damon Nguyen wrote: >> The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. >> >> Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. >> >> Also removing the test from the problem list. > > Damon Nguyen 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 8294254/overlapFixEditableCombobox > - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox > - Remove test from problem list > - Adjust rect width to remove overlap src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java line 478: > 476: else { > 477: return new Rectangle(insets.left + buttonSize, insets.top + midHeight, > 478: width - (insets.left + insets.right + buttonSize) + 3, I guess previous to this fix, we were using BasicComboBoxUI#rectangleForCurrentValue() which returns a width on which we add +4 for editor/textField width. Since the calculation is basically same for width, why was it giving problem now (where only height is modified in the 8054572 fix) and not before this fix. I dont think this test use to fail before this fix was integrated with promoted CI builds ------------- PR: https://git.openjdk.org/jdk/pull/10626 From duke at openjdk.org Tue Oct 11 07:10:32 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 07:10:32 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 07:02:18 GMT, Prasanta Sadhukhan wrote: >> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: >> >> Review comment fix and test case changed to manual > > src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 997: > >> 995: File crntDir = getFileChooser().getCurrentDirectory(); >> 996: if (crntDir != null && crntDir.getParentFile() == null && >> 997: files.contains(new File("/.."))) { > > Is it not possible to use "FileSystemView.isFileSystemRoot(File)" for this? I have not checked this. Do you mean to check `FileSystemView.isFileSystemRoot(crntDir )` ? ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 07:26:30 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 07:26:30 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 07:06:35 GMT, Abhishek Kumar wrote: >> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 997: >> >>> 995: File crntDir = getFileChooser().getCurrentDirectory(); >>> 996: if (crntDir != null && crntDir.getParentFile() == null && >>> 997: files.contains(new File("/.."))) { >> >> Is it not possible to use "FileSystemView.isFileSystemRoot(File)" for this? > > I have not checked this. > Do you mean to check `FileSystemView.isFileSystemRoot(crntDir )` ? I guess that's what you commented "if current directory is root" ------------- PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 07:33:41 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 07:33:41 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: <5jNarH3tgm0W6SBM2KKn-tMm7plvCgVHgU4FYEnA-cQ=.ee131d4c-9b5c-4ae3-b0fa-134e441eee9f@github.com> On Tue, 11 Oct 2022 07:22:32 GMT, Prasanta Sadhukhan wrote: >> I have not checked this. >> Do you mean to check `FileSystemView.isFileSystemRoot(crntDir )` ? > > I guess that's what you commented "if current directory is root" Ok... I will check this. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From aivanov at openjdk.org Tue Oct 11 07:51:37 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 07:51:37 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: <1uyz7IrOUnEVfq4Y2bmzs7GP1pppk4bqeUxYTi47ook=.7909ba4e-4c04-4f9a-9450-9f2c33ff981c@github.com> On Tue, 11 Oct 2022 04:54:14 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Marked as reviewed by aivanov (Reviewer). test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 77: > 75: 3. Select the Documents folder again. > 76: 4. If NullPointerException does not occurs in the step 3, > 77: click Pass, otherwise the Test Fails. Suggestion: 4. If NullPointerException does not occur in the step 3, click Pass, otherwise the test fails automatically. I guess this is better and has no grammar mistakes. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From duke at openjdk.org Tue Oct 11 07:55:00 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 07:55:00 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> On Tue, 11 Oct 2022 04:54:14 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 39: > 37: * @test > 38: * @bug 6616245 > 39: * @key headful is it required to have a `key` tag for manual test case? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From duke at openjdk.org Tue Oct 11 07:59:29 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 07:59:29 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: <82u3B21KXDPRCZP3ZtdlkWTgBm9AcPH-cmMCWqfz96E=.92d84ee2-e744-48a9-bb42-17e04a3b50aa@github.com> On Tue, 11 Oct 2022 04:54:14 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 80: > 78: """; > 79: frame = new JFrame("JFileChooser File View NPE test"); > 80: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); Few lines are going beyond 80 columns, can you please update them? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 11 08:50:30 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 08:50:30 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: <82u3B21KXDPRCZP3ZtdlkWTgBm9AcPH-cmMCWqfz96E=.92d84ee2-e744-48a9-bb42-17e04a3b50aa@github.com> References: <82u3B21KXDPRCZP3ZtdlkWTgBm9AcPH-cmMCWqfz96E=.92d84ee2-e744-48a9-bb42-17e04a3b50aa@github.com> Message-ID: On Tue, 11 Oct 2022 07:57:26 GMT, Abhishek Kumar wrote: > Few lines are going beyond 80 columns, can you please update them? I agree, line 80 could be wrapped, it's 92 columns long. At the same, I wouldn't have insisted because it contains the parameters to `PassFailJFrame` which aren't so important to understanding the logic of the test. Line 92 with the position is better left untouched, it's not too long (five chars outside of 80-column limit) and it's cleaner unwrapped. You may statically-import `PassFailJFrame.Position` in which case the line would become shorter: PassFailJFrame.positionTestWindow(frame, Position.HORIZONTAL); I am for keeping line 61 as it is now even though it doesn't fit the limit by 5 characters. It's still readable. In fact, this `throws` clause could be avoided altogether by restructuring the code. The constructor of `PassFailJFrame` is designed to be called on the main thread, yet Tejesh prefers it this way. I don't think it's worth moving the code around at this point when it's approved already. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 11 08:54:35 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 08:54:35 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> References: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> Message-ID: On Tue, 11 Oct 2022 07:52:42 GMT, Abhishek Kumar wrote: > Is it required to have a `key` tag for manual test case? A manual test is declared by its `@run` tag: * @run main/manual FileViewNPETest If `-a` (automatic tests) is passed to jtreg, this test isn't selected for running. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From duke at openjdk.org Tue Oct 11 09:00:26 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 09:00:26 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 04:54:14 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Marked as reviewed by kumarabhi006 at github.com (no known OpenJDK username). Verified the latest fix and is working fine. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From duke at openjdk.org Tue Oct 11 09:00:28 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 09:00:28 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: <82u3B21KXDPRCZP3ZtdlkWTgBm9AcPH-cmMCWqfz96E=.92d84ee2-e744-48a9-bb42-17e04a3b50aa@github.com> Message-ID: On Tue, 11 Oct 2022 08:48:20 GMT, Alexey Ivanov wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 80: >> >>> 78: """; >>> 79: frame = new JFrame("JFileChooser File View NPE test"); >>> 80: passFailJFrame = new PassFailJFrame("Test Instructions", INSTRUCTIONS, 5L, 13, 40); >> >> Few lines are going beyond 80 columns, can you please update them? > >> Few lines are going beyond 80 columns, can you please update them? > > I agree, line 80 could be wrapped, it's 92 columns long. At the same, I wouldn't have insisted because it contains the parameters to `PassFailJFrame` which aren't so important to understanding the logic of the test. > > Line 92 with the position is better left untouched, it's not too long (five chars outside of 80-column limit) and it's cleaner unwrapped. You may statically-import `PassFailJFrame.Position` in which case the line would become shorter: > > PassFailJFrame.positionTestWindow(frame, Position.HORIZONTAL); > > > I am for keeping line 61 as it is now even though it doesn't fit the limit by 5 characters. It's still readable. In fact, this `throws` clause could be avoided altogether by restructuring the code. The constructor of `PassFailJFrame` is designed to be called on the main thread, yet Tejesh prefers it this way. I don't think it's worth moving the code around at this point when it's approved already. Ok. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From duke at openjdk.org Tue Oct 11 09:10:10 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 09:10:10 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v4] In-Reply-To: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: > When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. > > Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. > > Test case has been added and checked in CI pipeline. Link is attached in JBS. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Review comment fix ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10390/files - new: https://git.openjdk.org/jdk/pull/10390/files/698a1202..c7493bf1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=02-03 Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10390.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10390/head:pull/10390 PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 09:10:12 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 09:10:12 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v3] In-Reply-To: <5jNarH3tgm0W6SBM2KKn-tMm7plvCgVHgU4FYEnA-cQ=.ee131d4c-9b5c-4ae3-b0fa-134e441eee9f@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> <5jNarH3tgm0W6SBM2KKn-tMm7plvCgVHgU4FYEnA-cQ=.ee131d4c-9b5c-4ae3-b0fa-134e441eee9f@github.com> Message-ID: On Tue, 11 Oct 2022 07:31:10 GMT, Abhishek Kumar wrote: >> I guess that's what you commented "if current directory is root" > > Ok... I will check this. > Is it not possible to use "FileSystemView.isFileSystemRoot(File)" for this? Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 09:57:35 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 09:57:35 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v4] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: <_bjrFdGf0G-M5TixEIp1WFs3PSEJwMOf7H0SLt5AWEk=.7332483b-5e80-4ed2-9968-ff767272c3e5@github.com> On Tue, 11 Oct 2022 09:10:10 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Review comment fix test/jdk/javax/swing/JFileChooser/TestFileChooserDirectorySelection.java line 34: > 32: * @run main/manual TestFileChooserDirectorySelection > 33: */ > 34: better to put the test in plaf/gtk folder as it fixed gtk issue ------------- PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 10:12:47 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 10:12:47 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v5] In-Reply-To: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: > When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. > > Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. > > Test case has been added and checked in CI pipeline. Link is attached in JBS. Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: Test moved to plaf/gtk folder ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10390/files - new: https://git.openjdk.org/jdk/pull/10390/files/c7493bf1..7b9b74f5 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10390&range=03-04 Stats: 0 lines in 1 file changed: 0 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/10390.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10390/head:pull/10390 PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 10:12:47 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 10:12:47 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v4] In-Reply-To: <_bjrFdGf0G-M5TixEIp1WFs3PSEJwMOf7H0SLt5AWEk=.7332483b-5e80-4ed2-9968-ff767272c3e5@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> <_bjrFdGf0G-M5TixEIp1WFs3PSEJwMOf7H0SLt5AWEk=.7332483b-5e80-4ed2-9968-ff767272c3e5@github.com> Message-ID: On Tue, 11 Oct 2022 09:55:23 GMT, Prasanta Sadhukhan wrote: >> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: >> >> Review comment fix > > test/jdk/javax/swing/JFileChooser/TestFileChooserDirectorySelection.java line 34: > >> 32: * @run main/manual TestFileChooserDirectorySelection >> 33: */ >> 34: > > better to put the test in plaf/gtk folder as it fixed gtk issue Test file moved to plaf/gtk folder. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From tr at openjdk.org Tue Oct 11 10:15:10 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:15:10 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v8] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/f5d345e5..de312f56 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=06-07 Stats: 5 lines in 1 file changed: 1 ins; 1 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 10:15:15 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:15:15 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> Message-ID: On Tue, 11 Oct 2022 08:50:48 GMT, Alexey Ivanov wrote: >> test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 39: >> >>> 37: * @test >>> 38: * @bug 6616245 >>> 39: * @key headful >> >> Is it required to have a `key` tag for manual test case? > >> Is it required to have a `key` tag for manual test case? > > A manual test is declared by its `@run` tag: > > * @run main/manual FileViewNPETest > > > If `-a` (automatic tests) is passed to jtreg, this test isn't selected for running. Removed the tag. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 10:15:17 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:15:17 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: <1uyz7IrOUnEVfq4Y2bmzs7GP1pppk4bqeUxYTi47ook=.7909ba4e-4c04-4f9a-9450-9f2c33ff981c@github.com> References: <1uyz7IrOUnEVfq4Y2bmzs7GP1pppk4bqeUxYTi47ook=.7909ba4e-4c04-4f9a-9450-9f2c33ff981c@github.com> Message-ID: On Tue, 11 Oct 2022 07:46:06 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 77: > >> 75: 3. Select the Documents folder again. >> 76: 4. If NullPointerException does not occurs in the step 3, >> 77: click Pass, otherwise the Test Fails. > > Suggestion: > > 4. If NullPointerException does not occur in the step 3, > click Pass, otherwise the test fails automatically. > > I guess this is better and has no grammar mistakes. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 10:15:18 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:15:18 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: <82u3B21KXDPRCZP3ZtdlkWTgBm9AcPH-cmMCWqfz96E=.92d84ee2-e744-48a9-bb42-17e04a3b50aa@github.com> Message-ID: On Tue, 11 Oct 2022 08:54:45 GMT, Abhishek Kumar wrote: >>> Few lines are going beyond 80 columns, can you please update them? >> >> I agree, line 80 could be wrapped, it's 92 columns long. At the same, I wouldn't have insisted because it contains the parameters to `PassFailJFrame` which aren't so important to understanding the logic of the test. >> >> Line 92 with the position is better left untouched, it's not too long (five chars outside of 80-column limit) and it's cleaner unwrapped. You may statically-import `PassFailJFrame.Position` in which case the line would become shorter: >> >> PassFailJFrame.positionTestWindow(frame, Position.HORIZONTAL); >> >> >> I am for keeping line 61 as it is now even though it doesn't fit the limit by 5 characters. It's still readable. In fact, this `throws` clause could be avoided altogether by restructuring the code. The constructor of `PassFailJFrame` is designed to be called on the main thread, yet Tejesh prefers it this way. I don't think it's worth moving the code around at this point when it's approved already. > > Ok. Updated. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 11 10:31:03 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 10:31:03 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v8] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 10:15:10 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Changes requested by aivanov (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 11 10:31:05 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 10:31:05 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 04:54:14 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 39: > 37: * @test > 38: * @bug 6616245 > 39: * @key headful Why did you remove `headful`? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 10:35:35 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:35:35 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v9] In-Reply-To: References: Message-ID: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. Tejesh R has updated the pull request incrementally with one additional commit since the last revision: Updated based on review comments ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10485/files - new: https://git.openjdk.org/jdk/pull/10485/files/de312f56..5854ef23 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=08 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10485&range=07-08 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/jdk/pull/10485.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10485/head:pull/10485 PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 10:41:29 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:41:29 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 10:27:23 GMT, Alexey Ivanov wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 39: > >> 37: * @test >> 38: * @bug 6616245 >> 39: * @key headful > > Why did you remove `headful`? Added again, though some manual tests have this tag and some don't better to keep it as an indication that represents as headful test...... ------------- PR: https://git.openjdk.org/jdk/pull/10485 From magare31 at gmail.com Tue Oct 11 10:47:31 2022 From: magare31 at gmail.com (magare31 at gmail.com) Date: Tue, 11 Oct 2022 06:47:31 -0400 Subject: professional (24-bit) sampled audio support in the Windows native implementation of libjsound In-Reply-To: <0de52bab-dab9-a536-bd15-0df2b69f28a9@oracle.com> References: <02e901d8d4c0$7dd12ee0$79738ca0$@gmail.com> <506f19c5-28ae-e606-e7f1-22464793afcb@oracle.com> <028e01d8dbef$69b25070$3d16f150$@gmail.com> <5ca697e2-fd4f-8a4b-9f98-b536ed5bb2a7@oracle.com> <0de52bab-dab9-a536-bd15-0df2b69f28a9@oracle.com> Message-ID: <042b01d8dd5e$dda3e640$98ebb2c0$@gmail.com> Hi Phillip: Actual name is Anton. Understood. For various reasons, I am not interested in becoming a contributor at this point. I was simply looking for a current contributor that would pick up a small change. I'll drop this. Thank you all. Anton From: Philip Race Sent: Monday, October 10, 2022 10:21 PM To: Aleksei Ivanov ; magare31 at gmail.com; client-libs-dev at openjdk.org Subject: Re: professional (24-bit) sampled audio support in the Windows native implementation of libjsound So Magare (what is your actual name ?), As admin for this list I saw your latest email but due to size etc it was rejected by OpenJDK mail servers. I don't think I can do anything about that. In fact it wasn't even a patch. It was a full copy of a file. And I believe you misunderstood that Alexey was quoting what you should have sent in reply to the person who is triaging your bug submission. NOT to be sent to this list. Go look in your inbox+spam. Regardless OpenJDK does not take patches in email. They need to be github PRs *after* following process below. Have you read the OpenJDK Developer's Guide ? https://openjdk.org/guide/ Start here https://openjdk.org/guide/#contributing-to-an-openjdk-project and make sure to sign and return the OCA mentioned there. The OCA must be accepted in order to take code from you. Do you have a github account ? You'll need one and it'll have to be linked to an approved OCA. You can then submit a PR against https://github.com/openjdk/jdk I can help you "sponsor" this change, but you need to absorb the process and do the OCA first. -phil. On 10/10/22 2:03 PM, Aleksei Ivanov wrote: Hi, JDK-8294904 [1] was resolved as Incomplete because there's no sample code which demonstrates the problem. A comment was added: Mail to submitter: ============= Please share standalone test case/ reproducible step/ scenario to analyze the issue better. I should have received an email with request for clarification. I looked through the description but it's still unclear to me how to reproduce the problem and how to incorporate the fix you're proposing and what the fix is. If you could provide the test case and better yet the fix along with a regression test, it would be greatly appreciated. The fix in the form of the diff would also help. -- Regards, Alexey [1] https://bugs.openjdk.org/browse/JDK-8294904 On 09/10/2022 15:57, magare31 at gmail.com wrote: Since I am new to this, and apologies for the broad email, could someone explain the following for the corresponding bug (JDK-8294904)? 1. This bug is listed as one for a generic OS, whereas I specified Windows (I can confirm that it is Windows only). 2. This bug is listed as "resolved" with an "incomplete resolution". I did provide the full solution, so I am not sure what this means. (Also, Oracle asked for a standalone test, which I also provided over email) And thanks. From: Kevin Rushforth Sent: Friday, September 30, 2022 8:29 AM To: magare31 at gmail.com ; client-libs-dev at openjdk.org ; core-libs-dev at openjdk.org Subject: Re: professional (24-bit) sampled audio support in the Windows native implementation of libjsound Java Sound is in the client-libs area. You can file the bug yourself at https://bugreport.java.com/ if you like, or ask the sponsor of your bug (when one steps forward) to do it. If you want to contribute your fix, please see the contributing a patch section [1] in the JDK Developers Guide for the next steps. -- Kevin [1] https://openjdk.org/guide/#i-have-a-patch-what-do-i-do On 9/30/2022 4:33 AM, magare31 at gmail.com wrote: Would anyone want to sponsor the following simple bug fix? - The purpose is to enable playback and recording of 24-bit sampled audio on Windows. This is already supported on other systems. - There is no associated bug in the bug database. I noted it as a "bug" as the code misunderstands the WAVE RIFF format standards. - There will be two very small changes to one Windows native cpp file under libjsound - I have tested the changes on a jdk build of the latest code. Also, please advise which of these two groups this belongs to: client libs or core libs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tr at openjdk.org Tue Oct 11 10:48:29 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 10:48:29 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v5] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 10:12:47 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Test moved to plaf/gtk folder Marked as reviewed by tr (Author). Fix works fine and tested. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 10:48:30 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 10:48:30 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v5] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 10:12:47 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Test moved to plaf/gtk folder Please confirm that along with ubuntu, you have tested on Oracle Linux too. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From aivanov at openjdk.org Tue Oct 11 10:51:17 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 10:51:17 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v9] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 10:35:35 GMT, Tejesh R wrote: >> When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. > > Tejesh R has updated the pull request incrementally with one additional commit since the last revision: > > Updated based on review comments Marked as reviewed by aivanov (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aivanov at openjdk.org Tue Oct 11 10:51:19 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 10:51:19 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v7] In-Reply-To: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> References: <5BSqtyelyosUlbni9ct5mf0Une9WE_N0A0jh_6MY4Ao=.4aa4975f-ae4b-4f85-92bd-138a124d8120@github.com> Message-ID: On Tue, 11 Oct 2022 07:52:42 GMT, Abhishek Kumar wrote: >> Tejesh R has updated the pull request incrementally with one additional commit since the last revision: >> >> Updated based on review comments > > test/jdk/javax/swing/JFileChooser/FileViewNPETest.java line 39: > >> 37: * @test >> 38: * @bug 6616245 >> 39: * @key headful > > Is it required to have a `key` tag for manual test case? I admit I misunderstood the question. I thought @kumarabhi006 had asked for adding another keyword to `@key` to specify a _manual_ test. I didn't think about removing `@key headful`. At the same time, a manual test implies being _headful_ to the UI with instructions. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From tr at openjdk.org Tue Oct 11 11:14:34 2022 From: tr at openjdk.org (Tejesh R) Date: Tue, 11 Oct 2022 11:14:34 GMT Subject: Integrated: 6616245: NullPointerException when using JFileChooser with a custom FileView In-Reply-To: References: Message-ID: On Thu, 29 Sep 2022 11:12:41 GMT, Tejesh R wrote: > When a custom `FileView` is used and folder traversal is restricted to a particular directory NPE occurs when user tries to traverse/select other folders except traversable folder. This is caused because when user selects folder other than traversable, the traversal is rejected and hence no file is selected as `currentDirectory` of `JFileChooser`. When user tries to access the restricted folder second time, previous selected file check is failing because of NPE since `getFileChooser().getCurrentDirectory();` is null. To fix the issue, NPE check is added. This pull request has now been integrated. Changeset: 33d06188 Author: Tejesh R Committer: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/33d061881350c23b5116b3e555eaa905020636f7 Stats: 117 lines in 2 files changed: 113 ins; 2 del; 2 mod 6616245: NullPointerException when using JFileChooser with a custom FileView Reviewed-by: aivanov ------------- PR: https://git.openjdk.org/jdk/pull/10485 From kevin.rushforth at oracle.com Tue Oct 11 11:17:45 2022 From: kevin.rushforth at oracle.com (Kevin Rushforth) Date: Tue, 11 Oct 2022 04:17:45 -0700 Subject: Examples Of Many Java Swing Components In One Program. In-Reply-To: References: Message-ID: <702e6103-a19f-2d60-9ae8-e207e917d787@oracle.com> It's still there. https://github.com/openjdk/jdk/tree/master/src/demo/share/jfc/SwingSet2 Btw, client-libs-dev at openjdk.org (included) is the relevant mailing list for this message, not core-libs-dev. -- Kevin On 10/11/2022 1:54 AM, David Holmes wrote: > On 11/10/2022 4:38 pm, Amit wrote: >> Code for many Java Swing Components In One Program in case someone >> needs it. > > We used to have a Swing demo in the JDK ... don't know what happened > to it. > > David > >> Description: The program >> Examples_Of_Many_Swing_Components_In_One_Program contains examples of >> many swing components - that is, how to initialize them and use them. >> You can use code from this program in your code. Where applicable, >> appropriate listeners are also implemented. snip From duke at openjdk.org Tue Oct 11 11:46:32 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 11:46:32 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v5] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: <3Oewv3Ll4rb94Z0qMcP_YOat5UhosAbKEHXx0GJlhxg=.6e1278e5-77f3-425d-a647-c354c908f1a1@github.com> On Tue, 11 Oct 2022 10:42:46 GMT, Prasanta Sadhukhan wrote: > Please confirm that along with ubuntu, you have tested on Oracle Linux too. I have checked in Oracle Linux, Fix is working fine. ------------- PR: https://git.openjdk.org/jdk/pull/10390 From psadhukhan at openjdk.org Tue Oct 11 12:22:28 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Tue, 11 Oct 2022 12:22:28 GMT Subject: RFR: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. [v5] In-Reply-To: References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Tue, 11 Oct 2022 10:12:47 GMT, Abhishek Kumar wrote: >> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. >> >> Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. >> >> Test case has been added and checked in CI pipeline. Link is attached in JBS. > > Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision: > > Test moved to plaf/gtk folder Marked as reviewed by psadhukhan (Reviewer). ------------- PR: https://git.openjdk.org/jdk/pull/10390 From duke at openjdk.org Tue Oct 11 13:40:30 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Tue, 11 Oct 2022 13:40:30 GMT Subject: Integrated: 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. In-Reply-To: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> References: <_oBfe_QgJrCclVE_1Wr3i-MgYCztsi6gLvpSbh1fEtE=.74b31236-e722-4921-afc5-1a9fe20c59f6@github.com> Message-ID: On Thu, 22 Sep 2022 12:48:14 GMT, Abhishek Kumar wrote: > When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level. > > Fix for the issue is to remove "../" entry from JFileChooser directory list in GTK LAF if current directory is root. > > Test case has been added and checked in CI pipeline. Link is attached in JBS. This pull request has now been integrated. Changeset: 9d0009e9 Author: Abhishek Kumar Committer: Jayathirth D V URL: https://git.openjdk.org/jdk/commit/9d0009e92b790b43153e3db353db775e6ff731cb Stats: 98 lines in 2 files changed: 97 ins; 0 del; 1 mod 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. Reviewed-by: jdv, tr, psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/10390 From mvs at openjdk.org Tue Oct 11 13:49:31 2022 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 11 Oct 2022 13:49:31 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines [v2] In-Reply-To: References: Message-ID: <6vNrM57A4zL2ezWR8d_dA6P3_qdKJjqmI35pX8OfJYg=.c1295d00-99a8-496b-a362-bbed75cc169a@github.com> > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. Manukumar V S has updated the pull request incrementally with 39 additional commits since the last revision: - Updated screen capture code, made frame undecorated, added some prints for debugging - 6777156: GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea. Reviewed-by: jdv, tr, psadhukhan - 8294751: Zero: Allow larger default heaps Reviewed-by: iklam, rkennke - 6616245: NullPointerException when using JFileChooser with a custom FileView Reviewed-by: aivanov - 8291519: jdk/jfr/api/event/TestShouldCommit.java failed with Unexpected value of shouldCommit() Reviewed-by: mgronlun - 8293782: Shenandoah: some tests failed on lock rank check Reviewed-by: mdoerr, shade - 8282395: URL.openConnection can throw IOOBE Reviewed-by: dfuchs - 8294958: java/net/httpclient/ConnectTimeout tests are slow Reviewed-by: dfuchs, aefimov - 8294356: IGV: scheduled graphs contain duplicated elements Reviewed-by: chagedorn, thartmann - 8294901: remove pre-VS2017 checks in Windows related coding Reviewed-by: dholmes, mdoerr, kbarrett - ... and 29 more: https://git.openjdk.org/jdk/compare/d738f35d...5af46570 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10606/files - new: https://git.openjdk.org/jdk/pull/10606/files/d738f35d..5af46570 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10606&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10606&range=00-01 Stats: 4199 lines in 126 files changed: 3306 ins; 375 del; 518 mod Patch: https://git.openjdk.org/jdk/pull/10606.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10606/head:pull/10606 PR: https://git.openjdk.org/jdk/pull/10606 From aivanov at openjdk.org Tue Oct 11 13:50:58 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Tue, 11 Oct 2022 13:50:58 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 13:36:17 GMT, Manukumar V S wrote: > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. You did something wrong, now there are 40 commits and 126 files changed. It doesn't look right. Merging master should result in one commit only even though it brings multiple commits into the history. ------------- PR: https://git.openjdk.org/jdk/pull/10606 From mvs at openjdk.org Tue Oct 11 14:10:36 2022 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 11 Oct 2022 14:10:36 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 13:48:34 GMT, Alexey Ivanov wrote: > You did something wrong, now there are 40 commits and 126 files changed. It doesn't look right. > > Merging master should result in one commit only even though it brings multiple commits into the history. Yea, I have seen that. I tried to fix it, but its not working, will delete this branch and create a new one. ------------- PR: https://git.openjdk.org/jdk/pull/10606 From mvs at openjdk.org Tue Oct 11 14:10:37 2022 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 11 Oct 2022 14:10:37 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 17:59:23 GMT, Sergey Bylokhov wrote: >> But, is there any way we can capture the current screen where the frame is displayed? > > You can pass coordinates/bounds of that screen to the createScreenCapture. Will do that in a new PR as something went wrong with this and some unnecessary commits got added ------------- PR: https://git.openjdk.org/jdk/pull/10606 From mvs at openjdk.org Tue Oct 11 14:12:33 2022 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 11 Oct 2022 14:12:33 GMT Subject: Withdrawn: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 13:36:17 GMT, Manukumar V S wrote: > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/10606 From mvs at openjdk.org Tue Oct 11 14:27:25 2022 From: mvs at openjdk.org (Manukumar V S) Date: Tue, 11 Oct 2022 14:27:25 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines Message-ID: java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. Fix: Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. Also updated the screen capture code, made frame undecorated, added some prints for better debugging. ------------- Commit messages: - 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines Changes: https://git.openjdk.org/jdk/pull/10655/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10655&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8288415 Stats: 55 lines in 1 file changed: 35 ins; 4 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/10655.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10655/head:pull/10655 PR: https://git.openjdk.org/jdk/pull/10655 From dnguyen at openjdk.org Tue Oct 11 18:17:16 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 11 Oct 2022 18:17:16 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 07:08:57 GMT, Prasanta Sadhukhan wrote: >> Damon Nguyen 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 8294254/overlapFixEditableCombobox >> - Merge branch 'openjdk:master' into 8294254/overlapFixEditableCombobox >> - Remove test from problem list >> - Adjust rect width to remove overlap > > src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java line 478: > >> 476: else { >> 477: return new Rectangle(insets.left + buttonSize, insets.top + midHeight, >> 478: width - (insets.left + insets.right + buttonSize) + 3, > > I guess previous to this fix, we were using BasicComboBoxUI#rectangleForCurrentValue() which returns a width on which we add +4 for editor/textField width. > Since the calculation is basically same for width, why was it giving problem now (where only height is modified in the 8054572 fix) and not before this fix. I dont think this test use to fail before this fix was integrated with promoted CI builds Previously, editable comboboxes on macOS were misaligned altogether. The button and textfield were not at the same height (as seen on the "before" screenshots in [https://bugs.openjdk.org/browse/JDK-8054572](https://bugs.openjdk.org/browse/JDK-8054572)). My assumption is that these pixels that would normally overlap are no longer overlapping because of this. ------------- PR: https://git.openjdk.org/jdk/pull/10626 From dnguyen at openjdk.org Tue Oct 11 18:54:44 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 11 Oct 2022 18:54:44 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v3] In-Reply-To: References: Message-ID: > The previous change to AquaComboBoxUI had 1 pixel of overlap between the text field and the combo button. This caused a few pixels to darken sometimes when an editable combobox is displayed. Since this test passes sometimes and fails some other times, it was not initially detected. > > Since these few darkening pixels occur due to the change in AquaComboBoxUI, no reasonable change to the test could really be made, and the change would need to be to the class for the combobox. This fix was tested with a high count repeat and no failures occurred for various macOS systems. > > Also removing the test from the problem list. Damon Nguyen has updated the pull request incrementally with two additional commits since the last revision: - Merge branch '8294254/overlapFixEditableCombobox' of github.com:DamonGuy/jdk into 8294254/overlapFixEditableCombobox - Set uiscale ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10626/files - new: https://git.openjdk.org/jdk/pull/10626/files/6ee1f92f..8c0e0d8e Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10626&range=02 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10626&range=01-02 Stats: 5 lines in 1 file changed: 2 ins; 2 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/10626.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10626/head:pull/10626 PR: https://git.openjdk.org/jdk/pull/10626 From dnguyen at openjdk.org Tue Oct 11 18:54:46 2022 From: dnguyen at openjdk.org (Damon Nguyen) Date: Tue, 11 Oct 2022 18:54:46 GMT Subject: RFR: 8294254: [macOS] javax/swing/plaf/aqua/CustomComboBoxFocusTest.java failure [v2] In-Reply-To: References: Message-ID: On Mon, 10 Oct 2022 19:05:50 GMT, Harshitha Onkar wrote: > Suggestion: Does running the test - CustomComboBoxFocusTest.java with uiScale always set to 1 make it more robust? Sure, I can add a uiscale of 1 for robustness. Seems like a good idea since Jay's results at different uiscales may show variable pass rates at different uiscales. ------------- PR: https://git.openjdk.org/jdk/pull/10626 From duke at openjdk.org Tue Oct 11 19:59:00 2022 From: duke at openjdk.org (SWinxy) Date: Tue, 11 Oct 2022 19:59:00 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 14:17:42 GMT, Manukumar V S wrote: > java/awt/PopupMenu/PopupMenuLocation.java seems to be unstable in MacOS machines, especially in MacOSX 12 & 13 machines. It seems to be a testbug as adding some stability improvements fixes the issue. It intermittently fails in CI causing some noise. This test was already problem listed in windows due to an umbrella bug JDK-8238720. This fix doesn't cover the Windows issue, so the problem listing in windows will remain same. > > Fix: > Some stability improvements have been done and the test has been run 100 times per platform in mach5 and got full PASS. > Also updated the screen capture code, made frame undecorated, added some prints for better debugging. So, what's the difference between this and #9187 and #10606? And did one of them have git issues? ------------- PR: https://git.openjdk.org/jdk/pull/10655 From psadhukhan at openjdk.org Wed Oct 12 04:23:18 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 12 Oct 2022 04:23:18 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v4] In-Reply-To: References: Message-ID: > DefaultListSelectionModel.removeIndexInterva accepts `int` value which allows it to take in Integer.MAX_VALUE theoratically but it does calculation with that value which can results in IOOBE. > Fix is to make sure the calculation stays within bounds. Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: Review comment to exclude MAX_VALUE ------------- Changes: - all: https://git.openjdk.org/jdk/pull/10409/files - new: https://git.openjdk.org/jdk/pull/10409/files/b70c6ad7..23d59222 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10409&range=02-03 Stats: 42 lines in 2 files changed: 26 ins; 11 del; 5 mod Patch: https://git.openjdk.org/jdk/pull/10409.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10409/head:pull/10409 PR: https://git.openjdk.org/jdk/pull/10409 From psadhukhan at openjdk.org Wed Oct 12 04:23:19 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Wed, 12 Oct 2022 04:23:19 GMT Subject: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails [v4] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 19:50:19 GMT, Alexey Ivanov wrote: >> I guess Integer.MAX_VALUE should be valid "int" value, its because of internal calculation which is causing it to overflow so I guess we should not update the spec for wrongful calculation. >> I have fixed the overflow in setSelectionInterval. > > This is not a generic class, its main purpose is to handle list selection in UI components, such as `JList`. Excluding `Integer.MAX_VALUE` makes sense to me, it simplifies the code: no additional check in the loop and no special handling `removeIndexInterval` which also adds a condition to the loop. OK. Practically, it seems right as list probably may not have MAX_VALUE entries..Updated to exclude MAX_VALUE and updated the javadoc. ------------- PR: https://git.openjdk.org/jdk/pull/10409 From ihse at openjdk.org Wed Oct 12 09:52:26 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 12 Oct 2022 09:52:26 GMT Subject: RFR: 8295205: Add jcheck whitespace checking for markdown files Message-ID: Markdown files are basically source code for documentation. It should have the same whitespace checks as all other source code, so we don't get spurious trailing whitespace changes. ------------- Commit messages: - 8295205: Add jcheck whitespace checking for markdown files Changes: https://git.openjdk.org/jdk/pull/10671/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10671&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295205 Stats: 34 lines in 9 files changed: 0 ins; 0 del; 34 mod Patch: https://git.openjdk.org/jdk/pull/10671.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10671/head:pull/10671 PR: https://git.openjdk.org/jdk/pull/10671 From ihse at openjdk.org Wed Oct 12 10:31:51 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 12 Oct 2022 10:31:51 GMT Subject: RFR: 8295211: Fix autoconf 2.71 warning "AC_CHECK_HEADERS: you should use literals" Message-ID: In autoconf 2.71, there is a warning generated for calling AC_CHECK_HEADERS with a variable. It is not clear to me why they consider this to be a problem, but the warning is printed whenever you run configure with autoconf 2.71 or newer, and it is annoying. We're only doing this in one place. Let's hardcode the values instead so we get rid of the warning. ------------- Commit messages: - 8295211: Fix autoconf 2.71 warning "AC_CHECK_HEADERS: you should use literals" Changes: https://git.openjdk.org/jdk/pull/10672/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10672&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295211 Stats: 31 lines in 1 file changed: 17 ins; 12 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/10672.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10672/head:pull/10672 PR: https://git.openjdk.org/jdk/pull/10672 From ihse at openjdk.org Wed Oct 12 11:03:13 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 12 Oct 2022 11:03:13 GMT Subject: RFR: 8285306: Fix typos in java.desktop [v8] In-Reply-To: References: <5gAPAoRiIJr6BEko1UEaMd3QeUte-snqvfc9eNU2Jgk=.a6d39dcd-0d89-4444-a890-a6c53f41245b@github.com> Message-ID: <-2yChViV1cpNVUS3HMzM3d9I7J3ReBWr9G2w3skxF9M=.034c3f7f-d7fd-4961-a468-e250ac876062@github.com> On Tue, 13 Sep 2022 22:03:44 GMT, Phil Race wrote: >> I see now that Phil cryptically said: >> >>> Regarding changes in gif + freetype >> diff --git a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c \ >> \ >> diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c \ >> \ >> Please exclude ALL 3rd party libraries from this PR. >> >> That might be interpreted as stating that `gifdecoder.c` is 3rd party source code (although that was by no means clear to me the first time I read it). I'll revert the changes in that file, and also `src/java.desktop/share/native/libfontmanager/freetypeScaler.c`. > >> I see now that Phil cryptically said: >> >> > Regarding changes in gif + freetype >> > diff --git a/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c b/src/java.desktop/share/native/libawt/awt/image/gif/gifdecoder.c >> > >> > diff --git a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c >> > >> > Please exclude ALL 3rd party libraries from this PR. >> >> That might be interpreted as stating that `gifdecoder.c` is 3rd party source code (although that was by no means clear to me the first time I read it). I'll revert the changes in that file, and also `src/java.desktop/share/native/libfontmanager/freetypeScaler.c`. > > I don't know why I mentioned those two files like that but those particular two are JDK code so are fair game. > > I did write > "Please exclude ALL 3rd party libraries from this PR." > and later : > "We need to revert the native code changes to "libfreetype". > and those points are correct. > > You did fix the latter, but there are still some 3rd party files in there that are edited : glext.h, wsutils.h, multiVis.c @prrace Do you think you can approve this now, so we can finally close it? (I promise I won't open huge PRs like this in the future; lesson well learnt.) ------------- PR: https://git.openjdk.org/jdk/pull/8328 From ihse at openjdk.org Wed Oct 12 11:24:17 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 12 Oct 2022 11:24:17 GMT Subject: RFR: 8285306: Fix typos in java.desktop [v11] In-Reply-To: <5gAPAoRiIJr6BEko1UEaMd3QeUte-snqvfc9eNU2Jgk=.a6d39dcd-0d89-4444-a890-a6c53f41245b@github.com> References: <5gAPAoRiIJr6BEko1UEaMd3QeUte-snqvfc9eNU2Jgk=.a6d39dcd-0d89-4444-a890-a6c53f41245b@github.com> Message-ID: > I ran `codespell` on the `src/java.desktop` directory, and accepted those changes where it indeed discovered real typos. > > I ignored typos in public methods and variables. Maybe they can be fixed later on without much fanfare, if they are in internal classes. Typos in exposed APIs are likely here to stay. > > I will update copyright years using a script before pushing (otherwise like every second change would be a copyright update, making reviewing much harder). > > The long term goal here is to make tooling support for running `codespell`. The trouble with automating this is of course all false positives. But before even trying to solve that issue, all true positives must be fixed. Hence this PR. 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 50 commits: - Merge branch 'master' into typos-in-java.desktop - Merge branch 'master' into typos-in-java.desktop - Revert changes to glext.h - Revert changes to multiVis.c and wsutils.h - Merge branch 'master' into typos-in-java.desktop - Revert changes in libjpeg - Revert changes in libfreetype - Update src/java.desktop/windows/classes/sun/awt/windows/WPrinterJob.java Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk at users.noreply.github.com> - Update src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk at users.noreply.github.com> - Update src/java.desktop/unix/classes/sun/awt/X11/XBaseMenuWindow.java Co-authored-by: Alexey Ivanov <70774172+aivanov-jdk at users.noreply.github.com> - ... and 40 more: https://git.openjdk.org/jdk/compare/bdb4ed0f...e2d0979f ------------- Changes: https://git.openjdk.org/jdk/pull/8328/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=8328&range=10 Stats: 1017 lines in 483 files changed: 0 ins; 0 del; 1017 mod Patch: https://git.openjdk.org/jdk/pull/8328.diff Fetch: git fetch https://git.openjdk.org/jdk pull/8328/head:pull/8328 PR: https://git.openjdk.org/jdk/pull/8328 From erikj at openjdk.org Wed Oct 12 13:19:22 2022 From: erikj at openjdk.org (Erik Joelsson) Date: Wed, 12 Oct 2022 13:19:22 GMT Subject: RFR: 8295205: Add jcheck whitespace checking for markdown files In-Reply-To: References: Message-ID: <2owj2BREdvPlEo70s1rAvPywZeUPcimsej24fiAHyB4=.26f3a76b-0765-49ea-882d-591748bf1dcf@github.com> On Wed, 12 Oct 2022 09:44:54 GMT, Magnus Ihse Bursie wrote: > Markdown files are basically source code for documentation. It should have the same whitespace checks as all other source code, so we don't get spurious trailing whitespace changes. Thank you! Since I enabled visible whitespace in emacs (to be able to properly edit makefiles) editing any file where trailing whitespace isn't enforced makes my eyes bleed. :) ------------- Marked as reviewed by erikj (Reviewer). PR: https://git.openjdk.org/jdk/pull/10671 From ihse at openjdk.org Wed Oct 12 13:34:32 2022 From: ihse at openjdk.org (Magnus Ihse Bursie) Date: Wed, 12 Oct 2022 13:34:32 GMT Subject: Integrated: 8295205: Add jcheck whitespace checking for markdown files In-Reply-To: References: Message-ID: <4JUC33BHEbQxyvmLXseCLGOGURYFR_6f0uHcyJaGUkc=.cb1528a9-2718-4bfc-9a70-dce6a9e4db00@github.com> On Wed, 12 Oct 2022 09:44:54 GMT, Magnus Ihse Bursie wrote: > Markdown files are basically source code for documentation. It should have the same whitespace checks as all other source code, so we don't get spurious trailing whitespace changes. This pull request has now been integrated. Changeset: 86078423 Author: Magnus Ihse Bursie URL: https://git.openjdk.org/jdk/commit/860784238ea1f3e4a817fc3c28fb89cfee7549dd Stats: 34 lines in 9 files changed: 0 ins; 0 del; 34 mod 8295205: Add jcheck whitespace checking for markdown files Reviewed-by: erikj ------------- PR: https://git.openjdk.org/jdk/pull/10671 From serb at openjdk.org Wed Oct 12 21:19:15 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 12 Oct 2022 21:19:15 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: On Fri, 7 Oct 2022 22:01:00 GMT, Harshitha Onkar wrote: >> src/java.desktop/share/classes/javax/swing/plaf/metal/MetalBorders.java line 292: >> >>> 290: height = Region.clipRound(at.getScaleY() * h); >>> 291: xtranslation = Region.clipRound(at.getScaleX() * x + at.getTranslateX()); >>> 292: ytranslation = Region.clipRound(at.getScaleY() * y + at.getTranslateY()); >> >> This probably should be refactored to something like this: >> https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L375 > > @mrserb Thank for the suggestion. Are you suggesting that same transformations be applied for width, height and additionally to x&y translations? > https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L373 The methods like Rigion.dimAdd/clipScale should be used everywhere the overflow is possible. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From serb at openjdk.org Wed Oct 12 21:25:09 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 12 Oct 2022 21:25:09 GMT Subject: RFR: 7175396: The text on label is not painted red for Nimbus LaF. [v6] In-Reply-To: References: Message-ID: On Fri, 7 Oct 2022 08:40:42 GMT, Prasanta Sadhukhan wrote: >> Label.foreground UIProperty is not honored by Nimbus L&F. >> Added support for setting JLabel foreground color for Nimbus L&F > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Set foreground in installDefaults It would be good to understand how all that properties are handled by the skin. For example can you please check how the next property in the NimbusDefaults.java is handled by the L&F. `addColor(d, "Label[Disabled].textForeground", "nimbusDisabledText", 0.0f, 0.0f, 0.0f, 0);` Does it works fine? If yes probably we should add something like `addColor(d, "Label[Enabled].textForeground", "nimbusDisabledText", 0.0f, 0.0f, 0.0f, 0);` ? ------------- PR: https://git.openjdk.org/jdk/pull/9900 From aivanov at openjdk.org Wed Oct 12 21:28:10 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Wed, 12 Oct 2022 21:28:10 GMT Subject: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v9] In-Reply-To: References: <3MhNJ89856II0gMHYApX72zGgTm_NSRq9Tf6kdxLolw=.6486f993-6fab-4350-b30b-4e8b7d12024a@github.com> Message-ID: <94T9OU47fx7zjD8iKd9T89YvHP-8gxlZJusN7fJX7n4=.ee9c1377-67c5-4766-9883-54c2131941bc@github.com> On Wed, 12 Oct 2022 21:16:47 GMT, Sergey Bylokhov wrote: >> @mrserb Thank for the suggestion. Are you suggesting that same transformations be applied for width, height and additionally to x&y translations? >> https://github.com/openjdk/jdk/blob/ec4fb47b90c9737dfdc285ebe98367a221c90c79/src/java.desktop/share/classes/sun/java2d/SunGraphics2D.java#L373 > > The methods like Rigion.dimAdd/clipScale should be used everywhere the overflow is possible. Thank you, @mrserb, for your suggestion. I didn't know about those methods. We already have [JDK-8294680](https://bugs.openjdk.org/browse/JDK-8294680) to refactor this code. If you don't object, I'd rather postpone updating the calculations to a later time. We should absolutely re-use the existing code if it does the same thing. ------------- PR: https://git.openjdk.org/jdk/pull/10274 From serb at openjdk.org Wed Oct 12 21:33:18 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 12 Oct 2022 21:33:18 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: Message-ID: <2U1zChzBva4BAT9holXMofyEaw94-0TakLj7HA2PoLU=.f09e788e-a5b9-4d15-adf3-cfcd649fa7a1@github.com> On Mon, 10 Oct 2022 11:27:27 GMT, Alexey Ivanov wrote: >> Ok, since the test has to select non traversable folders in both windows and linux I had thought that making it as manual would be better. > > Yet you control which folders are non-traversable. Anyway? A test is better than no test; an automatic test is better than a manual one. Probably it will be good to automate it, and cover the macOS? I do not see a reason why we cannot set Metal L&F and verify the fix. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From serb at openjdk.org Wed Oct 12 21:45:14 2022 From: serb at openjdk.org (Sergey Bylokhov) Date: Wed, 12 Oct 2022 21:45:14 GMT Subject: RFR: 8075916: The regression-swing case failed as colored text is not shown on disabled checkbox and radio button with Nimbus LAF [v6] In-Reply-To: <1SNEA4yF2vhL2WZ5nEsFIN8IPoLzDpdctrv9fq4XznA=.c7f28180-116f-406d-8a7e-ece8b3b60bae@github.com> References: <_Pu4ZIceztdCjw5gy3bOR39Y0Jvz_TEiHdGMN0rKu-M=.9843abff-48d9-4a66-95f3-198e897c1399@github.com> <1SNEA4yF2vhL2WZ5nEsFIN8IPoLzDpdctrv9fq4XznA=.c7f28180-116f-406d-8a7e-ece8b3b60bae@github.com> Message-ID: On Wed, 28 Sep 2022 12:42:14 GMT, Prasanta Sadhukhan wrote: >> CheckBox.disabledText and RadioButton.disabledText color UIProperty is not honoured by Nimbus L&F when disabled text is drawn for JCheckBox and JRadioButton, so disabled text color was rendered incorrectly. >> Fix is to honour these UIProperty color if they are set by user, else use the color from the component or via getColorForState(). >> >> Closed test as mentioned in JBS is used to check the fix. > > Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision: > > Test fix The spec for the changed method mention that the "getColorForState" should be called for the component if the app did not specify the color explicetly. Should the fix do the same instead of direct call of "UIManager.getColor"? And if it does not work should we updated the skin to include these props? ------------- PR: https://git.openjdk.org/jdk/pull/10177 From tr at openjdk.org Thu Oct 13 04:54:18 2022 From: tr at openjdk.org (Tejesh R) Date: Thu, 13 Oct 2022 04:54:18 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: <2U1zChzBva4BAT9holXMofyEaw94-0TakLj7HA2PoLU=.f09e788e-a5b9-4d15-adf3-cfcd649fa7a1@github.com> References: <2U1zChzBva4BAT9holXMofyEaw94-0TakLj7HA2PoLU=.f09e788e-a5b9-4d15-adf3-cfcd649fa7a1@github.com> Message-ID: On Wed, 12 Oct 2022 21:30:42 GMT, Sergey Bylokhov wrote: >> Yet you control which folders are non-traversable. Anyway? A test is better than no test; an automatic test is better than a manual one. > > Probably it will be good to automate it, and cover the macOS? I do not see a reason why we cannot set Metal L&F and verify the fix. I wasn't able to reproduce the issue in macOS, so didn't include it in test...... And the fix is for metal L&F and should we explicitly set the L&F? Anyhow default L&F is metal right....? ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aturbanov at openjdk.org Thu Oct 13 07:00:11 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Thu, 13 Oct 2022 07:00:11 GMT Subject: Integrated: 8293984: Unnecessary Vector usage in PropertyEditorSupport In-Reply-To: References: Message-ID: On Mon, 19 Sep 2022 06:55:50 GMT, Andrey Turbanov wrote: > Field PropertyEditorSupport.listeners is accessed only under `synchronized(this)`. > It means extra synchronization by Vector is not needed. This pull request has now been integrated. Changeset: 6ae7e4d4 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/6ae7e4d4aad5712cf2fe6ab9f98dc424fa4170cb Stats: 14 lines in 1 file changed: 0 ins; 5 del; 9 mod 8293984: Unnecessary Vector usage in PropertyEditorSupport Reviewed-by: serb ------------- PR: https://git.openjdk.org/jdk/pull/10331 From mvs at openjdk.org Thu Oct 13 07:46:01 2022 From: mvs at openjdk.org (Manukumar V S) Date: Thu, 13 Oct 2022 07:46:01 GMT Subject: RFR: 8288415: java/awt/PopupMenu/PopupMenuLocation.java is unstable in MacOS machines In-Reply-To: References: Message-ID: On Tue, 11 Oct 2022 19:56:49 GMT, SWinxy wrote: > So, what's the difference between this and #9187 and #10606? And did one of them have git issues? No, #9187 got closed automatically by bot after being inactive for 8 weeks. And difference between #9187 and #10606 are, 1. Improved the screen capture logic in #10606 to capture the corresponding screen where the frame is displayed. 2. Made the frame undecorated as I have seen in some linux machines that, sometimes the mouse click inadvertently goes to the frame header which in turn fails the test(as it will not invoke the popup menu). ------------- PR: https://git.openjdk.org/jdk/pull/10655 From duke at openjdk.org Thu Oct 13 16:19:33 2022 From: duke at openjdk.org (Abhishek Kumar) Date: Thu, 13 Oct 2022 16:19:33 GMT Subject: Integrated: 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB In-Reply-To: References: Message-ID: On Wed, 29 Jun 2022 13:06:21 GMT, Abhishek Kumar wrote: > JFileChooser - empty file size issue fixed. > For empty file, now the size 0 KB. > Manual Test Case "FileSizeCheck.java" created. This pull request has now been integrated. Changeset: 3b343875 Author: Abhishek Kumar Committer: Alexey Ivanov URL: https://git.openjdk.org/jdk/commit/3b3438752cbac49272dfda7d11adbeac0ab2ea9d Stats: 167 lines in 2 files changed: 155 ins; 1 del; 11 mod 8288882: JFileChooser - empty (0 bytes) file is displayed as 1 KB Reviewed-by: aivanov, angorya, psadhukhan ------------- PR: https://git.openjdk.org/jdk/pull/9327 From duke at openjdk.org Thu Oct 13 16:32:19 2022 From: duke at openjdk.org (Rajat Mahajan) Date: Thu, 13 Oct 2022 16:32:19 GMT Subject: RFR: 8282958: Rendering issues of borders, TextFields on Windows High-DPI systems Message-ID: This fix is based on a similar approach as described here https://github.com/openjdk/jdk/pull/7449#issuecomment-1068218648. We rescale the line border to render the Textfield border correctly, so that all sides of the Textfield border are of same thickness. ------------- Commit messages: - remove executable permission - fix file ending - 8282958: Rendering issues of borders, TextFields on Windows High-DPI systems Changes: https://git.openjdk.org/jdk/pull/10681/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10681&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8282958 Stats: 663 lines in 3 files changed: 658 ins; 1 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/10681.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10681/head:pull/10681 PR: https://git.openjdk.org/jdk/pull/10681 From aivanov at openjdk.org Thu Oct 13 20:33:10 2022 From: aivanov at openjdk.org (Alexey Ivanov) Date: Thu, 13 Oct 2022 20:33:10 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: <2U1zChzBva4BAT9holXMofyEaw94-0TakLj7HA2PoLU=.f09e788e-a5b9-4d15-adf3-cfcd649fa7a1@github.com> Message-ID: On Thu, 13 Oct 2022 04:52:02 GMT, Tejesh R wrote: >> Probably it will be good to automate it, and cover the macOS? I do not see a reason why we cannot set Metal L&F and verify the fix. > > I wasn't able to reproduce the issue in macOS, so didn't include it in test...... And the fix is for metal L&F and should we explicitly set the L&F? Anyhow default L&F is metal right....? > Probably it will be good to automate it I've submitted [JDK-8295298](https://bugs.openjdk.org/browse/JDK-8295298): Automate javax/swing/JFileChooser/FileViewNPETest.java > ? and cover the macOS? I do not see a reason why we cannot set Metal L&F and verify the fix. Agreed. > I wasn't able to reproduce the issue in macOS, so didn't include it in test...... And the fix is for metal L&F and should we explicitly set the L&F? Anyhow default L&F is metal right....? The default Look and Feel is Metal except for macOS where the default one is Aqua which is the system L&F. The default L&F can be changed using a property file or setting the system property. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From prr at openjdk.org Thu Oct 13 21:28:04 2022 From: prr at openjdk.org (Phil Race) Date: Thu, 13 Oct 2022 21:28:04 GMT Subject: RFR: 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04 Message-ID: 7 TrayIcon tests fail on Ubuntu 22.04. We need to problem list them until this can be resolved. ------------- Commit messages: - 8295301 Changes: https://git.openjdk.org/jdk/pull/10705/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10705&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295301 Stats: 7 lines in 1 file changed: 0 ins; 0 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/10705.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10705/head:pull/10705 PR: https://git.openjdk.org/jdk/pull/10705 From dholmes at openjdk.org Thu Oct 13 21:35:11 2022 From: dholmes at openjdk.org (David Holmes) Date: Thu, 13 Oct 2022 21:35:11 GMT Subject: RFR: 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04 In-Reply-To: References: Message-ID: On Thu, 13 Oct 2022 21:21:12 GMT, Phil Race wrote: > 7 TrayIcon tests fail on Ubuntu 22.04. We need to problem list them until this can be resolved. LGTM. Thanks. ------------- Marked as reviewed by dholmes (Reviewer). PR: https://git.openjdk.org/jdk/pull/10705 From prr at openjdk.org Thu Oct 13 21:40:01 2022 From: prr at openjdk.org (Phil Race) Date: Thu, 13 Oct 2022 21:40:01 GMT Subject: Integrated: 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04 In-Reply-To: References: Message-ID: On Thu, 13 Oct 2022 21:21:12 GMT, Phil Race wrote: > 7 TrayIcon tests fail on Ubuntu 22.04. We need to problem list them until this can be resolved. This pull request has now been integrated. Changeset: fdb74ed4 Author: Phil Race URL: https://git.openjdk.org/jdk/commit/fdb74ed45240477bd08eb40ede5eaa2345ca6b5d Stats: 7 lines in 1 file changed: 0 ins; 0 del; 7 mod 8295301: Problem list TrayIcon tests that fail on Ubuntu 22.04 Reviewed-by: dholmes ------------- PR: https://git.openjdk.org/jdk/pull/10705 From tr at openjdk.org Fri Oct 14 04:42:47 2022 From: tr at openjdk.org (Tejesh R) Date: Fri, 14 Oct 2022 04:42:47 GMT Subject: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v4] In-Reply-To: References: <2U1zChzBva4BAT9holXMofyEaw94-0TakLj7HA2PoLU=.f09e788e-a5b9-4d15-adf3-cfcd649fa7a1@github.com> Message-ID: <_ThHKmYvKqYhRNLoXCwIh6ykBNLlV8h9gITFBbaUElc=.23d55327-e2d8-404b-953b-00c64f27d7f4@github.com> On Thu, 13 Oct 2022 20:01:37 GMT, Alexey Ivanov wrote: >> I wasn't able to reproduce the issue in macOS, so didn't include it in test...... And the fix is for metal L&F and should we explicitly set the L&F? Anyhow default L&F is metal right....? > >> Probably it will be good to automate it > > I've submitted [JDK-8295298](https://bugs.openjdk.org/browse/JDK-8295298): Automate javax/swing/JFileChooser/FileViewNPETest.java > >> ? and cover the macOS? I do not see a reason why we cannot set Metal L&F and verify the fix. > > Agreed. > >> I wasn't able to reproduce the issue in macOS, so didn't include it in test...... And the fix is for metal L&F and should we explicitly set the L&F? Anyhow default L&F is metal right....? > > The default Look and Feel is Metal except for macOS where the default one is Aqua which is the system L&F. The default L&F can be changed using a property file or setting the system property. > > You can always change the L&F in the code. Ok will check in macOS again then. ------------- PR: https://git.openjdk.org/jdk/pull/10485 From aturbanov at openjdk.org Fri Oct 14 06:46:02 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Fri, 14 Oct 2022 06:46:02 GMT Subject: Integrated: 8295026: Remove unused fields in StyleSheet In-Reply-To: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> References: <9p71hu-CpTJ6dsy_0j2Rnks8TX7m4jyIgyGpeo8l18k=.9cfe4931-2d55-4ad8-bf67-78c05a13d7b7@github.com> Message-ID: On Sat, 1 Oct 2022 17:05:11 GMT, Andrey Turbanov wrote: > There are 3 unused fields in single `StyleSheet` file: > 1. `static final Border noBorder = new EmptyBorder(0,0,0,0);` > 2. `static final int DEFAULT_FONT_SIZE = 3;` > 3. `URL imageurl;` in nested `javax.swing.text.html.StyleSheet.ListPainter` class This pull request has now been integrated. Changeset: be3b3354 Author: Andrey Turbanov URL: https://git.openjdk.org/jdk/commit/be3b3354523917c024fb9d7d99de7c7eec3d175a Stats: 5 lines in 1 file changed: 0 ins; 5 del; 0 mod 8295026: Remove unused fields in StyleSheet Reviewed-by: aivanov ------------- PR: https://git.openjdk.org/jdk/pull/10523 From aturbanov at openjdk.org Fri Oct 14 07:10:11 2022 From: aturbanov at openjdk.org (Andrey Turbanov) Date: Fri, 14 Oct 2022 07:10:11 GMT Subject: RFR: 8295323: Unnecessary HashTable usage in StyleSheet Message-ID: <_bCtfNKiq4bp595w1PBfN74xfoobhAVYx58ntgrVGug=.bc7397a2-9b9e-44e8-b5f2-4058828f0c50@github.com> Hashtable was used only from single thread. And only non-null key/values added to it. We can safely replace it with HashSet. ------------- Commit messages: - [PATCH] Unnecessary HashTable usage in StyleSheet Changes: https://git.openjdk.org/jdk/pull/10522/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10522&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8295323 Stats: 18 lines in 1 file changed: 0 ins; 2 del; 16 mod Patch: https://git.openjdk.org/jdk/pull/10522.diff Fetch: git fetch https://git.openjdk.org/jdk pull/10522/head:pull/10522 PR: https://git.openjdk.org/jdk/pull/10522 From duke at openjdk.org Fri Oct 14 07:10:11 2022 From: duke at openjdk.org (SWinxy) Date: Fri, 14 Oct 2022 07:10:11 GMT Subject: RFR: 8295323: Unnecessary HashTable usage in StyleSheet In-Reply-To: <_bCtfNKiq4bp595w1PBfN74xfoobhAVYx58ntgrVGug=.bc7397a2-9b9e-44e8-b5f2-4058828f0c50@github.com> References: <_bCtfNKiq4bp595w1PBfN74xfoobhAVYx58ntgrVGug=.bc7397a2-9b9e-44e8-b5f2-4058828f0c50@github.com> Message-ID: On Sat, 1 Oct 2022 16:53:17 GMT, Andrey Turbanov wrote: > Hashtable was used only from single thread. And only non-null key/values added to it. We can safely replace it with HashSet. src/java.desktop/share/classes/javax/swing/text/html/StyleSheet.java line 1364: > 1362: HashSet alreadyChecked) { > 1363: // Avoid descending the same mapping twice. > 1364: if (!alreadyChecked.add(parentMapping)) { Clever! ------------- PR: https://git.openjdk.org/jdk/pull/10522 From psadhukhan at openjdk.org Fri Oct 14 09:06:40 2022 From: psadhukhan at openjdk.org (Prasanta Sadhukhan) Date: Fri, 14 Oct 2022 09:06:40 GMT Subject: RFR: 7172359: HTML parser StackOverflowError on invalid HTML:

  • tag inside an
  • tag inside an
  • tag inside an