Program: 121428
Project: 121428
Buggy source:
/** 
 * DOC hcyi Comment method "insertionRevisionService".
 * @param idExtension
 * @param typeExtension
 * @param username
 * @param passwordHash
 * @param version
 * @param listVersionCompatibles
 * @param filename
 * @param content
 * @param description
 * @param agreement
 * @return
 */
public static WebserviceStatus insertionRevisionService(String idExtension,String typeExtension,String username,String passwordHash,String version,String listVersionCompatibles,String filename,String content,String description,String agreement){
  byte[] fileBytes=null;
  try {
    File f=new File(filename);
    if (f != null) {
      FileInputStream fis=new FileInputStream(f);
      if (fis != null) {
        int len=fis.available();
        fileBytes=new byte[len];
        fis.read(fileBytes);
      }
    }
  }
 catch (  Exception e) {
  }
  WebserviceStatus ws=new WebserviceStatus();
  ws.setResult(false);
  Resty r=new Resty();
  JSONObject tokenMessage=new JSONObject();
  try {
    tokenMessage.put("String_Node_Str",username);
    tokenMessage.put("String_Node_Str",passwordHash);
    tokenMessage.put("String_Node_Str",idExtension);
    tokenMessage.put("String_Node_Str",typeExtension);
    tokenMessage.put("String_Node_Str",version);
    tokenMessage.put("String_Node_Str",listVersionCompatibles);
    tokenMessage.put("String_Node_Str",new Path(filename).lastSegment());
    tokenMessage.put("String_Node_Str",asHex(fileBytes));
    tokenMessage.put("String_Node_Str",description);
    tokenMessage.put("String_Node_Str",agreement);
    JSONObject token=new us.monoid.json.JSONObject();
    token.put("String_Node_Str",tokenMessage);
    AbstractContent ac=Resty.content(token);
    MultipartContent mpc=Resty.form(new FormData("String_Node_Str",ac));
    TextResource textResult=r.text(exchangeWSServer + "String_Node_Str",mpc);
    JSONObject resultObject=new JSONObject(textResult.toString());
    JSONObject result=(JSONObject)resultObject.get("String_Node_Str");
    String idRevision=result.getString("String_Node_Str");
    ws.setValue(idRevision);
    ws.setResult(true);
    ws.setMessageException(Messages.getString("String_Node_Str"));
  }
 catch (  JSONException e) {
    ws.setMessageException(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
    ws.setMessageException(e.getMessage());
  }
  return ws;
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "insertionRevisionService".
 * @param idExtension
 * @param typeExtension
 * @param username
 * @param passwordHash
 * @param version
 * @param listVersionCompatibles
 * @param filename
 * @param content
 * @param description
 * @param agreement
 * @return
 */
public static WebserviceStatus insertionRevisionService(String idExtension,String typeExtension,String username,String passwordHash,String version,String listVersionCompatibles,String filename,String content,String description,String agreement){
  byte[] fileBytes=null;
  try {
    File f=new File(filename);
    if (f != null) {
      FileInputStream fis=new FileInputStream(f);
      if (fis != null) {
        int len=fis.available();
        fileBytes=new byte[len];
        fis.read(fileBytes);
      }
    }
  }
 catch (  Exception e) {
  }
  WebserviceStatus ws=new WebserviceStatus();
  ws.setResult(false);
  Resty r=new Resty();
  JSONObject tokenMessage=new JSONObject();
  try {
    tokenMessage.put("String_Node_Str",username);
    tokenMessage.put("String_Node_Str",passwordHash);
    tokenMessage.put("String_Node_Str",idExtension);
    tokenMessage.put("String_Node_Str",typeExtension);
    tokenMessage.put("String_Node_Str",version);
    tokenMessage.put("String_Node_Str",listVersionCompatibles);
    tokenMessage.put("String_Node_Str",new Path(filename).lastSegment());
    tokenMessage.put("String_Node_Str",asHex(fileBytes));
    tokenMessage.put("String_Node_Str",description.replace("String_Node_Str","String_Node_Str"));
    tokenMessage.put("String_Node_Str",agreement);
    JSONObject token=new us.monoid.json.JSONObject();
    token.put("String_Node_Str",tokenMessage);
    AbstractContent ac=Resty.content(token);
    MultipartContent mpc=Resty.form(new FormData("String_Node_Str",ac));
    TextResource textResult=r.text(exchangeWSServer + "String_Node_Str",mpc);
    JSONObject resultObject=new JSONObject(textResult.toString());
    JSONObject result=(JSONObject)resultObject.get("String_Node_Str");
    String idRevision=result.getString("String_Node_Str");
    ws.setValue(idRevision);
    ws.setResult(true);
    ws.setMessageException(Messages.getString("String_Node_Str"));
  }
 catch (  JSONException e) {
    ws.setMessageException(e.getMessage());
  }
catch (  Exception e) {
    e.printStackTrace();
    ws.setMessageException(e.getMessage());
  }
  return ws;
}