[jdom-interest] NullPointerException in Element.setAttribute(final String name, final String value, final Namespace ns)
jdom at tuis.net
Fri Apr 6 14:39:43 PDT 2012
I have looked through the JDOM 1.0 code. JDOM 1.0 was released in
September 2004. Here's the code as it was at the time:
Here's the getAttribute method:
Here's the attributes.get(String,Namespace) method:
And that calls the indexOf(String,Namespace) method:
Which calls namespace.getURI().
The way I see it is that JDOM 1.0 would always throw a
NullPointerException if you gave it a null Namespace.
I don't think it would have ever worked in JDOM 1.0...
Did you have your own custom build of JDOM 1.0?
On 06/04/2012 5:08 PM, Rolf Lear wrote:
> Hi Gisella.
> Is it possible to send us a stack trace, at least the parts including
> the org.jdom.* code.
> On 06/04/2012 1:43 PM, gisella.saavedra at navis.com wrote:
>> I just upgraded from jdom 1.0 to jdom 1.1.3
>> and I was setting an attribute where the namespace was NULL.
>> The old code was different, it was NOT calling get(…), so it was setting
>> the namespace to namespace.NO_NAMESPACE when the namespace was NULL,
>> before calling this get(…)
>> but the new code, when it calls getAttribute(name, ns) (first line of
>> method described)
>> is getting a null pointer on the namespace.
>> Probably the namespace needs to be set to NO_NAMESPACE before calling
>> get(..) when it is NULL.
>> *Gisella Saavedra**
>> *Framework Team
>> _gsaavedra at navis.com <mailto:gsaavedra at navis.com>_
>> 1000 Broadway, Suite 150, Oakland, CA 94607 | T+1 510 267 5123 T Main+1
>> 510 267 5000 F+1 510 267 5100 | _http://www.navis.com
>> To control your jdom-interest membership:
> To control your jdom-interest membership:
More information about the jdom-interest