[jdom-interest] BUG in Document

Frank Morton fmorton at base2inc.com
Fri Feb 9 08:56:17 PST 2001

I'm a newbie (today), but really like what I see so far and will
be happy to contribute significantly. I'm using code freshly 
checked out of CVS.

If you do:

Document doc = new Document();
doc.setRootElement(new Element("something"));

You get a NullPointerException because "content" is
not initialized when using the no arg constructor.

So, I added the following to the first line of setRootElement(element):

if(content == null) content = new LinkedList();

Since I'm new to the code, don't know if this is the best way to 
do this. So, what is the process of bug fixing?

Just to head this off, I need to be able to do it this way because
I'm writing a class that extends Document, so it needs to construct
the Document before it has a chance to create what is going to
be the root element.


More information about the jdom-interest mailing list