nus-yam/ex-repair huggingface dataset:
Program: 80950
Project: 80950
Buggy source:
private void unpackagePrivateData(Type type){
  if (type.equals(Type.BOOLEAN_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.BYTE_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.CHAR_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.SHORT_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.INT_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.LONG_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.FLOAT_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.DOUBLE_TYPE)) {
    mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
}

Fixed version (ground truth):
private void unpackagePrivateData(Type type){
  if (type.equals(Type.BOOLEAN_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.BYTE_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.CHAR_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.SHORT_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.INT_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.LONG_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.FLOAT_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
 else   if (type.equals(Type.DOUBLE_TYPE)) {
    mv.visitMethodInsn(INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
  }
}
Program: 80951
Project: 80951
Buggy source:
private void load(Map<String,Map<String,Object>> map,File[] files){
  for (  File f : files) {
    if (f.isDirectory()) {
      loadFromDir(map,f);
    }
 else     if (f.isFile()) {
      map.putAll(buildMap(f));
    }
  }
}

Fixed version (ground truth):
private void load(Map<String,Map<String,Object>> map,File[] files){
  for (  File f : files) {
    if (f.isDirectory()) {
      loadFromDir(map,f);
    }
 else     if (f.isFile()) {
      Map<String,Map<String,Object>> fileMap=buildMap(f);
      if (null != fileMap && fileMap.size() > 0)       map.putAll(fileMap);
    }
  }
}
Program: 80952
Project: 80952
Buggy source:
protected NutIoc(ObjectMaker maker,IocLoader loader,IocContext context,String defaultScope){
  this.maker=maker;
  this.defaultScope=defaultScope;
  this.context=context;
  if (loader instanceof CachedIocLoader)   this.loader=loader;
 else   this.loader=CachedIocLoaderImpl.create(loader);
  vpms=new ArrayList<ValueProxyMaker>(5);
  addValueProxyMaker(new DefaultValueProxyMaker());
  mirrors=new DefaultMirrorFactory(this);
}

Fixed version (ground truth):
protected NutIoc(ObjectMaker maker,IocLoader loader,IocContext context,String defaultScope,MirrorFactory mirrors){
  this.maker=maker;
  this.defaultScope=defaultScope;
  this.context=context;
  if (loader instanceof CachedIocLoader)   this.loader=loader;
 else   this.loader=CachedIocLoaderImpl.create(loader);
  vpms=new ArrayList<ValueProxyMaker>(5);
  addValueProxyMaker(new DefaultValueProxyMaker());
  if (mirrors == null)   this.mirrors=new DefaultMirrorFactory(this);
 else   this.mirrors=mirrors;
}
Program: 80953
Project: 80953
Buggy source:
public NutFilePool(String homePath,int size){
  this.size=size;
  home=Files.findFile(homePath);
  if (null == home) {
    home=new File(homePath);
    try {
      Files.makeDir(home);
    }
 catch (    IOException e) {
      throw Lang.wrapThrow(e);
    }
  }
  if (!home.isDirectory())   throw Lang.makeThrow("String_Node_Str",homePath,this.getClass().getName());
  File last=home;
  String[] subs=null;
  while (last.isDirectory()) {
    subs=last.list(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.matches("String_Node_Str");
      }
    }
);
    if (null != subs && subs.length > 0) {
      last=new File(last.getAbsolutePath() + "String_Node_Str" + subs[subs.length - 1]);
      if (last.isFile()) {
        cursor=Pools.getFileId(home,last);
        break;
      }
    }
 else {
      break;
    }
  }
}

Fixed version (ground truth):
public NutFilePool(String homePath,int size){
  this.size=size;
  try {
    home=Files.createIfNoExists(homePath);
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
  if (null == home) {
    home=new File(homePath);
    Files.makeDir(home);
  }
  if (!home.isDirectory())   throw Lang.makeThrow("String_Node_Str",homePath,this.getClass().getName());
  File last=home;
  String[] subs=null;
  while (last.isDirectory()) {
    subs=last.list(new FilenameFilter(){
      public boolean accept(      File dir,      String name){
        return name.matches("String_Node_Str");
      }
    }
);
    if (null != subs && subs.length > 0) {
      last=new File(last.getAbsolutePath() + "String_Node_Str" + subs[subs.length - 1]);
      if (last.isFile()) {
        cursor=Pools.getFileId(home,last);
        break;
      }
    }
 else {
      break;
    }
  }
}
Program: 80954
Project: 80954
Buggy source:
/** 
 * 创建新目录，如果父目录不存在，也一并创建。可接受 null 参数
 * @param dir 目录对象
 * @return false，如果目录已存在。 true 创建成功
 * @throws IOException
 */
public static boolean makeDir(File dir) throws IOException {
  if (null == dir)   return false;
  if (dir.exists())   return false;
  return dir.mkdirs();
}

Fixed version (ground truth):
/** 
 * 创建新目录，如果父目录不存在，也一并创建。可接受 null 参数
 * @param dir 目录对象
 * @return false，如果目录已存在。 true 创建成功
 * @throws IOException
 */
public static boolean makeDir(File dir){
  if (null == dir)   return false;
  if (dir.exists())   return false;
  return dir.mkdirs();
}
Program: 80955
Project: 80955
Buggy source:
/** 
 * 从 CLASSPATH 下寻找一个文件
 * @param path 文件路径
 * @return 文件对象，如果不存在，则为 null
 */
public static File findFile(String path){
  return findFile(path,Files.class,Charset.defaultCharset().name());
}

Fixed version (ground truth):
/** 
 * 从 CLASSPATH 下寻找一个文件
 * @param path 文件路径
 * @return 文件对象，如果不存在，则为 null
 */
public static File findFile(String path){
  return findFile(path,Files.class.getClassLoader(),Charset.defaultCharset().name());
}
Program: 80956
Project: 80956
Buggy source:
/** 
 * 将文件改名
 * @param src 文件
 * @param newName 新名称
 * @return 改名是否成功
 */
public static boolean rename(File src,String newName){
  if (src == null || newName == null)   return false;
  if (src.exists()) {
    File newFile=new File(src.getParent() + "String_Node_Str" + newName);
    if (newFile.exists())     return false;
    try {
      Files.makeDir(newFile.getParentFile());
    }
 catch (    IOException e) {
      return false;
    }
    return src.renameTo(newFile);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * 将文件改名
 * @param src 文件
 * @param newName 新名称
 * @return 改名是否成功
 */
public static boolean rename(File src,String newName){
  if (src == null || newName == null)   return false;
  if (src.exists()) {
    File newFile=new File(src.getParent() + "String_Node_Str" + newName);
    if (newFile.exists())     return false;
    Files.makeDir(newFile.getParentFile());
    return src.renameTo(newFile);
  }
  return false;
}
Program: 80957
Project: 80957
Buggy source:
public Context(){
  this.map=new HashMap<String,Object>();
}

Fixed version (ground truth):
public Context(Map<String,Object> map){
  this.map=map;
}
Program: 80959
Project: 80959
Buggy source:
public DefaultLoading(ServletConfig config){
  this.config=config;
}

Fixed version (ground truth):
public DefaultLoading(ServletConfig config){
  this.config=config;
  context=new Context();
  saveRootPathToContext(config);
  if (log.isDebugEnabled()) {
    log.debugf("String_Node_Str",Json.toJson(context,JsonFormat.nice()));
  }
}
Program: 80960
Project: 80960
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: 80962
Project: 80962
Buggy source:
public Link(Mirror<?> mirror,Field field,ManyMany mm,boolean fromName,boolean toName){
  this.ownField=field;
  this.type=LinkType.ManyMany;
  this.mapKeyField="String_Node_Str".equals(mm.key()) ? null : mm.key();
  this.targetClass=mm.target();
  this.from=mm.from();
  this.to=mm.to();
  this.relation=Relation.make(mm.relation());
  this.referField=lookupKeyField(mirror,fromName);
  this.targetField=lookupKeyField(Mirror.me(targetClass),toName);
  if (null == this.referField || null == this.targetField) {
    throw Lang.makeThrow("String_Node_Str" + "String_Node_Str" + "String_Node_Str",mirror.getType().getName(),field.getName(),targetClass.getName(),referField,targetField);
  }
}

Fixed version (ground truth):
@Deprecated public Link(Mirror<?> mirror,Field field,ManyMany mm,boolean fromName,boolean toName){
  this.ownField=field;
  this.type=LinkType.ManyMany;
  this.mapKeyField="String_Node_Str".equals(mm.key()) ? null : mm.key();
  this.targetClass=mm.target();
  this.from=mm.from();
  this.to=mm.to();
  this.relation=Relation.make(mm.relation());
  this.referField=lookupKeyField(mirror,fromName);
  this.targetField=lookupKeyField(Mirror.me(targetClass),toName);
  if (null == this.referField || null == this.targetField) {
    throw Lang.makeThrow("String_Node_Str" + "String_Node_Str" + "String_Node_Str",mirror.getType().getName(),field.getName(),targetClass.getName(),referField,targetField);
  }
}
Program: 80963
Project: 80963
Buggy source:
private Link evalLink(DatabaseMeta db,Connection conn,Mirror<?> mirror,Field field){
  try {
    One one=field.getAnnotation(One.class);
    if (null != one) {
      return new Link(mirror,field,one);
    }
 else {
      Many many=field.getAnnotation(Many.class);
      if (null != many) {
        return new Link(mirror,field,many);
      }
 else {
        ManyMany mm=field.getAnnotation(ManyMany.class);
        if (null != mm) {
          Statement stat=null;
          ResultSet rs=null;
          ResultSetMetaData rsmd=null;
          boolean fromName=false;
          boolean toName=false;
          try {
            stat=conn.createStatement();
            Segment tableName=new CharSegment(mm.relation());
            rs=stat.executeQuery(db.getResultSetMetaSql(TableName.render(tableName)));
            rsmd=rs.getMetaData();
            fromName=!Daos.isIntLikeColumn(rsmd,mm.from());
            toName=!Daos.isIntLikeColumn(rsmd,mm.to());
          }
 catch (          Exception e) {
            if (log.isWarnEnabled())             log.warnf("String_Node_Str" + "String_Node_Str",mm.relation(),mm.from(),mm.to());
          }
 finally {
            Daos.safeClose(stat,rs);
          }
          return new Link(mirror,field,mm,fromName,toName);
        }
      }
    }
  }
 catch (  Exception e) {
    throw Lang.makeThrow("String_Node_Str",field.getName(),mirror.getType().getName(),e.getMessage());
  }
  return null;
}

Fixed version (ground truth):
private Link evalLink(DatabaseMeta db,Connection conn,Mirror<?> mirror,Field field){
  try {
    One one=field.getAnnotation(One.class);
    if (null != one) {
      return Link.getLinkForOne(mirror,field,one.target(),one.field());
    }
 else {
      Many many=field.getAnnotation(Many.class);
      if (null != many) {
        return Link.getLinkForMany(mirror,field,many.target(),many.field(),many.key());
      }
 else {
        ManyMany mm=field.getAnnotation(ManyMany.class);
        if (null != mm) {
          Statement stat=null;
          ResultSet rs=null;
          ResultSetMetaData rsmd=null;
          boolean fromName=false;
          boolean toName=false;
          try {
            stat=conn.createStatement();
            Segment tableName=new CharSegment(mm.relation());
            rs=stat.executeQuery(db.getResultSetMetaSql(TableName.render(tableName)));
            rsmd=rs.getMetaData();
            fromName=!Daos.isIntLikeColumn(rsmd,mm.from());
            toName=!Daos.isIntLikeColumn(rsmd,mm.to());
          }
 catch (          Exception e) {
            if (log.isWarnEnabled())             log.warnf("String_Node_Str" + "String_Node_Str",mm.relation(),mm.from(),mm.to());
          }
 finally {
            Daos.safeClose(stat,rs);
          }
          return Link.getLinkForManyMany(mirror,field,mm.target(),mm.key(),mm.from(),mm.to(),mm.relation(),fromName,toName);
        }
      }
    }
  }
 catch (  Exception e) {
    throw Lang.makeThrow("String_Node_Str",field.getName(),mirror.getType().getName(),e.getMessage());
  }
  return null;
}
Program: 80964
Project: 80964
Buggy source:
public Entity(){
  fields=new HashMap<String,EntityField>();
  links=new LinkedList<Link>();
  _ln_cache=new HashMap<String,List<Link>>();
}

Fixed version (ground truth):
public Entity(){
  super();
  fields=new HashMap<String,EntityField>();
  links=new LinkedList<Link>();
  _ln_cache=new HashMap<String,List<Link>>();
}
Program: 80965
Project: 80965
Buggy source:
public EntityField(Entity<?> entity,Field field){
  if (null != entity && null != field) {
    this.mirror=Mirror.me(field.getType());
    this.entity=entity;
    this.field=field;
    try {
      getter=entity.getMirror().getGetter(field);
      getter.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
    }
    try {
      setter=entity.getMirror().getSetter(field);
      setter.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
    }
  }
}

Fixed version (ground truth):
public EntityField(Entity<?> entity,Field field){
  super();
  if (null != entity && null != field) {
    this.mirror=Mirror.me(field.getType());
    this.entity=entity;
    this.field=field;
    try {
      getter=entity.getMirror().getGetter(field);
      getter.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
    }
    try {
      setter=entity.getMirror().getSetter(field);
      setter.setAccessible(true);
    }
 catch (    NoSuchMethodException e) {
    }
  }
}
Program: 80966
Project: 80966
Buggy source:
private void _insertSelf(Entity<?> entity,Object obj){
  if (null != entity.getBefores())   for (  FieldQuery nq : entity.getBefores())   nq.update(this,obj);
  Sql sql=sqlMaker.insert(entity,obj);
  execute(sql);
  if (null != entity.getAfters())   for (  FieldQuery nq : entity.getAfters())   nq.update(this,obj);
}

Fixed version (ground truth):
private void _insertSelf(Entity<?> entity,Object obj){
  runFieldQuery(entity.getBefores(),obj);
  execute(sqlMaker.insert(entity,obj));
  runFieldQuery(entity.getAfters(),obj);
}
Program: 80967
Project: 80967
Buggy source:
public <T>T fastInsert(T obj){
  if (Lang.length(obj) > 0) {
    Object first=Lang.first(obj);
    final Entity<?> entity=this.getEntity(first.getClass());
    Lang.each(obj,new Each<Object>(){
      public void invoke(      int i,      Object ele,      int length){
        execute(sqlMaker.insert(entity,ele));
      }
    }
);
  }
  return obj;
}

Fixed version (ground truth):
public <T>T fastInsert(T obj){
  if (Lang.length(obj) > 0) {
    Object first=Lang.first(obj);
    final Entity<?> entity=this.getEntity(first.getClass());
    Lang.each(obj,new Each<Object>(){
      public void invoke(      int i,      Object ele,      int length){
        runFieldQuery(entity.getBefores(),ele);
        execute(sqlMaker.insert(entity,ele));
      }
    }
);
  }
  return obj;
}
Program: 80968
Project: 80968
Buggy source:
/** 
 * 获取一个路径的绝对路径
 * @param path 路径
 * @param klassLoader 参考 ClassLoader
 * @param enc 路径编码方式
 * @return 绝对路径
 */
public static String absolute(String path,ClassLoader klassLoader,String enc){
  path=normalize(path,enc);
  if (null == path || path.length() == 0)   return null;
  File f=new File(path);
  if (!f.exists()) {
    URL url=klassLoader.getResource(path);
    if (null == url)     url=ClassLoader.getSystemResource(path);
    if (null != url) {
      return url.getPath();
    }
    return null;
  }
  return path;
}

Fixed version (ground truth):
/** 
 * 获取一个路径的绝对路径
 * @param path 路径
 * @param klassLoader 参考 ClassLoader
 * @param enc 路径编码方式
 * @return 绝对路径
 */
public static String absolute(String path,ClassLoader klassLoader,String enc){
  path=normalize(path,enc);
  if (null == path || path.length() == 0)   return null;
  File f=new File(path);
  if (!f.exists()) {
    URL url=klassLoader.getResource(path);
    if (null == url)     url=ClassLoader.getSystemResource(path);
    if (null != url)     return normalize(url.getPath(),enc);
    return null;
  }
  return path;
}
Program: 80969
Project: 80969
Buggy source:
public static Link getLinkForOne(Field field,Class<?> targetClass,Field referField,Field targetField) throws NoSuchFieldException {
  Link link=new Link(field,targetClass,LinkType.One,referField,targetField);
  return link;
}

Fixed version (ground truth):
/** 
 * 创建一条一对一的映射，将<b>本 POJO</b> 的一个字段通过本身的一个参考字段指向<b>目标POJO</b>的主键。 <p> <b style=color:red>这里需要注意的是：</b><br> 你的 <b>本 POJO</b>的参考字段类型要同<b>目标POJO</b>的主键要对应。即， <ul> <li><b>目标POJO</b>不可以是复合主键 <li>如果你的 <b>本 POJO</b>参考字段类型是整数，<b>目标POJO</b>的主键就必须是整数型主键。 <li>如果你的 <b>本 POJO</b>参考字段类型是字符串，<b>目标POJO</b>的主键就必须是字符型主键 </ul>
 * @param mirror <b>本 POJO</b>的类型
 * @param field 被映射的字段，它的类型应该是<b>目标POJO</b>的类型的接口或者超类
 * @param targetClass <b>目标POJO</b>的类型
 * @param referFld <b>本 POJO</b>的参考字段
 * @param targetPkFld <b>目标POJO</b>的主键
 * @return 映射对象
 */
public static Link getLinkForOne(Mirror<?> mirror,Field field,Class<?> targetClass,Field referFld,Field targetPkFld){
  Link link=new Link(field,targetClass);
  link.type=LinkType.One;
  link.referField=referFld;
  link.targetField=targetPkFld;
  return link;
}
Program: 80970
Project: 80970
Buggy source:
public static Link getLinkForMany(Field field,Class<?> targetClass,Field referField,Field targetField,String key) throws NoSuchFieldException {
  Link link=new Link(field,targetClass,LinkType.Many,referField,targetField);
  link.mapKeyField="String_Node_Str".equals(key) ? null : key;
  return link;
}

Fixed version (ground truth):
/** 
 * 创建一条一对多的映射，将<b>本 POJO</b> 的一个字段通过<b>目标POJO</b>一个参考字段指向本身的主键。 因此<b>本 POJO</b>的这个映射字段可以是一个集合或数组，因为可能有多个<b>目标POJO</b>指向自己 <p> <b style=color:red>这里需要注意的是：</b><br> 你的 <b>目标POJO</b>的参考字段类型要同<b>本POJO</b>的主键要对应。即， <ul> <li><b>本POJO</b>不可以是复合主键 <li>如果你的 <b>目标 POJO</b>参考字段类型是整数，<b>本POJO</b>的主键就必须是整数型主键。 <li>如果你的 <b>目标 POJO</b>参考字段类型是字符串，<b>本POJO</b>的主键就必须是字符型主键 <li>如果 referField 为 null，则将映射 <b>目标 POJO</b>的全部集合 -- 比较适用于枚举类型。 </ul>
 * @param mirror <b>本 POJO</b>的类型
 * @param field 被映射的字段，它的类型应该是<b>目标POJO</b>的类型的接口或者超类
 * @param targetClass <b>目标POJO</b>的类型
 * @param targetReferFld <b>本 POJO</b>主键
 * @param pkFld <b>目标POJO</b>的参考字段
 * @param key 如果被映射字段是个 Map， 你需要声明一下，<b>目标POJO</b>哪个字段是用来作为键值的。 默认的，赋值 null 即可
 * @return 映射对象
 */
public static Link getLinkForMany(Mirror<?> mirror,Field field,Class<?> targetClass,Field targetReferFld,Field pkFld,String key){
  Link link=new Link(field,targetClass);
  link.type=LinkType.Many;
  link.mapKeyField=Strings.isBlank(key) ? null : key;
  link.targetField=targetReferFld;
  link.referField=pkFld;
  return link;
}
Program: 80971
Project: 80971
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: 80972
Project: 80972
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: 80973
Project: 80973
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: 80974
Project: 80974
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: 80975
Project: 80975
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: 80976
Project: 80976
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: 80977
Project: 80977
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: 80978
Project: 80978
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: 80979
Project: 80979
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: 80980
Project: 80980
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: 80981
Project: 80981
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: 80982
Project: 80982
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: 80983
Project: 80983
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: 80984
Project: 80984
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: 80985
Project: 80985
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: 80986
Project: 80986
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: 80987
Project: 80987
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: 80988
Project: 80988
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: 80989
Project: 80989
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: 80990
Project: 80990
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: 80991
Project: 80991
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: 80992
Project: 80992
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: 80993
Project: 80993
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: 80994
Project: 80994
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: 80995
Project: 80995
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: 80996
Project: 80996
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: 80997
Project: 80997
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: 80998
Project: 80998
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: 80999
Project: 80999
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: 81000
Project: 81000
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: 81001
Project: 81001
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: 81002
Project: 81002
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: 81003
Project: 81003
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: 81004
Project: 81004
Buggy source:
protected abstract void commit() throws Exception ;

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

Fixed version (ground truth):
public abstract void close();
Program: 81006
Project: 81006
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: 81007
Project: 81007
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: 81008
Project: 81008
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: 81009
Project: 81009
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: 81010
Project: 81010
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: 81011
Project: 81011
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: 81012
Project: 81012
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: 81013
Project: 81013
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: 81014
Project: 81014
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: 81016
Project: 81016
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: 81017
Project: 81017
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: 81018
Project: 81018
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: 81019
Project: 81019
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;
}