-
Bug
-
Resolution: Fixed
-
P2
-
beta
-
b78
-
generic
-
generic
One of the JAX-WSA test case fails because of an NPE in XMLStreamWriterImpl line 1225 (highlighted below):
void correctPrefix(QName attr1 , QName attr2){
String tmpPrefix = null;
QName decl = null;
boolean done = false;
*** if(attr1.prefix.equals(attr2.prefix) && !(attr1.uri.equals(attr2.uri))){
tmpPrefix = fNamespaceContext.getPrefix(attr2.uri);
Because attr1.uri is null. This seems to happen because of line 1186 (highlighted below):
for(int i=0 ; i< fAttributeCache.size();i++){
attr = (Attribute)fAttributeCache.get(i);
for(int j=i+1;j<fAttributeCache.size();j++){
attr2 = (Attribute)fAttributeCache.get(j);
*** if(attr.prefix == null && attr2.prefix != null)
correctPrefix(attr,attr2);
}
}
Sine this is an attribute, if attr.prefix==null, then the URI will be always null.
Given the intention of this code, I suspect that the above line is a mistake of:
if(attr.prefix != null && attr2.prefix != null)
?
(I confirmed that this fixes the problem. but there's a possibility that this could be a wrong way to fix a problem.)
void correctPrefix(QName attr1 , QName attr2){
String tmpPrefix = null;
QName decl = null;
boolean done = false;
*** if(attr1.prefix.equals(attr2.prefix) && !(attr1.uri.equals(attr2.uri))){
tmpPrefix = fNamespaceContext.getPrefix(attr2.uri);
Because attr1.uri is null. This seems to happen because of line 1186 (highlighted below):
for(int i=0 ; i< fAttributeCache.size();i++){
attr = (Attribute)fAttributeCache.get(i);
for(int j=i+1;j<fAttributeCache.size();j++){
attr2 = (Attribute)fAttributeCache.get(j);
*** if(attr.prefix == null && attr2.prefix != null)
correctPrefix(attr,attr2);
}
}
Sine this is an attribute, if attr.prefix==null, then the URI will be always null.
Given the intention of this code, I suspect that the above line is a mistake of:
if(attr.prefix != null && attr2.prefix != null)
?
(I confirmed that this fixes the problem. but there's a possibility that this could be a wrong way to fix a problem.)