[jdom-interest] Attribute comparison

Guy Nirpaz guyn at tantian.com
Tue Dec 5 01:55:58 PST 2000


I have two identical JDOM trees. I'd like to compare two attributes that
have the same values from both of the trees. I've noticed that the
Attribute.equals() method of Attribute (and other JDOM elements) only checks
for reference equality. This means that the result of :

(att1 == att2) and (att1.equals(att2)) is the same.

Is there any reason for this. (I remember several months ago there was
discussion in the list about that, but I can't really find it)

Shouldn't we implement the equals() method for the basic constructs such as
Attribute and Comment (and others)?


Guy Nirpaz

Tantian Corp.
guyn at tantian.com

More information about the jdom-interest mailing list