You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2007/08/10 21:47:42 UTC
[jira] Resolved: (WSCOMMONS-222) Serialize methods fail to close
locally created XMLStreamWriters
[ https://issues.apache.org/jira/browse/WSCOMMONS-222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rich Scheuerle resolved WSCOMMONS-222.
--------------------------------------
Resolution: Fixed
Fixed in revision 564731
> 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