You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2015/09/16 03:53:45 UTC

[jira] [Updated] (FLINK-2649) Potential resource leak in JarHelper#unjar()

     [ https://issues.apache.org/jira/browse/FLINK-2649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Yu updated FLINK-2649:
--------------------------
    Description: 
{code}
    dest = new BufferedOutputStream(fos, BUFFER_SIZE);
    while ((count = jis.read(data, 0, BUFFER_SIZE)) != -1) {
    dest.write(data, 0, count);
    }
    dest.flush();
    dest.close();
{code}

The close() of dest should be enclosed in finally block.

  was:
{code}
    dest = new BufferedOutputStream(fos, BUFFER_SIZE);
    while ((count = jis.read(data, 0, BUFFER_SIZE)) != -1) {
    dest.write(data, 0, count);
    }
    dest.flush();
    dest.close();
{code}
The close() of dest should be enclosed in finally block.


> Potential resource leak in JarHelper#unjar()
> --------------------------------------------
>
>                 Key: FLINK-2649
>                 URL: https://issues.apache.org/jira/browse/FLINK-2649
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>
> {code}
>     dest = new BufferedOutputStream(fos, BUFFER_SIZE);
>     while ((count = jis.read(data, 0, BUFFER_SIZE)) != -1) {
>     dest.write(data, 0, count);
>     }
>     dest.flush();
>     dest.close();
> {code}
> The close() of dest should be enclosed in finally block.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)