On Fri, 14 Oct 2022 04:39:02 GMT, Tejesh R wrote:
>>> 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 ca
On Mon, 10 Oct 2022 16:17:04 GMT, Alexey Ivanov wrote:
>> Yeah, was not able to reproduce in macOS.
>
> You can set Metal L&F explicitly on macOS.
Yeah, I checked it now and the issue is reproducible in macOS also, have to
update the test to include macOS.
Had thought that default L&F in macOS
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 i
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
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 w
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;
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
>
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 oth
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
>>
> 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
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 oth
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 oth
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:
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
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 fo
> 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
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 oth
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"
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.
---
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 imp
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 oth
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 oth
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 oth
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: pas
> 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
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 oth
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: imp
> 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
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: * @require
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 on
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 oth
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 = ne
> 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
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 w
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 othe
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 JComp
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
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
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
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 othe
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
> 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
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
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
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
> 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
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
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
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
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
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
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
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
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.
-
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
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
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?
>
>
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
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
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)
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
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
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
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
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
On Fri, 30 Sep 2022 07:44:31 GMT, Abhishek Kumar wrote:
> The instruction are not quite clear. Can you please modify it as we discussed
> over call?
Updated.
-
PR: https://git.openjdk.org/jdk/pull/10485
> 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
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 t
68 matches
Mail list logo