RFR: 8318082: ConcurrentModificationException from IndexWriter

Hannes Wallnöfer hannesw at openjdk.org
Fri Oct 20 08:50:38 UTC 2023


On Thu, 19 Oct 2023 17:07:15 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> Please review this fix to a bug in indexing.
>> 
>> The bug has been dormant for many releases and was noticed only because its likelihood was increased by [JDK-8286470](https://bugs.openjdk.org/browse/JDK-8286470) in JDK 21.
>> 
>> Here's the bug: every time an item is indexed, it is indexed relative to the context that triggers the indexing. For example, if an item is indexed in the context of a class page, then the index will refer to that class page. However, if that same item is indexed in the context of the "Deprecated" page, then the index will refer to the "Deprecated" page.
>> 
>> Since an item is indexed every time it is seen, the fix is to never index an item if seen in the context of a _derived_ page, such as hierarchy trees, indexes, and various lists (e.g. deprecated, new, preview). The fix includes a comprehensive test and updates an existing test to correct its bad assumptions.
>
> test/langtools/jdk/javadoc/doclet/testIndex/TestSelfIndexing.java line 153:
> 
>> 151:                                 "package-use.html", "package-tree.html", "preview-list.html",
>> 152:                                 "new-list.html", "allclasses-index.html", "allpackages-index.html",
>> 153:                                 "constant-values.html", "system-properties.html", "serialized-form.html"
> 
> The hard-coded list of derived HTML files could become outdated when new lists are added. For example, we just recently added `restricted-list.html` for restricted methods. Could we detect this from the presence of a dash in the file name, as this is our way to avoid conflict of derived files with Java types?

Upon second thought, feel free to ignore above comment. It's maybe not required to catch all derived files, and the explicit list makes the code much easier to understand.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16271#discussion_r1366675104


More information about the javadoc-dev mailing list