nus-yam/ex-repair huggingface dataset:
Program: 43713
Project: 43713
Buggy source:
public static Link getLinkForManyMany(Mirror<?> mirror,Field field,Class<?> targetClass,String key,String from,String to,String relation,Field referField,Field targetField) throws NoSuchFieldException {
  Link link=new Link(field,targetClass,LinkType.ManyMany,referField,targetField);
  link.mapKeyField="String_Node_Str".equals(key) ? null : key;
  link.from=from;
  link.to=to;
  link.relation=Relation.make(relation);
  if (null == link.referField || null == link.targetField) {
    throw Lang.makeThrow("String_Node_Str" + "String_Node_Str" + "String_Node_Str",mirror.getType().getName(),field.getName(),targetClass.getName(),link.referField,link.targetField);
  }
  return link;
}

Fixed version (ground truth):
/** 
 * 创建一条多对多的映射，通过一个关联表的两个字段 <ul> <li>from - selfClass.PK <li>to - targetClass.PK </ul> 为当前字段关联一组<b>目标POJO</b> <p> <b style=color:red>这里需要注意的是：</b><br> 无论是 from 和 to，都要和相对应的对象的主键类型一直 <ul> <li><b>本POJO</b>和<b>目标POJO</b>都不可以是复合主键 <li>如果 from 字段类型是整数，<b>本POJO</b>的主键就必须是整数型主键。 <li>如果 to 字段类型是字符串，<b>本POJO</b>的主键就必须是字符型主键 </ul>
 * @param mirror <b>本 POJO</b>的类型
 * @param field 被映射的字段，它的类型应该是<b>目标POJO</b>的类型的接口或者超类
 * @param targetClass <b>目标POJO</b>的类型
 * @param selfPk <b>本 POJO</b>的主键
 * @param targetPk <b>目标 POJO</b>的主键
 * @param key 如果被映射字段是个 Map， 你需要声明一下，<b>目标POJO</b>哪个字段是用来作为键值的。 <br> 默认的，赋值 null 即可
 * @param relation 关联表名
 * @param from 在关联表中指向 <b>本 POJO</b>主键的字段名
 * @param to 在关联表中指向 <b>目标POJO</b>主键的字段名
 * @return 映射对象
 */
public static Link getLinkForManyMany(Mirror<?> mirror,Field field,Class<?> targetClass,Field selfPk,Field targetPk,String key,String relation,String from,String to){
  Link link=new Link(field,targetClass);
  link.type=LinkType.ManyMany;
  link.mapKeyField="String_Node_Str".equals(key) ? null : key;
  link.from=from;
  link.to=to;
  link.relation=Relation.make(relation);
  link.referField=selfPk;
  link.targetField=targetPk;
  if (null == link.referField || null == link.targetField) {
    throw Lang.makeThrow("String_Node_Str" + "String_Node_Str" + "String_Node_Str",mirror.getType().getName(),field.getName(),targetClass.getName(),link.referField,link.targetField);
  }
  return link;
}
Program: 43714
Project: 43714
Buggy source:
private Link(Field field,Class<?> targetClass,LinkType type,Field referField,Field targetField) throws NoSuchFieldException {
  this.ownField=field;
  this.targetClass=targetClass;
  this.type=type;
  this.referField=referField;
  this.targetField=targetField;
}

Fixed version (ground truth):
private Link(Field field,Class<?> targetClass){
  this.ownField=field;
  this.targetClass=targetClass;
}
Program: 43715
Project: 43715
Buggy source:
public static void safeClose(ResultSet rs){
  if (null != rs)   try {
    if (!rs.isClosed())     rs.close();
  }
 catch (  Throwable e) {
  }
}

Fixed version (ground truth):
public static void safeClose(ResultSet rs){
  if (null != rs)   try {
    rs.close();
  }
 catch (  Throwable e) {
  }
}
Program: 43717
Project: 43717
Buggy source:
@Override protected void rollback(){
  StringBuilder es=new StringBuilder();
  for (  Pair p : list) {
    try {
      p.conn.rollback();
    }
 catch (    Throwable e) {
      es.append(e.getMessage()).append("String_Node_Str");
    }
 finally {
      try {
        p.conn.close();
      }
 catch (      SQLException e) {
        es.append(e.getMessage()).append("String_Node_Str");
      }
    }
  }
  if (es.length() > 0)   throw new RuntimeException(es.toString());
}

Fixed version (ground truth):
@Override protected void rollback(){
  for (  Pair p : list) {
    try {
      p.conn.rollback();
    }
 catch (    Throwable e) {
    }
  }
}
Program: 43718
Project: 43718
Buggy source:
@Override protected void commit() throws Exception {
  ComboException ce=new ComboException();
  for (  Pair p : list) {
    try {
      p.conn.commit();
      if (p.conn.getTransactionIsolation() != p.oldLevel)       p.conn.setTransactionIsolation(p.oldLevel);
    }
 catch (    SQLException e) {
      ce.add(e);
    }
 finally {
      p.conn.close();
    }
  }
  list.clear();
  if (null != ce.getCause()) {
    throw ce;
  }
}

Fixed version (ground truth):
@Override protected void commit(){
  ComboException ce=new ComboException();
  for (  Pair p : list) {
    try {
      p.conn.commit();
      if (p.conn.getTransactionIsolation() != p.oldLevel)       p.conn.setTransactionIsolation(p.oldLevel);
    }
 catch (    SQLException e) {
      ce.add(e);
    }
  }
  if (null != ce.getCause()) {
    throw ce;
  }
}
Program: 43719
Project: 43719
Buggy source:
@Override public void close() throws SQLException {
  for (  Pair p : list)   if (!p.conn.isClosed()) {
    try {
      if (p.conn.getTransactionIsolation() != p.oldLevel)       p.conn.setTransactionIsolation(p.oldLevel);
    }
 catch (    Exception e) {
    }
    p.conn.close();
  }
}

Fixed version (ground truth):
@Override public void close(){
  ComboException ce=new ComboException();
  for (  Pair p : list) {
    try {
      if (!p.conn.isClosed())       if (p.conn.getTransactionIsolation() != p.oldLevel)       p.conn.setTransactionIsolation(p.oldLevel);
    }
 catch (    Throwable e) {
    }
 finally {
      try {
        p.conn.close();
      }
 catch (      Exception e) {
        ce.add(e);
      }
    }
  }
  list.clear();
}
Program: 43720
Project: 43720
Buggy source:
private static void depose(){
  if (count.get() == 0)   try {
    trans.get().close();
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
 finally {
    trans.set(null);
  }
}

Fixed version (ground truth):
private static void depose(){
  if (count.get() == 0)   try {
    trans.get().close();
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
 finally {
    trans.set(null);
  }
}
Program: 43721
Project: 43721
Buggy source:
protected abstract void commit() throws Exception ;

Fixed version (ground truth):
protected abstract void commit();
Program: 43722
Project: 43722
Buggy source:
public abstract void close() throws SQLException ;

Fixed version (ground truth):
public abstract void close();
Program: 43723
Project: 43723
Buggy source:
public void setEntityMaker(EntityMaker entityMaker){
  this.entityMaker=entityMaker;
}

Fixed version (ground truth):
public void setEntityMaker(EntityMaker entityMaker){
  if (null == entityMaker) {
    log.error("String_Node_Str");
    return;
  }
  this.entityMaker=entityMaker;
  entities=new EntityHolder(this.entityMaker);
}
Program: 43724
Project: 43724
Buggy source:
/** 
 * 'databaseProductName' | 'driverName' <pre> psql:	'PostgreSQL'	|'PostgreSQL Native Driver' MySQL:	'MySQL'			|'MySQL-AB JDBC Driver' Oracle:	'Oracle'		|'Oracle JDBC driver' db2:		'DB2/NT'		|'IBM DB2 JDBC Universal Driver Architecture' SQLServer:	'Microsoft SQL Serve'	|'SQL Serve' </pre>
 */
public void setDataSource(DataSource dataSource){
  entities=new EntityHolder(null == entityMaker ? new DefaultEntityMaker() : entityMaker);
  this.dataSource=dataSource;
}

Fixed version (ground truth):
/** 
 * 'databaseProductName' | 'driverName' <pre> psql:	'PostgreSQL'	|'PostgreSQL Native Driver' MySQL:	'MySQL'			|'MySQL-AB JDBC Driver' Oracle:	'Oracle'		|'Oracle JDBC driver' db2:		'DB2/NT'		|'IBM DB2 JDBC Universal Driver Architecture' SQLServer:	'Microsoft SQL Serve'	|'SQL Serve' </pre>
 */
public void setDataSource(DataSource dataSource){
  if (null == entityMaker)   entities=new EntityHolder(new DefaultEntityMaker());
  this.dataSource=dataSource;
}
Program: 43725
Project: 43725
Buggy source:
public static void safeClose(ResultSet rs){
  if (null != rs)   try {
    rs.close();
  }
 catch (  Throwable e) {
  }
}

Fixed version (ground truth):
public static void safeClose(ResultSet rs){
  if (null != rs)   try {
    if (!rs.isClosed())     rs.close();
  }
 catch (  Throwable e) {
  }
}
Program: 43726
Project: 43726
Buggy source:
public void debug(Object message){
  debug(message,null);
}

Fixed version (ground truth):
public void debug(Object message){
  if (isDebugEnabled())   log(LEVEL_DEBUG,message,null);
}
Program: 43727
Project: 43727
Buggy source:
public void infof(String fmt,Object... args){
  info(String.format(fmt,args));
}

Fixed version (ground truth):
public void infof(String fmt,Object... args){
  if (isInfoEnabled())   log(LEVEL_INFO,String.format(fmt,args),null);
}
Program: 43728
Project: 43728
Buggy source:
public void tracef(String fmt,Object... args){
  trace(String.format(fmt,args));
}

Fixed version (ground truth):
public void tracef(String fmt,Object... args){
  if (isTraceEnabled())   log(LEVEL_TRACE,String.format(fmt,args),null);
}
Program: 43729
Project: 43729
Buggy source:
public void errorf(String fmt,Object... args){
  error(String.format(fmt,args));
}

Fixed version (ground truth):
public void errorf(String fmt,Object... args){
  if (isErrorEnabled())   log(LEVEL_ERROR,String.format(fmt,args),null);
}
Program: 43730
Project: 43730
Buggy source:
public void error(Object message){
  error(message,null);
}

Fixed version (ground truth):
public void error(Object message){
  if (isErrorEnabled())   log(LEVEL_ERROR,message,null);
}
Program: 43731
Project: 43731
Buggy source:
public void fatal(Object message){
  fatal(message,null);
}

Fixed version (ground truth):
public void fatal(Object message){
  if (isFatalEnabled())   log(LEVEL_FATAL,message,null);
}
Program: 43732
Project: 43732
Buggy source:
public void debugf(String fmt,Object... args){
  debug(String.format(fmt,args));
}

Fixed version (ground truth):
public void debugf(String fmt,Object... args){
  if (isDebugEnabled())   log(LEVEL_DEBUG,String.format(fmt,args),null);
}
Program: 43733
Project: 43733
Buggy source:
public void warn(Object message){
  warn(message,null);
}

Fixed version (ground truth):
public void warn(Object message){
  if (isWarnEnabled())   log(LEVEL_WARN,message,null);
}
Program: 43734
Project: 43734
Buggy source:
public void trace(Object message){
  trace(message,null);
}

Fixed version (ground truth):
public void trace(Object message){
  if (isTraceEnabled())   log(LEVEL_TRACE,message,null);
}
Program: 43735
Project: 43735
Buggy source:
public void fatalf(String fmt,Object... args){
  fatal(String.format(fmt,args));
}

Fixed version (ground truth):
public void fatalf(String fmt,Object... args){
  if (isFatalEnabled())   log(LEVEL_FATAL,String.format(fmt,args),null);
}
Program: 43736
Project: 43736
Buggy source:
public void warnf(String fmt,Object... args){
  warn(String.format(fmt,args));
}

Fixed version (ground truth):
public void warnf(String fmt,Object... args){
  if (isWarnEnabled())   log(LEVEL_WARN,String.format(fmt,args),null);
}
Program: 43737
Project: 43737
Buggy source:
public void info(Object message){
  info(message,null);
}

Fixed version (ground truth):
public void info(Object message){
  if (isInfoEnabled())   log(LEVEL_INFO,message,null);
}
Program: 43738
Project: 43738
Buggy source:
public void warn(Object message,Throwable t){
  if (isWarnEnabled())   log(WARN_LEVEL,message,t);
}

Fixed version (ground truth):
public void warn(Object message,Throwable t){
  if (isWarnEnabled())   log(LEVEL_WARN,message,t);
}
Program: 43739
Project: 43739
Buggy source:
public void trace(Object message,Throwable t){
  if (isTraceEnabled())   log(TRACE_LEVEL,message,t);
}

Fixed version (ground truth):
public void trace(Object message,Throwable t){
  if (isTraceEnabled())   log(LEVEL_TRACE,message,t);
}
Program: 43740
Project: 43740
Buggy source:
public void debug(Object message,Throwable t){
  if (isDebugEnabled())   log(DEBUG_LEVEL,message,t);
}

Fixed version (ground truth):
public void debug(Object message,Throwable t){
  if (isDebugEnabled())   log(LEVEL_DEBUG,message,t);
}
Program: 43741
Project: 43741
Buggy source:
public JdkLogger(String className){
  jdkLogger=Logger.getLogger(className);
  isFatalEnabled=jdkLogger.isLoggable(FATAL_LEVEL);
  isErrorEnabled=jdkLogger.isLoggable(ERROR_LEVEL);
  isWarnEnabled=jdkLogger.isLoggable(WARN_LEVEL);
  isInfoEnabled=jdkLogger.isLoggable(INFO_LEVEL);
  isDebugEnabled=jdkLogger.isLoggable(DEBUG_LEVEL);
  isTraceEnabled=jdkLogger.isLoggable(TRACE_LEVEL);
}

Fixed version (ground truth):
public JdkLogger(String className){
  jdkLogger=Logger.getLogger(className);
  isFatalEnabled=jdkLogger.isLoggable(Level.SEVERE);
  isErrorEnabled=jdkLogger.isLoggable(Level.SEVERE);
  isWarnEnabled=jdkLogger.isLoggable(Level.WARNING);
  isInfoEnabled=jdkLogger.isLoggable(Level.INFO);
  isDebugEnabled=jdkLogger.isLoggable(Level.FINE);
  isTraceEnabled=jdkLogger.isLoggable(Level.FINEST);
}
Program: 43742
Project: 43742
Buggy source:
public void log(Level level,Object message,Throwable t){
  Throwable dummyException=new Throwable();
  StackTraceElement locations[]=dummyException.getStackTrace();
  String cname="String_Node_Str";
  String method="String_Node_Str";
  if (locations != null && locations.length > 2) {
    StackTraceElement caller=locations[2];
    cname=caller.getClassName();
    method=caller.getMethodName();
  }
  if (t == null)   jdkLogger.logp(level,cname,method,String.valueOf(message));
 else   jdkLogger.logp(level,cname,method,String.valueOf(message),t);
}

Fixed version (ground truth):
protected void log(int level_int,Object message,Throwable t){
  Level level=null;
switch (level_int) {
case LEVEL_FATAL:
    level=Level.SEVERE;
  break;
case LEVEL_ERROR:
level=Level.SEVERE;
break;
case LEVEL_WARN:
level=Level.WARNING;
break;
case LEVEL_INFO:
level=Level.INFO;
break;
case LEVEL_DEBUG:
level=Level.FINE;
break;
case LEVEL_TRACE:
level=Level.FINEST;
break;
default :
return;
}
Throwable dummyException=new Throwable();
StackTraceElement locations[]=dummyException.getStackTrace();
String cname="String_Node_Str";
String method="String_Node_Str";
if (locations != null && locations.length > 1) {
StackTraceElement caller=locations[2];
cname=caller.getClassName();
method=caller.getMethodName();
}
if (t == null) jdkLogger.logp(level,cname,method,String.valueOf(message));
 else jdkLogger.logp(level,cname,method,String.valueOf(message),t);
}
Program: 43743
Project: 43743
Buggy source:
public void error(Object message,Throwable t){
  if (isErrorEnabled())   log(ERROR_LEVEL,message,t);
}

Fixed version (ground truth):
public void error(Object message,Throwable t){
  if (isErrorEnabled())   log(LEVEL_ERROR,message,t);
}
Program: 43744
Project: 43744
Buggy source:
public void fatal(Object message,Throwable t){
  if (isFatalEnabled())   log(FATAL_LEVEL,message,t);
}

Fixed version (ground truth):
public void fatal(Object message,Throwable t){
  if (isFatalEnabled())   log(LEVEL_FATAL,message,t);
}
Program: 43745
Project: 43745
Buggy source:
public void info(Object message,Throwable t){
  if (isInfoEnabled())   log(INFO_LEVEL,message,t);
}

Fixed version (ground truth):
public void info(Object message,Throwable t){
  if (isInfoEnabled())   log(LEVEL_INFO,message,t);
}
Program: 43746
Project: 43746
Buggy source:
public void debug(Object message,Throwable t){
  if (isDebugEnabled())   logMessage(Level.DEBUG,message,t);
}

Fixed version (ground truth):
public void debug(Object message,Throwable t){
  if (isDebugEnabled())   logger.log(SELF_FQCN,Level.DEBUG,message,t);
}
Program: 43747
Project: 43747
Buggy source:
Log4JLogger(String className){
  logger=LogManager.getLogger(className);
  loadLevel();
}

Fixed version (ground truth):
Log4JLogger(String className){
  logger=LogManager.getLogger(className);
  isFatalEnabled=logger.isEnabledFor(Level.FATAL);
  isErrorEnabled=logger.isEnabledFor(Level.ERROR);
  isWarnEnabled=logger.isEnabledFor(Level.WARN);
  isInfoEnabled=logger.isEnabledFor(Level.INFO);
  isDebugEnabled=logger.isEnabledFor(Level.DEBUG);
  if (hasTrace)   isTraceEnabled=logger.isEnabledFor(Level.TRACE);
}
Program: 43748
Project: 43748
Buggy source:
public void error(Object message,Throwable t){
  if (isErrorEnabled())   logMessage(Level.ERROR,message,t);
}

Fixed version (ground truth):
public void error(Object message,Throwable t){
  if (isErrorEnabled())   logger.log(SELF_FQCN,Level.ERROR,message,t);
}
Program: 43749
Project: 43749
Buggy source:
public void fatal(Object message,Throwable t){
  if (isFatalEnabled())   logMessage(Level.FATAL,message,t);
}

Fixed version (ground truth):
public void fatal(Object message,Throwable t){
  if (isFatalEnabled())   logger.log(SELF_FQCN,Level.FATAL,message,t);
}
Program: 43750
Project: 43750
Buggy source:
public void warn(Object message,Throwable t){
  if (isWarnEnabled())   logMessage(Level.WARN,message,t);
}

Fixed version (ground truth):
public void warn(Object message,Throwable t){
  if (isWarnEnabled())   logger.log(SELF_FQCN,Level.WARN,message,t);
}
Program: 43751
Project: 43751
Buggy source:
public void trace(Object message,Throwable t){
  if (isTraceEnabled())   logMessage(Level.TRACE,message,t);
 else   if (!hasTrace)   debug(message,t);
}

Fixed version (ground truth):
public void trace(Object message,Throwable t){
  if (isTraceEnabled())   logger.log(SELF_FQCN,Level.TRACE,message,t);
 else   if ((!hasTrace) && isDebugEnabled())   logger.log(SELF_FQCN,Level.DEBUG,message,t);
}
Program: 43752
Project: 43752
Buggy source:
public void info(Object message,Throwable t){
  if (isInfoEnabled())   logMessage(Level.INFO,message,t);
}

Fixed version (ground truth):
public void info(Object message,Throwable t){
  if (isInfoEnabled())   logger.log(SELF_FQCN,Level.INFO,message,t);
}
Program: 43753
Project: 43753
Buggy source:
/** 
 * 将两个文件对象比较，得出相对路径
 * @param base 基础文件对象
 * @param file 相对文件对象
 * @return 相对于基础文件对象的相对路径
 */
public static String getRelativePath(File base,File file){
  if (base.isFile())   base=base.getParentFile();
  String[] bb=Strings.splitIgnoreBlank(base.getAbsolutePath(),"String_Node_Str");
  String[] ff=Strings.splitIgnoreBlank(file.getAbsolutePath(),"String_Node_Str");
  int pos=0;
  for (; pos < Math.min(bb.length,ff.length); pos++)   if (!bb[pos].equals(ff[pos]))   break;
  String path=Strings.dup("String_Node_Str",bb.length - pos);
  path+=Lang.concat(pos,ff.length - pos,'/',ff);
  return path;
}

Fixed version (ground truth):
/** 
 * 将两个路径比较，得出相对路径
 * @param base 基础路径
 * @param path 相对文件路径
 * @return 相对于基础路径对象的相对路径
 */
public static String getRelativePath(String base,String path){
  String[] bb=Strings.splitIgnoreBlank(getCanonicalPath(base),"String_Node_Str");
  String[] ff=Strings.splitIgnoreBlank(getCanonicalPath(path),"String_Node_Str");
  int len=Math.min(bb.length,ff.length);
  int pos=0;
  for (; pos < len; pos++)   if (!bb[pos].equals(ff[pos]))   break;
  String re=Strings.dup("String_Node_Str",bb.length - pos);
  re+=Lang.concat(pos,ff.length - pos,'/',ff);
  return re;
}
Program: 43754
Project: 43754
Buggy source:
public static Record create(ResultSet rs){
  try {
    Record re=new Record();
    ResultSetMetaData meta=rs.getMetaData();
    int count=meta.getColumnCount();
    for (int i=1; i <= count; i++) {
      String name=meta.getColumnLabel(i);
      re.set(name.toLowerCase(),rs.getObject(i));
    }
    return re;
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public static Record create(ResultSet rs){
  try {
    Record re=new Record();
    ResultSetMetaData meta=rs.getMetaData();
    int count=meta.getColumnCount();
    for (int i=1; i <= count; i++) {
      String name=meta.getColumnLabel(i);
      if (meta.getColumnType(i) == Types.CLOB) {
        re.set(name.toLowerCase(),rs.getString(i));
      }
 else {
        re.set(name.toLowerCase(),rs.getObject(i));
      }
    }
    return re;
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43755
Project: 43755
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  for (Iterator<String> it=dest.keys().iterator(); it.hasNext(); ) {
    String key=it.next();
    Object value=null;
    if (null != mirror && key.startsWith("String_Node_Str") && key.length() > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=req.getParameter(key);
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str")) {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  for (Iterator<String> it=dest.keys().iterator(); it.hasNext(); ) {
    String key=it.next();
    Object value=null;
    if (null != mirror && key.startsWith("String_Node_Str") && key.length() > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && key.length() > 2) {
      value=req.getParameter(key.substring(2));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str")) {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}
Program: 43756
Project: 43756
Buggy source:
private int readTokenName(char[] cs,int i,StringBuilder sb){
  for (++i; i < cs.length; i++) {
    int b=(int)cs[i];
    if (b == 95 || b == 45 || b == 46 || (b >= 48 && b <= 57) || (b >= 65 && b <= 90) || (b >= 97 && b <= 122))     sb.append((char)b);
 else     break;
  }
  return i - 1;
}

Fixed version (ground truth):
private int readTokenName(char[] cs,int i,StringBuilder sb){
  for (++i; i < cs.length; i++) {
    int b=(int)cs[i];
    if (b == '_' || b == '-' || (b >= 48 && b <= 57) || (b >= 65 && b <= 90) || (b >= 97 && b <= 122))     sb.append((char)b);
 else     break;
  }
  return i - 1;
}
Program: 43757
Project: 43757
Buggy source:
public IocObject load(String name) throws ObjectLoadException {
  Map<String,Object> m=getMap(name);
  if (null == m)   throw new ObjectLoadException("String_Node_Str" + name + "String_Node_Str");
  Object p=m.get("String_Node_Str");
  if (null != p) {
    IocObject parent=load(p.toString());
    Map<String,Object> newMap=new HashMap<String,Object>();
    for (    Entry<String,Object> en : m.entrySet()) {
      if ("String_Node_Str".equals(en.getKey()))       continue;
      newMap.put(en.getKey(),en.getValue());
    }
    IocObject self=Iocs.map2iobj(newMap);
    return Iocs.mergeWith(self,parent);
  }
  return Iocs.map2iobj(m);
}

Fixed version (ground truth):
public IocObject load(String name) throws ObjectLoadException {
  Map<String,Object> m=getMap(name);
  if (null == m)   throw new ObjectLoadException("String_Node_Str" + name + "String_Node_Str");
  Object p=m.get("String_Node_Str");
  if (null != p) {
    checkParents(name);
    IocObject parent=load(p.toString());
    Map<String,Object> newMap=new HashMap<String,Object>();
    for (    Entry<String,Object> en : m.entrySet()) {
      if ("String_Node_Str".equals(en.getKey()))       continue;
      newMap.put(en.getKey(),en.getValue());
    }
    IocObject self=Iocs.map2iobj(newMap);
    return Iocs.mergeWith(self,parent);
  }
  return Iocs.map2iobj(m);
}
Program: 43758
Project: 43758
Buggy source:
<T>T parseFromJson(Class<T> type){
  try {
    nextChar();
    skipCommentsAndBlank();
    return parseFromCurrentLocation(type);
  }
 catch (  JsonException e) {
    throw e;
  }
catch (  Exception e) {
    throw makeError(e.getMessage());
  }
}

Fixed version (ground truth):
<T>T parseFromJson(Class<T> type,Class<?> componentType){
  try {
    nextChar();
    skipCommentsAndBlank();
    return parseFromCurrentLocation(type,componentType);
  }
 catch (  JsonException e) {
    throw e;
  }
catch (  Exception e) {
    throw makeError(e.getMessage());
  }
}
Program: 43760
Project: 43760
Buggy source:
/** 
 * 获取一个字段的泛型参数数组，如果这个字段没有泛型，返回空数组
 * @param f 字段
 * @return 泛型参数数组
 */
public static Class<?>[] getGenericTypes(Field f){
  String gts=f.toGenericString();
  Matcher m=PTN.matcher(gts);
  if (m.find()) {
    String s=m.group(2);
    String[] ss=Strings.splitIgnoreBlank(s);
    if (ss.length > 0) {
      Class<?>[] re=new Class<?>[ss.length];
      try {
        for (int i=0; i < ss.length; i++)         re[i]=Class.forName(ss[i]);
        return re;
      }
 catch (      ClassNotFoundException e) {
        throw Lang.wrapThrow(e);
      }
    }
  }
  return new Class<?>[0];
}

Fixed version (ground truth):
/** 
 * 获取一个字段的泛型参数数组，如果这个字段没有泛型，返回空数组
 * @param f 字段
 * @return 泛型参数数组
 */
public static Class<?>[] getGenericTypes(Field f){
  String gts=f.toGenericString();
  Matcher m=PTN.matcher(gts);
  if (m.find()) {
    String s=m.group(2);
    String[] ss=Strings.splitIgnoreBlank(s);
    if (ss.length > 0) {
      Class<?>[] re=new Class<?>[ss.length];
      try {
        for (int i=0; i < ss.length; i++) {
          String className=ss[i];
          if (className.startsWith("String_Node_Str"))           re[i]=Object.class;
 else {
            int pos=className.indexOf('<');
            if (pos < 0)             re[i]=Class.forName(className);
 else             re[i]=Class.forName(className.substring(0,pos));
          }
        }
        return re;
      }
 catch (      ClassNotFoundException e) {
        throw Lang.wrapThrow(e);
      }
    }
  }
  return new Class<?>[0];
}
Program: 43761
Project: 43761
Buggy source:
@Test public void test_getGenericTypes() throws Exception {
  Field f=Abcc.class.getDeclaredField("String_Node_Str");
  Class<?>[] types=Mirror.getGenericTypes(f);
  assertEquals(2,types.length);
  assertEquals(String.class,types[0]);
  assertEquals(Object.class,types[1]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(1,types.length);
  assertEquals(Abcc.class,types[0]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(0,types.length);
}

Fixed version (ground truth):
@Test public void test_getGenericTypes() throws Exception {
  Field f=Abcc.class.getDeclaredField("String_Node_Str");
  Class<?>[] types=Mirror.getGenericTypes(f);
  assertEquals(2,types.length);
  assertEquals(String.class,types[0]);
  assertEquals(Mirror.class,types[1]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(2,types.length);
  assertEquals(Object.class,types[0]);
  assertEquals(String.class,types[1]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(1,types.length);
  assertEquals(Abcc.class,types[0]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(1,types.length);
  assertEquals(Object.class,types[0]);
  f=Abcc.class.getDeclaredField("String_Node_Str");
  types=Mirror.getGenericTypes(f);
  assertEquals(0,types.length);
}
Program: 43762
Project: 43762
Buggy source:
@Override protected ParamInjector evalInjector(Class<?> type,Param param){
  if (null == param)   return new PathArgInjector(type);
  String pm=param.value();
  if ("String_Node_Str".equals(pm)) {
    return new ObjectPairInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new ObjectPairInjector(pm.substring(2),type);
  }
 else   if (type.isArray())   return new ArrayInjector(pm,type);
  return new NameInjector(pm,type);
}

Fixed version (ground truth):
@Override protected ParamInjector evalInjector(Class<?> type,Param param){
  if (null == param)   return new PathArgInjector(type);
  String pm=param.value();
  if ("String_Node_Str".equals(pm)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new ObjectPairInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new ObjectPairInjector(pm.substring(2),type);
  }
 else   if (type.isArray())   return new ArrayInjector(pm,type);
  return new NameInjector(pm,type);
}
Program: 43763
Project: 43763
Buggy source:
private boolean isPojoExistsColumnAnnField(Mirror<?> mirror){
  for (  Field f : mirror.getFields())   if (null != f.getAnnotation(Column.class))   return true;
  return false;
}

Fixed version (ground truth):
private boolean isPojoExistsColumnAnnField(Mirror<?> mirror){
  for (  Field f : mirror.getFields())   if (null != f.getAnnotation(Column.class))   return true;
 else   if (null != f.getAnnotation(Id.class))   return true;
 else   if (null != f.getAnnotation(Name.class))   return true;
  return false;
}
Program: 43765
Project: 43765
Buggy source:
/** 
 * 拷贝一个文件
 * @param src 原始文件
 * @param target 新文件
 * @return 是否拷贝成功
 * @throws IOException
 */
public static boolean copyFile(File src,File target) throws IOException {
  if (src == null || target == null)   return false;
  if (!src.exists())   return false;
  if (!target.exists())   if (!createNewFile(target))   return false;
  InputStream ins=new BufferedInputStream(new FileInputStream(src));
  OutputStream ops=new BufferedOutputStream(new FileOutputStream(target));
  int b;
  while (-1 != (b=ins.read()))   ops.write(b);
  ins.close();
  ops.close();
  target.setLastModified(src.lastModified());
  return true;
}

Fixed version (ground truth):
/** 
 * 拷贝一个文件
 * @param src 原始文件
 * @param target 新文件
 * @return 是否拷贝成功
 * @throws IOException
 */
public static boolean copyFile(File src,File target) throws IOException {
  if (src == null || target == null)   return false;
  if (!src.exists())   return false;
  if (!target.exists())   if (!createNewFile(target))   return false;
  InputStream ins=new BufferedInputStream(new FileInputStream(src));
  OutputStream ops=new BufferedOutputStream(new FileOutputStream(target));
  int b;
  while (-1 != (b=ins.read()))   ops.write(b);
  ins.close();
  ops.close();
  return target.setLastModified(src.lastModified());
}
Program: 43766
Project: 43766
Buggy source:
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        try {
          path=URLDecoder.decode(path,Charset.defaultCharset().name());
        }
 catch (        Exception e) {
        }
        file=new File(path);
      }
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null) {
        String path=url.getFile();
        path=decodePath(path);
        file=new File(path);
      }
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 43767
Project: 43767
Buggy source:
private static String[] findInJar(String jarPath,Class<?> baseClass){
  try {
    try {
      jarPath=URLDecoder.decode(jarPath,Charset.defaultCharset().name());
    }
 catch (    UnsupportedEncodingException e) {
    }
    ZipEntry[] entrys=Files.findEntryInZip(new ZipFile(jarPath),baseClass.getPackage().getName().replace('.','/') + "String_Node_Str");
    if (null != entrys && entrys.length > 0) {
      String[] classNames=new String[entrys.length];
      for (int i=0; i < entrys.length; i++) {
        String ph=entrys[i].getName();
        classNames[i]=ph.substring(0,ph.lastIndexOf('.')).replaceAll("String_Node_Str","String_Node_Str");
      }
      return classNames;
    }
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
private static String[] findInJar(String jarPath,Class<?> baseClass){
  try {
    jarPath=decodePath(jarPath);
    ZipEntry[] entrys=Files.findEntryInZip(new ZipFile(jarPath),baseClass.getPackage().getName().replace('.','/') + "String_Node_Str");
    if (null != entrys && entrys.length > 0) {
      String[] classNames=new String[entrys.length];
      for (int i=0; i < entrys.length; i++) {
        String ph=entrys[i].getName();
        classNames[i]=ph.substring(0,ph.lastIndexOf('.')).replaceAll("String_Node_Str","String_Node_Str");
      }
      return classNames;
    }
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 43769
Project: 43769
Buggy source:
public boolean canWork(NutPluginConfig config){
  try {
    LoggerFactory.getILoggerFactory();
    return true;
  }
 catch (  Throwable e) {
  }
  return false;
}

Fixed version (ground truth):
public boolean canWork(NutPluginConfig config){
  try {
    Class.forName("String_Node_Str");
    return true;
  }
 catch (  Throwable e) {
  }
  return false;
}
Program: 43770
Project: 43770
Buggy source:
private static void loadPlugin(String pluginClassName){
  try {
    Class<?> pluginClass=Class.forName(pluginClassName);
    NutPlugin nutPlugin=(NutPlugin)pluginClass.newInstance();
    if (nutPlugin.canWork(nutPluginConfig)) {
      nutPlugin.init(nutPluginConfig);
      Class<?> workForClass=nutPlugin.workFor();
      List<NutPlugin> list=plugins.get(workForClass);
      if (list == null) {
        list=new ArrayList<NutPlugin>();
        plugins.put(workForClass,list);
      }
      list.add(nutPlugin);
    }
  }
 catch (  Throwable e) {
    LogFactory.getLog(NutPluginManagement.class).warnf("String_Node_Str",pluginClassName);
  }
}

Fixed version (ground truth):
private static void loadPlugin(String pluginClassName){
  try {
    Class<?> pluginClass=Class.forName(pluginClassName);
    NutPlugin nutPlugin=(NutPlugin)pluginClass.newInstance();
    if (nutPlugin.canWork(nutPluginConfig)) {
      nutPlugin.init(nutPluginConfig);
      Class<?> workForClass=nutPlugin.workFor();
      List<NutPlugin> list=plugins.get(workForClass);
      if (list == null) {
        list=new ArrayList<NutPlugin>();
        plugins.put(workForClass,list);
      }
      list.add(nutPlugin);
    }
  }
 catch (  Throwable e) {
  }
}
Program: 43772
Project: 43772
Buggy source:
private Log4jAdapter(String className) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  if (false == isInited) {
    initLevelStuff();
    isInited=true;
  }
  log4jImpl=getLogger.invoke(null,className);
  isFatalEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelFatal);
  isErrorEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelError);
  isWarnEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelWarn);
  isInfoEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelInfo);
  isDebugEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelDebug);
  isTraceEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelTrace);
}

Fixed version (ground truth):
private Log4jAdapter(String className) throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  if (false == isInited) {
    initLevelStuff();
    isInited=true;
  }
  log4jImpl=getLogger.invoke(null,className);
  isFatalEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelFatal);
  isErrorEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelError);
  isWarnEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelWarn);
  isInfoEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelInfo);
  isDebugEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelDebug);
  isTraceEnabled=(Boolean)isEnabledFor.invoke(log4jImpl,levelTrace);
  System.out.println("String_Node_Str");
}
Program: 43773
Project: 43773
Buggy source:
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null)       file=new File(url.getFile());
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    if (file.isDirectory())     return file;
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * The function try to return the file path of one class or package. If it exists in regular directory, it will return as "D:/folder/folder/name.class" in windows, and "/folder/folder/name.class" in unix like system. <p> If the class file exists in one jar file, it will return the path like: <b>'XXXXXXXfile:\XXXXXX\XXX.jar!\XX\XX\XX'</b> <p> use ClassLoader.getResources(String) to search resources in classpath <p> <b style=color:red>Note:</b> <p> We use new <i>ClassLoader(){}</i> to instead of <i>classZ.getClassLoader()</i>, for the reason: in <b>GAE</b> , it will fail if you call getClassLoader() <br> <br>
 * @param base : the class file name or package dir name
 * @return path or null if nothing found
 * @author Wendal Chen
 * @author zozoh
 * @see java.lang.ClassLoader
 * @see java.io.File
 */
private static File getBasePath(String base){
  try {
    Enumeration<URL> urls=new ClassLoader(){
    }
.getResources(base);
    File file=null;
    if (null != urls && urls.hasMoreElements()) {
      URL url=urls.nextElement();
      if (url != null)       file=new File(url.getFile());
    }
    if (null == file)     file=Files.findFile(base);
    if (null == file)     return null;
    try {
      if (file.isDirectory())       return file;
    }
 catch (    SecurityException e) {
    }
    return file.getParentFile();
  }
 catch (  IOException e) {
  }
  return null;
}
Program: 43774
Project: 43774
Buggy source:
private void testAllMethodsThatReturnStringsActuallyReturnStrings(Object object) throws IllegalAccessException, InvocationTargetException {
  @SuppressWarnings("String_Node_Str") Set<Method> methodsThatReturnStrings=getAllMethods(object.getClass(),withModifier(Modifier.PUBLIC),withReturnType(String.class),withParametersCount(0));
  for (  Method method : methodsThatReturnStrings) {
    final Object returnValue=method.invoke(object);
    logger.info(String.format("String_Node_Str",object.getClass().getSimpleName().toLowerCase(),method.getName(),returnValue));
    if (isExcepted(object,method)) {
      continue;
    }
    assertThat(method + "String_Node_Str" + object,returnValue,is(notNullValue()));
    assertThat(method + "String_Node_Str" + object,(String)returnValue,not(isEmptyString()));
  }
}

Fixed version (ground truth):
private void testAllMethodsThatReturnStringsActuallyReturnStrings(Object object) throws IllegalAccessException, InvocationTargetException {
  @SuppressWarnings("String_Node_Str") Set<Method> methodsThatReturnStrings=getAllMethods(object.getClass(),withModifier(Modifier.PUBLIC),withReturnType(String.class),withParametersCount(0));
  for (  Method method : methodsThatReturnStrings) {
    if (isExcepted(object,method)) {
      continue;
    }
    final Object returnValue=method.invoke(object);
    logger.info(String.format("String_Node_Str",object.getClass().getSimpleName().toLowerCase(),method.getName(),returnValue));
    assertThat(method + "String_Node_Str" + object,returnValue,is(notNullValue()));
    assertThat(method + "String_Node_Str" + object,(String)returnValue,not(isEmptyString()));
  }
}
Program: 43775
Project: 43775
Buggy source:
public String url(){
  return join(new Object[]{"String_Node_Str","String_Node_Str",IDN.toASCII(domainName()),"String_Node_Str",domainSuffix()});
}

Fixed version (ground truth):
public String url(){
  return join(new Object[]{"String_Node_Str","String_Node_Str",FakerIDN.toASCII(domainName()),"String_Node_Str",domainSuffix()});
}
Program: 43776
Project: 43776
Buggy source:
public String url(){
  return join(new Object[]{"String_Node_Str","String_Node_Str",IDN.toASCII(faker.name().firstName().toLowerCase().replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str" + domainWord()),"String_Node_Str",domainSuffix()});
}

Fixed version (ground truth):
public String url(){
  return join(new Object[]{"String_Node_Str","String_Node_Str",FakerIDN.toASCII(faker.name().firstName().toLowerCase().replaceAll("String_Node_Str","String_Node_Str") + "String_Node_Str" + domainWord()),"String_Node_Str",domainSuffix()});
}
Program: 43777
Project: 43777
Buggy source:
public String cityName(){
  return city();
}

Fixed version (ground truth):
public String cityName(){
  return resolve("String_Node_Str");
}
Program: 43778
Project: 43778
Buggy source:
@Test public void testPastDate(){
  Date now=new Date();
  for (int i=0; i < 1000; i++) {
    Date future=faker.date().past(1,TimeUnit.SECONDS,now);
    assertThat("String_Node_Str",future.getTime(),lessThan(now.getTime()));
    assertThat("String_Node_Str",future.getTime(),greaterThan(now.getTime() - 1000));
  }
}

Fixed version (ground truth):
@Test public void testPastDate(){
  Date now=new Date();
  Date past=faker.date().past(100,TimeUnit.SECONDS);
  assertThat("String_Node_Str",past.getTime(),lessThan(now.getTime()));
}
Program: 43779
Project: 43779
Buggy source:
public String streetAddressNumber(){
  return fakeValuesService.fetchString("String_Node_Str");
}

Fixed version (ground truth):
public String streetAddressNumber(){
  return fakeValuesService.numerify(fakeValuesService.fetchString("String_Node_Str"));
}
Program: 43780
Project: 43780
Buggy source:
@Test public void testStreetAddressNumber(){
  String streetAddressNumber=faker.streetAddressNumber();
  logger.info("String_Node_Str" + streetAddressNumber);
  assertNotNull(streetAddressNumber);
  streetAddressNumber=faker.streetAddressNumber();
  logger.info("String_Node_Str" + streetAddressNumber);
  assertNotNull(streetAddressNumber);
}

Fixed version (ground truth):
@Test public void testStreetAddressNumber(){
  String streetAddressNumber=faker.streetAddressNumber();
  logger.info("String_Node_Str" + streetAddressNumber);
  assertNotNull(streetAddressNumber);
  assertTrue("String_Node_Str" + streetAddressNumber,streetAddressNumber.matches("String_Node_Str"));
  streetAddressNumber=faker.address().streetAddressNumber();
  logger.info("String_Node_Str" + streetAddressNumber);
  assertNotNull(streetAddressNumber);
  assertTrue("String_Node_Str" + streetAddressNumber,streetAddressNumber.matches("String_Node_Str"));
}
Program: 43781
Project: 43781
Buggy source:
public Faker(Locale locale){
  logger.info("String_Node_Str" + locale);
  String languageCode=locale.getLanguage();
  Map valuesMap=(Map)Yaml.load(ClassLoader.getSystemResourceAsStream(languageCode + "String_Node_Str"));
  valuesMap=(Map)valuesMap.get(languageCode);
  fakeValuesMap=(Map<String,Object>)valuesMap.get("String_Node_Str");
}

Fixed version (ground truth):
public Faker(Locale locale){
  logger.info("String_Node_Str" + locale);
  String languageCode=locale.getLanguage();
  Map valuesMap=(Map)Yaml.load(getClass().getClassLoader().getResourceAsStream(languageCode + "String_Node_Str"));
  valuesMap=(Map)valuesMap.get(languageCode);
  fakeValuesMap=(Map<String,Object>)valuesMap.get("String_Node_Str");
}
Program: 43782
Project: 43782
Buggy source:
/** 
 * <p> Returns the subscription billing support status, and checks it asynchronously if it is currently unknown. Observers will receive a  {@link IBillingObserver#onSubscriptionChecked(boolean)} notification ineither case. </p> <p> No support for subscriptions does not imply that in-app products are also unsupported. To check if in-app products are supported, use {@link BillingController#checkBillingSupported(Context)}. </p>
 * @param context
 * @return the current subscription billing status (unknown, supported orunsupported). If it is supported, in-app products are also supported.
 * @see IBillingObserver#onSubscriptionChecked(boolean)
 * @see BillingController#checkBillingSupported(Context)
 */
public static BillingStatus checkSubscriptionSupported(Context context){
  if (subscriptionStatus == BillingStatus.UNKNOWN) {
    BillingService.checkSubscriptionSupported(context);
  }
 else {
    boolean supported=billingStatus == BillingStatus.SUPPORTED;
    onSubscriptionChecked(supported);
  }
  return billingStatus;
}

Fixed version (ground truth):
/** 
 * <p> Returns the subscription billing support status, and checks it asynchronously if it is currently unknown. Observers will receive a  {@link IBillingObserver#onSubscriptionChecked(boolean)} notification ineither case. </p> <p> No support for subscriptions does not imply that in-app products are also unsupported. To check if in-app products are supported, use {@link BillingController#checkBillingSupported(Context)}. </p>
 * @param context
 * @return the current subscription billing status (unknown, supported orunsupported). If it is supported, in-app products are also supported.
 * @see IBillingObserver#onSubscriptionChecked(boolean)
 * @see BillingController#checkBillingSupported(Context)
 */
public static BillingStatus checkSubscriptionSupported(Context context){
  if (subscriptionStatus == BillingStatus.UNKNOWN) {
    BillingService.checkSubscriptionSupported(context);
  }
 else {
    boolean supported=subscriptionStatus == BillingStatus.SUPPORTED;
    onSubscriptionChecked(supported);
  }
  return subscriptionStatus;
}