[Mono-bugs] [Bug 540198] XContainer.ReplaceNodes doesn't seem to recognise 'IOrderedEnumerable<XElement>'

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 11 05:43:01 EST 2009


http://bugzilla.novell.com/show_bug.cgi?id=540198

User aenomoto at novell.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=540198#c1





--- Comment #1 from Atsushi Enomoto <aenomoto at novell.com>  2009-11-11 03:42:59 MST ---
A thoughtless fix is easy in XContainer.cs to have ReplaceNodes() like:

        public void ReplaceNodes (object content)
        {
            var e = XUtil.ExpandArray (content);
            object [] arr = new object [e.Count ()];
            int i = 0;
            foreach (var o in e)
                arr [i++] = o;
            RemoveNodes ();
            Add (arr);
        }

but it is rather likely about issue in having iterator results stored
somewhere, regardless of the actual tree node status during operations (in this
case the "content" nodes are supposed to exist in the tree during the replace
operation, but they in fact don't because of RemoveNodes() operation).

I'll try to find possibly better solution when I get back my windows
environment (which should be soon).

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list