RFR: 6777156: GTK L&F: JFileChooser shouldn't display /../../../.. in combobox and selection textarea. [v2]
Abhishek Kumar
duke at openjdk.org
Mon Sep 26 06:18:41 UTC 2022
On Fri, 23 Sep 2022 11:11:12 GMT, Tejesh R <tr at openjdk.org> wrote:
>> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Comment added and test case condotion update
>
> src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 436:
>
>> 434: int index = list.locationToIndex(e.getPoint());
>> 435: File currentDirectory = getFileChooser().getCurrentDirectory();
>> 436: if (currentDirectory.getParentFile() == null && index == 1) {
>
> Adding a Comment explaining the statement `index == 1` would be better to understand that it signifies root directory index.
Added a comment.
Basically, `getParentFile` method is used to check root directory and `index == 1` is the index of `../` directory.
-------------
PR: https://git.openjdk.org/jdk/pull/10390
More information about the client-libs-dev
mailing list