RFR: 8307091: Few test threw ConcurrentModificationException Intermittently

Phil Race prr at openjdk.org
Wed May 3 20:07:19 UTC 2023


On Wed, 3 May 2023 16:13:53 GMT, Tejesh R <tr at openjdk.org> wrote:

> Few test are throwing Concurrent Modification Exception Intermittently. Since the issue is intermittent and from the log and code review, It is found that the shared variable `fileCache` is used in comparison with the `newFileCache` where the comparison invokes the iterator method in AbstractList class. Since based on vector documentation it was evident that listIterator are fail-fast iterators and hence it would be better to make a separate local copy of vectors for comparing operations. 
> The same is implemented and tested in CI system which shows green.

Looks reasonable. Fix the formatting I noted

PS update the PR summary to match the revised JBS one -
"A few client tests intermittently throw ConcurrentModificationException"

src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java line 387:

> 385:                         if (start >= 0 && end > start) {
> 386:                             List<File> listEnd_OldSize = new Vector<>(fileCache.subList(end, oldSize));
> 387:                             if(listEnd_OldSize.equals(newFileCache.subList(start, newSize))) {

if( -> "if ("

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

Marked as reviewed by prr (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/13783#pullrequestreview-1411706092
PR Comment: https://git.openjdk.org/jdk/pull/13783#issuecomment-1533660964
PR Review Comment: https://git.openjdk.org/jdk/pull/13783#discussion_r1184196345



More information about the client-libs-dev mailing list