JiBX
  1. JiBX
  2. JIBX-275

StAXWriter.writeXMLDecl() passes arguments in the wrong order to the XMLStreamWriter.writeStartDocument

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: JiBX 1.1.6
    • Fix Version/s: JiBX 1.2.1
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      See API:
      https://stax-utils.dev.java.net/nonav/javadoc/api/javax/xml/stream/XMLStreamWriter.html#writeStartDocument(java.lang.String,%20java.lang.String)

      Below is the code currently used in StAXWriter. The version and encoding parameters received in writeXMLDecl() are the reverse order for the XMLStreamWriter.writeStartDocument() which causes an XMLStreamException to be thrown.

      public void writeXMLDecl(String version, String encoding, String standalone) throws IOException {
      try

      { m_writer.writeStartDocument(version, encoding); // Incorrect order }

      catch (XMLStreamException e)

      { throw new IOException("Error writing to stream: " + e.getMessage()); }

      }

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Reordered arguments.

        Show
        Dennis Sosnoski added a comment - Reordered arguments.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Assignee Dennis Sosnoski [ dsosnoski ]
        Fix Version/s JiBX 1.2.1 [ 15067 ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            boydst
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: