Program: 52671
Project: 52671
Buggy source:
/** 
 * func PutFile(url, key, mimeType, localFile, customMeta, callbackParams string) => (data PutRet, code int, err Error) 匿名上传一个文件(上传用的临时 url 通过 $rs->PutAuth 得到)
 * @throws IOException 
 * @throws RSException 
 * @throws JSONException 
 */
public static PutFileRet putFile(String url,String tblName,String key,String mimeType,String localFile,String customMeta,HashMap<String,String> callbackParams) throws RSException {
  File file=new File(localFile);
  if (!file.exists() || !file.canRead()) {
    return new PutFileRet(new CallRet(400,new Exception("String_Node_Str")));
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String entryURI=tblName + "String_Node_Str" + key;
  String action="String_Node_Str" + Base64.encodeBase64String(entryURI.getBytes()) + "String_Node_Str"+ Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    action+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  MultipartEntity requestEntity=new MultipartEntity();
  try {
    requestEntity.addPart("String_Node_Str",new StringBody(action));
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
  FileBody fileBody=new FileBody(new File(localFile));
  requestEntity.addPart("String_Node_Str",fileBody);
  if (callbackParams != null && !callbackParams.isEmpty()) {
    ArrayList<NameValuePair> callbackParamList=new ArrayList<NameValuePair>();
    for (    Entry<String,String> entry : callbackParams.entrySet()) {
      callbackParamList.add(new BasicNameValuePair(entry.getKey(),entry.getValue()));
    }
    try {
      requestEntity.addPart("String_Node_Str",new StringBody(URLEncodedUtils.format(callbackParamList,"String_Node_Str")));
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
  HttpPost postMethod=new HttpPost(url);
  postMethod.setEntity(requestEntity);
  DefaultHttpClient client=new DefaultHttpClient();
  try {
    HttpResponse response=client.execute(postMethod);
    return handleResult(response);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new PutFileRet(new CallRet(400,e));
  }
 finally {
    client.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
/** 
 * func PutFile(url, key, mimeType, localFile, customMeta, callbackParams string) => (data PutRet, code int, err Error) 匿名上传一个文件(上传用的临时 url 通过 $rs->PutAuth 得到)
 * @throws IOException 
 * @throws RSException 
 * @throws JSONException 
 */
public static PutFileRet putFile(String url,String bucketName,String key,String mimeType,String localFile,String customMeta,HashMap<String,String> callbackParams) throws RSException {
  File file=new File(localFile);
  if (!file.exists() || !file.canRead()) {
    return new PutFileRet(new CallRet(400,new Exception("String_Node_Str")));
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String entryURI=bucketName + "String_Node_Str" + key;
  String action="String_Node_Str" + Base64.encodeBase64String(entryURI.getBytes()) + "String_Node_Str"+ Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    action+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  MultipartEntity requestEntity=new MultipartEntity();
  try {
    requestEntity.addPart("String_Node_Str",new StringBody(action));
  }
 catch (  UnsupportedEncodingException e1) {
    e1.printStackTrace();
  }
  FileBody fileBody=new FileBody(new File(localFile));
  requestEntity.addPart("String_Node_Str",fileBody);
  if (callbackParams != null && !callbackParams.isEmpty()) {
    ArrayList<NameValuePair> callbackParamList=new ArrayList<NameValuePair>();
    for (    Entry<String,String> entry : callbackParams.entrySet()) {
      callbackParamList.add(new BasicNameValuePair(entry.getKey(),entry.getValue()));
    }
    try {
      requestEntity.addPart("String_Node_Str",new StringBody(URLEncodedUtils.format(callbackParamList,"String_Node_Str")));
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
  }
  HttpPost postMethod=new HttpPost(url);
  postMethod.setEntity(requestEntity);
  DefaultHttpClient client=new DefaultHttpClient();
  try {
    HttpResponse response=client.execute(postMethod);
    return handleResult(response);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new PutFileRet(new CallRet(400,e));
  }
 finally {
    client.getConnectionManager().shutdown();
  }
}