[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"?>
<response><result_code>200</result_code><user_message>OK</user_message>
<debug_info
/><return_values><authentication_token>Token-1</authentication_token>
</return_values></response>
I checked out code yesterday i.e Sep 19 and CVS version of Element.java was
1.28.
In the getText() somehow varible content is being set to null. This is
causing getContent(), getTextTrim() methods also to throw NPE. I added a
line
if (content == null) return null;
in the first line of getTextMethod(). And after that i seemed to work fine.
:)
--bhavesh
More information about the jdom-interest
mailing list