[jdom-interest] Exception: org.jdom.ContentList$FilterList

Ken Rune Helland kenh at csc.no
Thu Aug 29 00:23:02 PDT 2002


> The Exception getMessage() is:
> 
> org.jdom.ContentList$FilterList
> 

First tings first, when reporting an error give the type
(the class of the exception object) not only the message.
For good messure trow in the stacktrace as well.

> ArrayList temp=(ArrayList)currentElement.getChildren();

My guess is you are getting an ClassCastException, because
the list returned from getChildren is not a ArrayList but a
org.jdom.ContentList$FilterList. 

There is no need to cast the return value of the getChildren
metod. It returns a reference to a List inteface and
this interface shoud give you all the metods you need.
So the line shoud be:

List temp = currentElement.getChildren();


KenR





More information about the jdom-interest mailing list