[jdom-interest] Element.getMixedContent().addAll(...) adding into an empty Element fails -

Michael Skells mskells at aspirebanking.com
Thu Nov 16 01:01:24 PST 2000


Adding into an empty list fails and will always fail.
<code>
PartialList.java:227 ->       int index =
backingList.indexOf(getLast());
</code>
<note>
PartialList seems an unusual beast, I believe that it would be better to
have a filtered list.
The implementation of the PartialList is only semi live, as chnages to
the backing object list are not reflected. => The position of the added
components is not guaranteed
</note>
<performance>
the performance of the PartialList seems poor to me as the
implementation scans the list, and the backing list on many 'simple'
operations
for instance I believe that the performance will exhibit algebraic decay
increasing numbers of elements when add() is called, due to the
implementation

also the management of the list as two lists ( one for the backing store
and one for the PartialList seems unwaranted 
</performance>
I am happy to provide an implemntation of FullList to handle the result
of getMixedContent()

comments?



(from beta5)
java.util.NoSuchElementException
        at java.util.LinkedList.getLast(LinkedList.java:107)
        at org.jdom.PartialList.addAll(PartialList.java:227)
......




More information about the jdom-interest mailing list