BaseMarkupSerializer.endDocument doesn't throw an SAXException when disk is full
--------------------------------------------------------------------------------

         Key: XALANJ-2304
         URL: http://issues.apache.org/jira/browse/XALANJ-2304
     Project: XalanJ2
        Type: Bug

    Versions: 2.7    
 Environment: Windows 2000
    Reporter: Mark Arends


When disk is full no exception was thrown when the endDocument method is 
called. This resulted in empty xml files being written.

After the _printer.flush() the method _printer.getException should be called to 
determine if there was an exception. The following code should solve this I 
think:

    /**
     * Called at the end of the document to wrap it up.
     * Will flush the output stream and throw an exception
     * if any I/O error occured while serializing.
     *
     * @throws SAXException An I/O exception occured during
     *  serializing
     */
    public void endDocument()
        throws SAXException
    {
        try {
        // Print all the elements accumulated outside of
        // the root element.
        serializePreRoot();
        // Flush the output, this is necessary for fStrBuffered output.
        _printer.flush();

       // Find out if there was an exception
        if ( _printer.getException() != null ){
            throw _printer.getException();
        }
        
        } catch ( IOException except ) {
            throw new SAXException( except );
    }
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to