PrettyPrintXMLStreamWriter - method writeStartElement(localname) calls method 
writeStartElement(prefix, localName, namespaceURI) with wrong paramters
-----------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: CXF-2806
                 URL: https://issues.apache.org/jira/browse/CXF-2806
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.2.7
         Environment: openSuse 10, Eclipse 3.5.1
            Reporter: Andre Feldmann
            Priority: Minor


PrettyPrintXMLStreamWriter

If you call the method writeStartElement(String localname) it calls 
writeStartElement(String prefix, String localName, String namespaceURI) with 
the wrong parameters. 
writeStartElement(String localname, String namespaceURI) is affected as well 
(namespaceUri and localname are interchanged).

Instead of writeStartElement(null, localname, null) it calls 
writeStartElement(null, null, localname). So localname is used as namespaceURI 
and localname is NULL.

This leads to an Exception :

java.lang.IllegalArgumentException: local part cannot be "null" when creating a 
QName
        at javax.xml.namespace.QName.<init>(QName.java:214)
        at javax.xml.namespace.QName.<init>(QName.java:163)
        at 
org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:231)
        at 
org.apache.cxf.wsdl.PrettyPrintXMLStreamWriter.writeStartElement(PrettyPrintXMLStreamWriter.java:220)

Workaround :

Overwrite writeStartElement(String localname)

writeStartElement(String localname) {
  writeStartElement(null, localname, null);
}




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to