nus-yam/ex-repair huggingface dataset:
Program: 52622
Project: 52622
Buggy source:
/** 
 * Return the request that the system should be dealing with, given the request that the browse just sent.  If the incoming request is from a redirect resulting from successful authentication, a request object corresponding to the original request that prompted authentication is returned.  Otherwise, the request passed in is returned.
 * @param request   the incoming HTTP request
 * @return   the HTTP request the DSpace system should deal with
 */
public static HttpServletRequest getRealRequest(HttpServletRequest request){
  HttpSession session=request.getSession();
  if (session.getAttribute("String_Node_Str") != null) {
    HttpServletRequest actualRequest=(HttpServletRequest)session.getAttribute("String_Node_Str");
    session.removeAttribute("String_Node_Str");
    session.removeAttribute("String_Node_Str");
    return actualRequest;
  }
 else {
    return request;
  }
}

Fixed version (ground truth):
/** 
 * Return the request that the system should be dealing with, given the request that the browse just sent.  If the incoming request is from a redirect resulting from successful authentication, a request object corresponding to the original request that prompted authentication is returned.  Otherwise, the request passed in is returned.
 * @param request   the incoming HTTP request
 * @return   the HTTP request the DSpace system should deal with
 */
public static HttpServletRequest getRealRequest(HttpServletRequest request){
  HttpSession session=request.getSession();
  if (session.getAttribute("String_Node_Str") != null) {
    log.info("String_Node_Str");
    RequestInfo requestInfo=(RequestInfo)session.getAttribute("String_Node_Str");
    HttpServletRequest actualRequest=requestInfo.wrapRequest(request);
    session.removeAttribute("String_Node_Str");
    session.removeAttribute("String_Node_Str");
    session.removeAttribute("String_Node_Str");
    return actualRequest;
  }
 else {
    return request;
  }
}
Program: 52623
Project: 52623
Buggy source:
/** 
 * Start the authentication process.  This packages up the request that led to authentication being required, and then invokes the site-specific authentication method.
 * @param context   current DSpace context
 * @param request   current HTTP request - the one that promptedauthentication
 * @param response  current HTTP response
 */
public static void startAuthentication(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  HttpSession session=request.getSession();
  RequestMimic mimic=new RequestMimic(request);
  session.setAttribute("String_Node_Str",mimic);
  session.setAttribute("String_Node_Str",UIUtil.getOriginalURL(request));
  String siteAuthClassName=ConfigurationManager.getProperty("String_Node_Str");
  SiteAuthenticator siteAuth;
  try {
    Class siteAuthClass=Class.forName(siteAuthClassName);
    siteAuth=(SiteAuthenticator)siteAuthClass.newInstance();
  }
 catch (  Exception e) {
    if (siteAuthClassName == null) {
      siteAuthClassName="String_Node_Str";
    }
    log.fatal(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + siteAuthClassName),e);
    throw new ServletException(e);
  }
  siteAuth.startAuthentication(context,request,response);
}

Fixed version (ground truth):
/** 
 * Start the authentication process.  This packages up the request that led to authentication being required, and then invokes the site-specific authentication method.
 * @param context   current DSpace context
 * @param request   current HTTP request - the one that promptedauthentication
 * @param response  current HTTP response
 */
public static void startAuthentication(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  HttpSession session=request.getSession();
  RequestInfo info=new RequestInfo(request);
  session.setAttribute("String_Node_Str",info);
  session.setAttribute("String_Node_Str",UIUtil.getOriginalURL(request));
  String siteAuthClassName=ConfigurationManager.getProperty("String_Node_Str");
  SiteAuthenticator siteAuth;
  try {
    Class siteAuthClass=Class.forName(siteAuthClassName);
    siteAuth=(SiteAuthenticator)siteAuthClass.newInstance();
  }
 catch (  Exception e) {
    if (siteAuthClassName == null) {
      siteAuthClassName="String_Node_Str";
    }
    log.fatal(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + siteAuthClassName),e);
    throw new ServletException(e);
  }
  siteAuth.startAuthentication(context,request,response);
}
Program: 52624
Project: 52624
Buggy source:
/** 
 * Set the EPerson's password
 * @param s   the new email
 */
public void setPassword(String s){
  String encoded=encodePassword(s);
  myRow.setColumn("String_Node_Str",encoded);
}

Fixed version (ground truth):
/** 
 * Set the EPerson's password
 * @param s   the new email
 */
public void setPassword(String s){
  String encoded=Utils.getMD5(s);
  myRow.setColumn("String_Node_Str",encoded);
}
Program: 52625
Project: 52625
Buggy source:
/** 
 * Check EPerson's password
 * @param attempt the password attempt
 * @return boolean successful/unsuccessful
 */
public boolean checkPassword(String attempt){
  String encoded=encodePassword(attempt);
  if (attempt.equals(myRow.getStringColumn("String_Node_Str")))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * Check EPerson's password
 * @param attempt the password attempt
 * @return boolean successful/unsuccessful
 */
public boolean checkPassword(String attempt){
  String encoded=Utils.getMD5(attempt);
  return (encoded.equals(myRow.getStringColumn("String_Node_Str")));
}
Program: 52626
Project: 52626
Buggy source:
/** 
 * Construct an item with the given table row
 * @param context  the context this object exists in
 * @param row      the corresponding row in the table
 */
Item(Context context,TableRow row) throws SQLException {
  ourContext=context;
  itemRow=row;
  dublinCoreChanged=false;
  dublinCore=new ArrayList();
  bundlesChanged=false;
  bundles=new ArrayList();
  submitter=null;
  TableRowIterator tri=DatabaseManager.query(ourContext,"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str" + itemRow.getIntColumn("String_Node_Str") + "String_Node_Str");
  while (tri.hasNext()) {
    TableRow r=(TableRow)tri.next();
    bundles.add(new Bundle(ourContext,r));
  }
  tri=DatabaseManager.query(ourContext,"String_Node_Str","String_Node_Str" + itemRow.getIntColumn("String_Node_Str"));
  while (tri.hasNext()) {
    TableRow resultRow=(TableRow)tri.next();
    TableRow typeRow=DatabaseManager.find(ourContext,"String_Node_Str",resultRow.getIntColumn("String_Node_Str"));
    DCValue dcv=new DCValue();
    dcv.element=typeRow.getStringColumn("String_Node_Str");
    dcv.qualifier=typeRow.getStringColumn("String_Node_Str");
    dcv.value=resultRow.getStringColumn("String_Node_Str");
    dcv.language=resultRow.getStringColumn("String_Node_Str");
    dublinCore.add(dcv);
  }
}

Fixed version (ground truth):
/** 
 * Construct an item with the given table row
 * @param context  the context this object exists in
 * @param row      the corresponding row in the table
 */
Item(Context context,TableRow row) throws SQLException {
  ourContext=context;
  itemRow=row;
  dublinCoreChanged=false;
  dublinCore=new ArrayList();
  bundlesChanged=false;
  bundles=new ArrayList();
  submitter=null;
  TableRowIterator tri=DatabaseManager.query(ourContext,"String_Node_Str","String_Node_Str" + "String_Node_Str" + "String_Node_Str" + itemRow.getIntColumn("String_Node_Str") + "String_Node_Str");
  while (tri.hasNext()) {
    TableRow r=(TableRow)tri.next();
    bundles.add(new Bundle(ourContext,r));
  }
  tri=DatabaseManager.query(ourContext,"String_Node_Str","String_Node_Str" + itemRow.getIntColumn("String_Node_Str") + "String_Node_Str");
  while (tri.hasNext()) {
    TableRow resultRow=(TableRow)tri.next();
    TableRow typeRow=DatabaseManager.find(ourContext,"String_Node_Str",resultRow.getIntColumn("String_Node_Str"));
    DCValue dcv=new DCValue();
    dcv.element=typeRow.getStringColumn("String_Node_Str");
    dcv.qualifier=typeRow.getStringColumn("String_Node_Str");
    dcv.value=resultRow.getStringColumn("String_Node_Str");
    dcv.language=resultRow.getStringColumn("String_Node_Str");
    dublinCore.add(dcv);
  }
}
Program: 52627
Project: 52627
Buggy source:
/** 
 * Clear Dublin Core metadata values.  As with <code>addDC</code> above, passing in <code>null</code> only matches fields where the qualifier or language is actually <code>null</code>.  <code>Item.ANY</code> will match any element, qualifier or language, including <code>null</code>. Thus, <code>item.clearDC(Item.ANY, Item.ANY, Item.ANY)</code> will remove all Dublin Core metadata associated with an item.
 * @param element     the Dublin Core element to remove, or<code>Item.ANY</code>
 * @param qualifier   the qualifier.  <code>null</code> means unqualified,and <code>Item.ANY</code> means any qualifier (including unqualified.)
 * @param lang       the ISO639 language code, optionally followed byan underscore and the ISO3166 country code. <code>null</code> means only values with no language are removed, and <code>Item.ANY</code> means values with any country code or no country code are removed.
 */
public void clearDC(String element,String qualifier,String lang) throws AuthorizeException {
  List values=new ArrayList();
  Iterator i=dublinCore.iterator();
  while (i.hasNext()) {
    DCValue dcv=(DCValue)i.next();
    if (!match(element,qualifier,lang,dcv)) {
      values.add(dcv.value);
    }
  }
  dublinCore=values;
}

Fixed version (ground truth):
/** 
 * Clear Dublin Core metadata values.  As with <code>addDC</code> above, passing in <code>null</code> only matches fields where the qualifier or language is actually <code>null</code>.  <code>Item.ANY</code> will match any element, qualifier or language, including <code>null</code>. Thus, <code>item.clearDC(Item.ANY, Item.ANY, Item.ANY)</code> will remove all Dublin Core metadata associated with an item.
 * @param element     the Dublin Core element to remove, or<code>Item.ANY</code>
 * @param qualifier   the qualifier.  <code>null</code> means unqualified,and <code>Item.ANY</code> means any qualifier (including unqualified.)
 * @param lang       the ISO639 language code, optionally followed byan underscore and the ISO3166 country code. <code>null</code> means only values with no language are removed, and <code>Item.ANY</code> means values with any country code or no country code are removed.
 */
public void clearDC(String element,String qualifier,String lang) throws AuthorizeException {
  List values=new ArrayList();
  Iterator i=dublinCore.iterator();
  while (i.hasNext()) {
    DCValue dcv=(DCValue)i.next();
    if (!match(element,qualifier,lang,dcv)) {
      values.add(dcv);
    }
  }
  dublinCore=values;
}
Program: 52628
Project: 52628
Buggy source:
/** 
 * Assign an ID to row
 */
private static synchronized void assignId(TableRow row) throws SQLException {
  String table=canonicalize(row.getTable());
  String pk=getPrimaryKeyColumn(table);
  Integer id=(Integer)ids.get(table);
  int nid=id == null ? -1 : id.intValue() + 1;
  if (id == null) {
    String sql=MessageFormat.format("String_Node_Str",new Object[]{pk,table});
    Statement statement=null;
    try {
      statement=getConnection().createStatement();
      ResultSet results=statement.executeQuery(sql);
      nid=results.next() ? results.getInt(1) : -1;
    }
  finally {
      if (statement != null) {
        try {
          statement.close();
        }
 catch (        SQLException sqle) {
        }
      }
    }
  }
  row.setColumn(pk,nid);
  ids.put(table,new Integer(nid));
}

Fixed version (ground truth):
/** 
 * Assign an ID to row
 */
private static synchronized void assignId(TableRow row) throws SQLException {
  String table=canonicalize(row.getTable());
  String pk=getPrimaryKeyColumn(table);
  Integer id=(Integer)ids.get(table);
  int current_id=id == null ? -1 : id.intValue();
  if (id == null) {
    String sql=MessageFormat.format("String_Node_Str",new Object[]{pk,table});
    Statement statement=null;
    try {
      statement=getConnection().createStatement();
      ResultSet results=statement.executeQuery(sql);
      current_id=results.next() ? results.getInt(1) : -1;
    }
  finally {
      if (statement != null) {
        try {
          statement.close();
        }
 catch (        SQLException sqle) {
        }
      }
    }
  }
  int new_id=current_id + 1;
  row.setColumn(pk,new_id);
  ids.put(table,new Integer(new_id));
}
Program: 52631
Project: 52631
Buggy source:
/** 
 * 生成HTTP请求签名字符串
 * @param urlString
 * @param body
 * @param contentType
 * @return
 */
public String signRequestV2(String urlString,String method,byte[] body,String contentType){
  URI uri=URI.create(urlString);
  Mac mac=createMac();
  StringBuilder sb=new StringBuilder();
  sb.append(String.format("String_Node_Str",method,uri.getPath()));
  if (uri.getQuery() != null) {
    sb.append(String.format("String_Node_Str",uri.getQuery()));
  }
  sb.append(String.format("String_Node_Str",uri.getHost()));
  if (uri.getPort() > 0) {
    sb.append(String.format("String_Node_Str",uri.getPort()));
  }
  if (contentType != null) {
    sb.append(String.format("String_Node_Str",contentType));
  }
  sb.append("String_Node_Str");
  if (body != null && body.length > 0 && !StringUtils.isNullOrEmpty(contentType)) {
    if (contentType.equals(Client.FormMime) || contentType.equals(Client.JsonMime)) {
      sb.append(new String(body));
    }
  }
  mac.update(StringUtils.utf8Bytes(sb.toString()));
  String digest=UrlSafeBase64.encodeToString(mac.doFinal());
  return this.accessKey + "String_Node_Str" + digest;
}

Fixed version (ground truth):
/** 
 * 生成HTTP请求签名字符串
 * @param urlString
 * @param body
 * @param contentType
 * @return
 */
public String signRequestV2(String urlString,String method,byte[] body,String contentType){
  URI uri=URI.create(urlString);
  Mac mac=createMac();
  StringBuilder sb=new StringBuilder();
  sb.append(String.format("String_Node_Str",method,uri.getPath()));
  if (uri.getQuery() != null) {
    sb.append(String.format("String_Node_Str",uri.getQuery()));
  }
  sb.append(String.format("String_Node_Str",uri.getHost()));
  if (uri.getPort() > 0) {
    sb.append(String.format("String_Node_Str",uri.getPort()));
  }
  if (contentType != null) {
    sb.append(String.format("String_Node_Str",contentType));
  }
  sb.append("String_Node_Str");
  if (body != null && body.length > 0 && !StringUtils.isNullOrEmpty(contentType)) {
    if (contentType.equals(Client.FormMime) || contentType.equals(Client.JsonMime)) {
      sb.append(new String(body));
    }
  }
  System.out.println(sb.toString());
  mac.update(StringUtils.utf8Bytes(sb.toString()));
  String digest=UrlSafeBase64.encodeToString(mac.doFinal());
  return this.accessKey + "String_Node_Str" + digest;
}
Program: 52632
Project: 52632
Buggy source:
/** 
 * 生成HTTP请求签名字符串
 * @param urlString
 * @param body
 * @param contentType
 * @return
 */
public String signRequest(String urlString,byte[] body,String contentType){
  URI uri=URI.create(urlString);
  String path=uri.getRawPath();
  String query=uri.getRawQuery();
  Mac mac=createMac();
  mac.update(StringUtils.utf8Bytes(path));
  if (query != null && query.length() != 0) {
    mac.update((byte)('?'));
    mac.update(StringUtils.utf8Bytes(query));
  }
  mac.update((byte)'\n');
  if (body != null && body.length > 0 && !StringUtils.isNullOrEmpty(contentType)) {
    if (contentType.equals(Client.FormMime) || contentType.equals(Client.JsonMime)) {
      mac.update(body);
    }
  }
  String digest=UrlSafeBase64.encodeToString(mac.doFinal());
  return this.accessKey + "String_Node_Str" + digest;
}

Fixed version (ground truth):
/** 
 * 生成HTTP请求签名字符串
 * @param urlString
 * @param body
 * @param contentType
 * @return
 */
public String signRequest(String urlString,byte[] body,String contentType){
  URI uri=URI.create(urlString);
  String path=uri.getRawPath();
  String query=uri.getRawQuery();
  Mac mac=createMac();
  mac.update(StringUtils.utf8Bytes(path));
  if (query != null && query.length() != 0) {
    mac.update((byte)('?'));
    mac.update(StringUtils.utf8Bytes(query));
  }
  mac.update((byte)'\n');
  if (body != null && Client.FormMime.equalsIgnoreCase(contentType)) {
    mac.update(body);
  }
  String digest=UrlSafeBase64.encodeToString(mac.doFinal());
  return this.accessKey + "String_Node_Str" + digest;
}
Program: 52633
Project: 52633
Buggy source:
@Test public void testCreateTimestampAntiLeechUrlWithQueryString(){
  String host="String_Node_Str";
  String fileName="String_Node_Str";
  String queryString="String_Node_Str";
  long deadline=System.currentTimeMillis() / 1000 + 3600;
  String encryptKey="String_Node_Str";
  String signedUrl;
  try {
    signedUrl=CdnManager.ceateTimestampAntiLeechUrl(host,fileName,queryString,encryptKey,deadline);
    System.out.println(signedUrl);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testCreateTimestampAntiLeechUrlWithQueryString(){
  String host="String_Node_Str";
  String fileName="String_Node_Str";
  String queryString="String_Node_Str";
  long deadline=System.currentTimeMillis() / 1000 + 3600;
  String encryptKey="String_Node_Str";
  String signedUrl;
  try {
    signedUrl=CdnManager.createTimestampAntiLeechUrl(host,fileName,queryString,encryptKey,deadline);
    System.out.println(signedUrl);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    Assert.fail();
  }
}
Program: 52634
Project: 52634
Buggy source:
@Test public void testCreateTimestampAntiLeechUrlSimple(){
  String host="String_Node_Str";
  String fileName="String_Node_Str";
  String queryString="String_Node_Str";
  long deadline=System.currentTimeMillis() / 1000 + 3600;
  String encryptKey="String_Node_Str";
  String signedUrl;
  try {
    signedUrl=CdnManager.ceateTimestampAntiLeechUrl(host,fileName,queryString,encryptKey,deadline);
    System.out.println(signedUrl);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    Assert.fail();
  }
}

Fixed version (ground truth):
@Test public void testCreateTimestampAntiLeechUrlSimple(){
  String host="String_Node_Str";
  String fileName="String_Node_Str";
  String queryString="String_Node_Str";
  long deadline=System.currentTimeMillis() / 1000 + 3600;
  String encryptKey="String_Node_Str";
  String signedUrl;
  try {
    signedUrl=CdnManager.createTimestampAntiLeechUrl(host,fileName,queryString,encryptKey,deadline);
    System.out.println(signedUrl);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
    Assert.fail();
  }
}
Program: 52635
Project: 52635
Buggy source:
private static PutRet putStream(String uptoken,String key,InputStream reader,PutExtra extra){
  MultipartEntity requestEntity=new MultipartEntity();
  try {
    requestEntity.addPart("String_Node_Str",new StringBody(uptoken));
    AbstractContentBody inputBody=buildInputStreamBody(reader,extra,key);
    requestEntity.addPart("String_Node_Str",inputBody);
    setKey(requestEntity,key);
    setParam(requestEntity,extra.params);
    if (extra.checkCrc != NO_CRC32) {
      if (extra.crc32 == 0) {
        return new PutRet(new CallRet(400,new Exception("String_Node_Str")));
      }
      requestEntity.addPart("String_Node_Str",new StringBody(extra.crc32 + "String_Node_Str"));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new PutRet(new CallRet(400,e));
  }
  String url=Config.UP_HOST;
  CallRet ret=new Client().callWithMultiPart(url,requestEntity);
  return new PutRet(ret);
}

Fixed version (ground truth):
private static PutRet putStream(String uptoken,String key,InputStream reader,PutExtra extra,String fileName){
  MultipartEntity requestEntity=new MultipartEntity();
  try {
    requestEntity.addPart("String_Node_Str",new StringBody(uptoken));
    AbstractContentBody inputBody=buildInputStreamBody(reader,extra,fileName != null ? fileName : "String_Node_Str");
    requestEntity.addPart("String_Node_Str",inputBody);
    setKey(requestEntity,key);
    setParam(requestEntity,extra.params);
    if (extra.checkCrc != NO_CRC32) {
      if (extra.crc32 == 0) {
        return new PutRet(new CallRet(400,new Exception("String_Node_Str")));
      }
      requestEntity.addPart("String_Node_Str",new StringBody(extra.crc32 + "String_Node_Str"));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new PutRet(new CallRet(400,e));
  }
  String url=Config.UP_HOST;
  CallRet ret=new Client().callWithMultiPart(url,requestEntity);
  return new PutRet(ret);
}
Program: 52636
Project: 52636
Buggy source:
private static InputStreamBody buildInputStreamBody(InputStream reader,PutExtra extra,String key){
  if (extra.mimeType != null) {
    return new InputStreamBody(reader,extra.mimeType,key);
  }
 else {
    return new InputStreamBody(reader,key);
  }
}

Fixed version (ground truth):
private static InputStreamBody buildInputStreamBody(InputStream reader,PutExtra extra,String fileName){
  if (extra.mimeType != null) {
    return new InputStreamBody(reader,extra.mimeType,fileName);
  }
 else {
    return new InputStreamBody(reader,fileName);
  }
}
Program: 52637
Project: 52637
Buggy source:
private static PutRet put(String uptoken,String key,File file,PutExtra extra){
  if (!file.exists() || !file.canRead()) {
    return new PutRet(new CallRet(400,new Exception("String_Node_Str")));
  }
  MultipartEntity requestEntity=new MultipartEntity();
  try {
    requestEntity.addPart("String_Node_Str",new StringBody(uptoken));
    AbstractContentBody fileBody=buildFileBody(file,extra);
    requestEntity.addPart("String_Node_Str",fileBody);
    setKey(requestEntity,key);
    setParam(requestEntity,extra.params);
    if (extra.checkCrc != NO_CRC32) {
      if (extra.crc32 == 0) {
        return new PutRet(new CallRet(400,new Exception("String_Node_Str")));
      }
      requestEntity.addPart("String_Node_Str",new StringBody(extra.crc32 + "String_Node_Str"));
    }
    if (extra.params != null) {
      for (      Map.Entry<String,String> xvar : extra.params.entrySet()) {
        requestEntity.addPart(xvar.getKey(),new StringBody(xvar.getValue()));
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new PutRet(new CallRet(400,e));
  }
  String url=Config.UP_HOST;
  CallRet ret=new Client().callWithMultiPart(url,requestEntity);
  return new PutRet(ret);
}

Fixed version (ground truth):
public static PutRet put(String uptoken,String key,InputStream reader,PutExtra extra,String fileName){
  return putStream(uptoken,key,reader,extra,fileName);
}
Program: 52638
Project: 52638
Buggy source:
public static PutRet Put(String uptoken,String key,InputStream reader,PutExtra extra){
  PutRet ret=putStream(uptoken,key,reader,extra);
  return ret;
}

Fixed version (ground truth):
public static PutRet Put(String uptoken,String key,InputStream reader,PutExtra extra){
  return put(uptoken,key,reader,extra);
}
Program: 52639
Project: 52639
Buggy source:
@Override public void setUp(){
  Config.ACCESS_KEY=System.getenv("String_Node_Str");
  Config.SECRET_KEY=System.getenv("String_Node_Str");
  Config.RS_HOST=System.getenv("String_Node_Str");
  bucketName=System.getenv("String_Node_Str");
  assertNotNull(Config.ACCESS_KEY);
  assertNotNull(Config.SECRET_KEY);
  assertNotNull(Config.RS_HOST);
  assertNotNull(bucketName);
  mac=new Mac(Config.ACCESS_KEY,Config.SECRET_KEY);
}

Fixed version (ground truth):
@Override public void setUp(){
  Config.ACCESS_KEY=System.getenv("String_Node_Str");
  Config.SECRET_KEY=System.getenv("String_Node_Str");
  bucketName=System.getenv("String_Node_Str");
  mac=new Mac(Config.ACCESS_KEY,Config.SECRET_KEY);
  key=UUID.randomUUID().toString();
  key2=UUID.randomUUID().toString();
}
Program: 52640
Project: 52640
Buggy source:
@Override public void tearDown(){
{
    RSClient rs=new RSClient(mac);
    Entry sr=rs.stat(bucketName,key);
    assertTrue(sr.ok());
    assertTrue(expectedHash.equals(sr.getHash()));
  }
{
    RSClient rs=new RSClient(mac);
    CallRet cr=rs.delete(bucketName,key);
    assertTrue(cr.ok());
  }
{
    RSClient rs=new RSClient(mac);
    Entry sr=rs.stat(bucketName,key);
    assertTrue(!sr.ok());
  }
}

Fixed version (ground truth):
@Override public void tearDown(){
  RSClient rs=new RSClient(mac);
  try {
    rs.delete(bucketName,key2);
  }
 catch (  Exception e) {
  }
  try {
    rs.delete(bucketName,key);
  }
 catch (  Exception e) {
  }
}
Program: 52642
Project: 52642
Buggy source:
public static ExifRet call(String url){
  CallRet ret=new Client().call(makeRequest(url));
  return new ExifRet(ret);
}

Fixed version (ground truth):
public static ExifRet call(String url,Mac mac) throws AuthException {
  String pubUrl=makeRequest(url);
  GetPolicy policy=new GetPolicy();
  String priUrl=policy.makeRequest(pubUrl,mac);
  CallRet ret=new Client().call(priUrl);
  return new ExifRet(ret);
}
Program: 52643
Project: 52643
Buggy source:
public static ImageInfoRet call(String url){
  CallRet ret=new Client().call(makeRequest(url));
  return new ImageInfoRet(ret);
}

Fixed version (ground truth):
/** 
 */
public static ImageInfoRet call(String url,Mac mac) throws AuthException {
  String pubUrl=makeRequest(url);
  GetPolicy policy=new GetPolicy();
  String priUrl=policy.makeRequest(pubUrl,mac);
  CallRet ret=new Client().call(priUrl);
  return new ImageInfoRet(ret);
}
Program: 52644
Project: 52644
Buggy source:
public CallRet call(String url){
  CallRet ret=new Client().call(this.makeRequest(url));
  return ret;
}

Fixed version (ground truth):
public CallRet call(String url,Mac mac) throws AuthException {
  String pubUrl=makeRequest(url);
  GetPolicy policy=new GetPolicy();
  String priUrl=policy.makeRequest(pubUrl,mac);
  CallRet ret=new Client().call(priUrl);
  return ret;
}
Program: 52645
Project: 52645
Buggy source:
private String marshal() throws JSONException {
  JSONStringer stringer=new JSONStringer();
  stringer.object();
  stringer.key("String_Node_Str").value(this.scope);
  if (this.callbackUrl != null && this.callbackUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackUrl);
  }
  if (this.returnUrl != null && this.returnUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnUrl);
  }
  if (this.asyncOps != null && this.asyncOps.length() > 0) {
    stringer.key("String_Node_Str").value(this.asyncOps);
  }
  if (this.returnBody != null && this.returnBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnBody);
  }
  stringer.key("String_Node_Str").value(this.expires);
  stringer.endObject();
  return stringer.toString();
}

Fixed version (ground truth):
private String marshal() throws JSONException {
  JSONStringer stringer=new JSONStringer();
  stringer.object();
  stringer.key("String_Node_Str").value(this.scope);
  if (this.callbackUrl != null && this.callbackUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackUrl);
  }
  if (this.callbackBody != null && this.callbackBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackBody);
  }
  if (this.returnUrl != null && this.returnUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnUrl);
  }
  if (this.returnBody != null && this.returnBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnBody);
  }
  if (this.asyncOps != null && this.asyncOps.length() > 0) {
    stringer.key("String_Node_Str").value(this.asyncOps);
  }
  stringer.key("String_Node_Str").value(this.expires);
  stringer.endObject();
  return stringer.toString();
}
Program: 52646
Project: 52646
Buggy source:
private String marshal() throws JSONException {
  JSONStringer stringer=new JSONStringer();
  stringer.object();
  stringer.key("String_Node_Str").value(this.scope);
  if (this.callbackUrl != null && this.callbackUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackUrl);
  }
  if (this.returnUrl != null && this.returnUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnUrl);
  }
  if (this.asyncOps != null && this.asyncOps.length() > 0) {
    stringer.key("String_Node_Str").value(this.asyncOps);
  }
  if (this.returnBody != null && this.returnBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnBody);
  }
  stringer.key("String_Node_Str").value(this.expires);
  stringer.endObject();
  return stringer.toString();
}

Fixed version (ground truth):
private String marshal() throws JSONException {
  JSONStringer stringer=new JSONStringer();
  stringer.object();
  stringer.key("String_Node_Str").value(this.scope);
  if (this.callbackUrl != null && this.callbackUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackUrl);
  }
  if (this.callbackBody != null && this.callbackBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.callbackBody);
  }
  if (this.returnUrl != null && this.returnUrl.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnUrl);
  }
  if (this.returnBody != null && this.returnBody.length() > 0) {
    stringer.key("String_Node_Str").value(this.returnBody);
  }
  if (this.asyncOps != null && this.asyncOps.length() > 0) {
    stringer.key("String_Node_Str").value(this.asyncOps);
  }
  stringer.key("String_Node_Str").value(this.expires);
  stringer.endObject();
  return stringer.toString();
}
Program: 52647
Project: 52647
Buggy source:
public static CallRet call(String url){
  CallRet ret=new Client().call(url);
  return ret;
}

Fixed version (ground truth):
public static CallRet call(String url){
  CallRet ret=new Client().call(makeRequest(url));
  return ret;
}
Program: 52648
Project: 52648
Buggy source:
public static ImageInfoRet call(String url){
  CallRet ret=new Client().call(url);
  return new ImageInfoRet(ret);
}

Fixed version (ground truth):
public static ImageInfoRet call(String url){
  CallRet ret=new Client().call(makeRequest(url));
  return new ImageInfoRet(ret);
}
Program: 52649
Project: 52649
Buggy source:
public CallRet call(String url){
  CallRet ret=new Client().call(url);
  return ret;
}

Fixed version (ground truth):
public CallRet call(String url){
  CallRet ret=new Client().call(this.makeRequest(url));
  return ret;
}
Program: 52650
Project: 52650
Buggy source:
public CallRet call(String url){
  CallRet ret=new Client().call(url);
  return ret;
}

Fixed version (ground truth):
public CallRet call(String url){
  CallRet ret=new Client().call(this.makeRequest(url));
  return ret;
}
Program: 52652
Project: 52652
Buggy source:
public static PutFileRet resumablePutFile(UpService c,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier,String bucketName,String key,String mimeType,RandomAccessFile f,long fsize,String customMeta,String callbackParams){
  ResumablePutRet ret=c.resumablePut(f,fsize,checksums,progresses,progressNotifier,blockProgressNotifier);
  if (!ret.ok()) {
    return new PutFileRet(ret);
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String params="String_Node_Str" + Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    params+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  String entryUri=bucketName + "String_Node_Str" + key;
  CallRet callRet=c.makeFile("String_Node_Str",entryUri,fsize,params,callbackParams,checksums);
  return new PutFileRet(callRet);
}

Fixed version (ground truth):
public static PutFileRet resumablePutFile(UpService c,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier,String bucketName,String key,String mimeType,RandomAccessFile f,long fsize,String customMeta,String callbackParams){
  ResumablePutRet ret=c.resumablePut(f,fsize,checksums,progresses,progressNotifier,blockProgressNotifier);
  if (!ret.ok()) {
    return new PutFileRet(ret);
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String params="String_Node_Str" + Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    params+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  String entryUri=bucketName + "String_Node_Str" + key;
  String upHost=ret.getHost();
  CallRet callRet=c.makeFile(upHost,"String_Node_Str",entryUri,fsize,params,callbackParams,checksums);
  return new PutFileRet(callRet);
}
Program: 52653
Project: 52653
Buggy source:
public ResumablePutRet makeBlock(long blockSize,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + String.valueOf(blockSize),"String_Node_Str",body,bodyLength);
  ResumablePutRet putRet=new ResumablePutRet(ret);
  upHost=putRet.getHost();
  return putRet;
}

Fixed version (ground truth):
public ResumablePutRet makeBlock(String upHost,long blockSize,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + String.valueOf(blockSize),"String_Node_Str",body,bodyLength);
  ResumablePutRet putRet=new ResumablePutRet(ret);
  return putRet;
}
Program: 52654
Project: 52654
Buggy source:
public CallRet makeFile(String cmd,String entry,long fsize,String params,String callbackParams,String[] checksums){
  if (callbackParams != null && !callbackParams.isEmpty()) {
    params+="String_Node_Str" + new String(Base64.encodeBase64(callbackParams.getBytes(),false,false));
  }
  String url=upHost + cmd + Client.urlsafeEncodeString(entry.getBytes())+ "String_Node_Str"+ String.valueOf(fsize)+ params;
  byte[] body=new byte[20 * checksums.length];
  for (int i=0; i < checksums.length; i++) {
    byte[] buf=Base64.decodeBase64(checksums[i]);
    System.arraycopy(buf,0,body,i * 20,buf.length);
  }
  CallRet ret=this.conn.callWithBinary(url,null,body,body.length);
  return ret;
}

Fixed version (ground truth):
public CallRet makeFile(String upHost,String cmd,String entry,long fsize,String params,String callbackParams,String[] checksums){
  if (callbackParams != null && !callbackParams.isEmpty()) {
    params+="String_Node_Str" + new String(Base64.encodeBase64(callbackParams.getBytes(),false,false));
  }
  String url=upHost + cmd + Client.urlsafeEncodeString(entry.getBytes())+ "String_Node_Str"+ String.valueOf(fsize)+ params;
  byte[] body=new byte[20 * checksums.length];
  for (int i=0; i < checksums.length; i++) {
    byte[] buf=Base64.decodeBase64(checksums[i]);
    System.arraycopy(buf,0,body,i * 20,buf.length);
  }
  CallRet ret=this.conn.callWithBinary(url,null,body,body.length);
  return ret;
}
Program: 52655
Project: 52655
Buggy source:
public ResumablePutRet putBlock(long blockSize,String ctx,long offset,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + ctx+ "String_Node_Str"+ String.valueOf(offset),"String_Node_Str",body,bodyLength);
  return new ResumablePutRet(ret);
}

Fixed version (ground truth):
public ResumablePutRet putBlock(String upHost,long blockSize,String ctx,long offset,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + ctx+ "String_Node_Str"+ String.valueOf(offset),"String_Node_Str",body,bodyLength);
  return new ResumablePutRet(ret);
}
Program: 52657
Project: 52657
Buggy source:
public ResumablePutRet resumablePut(RandomAccessFile file,long fsize,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier){
  int blockCount=blockCount(fsize);
  if (checksums.length != blockCount || progresses.length != blockCount) {
    return new ResumablePutRet(new CallRet(400,"String_Node_Str"));
  }
  for (int i=0; i < blockCount; i++) {
    if (checksums[i] == null || checksums[i].isEmpty()) {
      int blockIndex=i;
      long blockSize=Config.BLOCK_SIZE;
      if (blockIndex == blockCount - 1) {
        blockSize=fsize - Config.BLOCK_SIZE * blockIndex;
      }
      if (progresses[i] == null) {
        progresses[i]=new BlockProgress();
      }
      ResumablePutRet ret=resumablePutBlock(file,blockIndex,blockSize,Config.PUT_CHUNK_SIZE,Config.PUT_RETRY_TIMES,progresses[i],blockProgressNotifier);
      if (!ret.ok()) {
        return ret;
      }
      checksums[i]=ret.getChecksum();
      progressNotifier.notify(i,checksums[i]);
    }
  }
  return new ResumablePutRet(new CallRet(200,(String)null));
}

Fixed version (ground truth):
public ResumablePutRet resumablePut(RandomAccessFile file,long fsize,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier){
  String upHost=Config.UP_HOST;
  ResumablePutRet ret=null;
  int blockCount=blockCount(fsize);
  if (checksums.length != blockCount || progresses.length != blockCount) {
    return new ResumablePutRet(new CallRet(400,"String_Node_Str"));
  }
  for (int i=0; i < blockCount; i++) {
    if (checksums[i] == null || checksums[i].isEmpty()) {
      int blockIndex=i;
      long blockSize=Config.BLOCK_SIZE;
      if (blockIndex == blockCount - 1) {
        blockSize=fsize - Config.BLOCK_SIZE * blockIndex;
      }
      if (progresses[i] == null) {
        progresses[i]=new BlockProgress();
      }
      ret=resumablePutBlock(upHost,file,blockIndex,blockSize,Config.PUT_CHUNK_SIZE,Config.PUT_RETRY_TIMES,progresses[i],blockProgressNotifier);
      if (i == 0) {
        upHost=ret.getHost();
      }
      if (!ret.ok()) {
        return ret;
      }
      checksums[i]=ret.getChecksum();
      progressNotifier.notify(i,checksums[i]);
    }
  }
  ret.setHost(upHost);
  return ret;
}
Program: 52658
Project: 52658
Buggy source:
public static PutFileRet resumablePutFile(UpService c,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier,String bucketName,String key,String mimeType,RandomAccessFile f,long fsize,String customMeta,String callbackParams){
  ResumablePutRet ret=c.resumablePut(f,fsize,checksums,progresses,progressNotifier,blockProgressNotifier);
  if (!ret.ok()) {
    return new PutFileRet(ret);
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String params="String_Node_Str" + Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    params+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  String entryUri=bucketName + "String_Node_Str" + key;
  CallRet callRet=c.makeFile("String_Node_Str",entryUri,fsize,params,callbackParams,checksums);
  return new PutFileRet(callRet);
}

Fixed version (ground truth):
public static PutFileRet resumablePutFile(UpService c,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier,String bucketName,String key,String mimeType,RandomAccessFile f,long fsize,String customMeta,String callbackParams){
  ResumablePutRet ret=c.resumablePut(f,fsize,checksums,progresses,progressNotifier,blockProgressNotifier);
  if (!ret.ok()) {
    return new PutFileRet(ret);
  }
  if (mimeType == null || mimeType.isEmpty()) {
    mimeType="String_Node_Str";
  }
  String params="String_Node_Str" + Base64.encodeBase64String(mimeType.getBytes());
  if (customMeta != null && !customMeta.isEmpty()) {
    params+="String_Node_Str" + Base64.encodeBase64String(customMeta.getBytes());
  }
  String entryUri=bucketName + "String_Node_Str" + key;
  String upHost=ret.getHost();
  CallRet callRet=c.makeFile(upHost,"String_Node_Str",entryUri,fsize,params,callbackParams,checksums);
  return new PutFileRet(callRet);
}
Program: 52659
Project: 52659
Buggy source:
public ResumablePutRet makeBlock(long blockSize,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + String.valueOf(blockSize),"String_Node_Str",body,bodyLength);
  ResumablePutRet putRet=new ResumablePutRet(ret);
  upHost=putRet.getHost();
  return putRet;
}

Fixed version (ground truth):
public ResumablePutRet makeBlock(String upHost,long blockSize,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + String.valueOf(blockSize),"String_Node_Str",body,bodyLength);
  ResumablePutRet putRet=new ResumablePutRet(ret);
  return putRet;
}
Program: 52660
Project: 52660
Buggy source:
public CallRet makeFile(String cmd,String entry,long fsize,String params,String callbackParams,String[] checksums){
  if (callbackParams != null && !callbackParams.isEmpty()) {
    params+="String_Node_Str" + new String(Base64.encodeBase64(callbackParams.getBytes(),false,false));
  }
  String url=upHost + cmd + Client.urlsafeEncodeString(entry.getBytes())+ "String_Node_Str"+ String.valueOf(fsize)+ params;
  byte[] body=new byte[20 * checksums.length];
  for (int i=0; i < checksums.length; i++) {
    byte[] buf=Base64.decodeBase64(checksums[i]);
    System.arraycopy(buf,0,body,i * 20,buf.length);
  }
  CallRet ret=this.conn.callWithBinary(url,null,body,body.length);
  return ret;
}

Fixed version (ground truth):
public CallRet makeFile(String upHost,String cmd,String entry,long fsize,String params,String callbackParams,String[] checksums){
  if (callbackParams != null && !callbackParams.isEmpty()) {
    params+="String_Node_Str" + new String(Base64.encodeBase64(callbackParams.getBytes(),false,false));
  }
  String url=upHost + cmd + Client.urlsafeEncodeString(entry.getBytes())+ "String_Node_Str"+ String.valueOf(fsize)+ params;
  byte[] body=new byte[20 * checksums.length];
  for (int i=0; i < checksums.length; i++) {
    byte[] buf=Base64.decodeBase64(checksums[i]);
    System.arraycopy(buf,0,body,i * 20,buf.length);
  }
  CallRet ret=this.conn.callWithBinary(url,null,body,body.length);
  return ret;
}
Program: 52661
Project: 52661
Buggy source:
public ResumablePutRet putBlock(long blockSize,String ctx,long offset,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + ctx+ "String_Node_Str"+ String.valueOf(offset),"String_Node_Str",body,bodyLength);
  return new ResumablePutRet(ret);
}

Fixed version (ground truth):
public ResumablePutRet putBlock(String upHost,long blockSize,String ctx,long offset,byte[] body,long bodyLength){
  CallRet ret=this.conn.callWithBinary(upHost + "String_Node_Str" + ctx+ "String_Node_Str"+ String.valueOf(offset),"String_Node_Str",body,bodyLength);
  return new ResumablePutRet(ret);
}
Program: 52663
Project: 52663
Buggy source:
public ResumablePutRet resumablePut(RandomAccessFile file,long fsize,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier){
  int blockCount=blockCount(fsize);
  if (checksums.length != blockCount || progresses.length != blockCount) {
    return new ResumablePutRet(new CallRet(400,"String_Node_Str"));
  }
  for (int i=0; i < blockCount; i++) {
    if (checksums[i] == null || checksums[i].isEmpty()) {
      int blockIndex=i;
      long blockSize=Config.BLOCK_SIZE;
      if (blockIndex == blockCount - 1) {
        blockSize=fsize - Config.BLOCK_SIZE * blockIndex;
      }
      if (progresses[i] == null) {
        progresses[i]=new BlockProgress();
      }
      ResumablePutRet ret=resumablePutBlock(file,blockIndex,blockSize,Config.PUT_CHUNK_SIZE,Config.PUT_RETRY_TIMES,progresses[i],blockProgressNotifier);
      if (!ret.ok()) {
        return ret;
      }
      checksums[i]=ret.getChecksum();
      progressNotifier.notify(i,checksums[i]);
    }
  }
  return new ResumablePutRet(new CallRet(200,(String)null));
}

Fixed version (ground truth):
public ResumablePutRet resumablePut(RandomAccessFile file,long fsize,String[] checksums,BlockProgress[] progresses,ProgressNotifier progressNotifier,BlockProgressNotifier blockProgressNotifier){
  String upHost=Config.UP_HOST;
  ResumablePutRet ret=null;
  int blockCount=blockCount(fsize);
  if (checksums.length != blockCount || progresses.length != blockCount) {
    return new ResumablePutRet(new CallRet(400,"String_Node_Str"));
  }
  for (int i=0; i < blockCount; i++) {
    if (checksums[i] == null || checksums[i].isEmpty()) {
      int blockIndex=i;
      long blockSize=Config.BLOCK_SIZE;
      if (blockIndex == blockCount - 1) {
        blockSize=fsize - Config.BLOCK_SIZE * blockIndex;
      }
      if (progresses[i] == null) {
        progresses[i]=new BlockProgress();
      }
      ret=resumablePutBlock(upHost,file,blockIndex,blockSize,Config.PUT_CHUNK_SIZE,Config.PUT_RETRY_TIMES,progresses[i],blockProgressNotifier);
      if (i == 0) {
        upHost=ret.getHost();
      }
      if (!ret.ok()) {
        return ret;
      }
      checksums[i]=ret.getChecksum();
      progressNotifier.notify(i,checksums[i]);
    }
  }
  ret.setHost(upHost);
  return ret;
}
Program: 52664
Project: 52664
Buggy source:
public CallRet callWithBinary(String url,String contentType,byte[] body,long bodyLength){
  ByteArrayEntity entity=new ByteArrayEntity(body);
  if (contentType == null || contentType.length() == 0) {
    contentType="String_Node_Str";
  }
  entity.setContentType(contentType);
  HttpPost postMethod=new HttpPost(url);
  postMethod.setEntity(entity);
  DefaultHttpClient client=new DefaultHttpClient();
  try {
    setAuth(postMethod);
    HttpResponse response=client.execute(postMethod);
    return handleResult(response);
  }
 catch (  Exception e) {
    e.printStackTrace();
    return new CallRet(400,e);
  }
 finally {
    client.getConnectionManager().shutdown();
  }
}

Fixed version (ground truth):
public CallRet callWithBinary(String url,String contentType,byte[] body,long bodyLength){
  ByteArrayEntity entity=new ByteArrayEntity(body);
  if (contentType == null || contentType.isEmpty()) {
    contentType="String_Node_Str";
  }
  entity.setContentType(contentType);
  return callWithBinary(url,entity);
}
Program: 52665
Project: 52665
Buggy source:
/** 
 * @param args
 */
public static void main(String[] args){
  String tblName="String_Node_Str";
  String key="String_Node_Str";
  String path=RSDemo.class.getClassLoader().getResource("String_Node_Str").getPath();
  System.out.println("String_Node_Str" + path + key);
  AuthPolicy policy=new AuthPolicy("String_Node_Str",3600);
  String token=policy.makeAuthTokenString();
  UpTokenClient upTokenClient=new UpTokenClient(token);
  UpService upClient=new UpService(upTokenClient);
  try {
    RandomAccessFile f=new RandomAccessFile(path + key,"String_Node_Str");
    long fsize=f.length();
    long blockCount=UpService.blockCount(fsize);
    String[] checksums=new String[(int)blockCount];
    BlockProgress[] progresses=new BlockProgress[(int)blockCount];
    Notifier notif=new Notifier();
    PutFileRet putFileRet=RSClient.resumablePutFile(upClient,checksums,progresses,(ProgressNotifier)notif,(BlockProgressNotifier)notif,tblName + "String_Node_Str" + key,"String_Node_Str",f,fsize,"String_Node_Str","String_Node_Str");
    if (putFileRet.ok()) {
      System.out.println("String_Node_Str" + putFileRet.getHash());
    }
 else {
      System.out.println("String_Node_Str" + putFileRet.getException());
    }
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * @param args
 */
public static void main(String[] args){
  String bucketName="String_Node_Str";
  String key="String_Node_Str";
  String path=RSDemo.class.getClassLoader().getResource("String_Node_Str").getPath();
  System.out.println("String_Node_Str" + path + key);
  AuthPolicy policy=new AuthPolicy("String_Node_Str",3600);
  String token=policy.makeAuthTokenString();
  UpTokenClient upTokenClient=new UpTokenClient(token);
  UpService upClient=new UpService(upTokenClient);
  try {
    RandomAccessFile f=new RandomAccessFile(path + key,"String_Node_Str");
    long fsize=f.length();
    long blockCount=UpService.blockCount(fsize);
    String[] checksums=new String[(int)blockCount];
    BlockProgress[] progresses=new BlockProgress[(int)blockCount];
    Notifier notif=new Notifier();
    PutFileRet putFileRet=RSClient.resumablePutFile(upClient,checksums,progresses,(ProgressNotifier)notif,(BlockProgressNotifier)notif,bucketName,key,"String_Node_Str",f,fsize,"String_Node_Str","String_Node_Str");
    if (putFileRet.ok()) {
      System.out.println("String_Node_Str" + putFileRet.getHash());
    }
 else {
      System.out.println("String_Node_Str" + putFileRet);
    }
  }
 catch (  FileNotFoundException e1) {
    e1.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
}