SPR-7474 - AbstractXmlStreamReader getAttributeValue(String, String) does not handle null namespaceURI properly

This commit is contained in:
Arjen Poutsma 2010-08-19 07:53:48 +00:00
parent 9ab2c6628b
commit 061b2c91a0
1 changed files with 2 additions and 1 deletions

View File

@ -149,7 +149,8 @@ abstract class AbstractXMLStreamReader implements XMLStreamReader {
public String getAttributeValue(String namespaceURI, String localName) {
for (int i = 0; i < getAttributeCount(); i++) {
QName name = getAttributeName(i);
if (name.getNamespaceURI().equals(namespaceURI) && name.getLocalPart().equals(localName)) {
if (name.getLocalPart().equals(localName) &&
(namespaceURI == null || name.getNamespaceURI().equals(namespaceURI))) {
return getAttributeValue(i);
}
}