Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-4907

FB - FileTransfer.java - method does not close stream

    XMLWordPrintableJSON

Details

    Description

      Resolve FindBugs reported issue in FileTransfer.java:

      Before

      String line = reader.readLine();
      while(line != null)
      {
          bodyBuilder.append(line);
          line = reader.readLine();
          if(line != null)
              bodyBuilder.append('\n');
      }
      body = bodyBuilder.toString();
      

      After

      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();
      }
      

      Attachments

        Issue Links

          Activity

            People

              BBosman Bas Bosman
              dinglemouse Peter
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: