[
https://issues.apache.org/jira/browse/XERCESJ-1345?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ludger Bünger updated XERCESJ-1345:
-----------------------------------
Attachment: Xerces-Eventlistener-Count-patch.txt
This patch moves the static listener count inside the document instance, i.e.
that each document uses it's own listener counters.
Besides fixing the mentioned issues this also has the side effect of speeding
up dom mutations for documents having no event listeners registered if other
documents are (somewhere) present in the same VM having dom event listeners.
Furthermore since listener deserialisation caused unpredictable behavior I
declared the listener datastructures as transient.
I am not sure whether the community considers this is a good idea, however this
has not been working before anyhow.
> Listener Count datastructure in DocumentImpl should be a document variable
> and not static.
> ------------------------------------------------------------------------------------------
>
> Key: XERCESJ-1345
> URL: https://issues.apache.org/jira/browse/XERCESJ-1345
> Project: Xerces2-J
> Issue Type: Improvement
> Reporter: Ludger Bünger
> Attachments: Xerces-Eventlistener-Count-patch.txt
>
>
> The listener count datastructure is currently a static global hashtable.
> This has the disadvantage of not being thread-safe even across otherwise
> totally independent document instances since each uses the same static
> hashtable to keep track of the number of event listeners registered upon the
> document.
> A second effect of this is:
> Deserializing a document with listeners registered upon it in a freshly
> created virtual machine (with a fresh static listener table having no
> listener count data inside) causes the document to believe no event listeners
> are registered upon it and thus not causing dom events to be fired even
> though listeners are registered.
> Thus serialisation/deserialisation of documents having listeners registered
> upon them is factually broken since the very first implementation of event
> listeners using the static listener counters (which is if I did not get it
> wrong since event listeners have been implemented in xerces).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]