You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/02/10 19:27:23 UTC

[jira] [Commented] (CB-4907) FB - FileTransfer.java - method does not close stream

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

ASF subversion and git services commented on CB-4907:
-----------------------------------------------------

Commit 6f91ac3a3068a12b7bffe3d03471943a1690941e in branch refs/heads/dev from [~BBosman]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file-transfer.git;h=6f91ac3 ]

CB-4907 Close stream when we're finished with it


> 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, Plugin File Transfer
>    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)