On Tue, 10 Mar 2026 17:23:52 GMT, Andy Goryachev <[email protected]> wrote:

>> Dmitry Markov has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Update exception message
>
> modules/javafx.graphics/src/main/java/javafx/stage/FileChooser.java line 328:
> 
>> 326:      * @param ownerWindow the owner window of the displayed file dialog
>> 327:      * @throws IllegalArgumentException if the initial directory does 
>> not
>> 328:      *      exist or is not a directory or is not accessible
> 
> I wonder if this is the right approach.  Yes, it currently works like that, 
> but I think it's wrong!
> What if the directory was deleted?  What if it was on a network share?
> 
> The right behavior should be to open the dialog using the current directory 
> (ignoring the error), and let the user deal with it.

That would be a noticeable behavior change. We could do what you suggest, but 
then the application wouldn't be able to tell that's what happened. As it is, 
the app can do what you suggest (catch the exception and set the dialog to the 
current dir) or something else (maybe a default location for the app).

I wouldn't want to change it without more discussion.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2101#discussion_r2913573162

Reply via email to