On Thu, 18 Jun 2026 08:21:05 GMT, Prasanta Sadhukhan <[email protected]> wrote:
> `DTD.getElement(String)` is not thread safe. If there are 2 parallel parser > threads which call with the same new name then in the Vector there can be 2 > identical elements. These unsynchronized elementHash.get(name) calls can both > observe null before either thread creates and puts the `Element` which will > then have duplicates. The index from elements.size() can also be wrong under > races. > > The block needs to be synchronized to prevent this > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has been closed without being integrated. ------------- PR: https://git.openjdk.org/jdk/pull/31568
