[jdom-commits] CVS update: jdom/src/java/org/jdom

jhunter at cvs.jdom.org jhunter at cvs.jdom.org
Sun Oct 7 12:07:52 PDT 2001


Date:	Sunday October 7, 2001 @ 20:07
Author:	jhunter

Update of /home/cvspublic/jdom/src/java/org/jdom
In directory www.nmemonix.com:/tmp/cvs-serv7824

Modified Files:
	Document.java 
Log Message:
Bug fix from Jools:

A bug exists in Document.java where a ProcessingInstruction can be
removed
from a Document but the parentage is not set to null, should it be
removed.

Attached is a demonstraction of the bug (DocBug.java) and a diff which
will fix the problem taken against the current version in CVS.

--Jools

import org.jdom.Element;
import org.jdom.Document;
import org.jdom.ProcessingInstruction;


public class DocBug {

        public static void main(String[] args) {
                Document doc = new Document(new Element("bug"));

                ProcessingInstruction foo = new ProcessingInstruction("foo", "data");
                
                // Adding sets the parent.
                doc.addContent(foo);

                // Removing __should__ set the parent to null.
                doc.removeContent(foo);
                
                // This should not throw an exception.
                doc.addContent(foo);
        }
}


===================================================================
File: no file Document.java		Status: Needs Checkout

   Working revision:	1.45	Sun Oct  7 19:07:52 2001
   Repository revision:	1.45	/home/cvspublic/jdom/src/java/org/jdom/Document.java,v

   Existing Tags:
	jdom_1_0_b7              	(revision: 1.44)
	jdom_1_0_b6              	(revision: 1.25)
	start                    	(revision: 1.1.1.1)
	jdom                     	(branch: 1.1.1)




More information about the jdom-commits mailing list