cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bas Bosman (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-4907) FB - FileTransfer.java - method does not close stream
Date Sun, 26 Jan 2014 21:42:38 GMT

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

Bas Bosman commented on CB-4907:
--------------------------------

Pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/17

> FB - FileTransfer.java - method does not close stream
> -----------------------------------------------------
>
>                 Key: CB-4907
>                 URL: https://issues.apache.org/jira/browse/CB-4907
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.9.0
>            Reporter: Peter
>            Priority: Minor
>
> Resolve FindBugs reported issue in *FileTransfer.java*:
> Before
> {code}
> String line = reader.readLine();
> while(line != null)
> {
>     bodyBuilder.append(line);
>     line = reader.readLine();
>     if(line != null)
>         bodyBuilder.append('\n');
> }
> body = bodyBuilder.toString();
> {code}
> After
> {code}
> try {
>     String line = reader.readLine();
>     while(line != null) {
>         bodyBuilder.append(line);
>         line = reader.readLine();
>         if(line != null) {
>             bodyBuilder.append('\n');
>         }
>     }
>     body = bodyBuilder.toString();
> } finally {
>     reader.close();
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message