RFR: 8325179: Race in BasicDirectoryModel.validateFileCache [v3]

Alexey Ivanov aivanov at openjdk.org
Fri Mar 15 12:07:39 UTC 2024


On Thu, 14 Mar 2024 19:57:06 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Store the size of fileCache inside synchronized block
>
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java line 534:
> 
>> 532:         @Override
>> 533:         public void run() {
>> 534:             if (fetchID.get() != fid) {
> 
> How it will work if the "FilesLoader" was created already but before loading the files the "invalidateFileCache" was called, before the patch we stop execution due to "doFire=false".

Good catch!

I'll bump `fetchID` in `invalidateFileCache`. I missed this part.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18111#discussion_r1526188484


More information about the client-libs-dev mailing list