On Wed, 24 Jun 2026 03:33:40 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). > > Prasanta Sadhukhan has updated the pull request incrementally with one > additional commit since the last revision: > > Make other methods thread safe I think this should be closed as not an issue or don't fix. We aren't going to go and make this class thread safe now when it was never promised. ------------- PR Comment: https://git.openjdk.org/jdk/pull/31568#issuecomment-4785879695
