Program: 5847
Project: 5847
Buggy source:
public static boolean getFileFromServer(String path,Bundle params,OutputStream fos){
  byte[] bf=new byte[FILE_BUFFER_SIZE];
  int current=0;
  InputStream is=null;
  HttpURLConnection connect=null;
  BufferedInputStream bis=null;
  try {
    if (params != null) {
      StringBuilder sb=new StringBuilder();
      boolean first=true;
      for (      String key : params.keySet()) {
        if (first) {
          first=false;
        }
 else {
          sb.append("String_Node_Str");
        }
        sb.append(URLEncoder.encode(key) + "String_Node_Str" + URLEncoder.encode(params.getString(key)));
      }
      path=path + "String_Node_Str" + sb.toString();
    }
    URL url=new URL(path);
    connect=(HttpURLConnection)url.openConnection();
    connect.setDoInput(true);
    connect.setConnectTimeout(CONNECTION_TIME_OUT);
    connect.setReadTimeout(SOCKET_TIME_OUT);
    int code=connect.getResponseCode();
    if (code == HttpURLConnection.HTTP_OK) {
      is=connect.getInputStream();
      bis=new BufferedInputStream(is);
      while ((current=bis.read(bf)) != FILE_END) {
        fos.write(bf,0,current);
      }
    }
    return true;
  }
 catch (  MalformedURLException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
catch (  IOException e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
    return false;
  }
 finally {
    try {
      if (is != null) {
        is.close();
      }
      if (fos != null) {
        fos.close();
      }
      if (connect != null) {
        connect.disconnect();
      }
      if (bis != null) {
        bis.close();
      }
    }
 catch (    Exception e) {
      LogUtils.logD(e.getMessage());
    }
  }
}

Fixed version (ground truth):
public static void getFileFromServer(String path,Bundle params,String filePath){
  byte[] bf=new byte[FILE_BUFFER_SIZE];
  int current=0;
  InputStream is=null;
  HttpURLConnection connect=null;
  BufferedInputStream bis=null;
  OutputStream fos=null;
  try {
    fos=new FileOutputStream(filePath);
    String completePath=null;
    if (params != null) {
      StringBuilder sb=new StringBuilder();
      sb.append(path).append('?');
      boolean first=true;
      for (      String key : params.keySet()) {
        if (!first) {
          sb.append('&');
        }
 else {
          first=false;
        }
        sb.append(URLEncoder.encode(key)).append('=').append(URLEncoder.encode(params.getString(key)));
      }
      completePath=sb.toString();
    }
    URL url=new URL(completePath);
    connect=(HttpURLConnection)url.openConnection();
    connect.setDoInput(true);
    connect.setConnectTimeout(CONNECTION_TIME_OUT);
    connect.setReadTimeout(SOCKET_TIME_OUT);
    int code=connect.getResponseCode();
    if (code == HttpURLConnection.HTTP_OK) {
      is=connect.getInputStream();
      bis=new BufferedInputStream(is);
      while ((current=bis.read(bf)) != FILE_END) {
        fos.write(bf,0,current);
      }
    }
  }
 catch (  MalformedURLException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  IOException e) {
    LogUtils.logD(e.getMessage());
  }
catch (  Exception e) {
    LogUtils.logD(e.getMessage());
  }
 finally {
    try {
      if (bis != null) {
        bis.close();
      }
      if (is != null) {
        is.close();
      }
      if (fos != null) {
        fos.close();
      }
      if (connect != null) {
        connect.disconnect();
      }
    }
 catch (    IOException e) {
      LogUtils.logD(e.getMessage());
    }
  }
}