RFR: 8139228: JFileChooser renders file names as HTML document

Alexey Ivanov aivanov at openjdk.org
Wed Apr 23 10:24:41 UTC 2025


On Wed, 23 Apr 2025 10:17:16 GMT, Tejesh R <tr at openjdk.org> wrote:

>>> > Because it's impossible to create a file with `<html>` in the name on Windows.
>>> 
>>> But is should be possible to trigger the bug using a custom FileSystemView without interacting with the actual file system?
>> 
>> An interesting idea. Using a custom `FileSystemView` for testing on Windows should be explored.
>> 
>>> @mrserb You mean to say that, same issue would be their for Windows L&F too, since we are unable to test it directly it's been missed ?
>> 
>> @TejeshR13 I'm pretty sure Windows L&F is affected too.
>> 
>> You could remediated the issue by setting `"html.disable"` on `FilePane`, but it may be not enough as you also modified `FileChooserUI` for each L&F.
>
> I don't think we can reproduce this issue even with custom FileSystemView because windows doesn't allow to create a file with special characters, it just discard those special characters. Also it doesn't allow to create a new folder with special characters through JFileChooser also.

That's the point of using a custom `FileSystemView`… not to create the files on the file system but to return the list of files. The files themselves may not exist on the file system at all.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24439#discussion_r2055741736


More information about the client-libs-dev mailing list