RFR: 8325179: Race in BasicDirectoryModel.validateFileCache [v2]
Alexey Ivanov
aivanov at openjdk.org
Tue Mar 5 11:07:14 UTC 2024
On Tue, 5 Mar 2024 09:24:52 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
>> Alexey Ivanov has updated the pull request incrementally with four additional commits since the last revision:
>>
>> - Replace synchronized invalidateFileCache with synchronized block inside
>> - Declare DoChangeContents constructor private, wrap its parameters
>> - Space after synchronized in DoChangeContents.run
>> - Convert runnable to local variable
>
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java line 281:
>
>> 279: private final Thread loadThread;
>> 280:
>> 281: private DoChangeContents runnable;
>
> Can be converted to local variable now
You're right. I didn't notice it.
> src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java line 539:
>
>> 537: int remSize = (remFiles == null) ? 0 : remFiles.size();
>> 538: int addSize = (addFiles == null) ? 0 : addFiles.size();
>> 539: synchronized(fileCache) {
>
> Suggestion:
>
> synchronized (fileCache) {
I didn't modify this code. I went ahead and updated it so that it's consistent in the class.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18111#discussion_r1512635413
PR Review Comment: https://git.openjdk.org/jdk/pull/18111#discussion_r1512636642
More information about the client-libs-dev
mailing list