Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] Suggestion : make Element.getParent()  final ?

M Ghazi

2004-06-21

Replies:

Hi all

I just spent two hours debugging my own buggy code and it turns out that
the problem was that I had inadvertently overridden the  getParent()
method of the Element class. (In my own defence the method was named
that way since it returned the name of the father or mother of the
person)

So I was being told that the new element that I had just made had a
parent and could not be added to the root element via the
addContent(Content)  method.

It all makes sense now but all of this got me thinking why would you
want to override the getParent() anyway ? Specially since other JDOM
methods seem to use it.

Should it not be a final method to avoid idiots like me breaking things
?

Storm

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.