bugDotGNU Portable.NET - Bugs: bug #2692, Itterating through...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2692: Itterating through node.ChildNode's seems to skip the first child node, even

Submitted by:  Adam Ballai <minddog>
Submitted on:  Sat 01 Mar 2003 08:31:45 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Wed 05 Mar 2003 07:50:58 AM UTC, comment #5:

Fix committed - 5 March 2003. Your patch still wasn't
clean. It still contained debug code (albeit commented
out), and you completely missed the following simple 4 line
change:

Index: NodeList.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Xml/NodeList.cs,v
retrieving revision 1.5
diff -c -r1.5 NodeList.cs

      • NodeList.cs 6 Dec 2002 04:58:32 -0000 1.5

--- NodeList.cs 5 Mar 2003 07:46:49 -0000
***************

      • 242,247 ****

--- 242,251 ----
done = true;
return false;
}
+ else
+ {
+ return true;
+ }
}
current = current.list.nextSibling;
if(current != null)

Rhys Weatherley <rweather>
Project Administrator
Wed 05 Mar 2003 06:56:15 AM UTC, comment #4:

Here is a clean patch,
it uses the makepatch.sh tool and i fixed the indenting.
So, who says I cannot lean?

https://savannah.gnu.org/patch/index.php?func=detailpatch&patch_id=1225&group_id=353

mike

James Michael DuPont <mdupont>
Sun 02 Mar 2003 04:13:19 PM UTC, comment #3:

here is patch that addes some debugging to the xml tools
maybe you find it useful,
otherwise ignore it.
:)

James Michael DuPont <mdupont>
Sun 02 Mar 2003 04:11:51 PM UTC, comment #2:

Well, I guess you are not going to answer me.
Here is the patch anyway. Maybe you can consider giving me cvs access.

James Michael DuPont <mdupont>
Sun 02 Mar 2003 03:00:46 PM UTC, comment #1:

Please assign this bug to me.
Please give me write access to the CVS
I have a solution.

James Michael DuPont <mdupont>
Sat 01 Mar 2003 08:31:45 PM UTC, original submission:

Itterating through node.ChildNode's seems to skip the first child node, even
though .ChildNode.Count returns the true count.

I've dug further and found ...
I see a problem in this chunk of System.Xml/NodeList.cs
It seems to pass off the first node because it's refNode is null and it has a parent so it goes to the else {}. I'm trying to figure out a way to catch it, but I'm just not creative this week =/ Any hands?

public void InsertAfter(XmlNode newNode, XmlNode refNode)
{
if(refNode != null)
{
NodeList refList = GetList(refNode);
NodeList newList = GetList(newNode);
if(refList.nextSibling != null)
{
newList.nextSibling = refList.ne xtSibling;
newList.prevSibling = refNode;
refList.nextSibling = newNode;
}
else
{
refList.nextSibling = newNode;
newList.prevSibling = refNode;
last = newNode;
}
}
else if(first != null)
{
GetList(first).prevSibling = newNode;
GetList(newNode).nextSibling = first;
}
else
{
first = newNode;
last = newNode;
}
++count;
++generation;
}

Adam Ballai <minddog>
Project Member

 

Attached Files
file #327:  XMLSystem.diff added by mdupont (12KiB - text/plain - XML debugging)
file #326:  XMLChildNodes.diff added by mdupont (5KiB - text/plain - The minimal diff to fix the problem)
file #324:  childnode.cs added by minddog (801B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 05 Mar 2003 07:50:58 AM UTCrweatherStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1