ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amila Chinthaka Suriarachchi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WSCOMMONS-222) Serialize methods fail to close locally created XMLStreamWriters
Date Fri, 24 Aug 2007 06:02:30 GMT

    [ https://issues.apache.org/jira/browse/WSCOMMONS-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522383
] 

Amila Chinthaka Suriarachchi commented on WSCOMMONS-222:
--------------------------------------------------------

what is the fix you made
in ADBDataSource class serialize method has implemented in this way
public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException
{
        XMLStreamWriter xmlStreamWriter = StAXUtils.createXMLStreamWriter(output);
        serialize(xmlStreamWriter);
        xmlStreamWriter.flush();
    }
 
do I have to close the xmlStreamWriter in the ADBDataSource class?

> Serialize methods fail to close locally created XMLStreamWriters
> ----------------------------------------------------------------
>
>                 Key: WSCOMMONS-222
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-222
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>
> Example from NodeImpl.java:
> Here is the current code:
>      public void serialize(OutputStream output) throws XMLStreamException {
>          serialize(StAXUtils.createXMLStreamWriter(output));
>      }
> Here is the suggested change that correctly closes the locally created XMLStreamWriter:
>      public void serialize(OutputStream output) throws XMLStreamException {
>         XMLStreamWriter xmlStreamWriter = StAXUtils.createXMLStreamWriter(output);
>         try {
>             serialize(xmlStreamWriter);
>         } finally {
>             xmlStreamWriter.close();
>        }
>      }
> Failure to close the XMLStreamWriter prevents resources from being freed.
> I scrubbed the Axiom code and corrected all of the occurrences of this pattern.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Mime
View raw message