On Thu, 26 Mar 2026 21:55:40 GMT, Jeremy Wood <[email protected]> wrote:

>> If we made n-many calls to 
>> textPane.getAccessibleContext().getAccessibleText() then we'd add n-many 
>> DocumentListeners to the HTMLDocument.
>> 
>> These listeners are very light, but even so: after thousands of listeners it 
>> may start to degrade performance.
>
> Jeremy Wood has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8377938: remove regtesthelpers & PassFailJFrame
>   
>   This is in response to:
>   https://github.com/openjdk/jdk/pull/30401#discussion_r2997114800

If an app calls 
https://docs.oracle.com/en/java/javase/25/docs/api/java.desktop/javax/swing/text/JTextComponent.html#setDocument(javax.swing.text.Document)

doesn't that invalidate the single cached JEditorPaneAccessibleHypertextSupport 
?
It is attached to the old document and you'll never be able to listen to the 
new document.

If the app cached it, then it would have the same problem today, but probably 
they don't.
So unless I'm missing something we should null out the cached instance on a 
call to setDocument()

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

PR Comment: https://git.openjdk.org/jdk/pull/30401#issuecomment-4144874584

Reply via email to