[jdom-interest] Comments on JDOM b10-rc1

Elliotte Rusty Harold elharo at metalab.unc.edu
Fri Feb 6 05:50:27 PST 2004

At 1:09 AM -0800 2/6/04, Jason Hunter wrote:
>Good news!
>After today's work I'm proud to report there are NO known API 
>changes required before our 1.0 release.  What we have now is my 
>best effort at a 1.0 release API.

Any chance to get CVSWeb working so we can look at the source code easily?

Is there some reason Content is not called Node or perhaps Child? To 
my way of thinking "Content" refers to a list of all the content, not 
one node. This is in keeping with the XML spec which says:

[Definition: The text between the start-tag and end-tag is called the 
element's content:]

Content of Elements

[43] content ::= CharData? ((element | Reference | CDSect | PI | 
Comment) CharData?)*

Using words in a different sense than they're used in the XML spec is 
asking for confusion.

If the equals semantics is the same for all Content subclasses (Node 
identity, ==) then it could be pushed up into Content. I think it is 
== for all such cases, but I'm not sure. The JavaDocs for some 
classes like Comment and Attribute don't say. If it isn't the same, 
then it needs to be spelled out in the JavaDoc.

Does the mapping code in processing instruction actually works on 
cases like PHP processing instructions that can contain essentially 
anything? Is it tested? I thought we had decided to ditch all the 
pseudo-attribute parsing code.

Are all the overloaded methods in JDOMFactory really necessary? Does 
the Builder actually call all of these, or could some of them be cut?

Finally, I strongly recommend using code coverage tools like Clover 
or Jester or both to measure the test coverage before releasing. In 
my experience this turns up a huge amount of untested code, 
unreachable code, and outright bugs. It's also worth hitting the code 
base with static analysis tools like PMD.


   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)

More information about the jdom-interest mailing list