You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Erik Vikström (JIRA)" <ji...@apache.org> on 2013/04/19 08:49:58 UTC

[jira] [Comment Edited] (AXIS2-5511) Missing close call on FileInputStream

    [ https://issues.apache.org/jira/browse/AXIS2-5511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13636141#comment-13636141 ] 

Erik Vikström edited comment on AXIS2-5511 at 4/19/13 6:49 AM:
---------------------------------------------------------------

Look at line 61, which contains

            byteArray = IOUtils.getStreamAsByteArray(new FileInputStream(file));

There you create the unreferenced FileInputStream that isn't closed explicitly.

Regards,
erik
                
      was (Author: evi):
    Look at line 61, which contains

{noformat}
byteArray = IOUtils.getStreamAsByteArray(new FileInputStream(file));
{noformat}

There you create the unreferenced FileInputStream that isn't closed explicitly.

Regards,
erik
                  
> Missing close call on FileInputStream
> -------------------------------------
>
>                 Key: AXIS2-5511
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5511
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.6.2
>            Reporter: Erik Vikström
>            Priority: Trivial
>
> The "prettify(File)" method within "org.apache.axis2.util.XMLPrettyPrinter" creates a FileInputStream but does not close it explicitly. Hence XML files are locked for a while after this feature is being used; the stream is closed implicitly when the FileInputStream instance is garbage collected, but you never now when in time this happens.
> Since this class is used when running the code-generator, which we are using frequently within our application, this results in that we cannot tidy up files after this task has completed.
> Current workaround for us was to implement a custom Emitter and avoid running the XML pretty printing.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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