[
https://issues.apache.org/jira/browse/XERCESJ-1630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lenka Svobodova updated XERCESJ-1630:
-------------------------------------
Attachment: Rounding_bug_Xercesj_1630.patch
A possible solution to this bug could be adding a Reverse Iterator over
elements. This way no invalidation is necessary.
> DeepNodeListImpl cache should not be invalidated by Element.setAttribute()
> --------------------------------------------------------------------------
>
> Key: XERCESJ-1630
> URL: https://issues.apache.org/jira/browse/XERCESJ-1630
> Project: Xerces2-J
> Issue Type: Improvement
> Components: DOM (Level 3 Core)
> Affects Versions: 2.11.0
> Reporter: Enrico Scoda
> Attachments: Rounding_bug_Xercesj_1630.patch
>
>
> Consider the task of looping through a node list of elements to set an
> attribute on each of them. This task can be very expensive (seconds for some
> thousands elements).
> The cause is the node list cache (the array list) being invalidated by each
> call to setAttribute(). DeepNodeListImpl "cache" should be invalidated only
> by structural changes (insertion or removal of nodes).
> AttrImpl.setValue() is calling changed() in the "directly store string"
> branch.
> Even considering to support HTMLDocumentImpl.getElementsByName(), changed()
> could be called only when attribute is "name":
> if ("name".equals(name)) {
> changed();
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]