RFR: 8323670: A few client tests intermittently throw ConcurrentModificationException

Alexey Ivanov aivanov at openjdk.org
Thu Jan 25 12:10:35 UTC 2024


On Thu, 25 Jan 2024 10:50:32 GMT, Alexey Ivanov <aivanov at openjdk.org> 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


More information about the client-libs-dev mailing list