Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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) && (fil

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v3]

2022-10-03 Thread Tejesh R
> 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

RFR: 8294488: Delete KCMS transforms wrappers

2022-10-03 Thread Sergey Bylokhov
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 pr

Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

2022-10-03 Thread Harshitha Onkar
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 > 32

Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

2022-10-03 Thread Harshitha Onkar
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: http

Re: RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion

2022-10-03 Thread Sergey Bylokhov
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? -

Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

2022-10-03 Thread Alisen Chung
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 >> obs

Re: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6]

2022-10-03 Thread Alexey Ivanov
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

Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

2022-10-03 Thread Alexey Ivanov
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 >> obs

Re: RFR: JDK-8015739: Background of JInternalFrame is located out of JInternalFrame [v4]

2022-10-03 Thread Alexey Ivanov
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 >> obs

Re: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6]

2022-10-03 Thread Emmanuel Bourg
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 th

Re: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v4]

2022-10-03 Thread Damon Nguyen
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 t

Re: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v4]

2022-10-03 Thread Alisen Chung
> 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 -

Re: RFR: 8294426: Two fingers tap generates wrong mouse modifiers on M2 MacBooks

2022-10-03 Thread Phil Race
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

Re: RFR: 8294426: Two fingers tap generates wrong mouse modifiers on M2 MacBooks

2022-10-03 Thread Phil Race
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 `InputE

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7]

2022-10-03 Thread Joe Darcy
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: * >

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v8]

2022-10-03 Thread Joe Darcy
> 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 re

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7]

2022-10-03 Thread Phil Race
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

Re: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v3]

2022-10-03 Thread Alisen Chung
> 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 unnece

Integrated: 8276849: Refresh the window icon on graphics configuration changes

2022-10-03 Thread Emmanuel Bourg
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 > DP

Re: RFR: 8276849: Refresh the window icon on graphics configuration changes [v6]

2022-10-03 Thread Jayathirth D V
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 th

Re: RFR: 8292588: [macos] Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java: Robot.mouseMove test failed on Screen #0

2022-10-03 Thread Jayathirth D V
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

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4]

2022-10-03 Thread Joe Darcy
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

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v7]

2022-10-03 Thread Joe Darcy
> 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 sinc

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v6]

2022-10-03 Thread Joe Darcy
> 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 sinc

Re: RFR: JDK-8294618: Update openjdk.java.net => openjdk.org [v4]

2022-10-03 Thread Joe Darcy
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.n

Re: RFR: 8292309 : Fix java/awt/PrintJob/ConstrainedPrintingTest/ConstrainedPrintingTest.java test [v3]

2022-10-03 Thread Jayathirth D V
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) Replac

Re: RFR: 8292214: Memory leak in getAllConfigs of awt_GraphicsEnv.c:386 [v2]

2022-10-03 Thread Damon Nguyen
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 57

Re: RFR: 8292280: Unused field 'keyListener' in BasicRadioButtonUI [v2]

2022-10-03 Thread Jayathirth D V
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 update

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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 6616

Re: RFR: 6187113: DefaultListSelectionModel.removeIndexInterval(0, Integer.MAX_VALUE) fails

2022-10-03 Thread Alexey Ivanov
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 setSelec

Re: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert

2022-10-03 Thread Alexey Ivanov
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 c

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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 oth

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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/java

RFR: 8270915: GIFImageReader disregards ignoreMetadata flag which causes memory exhaustion

2022-10-03 Thread Jayathirth D V
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 cau

Re: RFR: 5080391: ArrayIndexOutOfBounds during "undo" of Right-to-Left text insert

2022-10-03 Thread Alexey Ivanov
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 und

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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.d

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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/JFile

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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. -

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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, yo

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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? > >

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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 Windo

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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)

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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: Stri

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Alexey Ivanov
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 oth

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView [v2]

2022-10-03 Thread Tejesh R
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 oth

Re: RFR: 6616245: NullPointerException when using JFileChooser with a custom FileView

2022-10-03 Thread Tejesh R
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 >> fold