users@fi.java.net

Re: StAXDocumentParser.getAttributeValue returning null

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 11 Jul 2005 10:40:24 +0200

Hi Ricardo,

Ricardo Barone wrote:
> Hi,
>
> I'm doing some tests with FI and StAX using StAXDocumentParser, and all
> the calls to getAttributeValue returned null, even if both the namespace
> and localName are correct.
>
> Searching the source code, I've noticed that an identity comparison is
> being performed to check the arguments, so my guess is that this is
> causing the method to return null.
>
> ....
> if (_attributes.getLocalName(i) == localName &&
> _attributes.getURI(i) == namespaceURI) {
> return _attributes.getValue(i);
> }
> ...
>
> Is this the expected behaviour?
>

No, this is a bug. The code was assuming that the strings used were
interned.

Thanks for finding this. I will fix it this week (i have a new laptop
and i am setting it up, taking some time to copy all my apps/data).

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109