[jdom-interest] bug in getText() ??

Bhavesh Chheda chheda at oak-grove-systems.com
Wed Sep 20 08:57:22 PDT 2000

hi, getText() method in Element class threw a NullPointerException when i
tried to get text from debug_info element in the xml shown below.

I dont see any problem with the xml shown above and also the instance of
element debug_info was not null. when i add some text in the debug_info
element it works fine but when i remove it throws an NPE.
<?xml version="1.0" encoding="UTF-8"?>

I checked out code yesterday i.e Sep 19 and CVS version of Element.java was

In the getText() somehow varible content is being set to null. This is
causing getContent(), getTextTrim() methods also to throw NPE. I added a
	if (content == null) return null;

in the first line of getTextMethod(). And after that i seemed to work fine.

More information about the jdom-interest mailing list