nus-yam/ex-repair huggingface dataset:
Program: 80323
Project: 80323
Buggy source:
public void invoke(Connection conn) throws Exception {
  PreparedStatement ps=conn.prepareStatement(sql.toString());
  try {
    for (int i=0; i < values.size(); i++)     adaptors.get(i).set(ps,values.get(i),i + 1);
    ints[0]=ps.executeUpdate();
  }
  finally {
    Daos.safeClose(ps);
  }
}

Fixed version (ground truth):
public void invoke(Connection conn) throws Exception {
  PreparedStatement ps=conn.prepareStatement(sql.toString());
  try {
    for (int i=0; i < values.size(); i++)     adaptors.get(i).set(ps,values.get(i),i + 1);
    ps.execute();
  }
  finally {
    Daos.safeClose(ps);
  }
}
Program: 80324
Project: 80324
Buggy source:
public void init(Method method){
  this.method=method;
  Class<?>[] argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  Type[] types=method.getGenericParameterTypes();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    ReqHeader reqHeader=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
 else     if (anns[x] instanceof ReqHeader) {
      reqHeader=(ReqHeader)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    if (null != reqHeader) {
      injs[i]=new ReqHeaderInjector(reqHeader.value(),argTypes[i]);
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(types[i],param);
    if (null == injs[i]) {
      injs[i]=paramNameInject(method,i);
    }
  }
}

Fixed version (ground truth):
public void init(Method method){
  this.method=method;
  argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  Type[] types=method.getGenericParameterTypes();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    ReqHeader reqHeader=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
 else     if (anns[x] instanceof ReqHeader) {
      reqHeader=(ReqHeader)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    if (null != reqHeader) {
      injs[i]=new ReqHeaderInjector(reqHeader.value(),argTypes[i]);
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(types[i],param);
    if (null == injs[i]) {
      injs[i]=paramNameInject(method,i);
    }
  }
}
Program: 80326
Project: 80326
Buggy source:
/** 
 * 设置新的数据源。 <p> 如果有老的数据源需要你在外部手动关闭
 * @param ds 数据源
 */
public void setDataSource(DataSource ds){
  if (null != dataSource)   if (log.isWarnEnabled())   log.warn("String_Node_Str");
  dataSource=ds;
  expert=Jdbcs.getExpert(ds);
  pojoMaker=new NutPojoMaker(expert);
  meta=new DatabaseMeta();
  runner.run(dataSource,new ConnCallback(){
    public void invoke(    Connection conn) throws Exception {
      DatabaseMetaData dmd=conn.getMetaData();
      meta.setProductName(dmd.getDatabaseProductName());
      meta.setVersion(dmd.getDatabaseProductVersion());
      log.debug("String_Node_Str" + dmd.getDriverVersion());
      log.debug("String_Node_Str" + dmd.getDriverName());
    }
  }
);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + meta);
  holder=new EntityHolder(this);
  holder.maker=createEntityMaker();
}

Fixed version (ground truth):
/** 
 * 设置新的数据源。 <p> 如果有老的数据源需要你在外部手动关闭
 * @param ds 数据源
 */
public void setDataSource(DataSource ds){
  if (null != dataSource)   if (log.isWarnEnabled())   log.warn("String_Node_Str");
  dataSource=ds;
  expert=Jdbcs.getExpert(ds);
  pojoMaker=new NutPojoMaker(expert);
  meta=new DatabaseMeta();
  runner.run(dataSource,new ConnCallback(){
    public void invoke(    Connection conn) throws Exception {
      DatabaseMetaData dmd=conn.getMetaData();
      meta.setProductName(dmd.getDatabaseProductName());
      meta.setVersion(dmd.getDatabaseProductVersion());
      log.debug("String_Node_Str" + dmd.getDriverVersion());
      log.debug("String_Node_Str" + dmd.getDriverName());
      if (dmd.getDriverName().contains("String_Node_Str") || dmd.getDriverName().contains("String_Node_Str")) {
        log.warn("String_Node_Str");
        SqlContext.DEFAULT_FETCH_SIZE=Integer.MIN_VALUE;
      }
    }
  }
);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + meta);
  holder=new EntityHolder(this);
  holder.maker=createEntityMaker();
}
Program: 80328
Project: 80328
Buggy source:
JdbcExpertConfigFile init(){
  String home=config.get("String_Node_Str").toString();
  try {
    home=Disks.normalize(home);
    if (home == null)     home=config.get("String_Node_Str").toString();
    long max=((Number)config.get("String_Node_Str")).longValue();
    pool=new NutFilePool(home,max);
    pool=new SynchronizedFilePool(pool);
  }
 catch (  Throwable e) {
    if (log.isWarnEnabled())     log.warnf("String_Node_Str" + home,e);
  }
  return this;
}

Fixed version (ground truth):
JdbcExpertConfigFile init(){
  String home=config.get("String_Node_Str").toString();
  try {
    home=Disks.normalize(home);
    if (home == null)     home=config.get("String_Node_Str").toString();
    long max=config.containsKey("String_Node_Str") ? ((Number)config.get("String_Node_Str")).longValue() : 2000;
    pool=new NutFilePool(home,max);
    pool=new SynchronizedFilePool(pool);
  }
 catch (  Throwable e) {
    if (log.isWarnEnabled())     log.warnf("String_Node_Str" + home,e);
  }
  return this;
}
Program: 80329
Project: 80329
Buggy source:
@Override protected String evalFieldType(MappingField mf){
  if (mf.getCustomDbType() != null)   return mf.getCustomDbType();
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0)     return "String_Node_Str";
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
  if (mf.getColumnType() == ColType.BINARY) {
    return "String_Node_Str";
  }
  return super.evalFieldType(mf);
}

Fixed version (ground truth):
@Override protected String evalFieldType(MappingField mf){
  if (mf.getCustomDbType() != null)   return mf.getCustomDbType();
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0) {
      return "String_Node_Str";
    }
 else     if (width <= 2) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
  if (mf.getColumnType() == ColType.BINARY) {
    return "String_Node_Str";
  }
  return super.evalFieldType(mf);
}
Program: 80330
Project: 80330
Buggy source:
public Object getValue(Object obj){
  if (ejecting == null)   return null;
  Object val=ejecting.eject(obj);
  if (val == null)   return null;
  if (USE_IGNORE_NUMBER) {
    if (isInt && ((Number)val).intValue() == ignoreNullInt)     return null;
    if (isDouble && ((Number)val).doubleValue() == ignoreNullDouble)     return null;
  }
  return val;
}

Fixed version (ground truth):
public Object getValue(Object obj){
  if (ejecting == null)   return null;
  Object val=ejecting.eject(obj);
  if (val == null)   return null;
  if (hasJsonIgnore) {
    if (isInt && ((Number)val).intValue() == ignoreNullInt)     return null;
    if (isDouble && ((Number)val).doubleValue() == ignoreNullDouble)     return null;
  }
  return val;
}
Program: 80331
Project: 80331
Buggy source:
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  if (fld == null) {
    return null;
  }
  if (fld.getName().startsWith("String_Node_Str") && fld.getAnnotation(JsonField.class) == null)   return null;
  JsonField jf=fld.getAnnotation(JsonField.class);
  JsonEntityField jef=new JsonEntityField();
  jef.genericType=Lang.getFieldType(mirror,fld);
  jef.name=Strings.sBlank(null == jf ? null : jf.value(),fld.getName());
  jef.ejecting=mirror.getEjecting(fld.getName());
  jef.injecting=mirror.getInjecting(fld.getName());
  if (Modifier.isTransient(fld.getModifiers()) || (null != jf && jf.ignore())) {
    jef.setIgnore(true);
  }
  Mirror<?> fldMirror=Mirror.me(fld.getType());
  jef.isInt=fldMirror.isInt();
  jef.isDouble=fldMirror.isDouble() || fldMirror.isFloat();
  if (null != jf) {
    jef.setForceString(jf.forceString());
    if (jef.isDouble)     jef.ignoreNullDouble=jf.null_double();
    if (jef.isInt)     jef.ignoreNullInt=jf.null_int();
  }
  return jef;
}

Fixed version (ground truth):
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  if (fld == null) {
    return null;
  }
  if (fld.getName().startsWith("String_Node_Str") && fld.getAnnotation(JsonField.class) == null)   return null;
  JsonField jf=fld.getAnnotation(JsonField.class);
  JsonEntityField jef=new JsonEntityField();
  jef.genericType=Lang.getFieldType(mirror,fld);
  jef.name=Strings.sBlank(null == jf ? null : jf.value(),fld.getName());
  jef.ejecting=mirror.getEjecting(fld.getName());
  jef.injecting=mirror.getInjecting(fld.getName());
  if (Modifier.isTransient(fld.getModifiers()) || (null != jf && jf.ignore())) {
    jef.setIgnore(true);
  }
  if (null != jf) {
    jef.setForceString(jf.forceString());
  }
  JsonIgnore jsonIgnore=fld.getAnnotation(JsonIgnore.class);
  if (jsonIgnore != null) {
    Mirror<?> fldMirror=Mirror.me(fld.getType());
    jef.isInt=fldMirror.isInt();
    jef.isDouble=fldMirror.isDouble() || fldMirror.isFloat();
    jef.hasJsonIgnore=true;
    if (jef.isDouble)     jef.ignoreNullDouble=jsonIgnore.null_double();
    if (jef.isInt)     jef.ignoreNullInt=jsonIgnore.null_int();
  }
  return jef;
}
Program: 80332
Project: 80332
Buggy source:
@Test public void test_ignore_numbers(){
  JsonEntityField.setUseIgnoreNumber(true);
  assertEquals("String_Node_Str",Json.toJson(new JQ(100,-255,-1),JsonFormat.compact().setQuoteName(false)));
  assertEquals("String_Node_Str",Json.toJson(new JQ(150,15.0,-1),JsonFormat.compact().setQuoteName(false)));
  assertEquals("String_Node_Str",Json.toJson(new JQ(150,-255,100.5f),JsonFormat.compact().setQuoteName(false)));
}

Fixed version (ground truth):
@Test public void test_ignore_numbers(){
  assertEquals("String_Node_Str",Json.toJson(new JQ(100,-255,-1),JsonFormat.compact().setQuoteName(false)));
  assertEquals("String_Node_Str",Json.toJson(new JQ(150,15.0,-1),JsonFormat.compact().setQuoteName(false)));
  assertEquals("String_Node_Str",Json.toJson(new JQ(150,-255,100.5f),JsonFormat.compact().setQuoteName(false)));
}
Program: 80333
Project: 80333
Buggy source:
/** 
 * 当本对象被GC的时候,打印之.<p/> 因为NutDao是线程安全的,用户反复创建NutDao的话,下面的方法将有提示作用
 */
protected void finalize() throws Throwable {
  log.debugf("String_Node_Str",getClass().getSimpleName(),_selfId);
  super.finalize();
}

Fixed version (ground truth):
/** 
 * 当本对象被GC的时候,打印之. <p/> 因为NutDao是线程安全的,用户反复创建NutDao的话,下面的方法将有提示作用
 */
protected void finalize() throws Throwable {
  log.debugf("String_Node_Str",getClass().getSimpleName(),_selfId);
  super.finalize();
}
Program: 80334
Project: 80334
Buggy source:
/** 
 * 较方便的创建一个没有重复的数组，比如： <pre> Pet[] pets = Lang.array("A","B","A");  => ["A","B"] Pet[] pets = Lang.array();  => null </pre> 返回的顺序会遵循输入的顺序
 * @param eles 可变参数
 * @return 数组对象
 */
@SuppressWarnings("String_Node_Str") public static <T>T[] arrayUniq(T... eles){
  if (null == eles || eles.length == 0)   return null;
  HashSet<T> set=new HashSet<T>(eles.length);
  T[] arr=(T[])Array.newInstance(eles[0].getClass(),set.size());
  int index=0;
  for (int i=0; i < eles.length; i++) {
    if (set.contains(eles[i])) {
      set.remove(eles[i]);
      arr[index++]=eles[i];
    }
  }
  return arr;
}

Fixed version (ground truth):
/** 
 * 较方便的创建一个没有重复的数组，比如： <pre> Pet[] pets = Lang.arrayUniq("A","B","A");  => ["A","B"] Pet[] pets = Lang.arrayUniq();  => null </pre> 返回的顺序会遵循输入的顺序
 * @param eles 可变参数
 * @return 数组对象
 */
@SuppressWarnings("String_Node_Str") public static <T>T[] arrayUniq(T... eles){
  if (null == eles || eles.length == 0)   return null;
  HashSet<T> set=new HashSet<T>(eles.length);
  for (  T ele : eles) {
    set.add(ele);
  }
  T[] arr=(T[])Array.newInstance(eles[0].getClass(),set.size());
  int index=0;
  for (  T ele : eles) {
    if (set.remove(ele))     Array.set(arr,index++,ele);
  }
  return arr;
}
Program: 80335
Project: 80335
Buggy source:
@SuppressWarnings("String_Node_Str") public List<Object> getList(String name){
  return getAs(List.class,name);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>List<T> getList(Class<T> classOfT,String name){
  return (List<T>)getList(name);
}
Program: 80336
Project: 80336
Buggy source:
List<Object> getList(String name);

Fixed version (ground truth):
<T>List<T> getList(Class<T> classOfT,String name);
Program: 80337
Project: 80337
Buggy source:
@Test public void testEncode(){
  Response response1=Http.get("String_Node_Str");
  assertEquals("String_Node_Str",response1.getEncodeType());
  assertTrue(response1.getContent().indexOf("String_Node_Str") > 0);
  Response response2=Http.get("String_Node_Str");
  assertTrue(response2.getContent("String_Node_Str").indexOf("String_Node_Str") > 0);
}

Fixed version (ground truth):
@Test public void testEncode(){
  Response response1=Http.get("String_Node_Str");
  assertEquals("String_Node_Str",response1.getEncodeType().toLowerCase());
  assertTrue(response1.getContent().indexOf("String_Node_Str") > 0);
  Response response2=Http.get("String_Node_Str");
  assertTrue(response2.getContent("String_Node_Str").indexOf("String_Node_Str") > 0);
}
Program: 80338
Project: 80338
Buggy source:
public int getMinorVersion(){
  throw Lang.noImplement();
}

Fixed version (ground truth):
public int getMinorVersion(){
  return 0;
}
Program: 80339
Project: 80339
Buggy source:
public int getMajorVersion(){
  throw Lang.noImplement();
}

Fixed version (ground truth):
public int getMajorVersion(){
  return 1;
}
Program: 80341
Project: 80341
Buggy source:
public Object getValue(Object obj){
  if (ejecting == null)   return null;
  return ejecting.eject(obj);
}

Fixed version (ground truth):
public Object getValue(Object obj){
  if (ejecting == null)   return null;
  Object val=ejecting.eject(obj);
  if (val == null)   return null;
  if (USE_IGNORE_NUMBER) {
    if (isInt && ((Number)val).intValue() == ignoreNullInt)     return null;
    if (isDouble && ((Number)val).doubleValue() == ignoreNullDouble)     return null;
  }
  return val;
}
Program: 80342
Project: 80342
Buggy source:
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  if (fld == null) {
    return null;
  }
  if (fld.getName().startsWith("String_Node_Str") && fld.getAnnotation(JsonField.class) == null)   return null;
  JsonField jf=fld.getAnnotation(JsonField.class);
  JsonEntityField jef=new JsonEntityField();
  jef.genericType=Lang.getFieldType(mirror,fld);
  jef.name=Strings.sBlank(null == jf ? null : jf.value(),fld.getName());
  jef.ejecting=mirror.getEjecting(fld.getName());
  jef.injecting=mirror.getInjecting(fld.getName());
  if (Modifier.isTransient(fld.getModifiers()) || (null != jf && jf.ignore())) {
    jef.setIgnore(true);
  }
  if (null != jf)   jef.setForceString(jf.forceString());
  return jef;
}

Fixed version (ground truth):
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  if (fld == null) {
    return null;
  }
  if (fld.getName().startsWith("String_Node_Str") && fld.getAnnotation(JsonField.class) == null)   return null;
  JsonField jf=fld.getAnnotation(JsonField.class);
  JsonEntityField jef=new JsonEntityField();
  jef.genericType=Lang.getFieldType(mirror,fld);
  jef.name=Strings.sBlank(null == jf ? null : jf.value(),fld.getName());
  jef.ejecting=mirror.getEjecting(fld.getName());
  jef.injecting=mirror.getInjecting(fld.getName());
  if (Modifier.isTransient(fld.getModifiers()) || (null != jf && jf.ignore())) {
    jef.setIgnore(true);
  }
  Mirror<?> fldMirror=Mirror.me(fld.getType());
  jef.isInt=fldMirror.isInt();
  jef.isDouble=fldMirror.isDouble() || fldMirror.isFloat();
  if (null != jf) {
    jef.setForceString(jf.forceString());
    if (jef.isDouble)     jef.ignoreNullDouble=jf.null_double();
    if (jef.isInt)     jef.ignoreNullInt=jf.null_int();
  }
  return jef;
}
Program: 80343
Project: 80343
Buggy source:
/** 
 * 获取一个 Json 实体
 */
public static JsonEntity getEntity(Mirror<?> mirror){
  JsonEntity je=entities.get(mirror.getTypeId());
  if (null == je) {
    je=new JsonEntity(mirror);
    entities.put(mirror.getTypeId(),je);
  }
  return je;
}

Fixed version (ground truth):
/** 
 * 获取一个 Json 实体
 */
public static JsonEntity getEntity(Mirror<?> mirror){
  JsonEntity je=entities.get(mirror.getType());
  if (null == je) {
    je=new JsonEntity(mirror);
    entities.put(mirror.getType(),je);
  }
  return je;
}
Program: 80344
Project: 80344
Buggy source:
/** 
 * 获取一个 Json 实体
 */
public static JsonEntity getEntity(Mirror<?> mirror){
  JsonEntity je=entities.get(mirror.getType());
  if (null == je) {
    je=new JsonEntity(mirror);
    entities.put(mirror.getType(),je);
  }
  return je;
}

Fixed version (ground truth):
/** 
 * 获取一个 Json 实体
 */
public static JsonEntity getEntity(Mirror<?> mirror){
  JsonEntity je=entities.get(mirror.getTypeId());
  if (null == je) {
    je=new JsonEntity(mirror);
    entities.put(mirror.getTypeId(),je);
  }
  return je;
}
Program: 80345
Project: 80345
Buggy source:
/** 
 * @return 本类型的唯一标识名称
 */
public String getTypeId(){
  if (null == _type_id) {
    if (null != type && type instanceof ParameterizedType) {
      ParameterizedType pmType=(ParameterizedType)type;
      List<Type> list=new ArrayList<Type>(pmType.getActualTypeArguments().length);
      for (      Type pmA : pmType.getActualTypeArguments()) {
        list.add(pmA);
      }
      _type_id=String.format("String_Node_Str",klass.getName(),Lang.concat("String_Node_Str",list));
    }
 else {
      _type_id=klass.getName();
    }
  }
  return _type_id;
}

Fixed version (ground truth):
/** 
 * @return 本类型的唯一标识名称
 */
public String getTypeId(){
  if (null == _type_id) {
    if (null != type && type instanceof ParameterizedType) {
      ParameterizedType pmType=(ParameterizedType)type;
      List<Type> list=new ArrayList<Type>(pmType.getActualTypeArguments().length);
      for (      Type pmA : pmType.getActualTypeArguments()) {
        list.add(pmA);
      }
      _type_id=String.format("String_Node_Str",klass.getName(),Lang.concat("String_Node_Str",list));
    }
 else {
      _type_id=klass.getName();
    }
    _type_id+="String_Node_Str" + klass.getClassLoader();
  }
  return _type_id;
}
Program: 80346
Project: 80346
Buggy source:
protected String _fmtcolnm(Entity<?> en,String name){
  if (null == en && null != pojo)   en=pojo.getEntity();
  if (null != en) {
    MappingField mf=en.getField(name);
    if (null != mf)     return mf.getColumnName();
  }
  return name;
}

Fixed version (ground truth):
protected String _fmtcolnm(Entity<?> en,String name){
  if (null == en && null != pojo)   en=pojo.getEntity();
  if (null != en) {
    MappingField mf=en.getField(name);
    if (null != mf)     return mf.getColumnName();
  }
  return name.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 80347
Project: 80347
Buggy source:
/** 
 * 这是最后的大招了,查一下形参的名字,作为@Param("形参名")进行处理
 */
protected ParamInjector paramNameInject(Method method,int index){
  List<String> names=MethodParamNamesScaner.getParamNames(method);
  if (names != null)   return new NameInjector(names.get(index),method.getParameterTypes()[index],null);
 else   if (log.isInfoEnabled())   log.infof("String_Node_Str",index,method);
  return new PathArgInjector(method.getParameterTypes()[index]);
}

Fixed version (ground truth):
/** 
 * 这是最后的大招了,查一下形参的名字,作为@Param("形参名")进行处理
 */
protected ParamInjector paramNameInject(Method method,int index){
  List<String> names=MethodParamNamesScaner.getParamNames(method);
  if (names != null)   return new NameInjector(names.get(index),null,method.getParameterTypes()[index],null);
 else   if (log.isInfoEnabled())   log.infof("String_Node_Str",index,method);
  return new PathArgInjector(method.getParameterTypes()[index]);
}
Program: 80348
Project: 80348
Buggy source:
protected ParamInjector evalInjectorBy(Type type,Param param){
  Class<?> clazz=Lang.getTypeClass(type);
  if (clazz == null) {
    if (log.isWarnEnabled())     log.warnf("String_Node_Str",type,param);
    return null;
  }
  Type[] paramTypes=null;
  if (type instanceof ParameterizedType)   paramTypes=((ParameterizedType)type).getActualTypeArguments();
  if (null == param)   return null;
  String pm=param.value();
  if ("String_Node_Str".equals(pm)) {
    if (clazz.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new ObjectPairInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new ObjectNavlPairInjector(pm.substring(2),type);
  }
 else   if (clazz.isArray())   return new ArrayInjector(pm,clazz,paramTypes);
  return new NameInjector(pm,clazz,paramTypes);
}

Fixed version (ground truth):
protected ParamInjector evalInjectorBy(Type type,Param param){
  Class<?> clazz=Lang.getTypeClass(type);
  if (clazz == null) {
    if (log.isWarnEnabled())     log.warnf("String_Node_Str",type,param);
    return null;
  }
  Type[] paramTypes=null;
  if (type instanceof ParameterizedType)   paramTypes=((ParameterizedType)type).getActualTypeArguments();
  if (null == param)   return null;
  String pm=param.value();
  String datefmt=param.dfmt();
  if ("String_Node_Str".equals(pm)) {
    if (clazz.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new ObjectPairInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new ObjectNavlPairInjector(pm.substring(2),type);
  }
 else   if (clazz.isArray())   return new ArrayInjector(pm,clazz,paramTypes);
  return new NameInjector(pm,datefmt,clazz,paramTypes);
}
Program: 80349
Project: 80349
Buggy source:
/** 
 * 构造参数转换器
 */
public static ParamConvertor makeParamConvertor(Class<?> type){
  if (type.isArray())   return new ArrayParamConvertor(type.getComponentType());
  Mirror<?> mirror=Mirror.me(type);
  if (mirror.isDateTimeLike()) {
    return new DateParamConvertor(type);
  }
  return new StringParamConvertor();
}

Fixed version (ground truth):
/** 
 * 构造参数转换器
 * @param type 要转换的目标类型
 * @param datefmt 如果目标类型是 DateTime 类似的类型，可以声明一个特殊转换格式，<br> 如果为 null 表示用 Times.D 函数自动猜测
 */
public static ParamConvertor makeParamConvertor(Class<?> type,String datefmt){
  if (type.isArray())   return new ArrayParamConvertor(type.getComponentType());
  Mirror<?> mirror=Mirror.me(type);
  if (mirror.isDateTimeLike()) {
    return new DateParamConvertor(type,datefmt);
  }
  return new StringParamConvertor();
}
Program: 80350
Project: 80350
Buggy source:
public ArrayParamConvertor(Class<?> eleType){
  this.eleType=eleType;
  this.convertor=Params.makeParamConvertor(eleType);
}

Fixed version (ground truth):
public ArrayParamConvertor(Class<?> eleType){
  this.eleType=eleType;
  this.convertor=Params.makeParamConvertor(eleType,null);
}
Program: 80351
Project: 80351
Buggy source:
public DateParamConvertor(Class<?> type){
  this.type=type;
}

Fixed version (ground truth):
public DateParamConvertor(Class<?> type,String datefmt){
  this.type=type;
  if (Strings.isBlank(datefmt)) {
    dfmt=null;
  }
 else {
    dfmt=new SimpleDateFormat(datefmt);
  }
}
Program: 80352
Project: 80352
Buggy source:
public Object convert(String[] ss){
  if (null == ss || ss.length == 0)   return null;
  if (Strings.isBlank(ss[0]))   return null;
  return Castors.me().cast(ss[0],String.class,type);
}

Fixed version (ground truth):
public Object convert(String[] ss){
  if (null == ss || ss.length == 0)   return null;
  if (Strings.isBlank(ss[0]))   return null;
  if (null != dfmt) {
    Date o=Times.parseq(dfmt,ss[0]);
    return Castors.me().castTo(o,type);
  }
  return Castors.me().cast(ss[0],String.class,type);
}
Program: 80353
Project: 80353
Buggy source:
public ArrayInjector(String name,Class<?> type,Type[] paramTypes){
  super(name,type,paramTypes);
}

Fixed version (ground truth):
public ArrayInjector(String name,Class<?> type,Type[] paramTypes){
  super(name,null,type,paramTypes);
}
Program: 80354
Project: 80354
Buggy source:
public Object fromReqParam(HttpServletRequest req){
  String[] params=req.getParameterValues(name);
  return Castors.me().castTo(params,type);
}

Fixed version (ground truth):
public Object fromReqParam(HttpServletRequest req){
  String[] params=req.getParameterValues(name);
  if (null != dfmt && params != null && params.length > 0) {
    Object o=Times.parseq(dfmt,params[0]);
    return Castors.me().castTo(o,type);
  }
  return Castors.me().castTo(params,type);
}
Program: 80355
Project: 80355
Buggy source:
public NameInjector(String name,Class<?> type,Type[] paramTypes){
  if (null == name)   throw Lang.makeThrow("String_Node_Str",type.getName());
  this.name=name;
  this.type=type;
  this.paramTypes=paramTypes;
}

Fixed version (ground truth):
public NameInjector(String name,String datefmt,Class<?> type,Type[] paramTypes){
  if (null == name)   throw Lang.makeThrow("String_Node_Str",type.getName());
  this.name=name;
  if (Strings.isBlank(datefmt) || !Mirror.me(type).isDateTimeLike()) {
    dfmt=null;
  }
 else {
    dfmt=new SimpleDateFormat(datefmt);
  }
  this.type=type;
  this.paramTypes=paramTypes;
}
Program: 80356
Project: 80356
Buggy source:
public ObjectPairInjector(String prefix,Type type){
  prefix=Strings.isBlank(prefix) ? "String_Node_Str" : Strings.trim(prefix);
  this.mirror=Mirror.me(type);
  fields=mirror.getFields();
  this.injs=new Injecting[fields.length];
  this.names=new String[fields.length];
  this.converters=new ParamConvertor[fields.length];
  for (int i=0; i < fields.length; i++) {
    Field f=fields[i];
    this.injs[i]=mirror.getInjecting(f.getName());
    Param param=f.getAnnotation(Param.class);
    String nm=null == param ? f.getName() : param.value();
    this.names[i]=prefix + nm;
    this.converters[i]=Params.makeParamConvertor(f.getType());
  }
}

Fixed version (ground truth):
public ObjectPairInjector(String prefix,Type type){
  prefix=Strings.isBlank(prefix) ? "String_Node_Str" : Strings.trim(prefix);
  this.mirror=Mirror.me(type);
  fields=mirror.getFields();
  this.injs=new Injecting[fields.length];
  this.names=new String[fields.length];
  this.converters=new ParamConvertor[fields.length];
  for (int i=0; i < fields.length; i++) {
    Field f=fields[i];
    this.injs[i]=mirror.getInjecting(f.getName());
    Param param=f.getAnnotation(Param.class);
    String nm=null == param ? f.getName() : param.value();
    String datefmt=null == param ? null : param.dfmt();
    this.names[i]=prefix + nm;
    this.converters[i]=Params.makeParamConvertor(f.getType(),datefmt);
  }
}
Program: 80357
Project: 80357
Buggy source:
public MapItemInjector(String name,Class<?> type,Type[] paramTypes){
  super(name,type,paramTypes);
}

Fixed version (ground truth):
public MapItemInjector(String name,Class<?> type,Type[] paramTypes){
  super(name,null,type,paramTypes);
}
Program: 80358
Project: 80358
Buggy source:
@SuppressWarnings({"String_Node_Str"}) private static <T>T inj(String name,Class<T> type,HttpServletRequest req){
  return (T)new NameInjector(name,type,null).get(null,req,null,null);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) private static <T>T inj(String name,Class<T> type,HttpServletRequest req){
  NameInjector nminj=new NameInjector(name,null,type,null);
  return (T)nminj.get(null,req,null,null);
}
Program: 80359
Project: 80359
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void init(){
  List<LinkField> lfs=new ArrayList<LinkField>();
  lfs.addAll(ones.getAll());
  lfs.addAll(manys.getAll());
  lfs.addAll(manymanys.getAll());
  if (lfs.isEmpty())   return;
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + type);
  Mirror<T> mirror=Mirror.me(type);
  List<InterceptorPair> interceptorPairs=new ArrayList<InterceptorPair>();
  for (  LinkField lf : lfs) {
    String fieldName=lf.getName();
    try {
      Method setter=mirror.getSetter(mirror.getField(fieldName));
      LazyMethodInterceptor lmi=new LazyMethodInterceptor(setter,fieldName);
      interceptorPairs.add(new InterceptorPair(lmi,MethodMatcherFactory.matcher("String_Node_Str" + Strings.capitalize(fieldName) + "String_Node_Str")));
    }
 catch (    Throwable e) {
      if (log.isWarnEnabled())       log.warn("String_Node_Str",e);
    }
  }
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  Class lazyClass=agent.define(cd,type);
  BornContext<T> bc=Borns.evalByArgTypes(type,ResultSet.class);
  if (null == bc)   this.bornByDefault=Mirror.me(lazyClass).getBorningByArgTypes();
 else   this.bornByRS=bc.getBorning();
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public void init(){
  List<LinkField> lfs=new ArrayList<LinkField>();
  lfs.addAll(ones.getAll());
  lfs.addAll(manys.getAll());
  lfs.addAll(manymanys.getAll());
  if (lfs.isEmpty())   return;
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + type);
  Mirror<T> mirror=Mirror.me(type);
  List<InterceptorPair> interceptorPairs=new ArrayList<InterceptorPair>();
  for (  LinkField lf : lfs) {
    String fieldName=lf.getName();
    try {
      Method setter=mirror.getSetter(mirror.getField(fieldName));
      LazyMethodInterceptor lmi=new LazyMethodInterceptor(setter,fieldName);
      interceptorPairs.add(new InterceptorPair(lmi,MethodMatcherFactory.matcher("String_Node_Str" + Strings.upperFirst(fieldName) + "String_Node_Str")));
    }
 catch (    Throwable e) {
      if (log.isWarnEnabled())       log.warn("String_Node_Str",e);
    }
  }
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  Class lazyClass=agent.define(cd,type);
  BornContext<T> bc=Borns.evalByArgTypes(type,ResultSet.class);
  if (null == bc)   this.bornByDefault=Mirror.me(lazyClass).getBorningByArgTypes();
 else   this.bornByRS=bc.getBorning();
}
Program: 80360
Project: 80360
Buggy source:
public static String post(String url,Map<String,Object> params,int timeout){
  return Sender.create(Request.create(url,METHOD.POST,params,null)).setTimeout(timeout).send().getContent();
}

Fixed version (ground truth):
public static String post(String url,Map<String,Object> params,String inenc,String reenc){
  return Sender.create(Request.create(url,METHOD.POST,params,null).setEnc(inenc)).send().getContent(reenc);
}
Program: 80361
Project: 80361
Buggy source:
public InputStream getInputStream(){
  if (inputStream != null) {
    return inputStream;
  }
 else {
    if (null == data) {
      return new ByteArrayInputStream(Strings.getBytesUTF8(getURLEncodedParams()));
    }
    return new ByteArrayInputStream(data);
  }
}

Fixed version (ground truth):
public InputStream getInputStream(){
  if (inputStream != null) {
    return inputStream;
  }
 else {
    if (null == data) {
      if (enc != null)       try {
        return new ByteArrayInputStream(getURLEncodedParams().getBytes(enc));
      }
 catch (      UnsupportedEncodingException e) {
        throw Lang.wrapThrow(e);
      }
      return new ByteArrayInputStream(Strings.getBytesUTF8(getURLEncodedParams()));
    }
    return new ByteArrayInputStream(data);
  }
}
Program: 80362
Project: 80362
Buggy source:
/** 
 * 优先通过 getter 获取字段值，如果没有，则直接获取字段值
 * @param obj 对象
 * @param name 字段名
 * @return 字段值
 * @throws FailToGetValueException 既没发现 getter，又没有字段
 */
public Object getValue(Object obj,String name) throws FailToGetValueException {
  try {
    return this.getGetter(name).invoke(obj);
  }
 catch (  Exception e) {
    try {
      return getValue(obj,getField(name));
    }
 catch (    NoSuchFieldException e1) {
      throw makeGetValueException(obj.getClass(),name,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * 优先通过 getter 获取字段值，如果没有，则直接获取字段值
 * @param obj 对象
 * @param name 字段名
 * @return 字段值
 * @throws FailToGetValueException 既没发现 getter，又没有字段
 */
public Object getValue(Object obj,String name) throws FailToGetValueException {
  try {
    return this.getGetter(name).invoke(obj);
  }
 catch (  Exception e) {
    try {
      return getValue(obj,getField(name));
    }
 catch (    NoSuchFieldException e1) {
      if (obj != null && obj.getClass().isArray() && "String_Node_Str".equals(name)) {
        return Lang.length(obj);
      }
      throw makeGetValueException(obj.getClass(),name,e);
    }
  }
}
Program: 80363
Project: 80363
Buggy source:
@Override public void init(NutConfig config,ActionInfo ai) throws Throwable {
  view=evalView(config,ai,ai.getOkView());
}

Fixed version (ground truth):
@Override public void init(NutConfig config,ActionInfo ai) throws Throwable {
  if ("String_Node_Str".equals(ai.getOkView()) && String.class.equals(ai.getMethod().getReturnType())) {
    log.warn("String_Node_Str" + Lang.simpleMetodDesc(ai.getMethod()));
  }
  view=evalView(config,ai,ai.getOkView());
}
Program: 80364
Project: 80364
Buggy source:
public static View evalView(NutConfig config,ActionInfo ai,String viewType){
  if (Strings.isBlank(viewType))   return new VoidView();
  String str=viewType;
  int pos=str.indexOf(':');
  String type, value;
  if (pos > 0) {
    type=Strings.trim(str.substring(0,pos).toLowerCase());
    value=Strings.trim(pos >= (str.length() - 1) ? null : str.substring(pos + 1));
  }
 else {
    type=str;
    value=null;
  }
  if ("String_Node_Str".equals(type) && String.class.equals(ai.getMethod().getReturnType())) {
    log.warn("String_Node_Str" + Lang.simpleMetodDesc(ai.getMethod()));
  }
  for (  ViewMaker maker : ai.getViewMakers()) {
    if (maker instanceof ViewMaker2) {
      View view=((ViewMaker2)maker).make(config,ai,type,value);
      if (view != null)       return view;
    }
    View view=maker.make(config.getIoc(),type,value);
    if (null != view)     return view;
  }
  throw Lang.makeThrow("String_Node_Str",viewType,str,ai.getMethod());
}

Fixed version (ground truth):
public static View evalView(NutConfig config,ActionInfo ai,String viewType){
  if (Strings.isBlank(viewType))   return new VoidView();
  String str=viewType;
  int pos=str.indexOf(':');
  String type, value;
  if (pos > 0) {
    type=Strings.trim(str.substring(0,pos).toLowerCase());
    value=Strings.trim(pos >= (str.length() - 1) ? null : str.substring(pos + 1));
  }
 else {
    type=str;
    value=null;
  }
  for (  ViewMaker maker : ai.getViewMakers()) {
    if (maker instanceof ViewMaker2) {
      View view=((ViewMaker2)maker).make(config,ai,type,value);
      if (view != null)       return view;
    }
    View view=maker.make(config.getIoc(),type,value);
    if (null != view)     return view;
  }
  throw Lang.makeThrow("String_Node_Str",viewType,str,ai.getMethod());
}
Program: 80365
Project: 80365
Buggy source:
/** 
 * 回滚事务，执行它前，你必需保证你已经手工开始了一个事务
 * @throws Exception
 */
public static void rollback() throws Exception {
  Integer c=Trans.count.get();
  if (c == null)   c=Integer.valueOf(0);
  Trans._rollback(c);
}

Fixed version (ground truth):
/** 
 * 回滚事务，执行它前，你必需保证你已经手工开始了一个事务
 * @throws Exception
 */
public static void rollback() throws Exception {
  Integer c=Trans.count.get();
  if (c == null)   c=Integer.valueOf(0);
 else   if (c > 0)   c--;
  Trans._rollback(c);
}
Program: 80366
Project: 80366
Buggy source:
static void _depose(){
  if (count.get() == 0)   try {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId());
    trans.get().close();
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
 finally {
    trans.set(null);
  }
}

Fixed version (ground truth):
static void _depose(){
  if (count.get() == 0)   try {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId(),count.get());
    trans.get().close();
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
 finally {
    trans.set(null);
  }
}
Program: 80367
Project: 80367
Buggy source:
static void _rollback(Integer num){
  count.set(num);
  if (count.get() == 0) {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId());
    trans.get().rollback();
  }
 else {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId());
  }
}

Fixed version (ground truth):
static void _rollback(Integer num){
  count.set(num);
  if (count.get() == 0) {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId(),num);
    trans.get().rollback();
  }
 else {
    if (DEBUG)     log.debugf("String_Node_Str",trans.get().getId(),num);
  }
}
Program: 80368
Project: 80368
Buggy source:
public void onAfter(Connection conn,ResultSet rs) throws SQLException {
  Context context=entityField.getEntity().wrapAsContext(getOperatingObject());
  Object value=bin.eval(context);
  entityField.setValue(getOperatingObject(),value);
}

Fixed version (ground truth):
public void onAfter(Connection conn,ResultSet rs) throws SQLException {
  Context context=entityField.getEntity().wrapAsContext(getOperatingObject());
  context.set("String_Node_Str",entityField.getColumnName());
  context.set("String_Node_Str",entityField.getEntity());
  Object value=bin.eval(context);
  entityField.setValue(getOperatingObject(),value);
}
Program: 80369
Project: 80369
Buggy source:
protected List<MappingField> _mfs(Entity<?> en){
  if (null == mfs)   return Pojos.getFieldsForUpdate(_en(en),getFieldMatcher(),refer);
  return mfs;
}

Fixed version (ground truth):
protected List<MappingField> _mfs(Entity<?> en){
  if (null == mfs)   return Pojos.getFieldsForUpdate(_en(en),getFieldMatcher(),refer == null ? pojo.getOperatingObject() : refer);
  return mfs;
}
Program: 80370
Project: 80370
Buggy source:
/** 
 * 根据默认时区计算时间字符串的绝对毫秒数
 * @param ds 时间字符串
 * @return 绝对毫秒数
 * @see #ms(String,TimeZone)
 */
public static long ams(String ds){
  return ms(ds,TimeZone.getDefault());
}

Fixed version (ground truth):
/** 
 * 根据字符串得到相对于 "UTC 1970-01-01 00:00:00" 的绝对毫秒数。 本函数假想给定的时间字符串是本地时间。所以计算出来结果后，还需要减去时差 支持的时间格式字符串为: <pre> yyyy-MM-dd HH:mm:ss yyyy-MM-dd HH:mm:ss.SSS yy-MM-dd HH:mm:ss; yy-MM-dd HH:mm:ss.SSS; yyyy-MM-dd; yy-MM-dd; HH:mm:ss; HH:mm:ss.SSS; </pre>
 * @param ds 时间字符串
 * @param tz 你给定的时间字符串是属于哪个时区的
 * @return 时间
 */
public static long ams(String ds,TimeZone tz){
  Matcher m=_P_TIME.matcher(ds);
  if (m.find()) {
    int yy=_int(m,2,1970);
    int MM=_int(m,4,1);
    int dd=_int(m,6,1);
    int HH=_int(m,9,0);
    int mm=_int(m,11,0);
    int ss=_int(m,13,0);
    int ms=_int(m,16,0);
    long day=(long)D1970(yy,MM,dd);
    long MS=day * 86400000L;
    MS+=(((long)HH) * 3600L + ((long)mm) * 60L + ss) * 1000L;
    MS+=(long)ms;
    long tzOffset;
    if (null == tz) {
      if (!Strings.isBlank(m.group(17))) {
        tzOffset=Long.parseLong(m.group(19)) * 3600000L * (m.group(18).charAt(0) == '-' ? -1 : 1);
      }
 else {
        tzOffset=TimeZone.getDefault().getRawOffset();
      }
    }
 else {
      tzOffset=tz.getRawOffset();
    }
    return MS - tzOffset;
  }
  throw Lang.makeThrow("String_Node_Str",ds);
}
Program: 80372
Project: 80372
Buggy source:
public static ResourceLocation file(File root){
  if (!root.exists())   return new ErrorResourceLocation(root);
  try {
    return new FileSystemResourceLocation(root.getAbsoluteFile().getCanonicalFile());
  }
 catch (  Exception e) {
    return new ErrorResourceLocation(root);
  }
}

Fixed version (ground truth):
public static ResourceLocation file(File root){
  try {
    if (!root.exists())     return new ErrorResourceLocation(root);
    return new FileSystemResourceLocation(root.getAbsoluteFile().getCanonicalFile());
  }
 catch (  Exception e) {
    return new ErrorResourceLocation(root);
  }
}
Program: 80373
Project: 80373
Buggy source:
public List<NutResource> loadResource(String regex,String... paths){
  List<NutResource> list=new LinkedList<NutResource>();
  for (  String path : paths) {
    list.addAll(scan(path,regex));
  }
  if (list.size() < 1 && paths.length > 0)   throw Lang.makeThrow(RuntimeException.class,"String_Node_Str",regex,Castors.me().castToString(paths));
  return new ArrayList<NutResource>((new HashSet<NutResource>(list)));
}

Fixed version (ground truth):
public List<NutResource> loadResource(String regex,String... paths){
  List<NutResource> list=new LinkedList<NutResource>();
  for (  String path : paths) {
    list.addAll(scan(path,regex));
  }
  if (list.size() < 1 && paths.length > 0)   throw Lang.makeThrow(RuntimeException.class,"String_Node_Str",regex,Castors.me().castToString(paths));
  return new ArrayList<NutResource>((new LinkedHashSet<NutResource>(list)));
}
Program: 80374
Project: 80374
Buggy source:
public void setupEntityField(Connection conn,Entity<?> en){
  Statement stat=null;
  ResultSet rs=null;
  ResultSetMetaData rsmd=null;
  try {
    stat=conn.createStatement();
    rs=stat.executeQuery(createResultSetMetaSql(en));
    rsmd=rs.getMetaData();
    for (    MappingField mf : en.getMappingFields()) {
      int ci=Daos.getColumnIndex(rsmd,mf.getColumnName());
      if (ResultSetMetaData.columnNoNulls == rsmd.isNullable(ci))       mf.setAsNotNull();
      if (mf.getTypeMirror().isEnum()) {
        if (Daos.isIntLikeColumn(rsmd,ci)) {
          mf.setColumnType(ColType.INT);
        }
 else {
          mf.setColumnType(ColType.VARCHAR);
        }
      }
    }
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getViewName());
  }
 finally {
    Daos.safeClose(stat,rs);
  }
}

Fixed version (ground truth):
public void setupEntityField(Connection conn,Entity<?> en){
  Statement stat=null;
  ResultSet rs=null;
  ResultSetMetaData rsmd=null;
  try {
    stat=conn.createStatement();
    rs=stat.executeQuery(createResultSetMetaSql(en));
    rsmd=rs.getMetaData();
    for (    MappingField mf : en.getMappingFields()) {
      try {
        int ci=Daos.getColumnIndex(rsmd,mf.getColumnName());
        if (ResultSetMetaData.columnNoNulls == rsmd.isNullable(ci))         mf.setAsNotNull();
        if (mf.getTypeMirror().isEnum()) {
          if (Daos.isIntLikeColumn(rsmd,ci)) {
            mf.setColumnType(ColType.INT);
          }
 else {
            mf.setColumnType(ColType.VARCHAR);
          }
        }
      }
 catch (      Exception e) {
      }
    }
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getViewName());
  }
 finally {
    Daos.safeClose(stat,rs);
  }
}
Program: 80375
Project: 80375
Buggy source:
public static int getColumnIndex(ResultSetMetaData meta,String colName) throws SQLException {
  if (meta == null)   return 0;
  int columnCount=meta.getColumnCount();
  for (int i=1; i <= columnCount; i++)   if (meta.getColumnName(i).equalsIgnoreCase(colName))   return i;
  log.infof("String_Node_Str",colName);
  throw Lang.makeThrow(SQLException.class,"String_Node_Str",colName);
}

Fixed version (ground truth):
public static int getColumnIndex(ResultSetMetaData meta,String colName) throws SQLException {
  if (meta == null)   return 0;
  int columnCount=meta.getColumnCount();
  for (int i=1; i <= columnCount; i++)   if (meta.getColumnName(i).equalsIgnoreCase(colName))   return i;
  log.infof("String_Node_Str",colName,meta.getTableName(1));
  throw Lang.makeThrow(SQLException.class,"String_Node_Str",colName);
}
Program: 80376
Project: 80376
Buggy source:
/** 
 * 这是最后的大招了,查一下形参的名字,作为@Param("形参名")进行处理
 */
protected ParamInjector paramNameInject(Method method,int index){
  List<String> names=MethodParamNamesScaner.getParamNames(method);
  if (names != null)   return new NameInjector(names.get(index),method.getParameterTypes()[index],null);
 else   if (log.isInfoEnabled())   log.info("String_Node_Str" + index);
  return new PathArgInjector(method.getParameterTypes()[index]);
}

Fixed version (ground truth):
/** 
 * 这是最后的大招了,查一下形参的名字,作为@Param("形参名")进行处理
 */
protected ParamInjector paramNameInject(Method method,int index){
  List<String> names=MethodParamNamesScaner.getParamNames(method);
  if (names != null)   return new NameInjector(names.get(index),method.getParameterTypes()[index],null);
 else   if (log.isInfoEnabled())   log.infof("String_Node_Str",index,method);
  return new PathArgInjector(method.getParameterTypes()[index]);
}
Program: 80377
Project: 80377
Buggy source:
public void init(Method method){
  this.method=method;
  Class<?>[] argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  Type[] types=method.getGenericParameterTypes();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(types[i],param);
    if (null == injs[i]) {
      injs[i]=paramNameInject(method,i);
    }
  }
}

Fixed version (ground truth):
public void init(Method method){
  this.method=method;
  Class<?>[] argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  Type[] types=method.getGenericParameterTypes();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    ReqHeader reqHeader=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
 else     if (anns[x] instanceof ReqHeader) {
      reqHeader=(ReqHeader)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    if (null != reqHeader) {
      injs[i]=new ReqHeaderInjector(reqHeader.value());
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(types[i],param);
    if (null == injs[i]) {
      injs[i]=paramNameInject(method,i);
    }
  }
}