Program: 180085
Project: 180085
Buggy source:
/** 
 * Does a multipart post which is different than a regular post mostly use this one if you're posting files
 * @param url
 * @param parameters Key-Value pairs in map.  Keys are always string.  Values can be string or IFormFile
 * @param properties
 * @return
 */
public HTTPResponse postMultipart(String url,Map<String,String> parameters) throws IOException {
  HttpURLConnection conn=getAndConfigureConnection(url);
  conn.setRequestMethod("String_Node_Str");
  String boundary=createMultipartBoundary();
  conn.setRequestProperty(HEADER_TYPE,CONTENT_TYPE + "String_Node_Str" + BOUNDARY+ boundary);
  conn.setDoOutput(true);
  if (debugMode)   debugMessage("String_Node_Str",url,conn);
  OutputStream os=conn.getOutputStream();
  Object[] elems=parameters.keySet().toArray();
  StringBuffer buf;
  IFormFile file;
  for (int i=0; i < elems.length; i++) {
    String key=(String)elems[i];
    Object obj=parameters.get(key);
    buf=new StringBuffer();
    if (obj instanceof IFormFile) {
      file=(IFormFile)obj;
      buf.append("String_Node_Str" + boundary + LINE_ENDING);
      buf.append(HEADER_PARA);
      buf.append("String_Node_Str" + PARA_NAME + "String_Node_Str"+ key+ "String_Node_Str");
      buf.append("String_Node_Str" + FILE_NAME + "String_Node_Str"+ file.getFilename()+ "String_Node_Str"+ LINE_ENDING);
      buf.append(HEADER_TYPE + "String_Node_Str" + file.getContentType()+ "String_Node_Str");
      buf.append(LINE_ENDING);
      buf.append(LINE_ENDING);
      os.write(buf.toString().getBytes());
      os.write(file.getBytes());
    }
 else     if (obj != null) {
      buf.append("String_Node_Str" + boundary + LINE_ENDING);
      buf.append(HEADER_PARA);
      buf.append("String_Node_Str" + PARA_NAME + "String_Node_Str"+ key+ "String_Node_Str");
      buf.append(LINE_ENDING);
      buf.append(LINE_ENDING);
      buf.append(obj.toString());
      os.write(buf.toString().getBytes());
    }
    os.write(LINE_ENDING.getBytes());
  }
  os.write(("String_Node_Str" + boundary + "String_Node_Str"+ LINE_ENDING).getBytes());
  return connect(conn);
}

Fixed version (ground truth):
/** 
 * Does a multipart post which is different than a regular post mostly use this one if you're posting files
 * @param url
 * @param parameters Key-Value pairs in map.  Keys are always string.  Values can be string or IFormFile
 * @param properties
 * @return
 */
public HTTPResponse postMultipart(String url,Map<String,Object> parameters) throws IOException {
  HttpURLConnection conn=getAndConfigureConnection(url);
  conn.setRequestMethod("String_Node_Str");
  String boundary=createMultipartBoundary();
  conn.setRequestProperty(HEADER_TYPE,CONTENT_TYPE + "String_Node_Str" + BOUNDARY+ boundary);
  conn.setDoOutput(true);
  if (debugMode)   debugMessage("String_Node_Str",url,conn);
  OutputStream os=conn.getOutputStream();
  Object[] elems=parameters.keySet().toArray();
  StringBuffer buf;
  IFormFile file;
  for (int i=0; i < elems.length; i++) {
    String key=(String)elems[i];
    Object obj=parameters.get(key);
    buf=new StringBuffer();
    if (obj instanceof IFormFile) {
      file=(IFormFile)obj;
      buf.append("String_Node_Str" + boundary + LINE_ENDING);
      buf.append(HEADER_PARA);
      buf.append("String_Node_Str" + PARA_NAME + "String_Node_Str"+ key+ "String_Node_Str");
      buf.append("String_Node_Str" + FILE_NAME + "String_Node_Str"+ file.getFilename()+ "String_Node_Str"+ LINE_ENDING);
      buf.append(HEADER_TYPE + "String_Node_Str" + file.getContentType()+ "String_Node_Str");
      buf.append(LINE_ENDING);
      buf.append(LINE_ENDING);
      os.write(buf.toString().getBytes());
      os.write(file.getBytes());
    }
 else     if (obj != null) {
      buf.append("String_Node_Str" + boundary + LINE_ENDING);
      buf.append(HEADER_PARA);
      buf.append("String_Node_Str" + PARA_NAME + "String_Node_Str"+ key+ "String_Node_Str");
      buf.append(LINE_ENDING);
      buf.append(LINE_ENDING);
      buf.append(obj.toString());
      os.write(buf.toString().getBytes());
    }
    os.write(LINE_ENDING.getBytes());
  }
  os.write(("String_Node_Str" + boundary + "String_Node_Str"+ LINE_ENDING).getBytes());
  return connect(conn);
}