On Thu, 25 Jan 2024 10:50:32 GMT, Alexey Ivanov <[email protected]> wrote:
> Looking at the methods of `BasicDirectoryModel`, I can see that some methods > use `synchronized(fileCache)` before accessing the field but others > (`getSize`, `contains`, `indexOf`, `getElementAt`), which makes the > `BasicDirectoryModel` class not thread-safe; it is especially dangerous with > `contains` and `indexOf` where the contents of the `fileCache` can be changed > while the method is iterating over the values inside `fileCache`. I've just submitted [JDK-8324719](https://bugs.openjdk.org/browse/JDK-8324719): _Missing synchronized block in BasicDirectoryModel_ to address this synchronisation issue. ------------- PR Comment: https://git.openjdk.org/jdk/pull/17462#issuecomment-1910070320
