-
Bug
-
Resolution: Fixed
-
P3
-
1.0
-
b92
-
generic
-
generic
NamespaceContext object returned from XMLStreamReader won't work when a non-interned string is passed to the getNamespaceURI method.
The following is the relevant code:
--------------------------------------------
com.sun.xml.stream.xerces.util.NamespaceContextWrapper
public String getNamespaceURI(String prefix) {
if(prefix == null){
throw new IllegalArgumentException("Prefix can't be null");
}
return fNamespaceContext.getURI(prefix) ;
}
--------------------------------------------
com.sun.xml.stream.xerces.util.NamespaceSupport
public String getURI(String prefix) {
// find prefix in current context
for (int i = fNamespaceSize; i > 0; i -= 2) {
if (fNamespace[i - 2] == prefix) {
return fNamespace[i - 1];
}
}
// prefix not found
return null;
} // getURI(String):String
--------------------------------------------
As you see the given parameter is compared with '=='.
The following is the relevant code:
--------------------------------------------
com.sun.xml.stream.xerces.util.NamespaceContextWrapper
public String getNamespaceURI(String prefix) {
if(prefix == null){
throw new IllegalArgumentException("Prefix can't be null");
}
return fNamespaceContext.getURI(prefix) ;
}
--------------------------------------------
com.sun.xml.stream.xerces.util.NamespaceSupport
public String getURI(String prefix) {
// find prefix in current context
for (int i = fNamespaceSize; i > 0; i -= 2) {
if (fNamespace[i - 2] == prefix) {
return fNamespace[i - 1];
}
}
// prefix not found
return null;
} // getURI(String):String
--------------------------------------------
As you see the given parameter is compared with '=='.