nus-yam/ex-repair huggingface dataset:
Program: 80771
Project: 80771
Buggy source:
@SuppressWarnings("String_Node_Str") public Node<T> add(Node<?>... nodes){
  if (nodes.length == 0) {
    return this;
  }
  if (nodes.length == 1) {
    Node<T> node=(Node<T>)nodes[0];
    node.parent(this);
    if (!this.hasChild()) {
      firstChild=node;
      lastChild=node;
      node.next(null);
      node.prev(null);
    }
 else {
      lastChild.next(node);
      node.prev(lastChild);
      node.next(null);
      lastChild=node;
    }
  }
 else {
    firstChild=(Node<T>)nodes[0];
    firstChild.parent(this);
    firstChild.next((Node<T>)nodes[1]);
    int i=1;
    for (; i < nodes.length - 1; i++) {
      Node<T> node=(Node<T>)nodes[i];
      node.parent(this);
      node.prev((Node<T>)nodes[i - 1]);
      node.next((Node<T>)nodes[i + 1]);
    }
    lastChild=(Node<T>)nodes[i];
    lastChild.parent(this);
    lastChild.prev((Node<T>)nodes[i - 1]);
  }
  return this;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Node<T> add(Node<?>... nodes){
  if (nodes.length == 0) {
    return this;
  }
  if (nodes.length == 1) {
    Node<T> node=(Node<T>)nodes[0];
    node.parent(this);
    if (!this.hasChild()) {
      firstChild=node;
      lastChild=node;
      node.next(null);
      node.prev(null);
    }
 else {
      lastChild.next(node);
      node.prev(lastChild);
      node.next(null);
      lastChild=node;
    }
  }
 else {
    Node<T> theNode=(Node<T>)nodes[0];
    theNode.parent(this);
    theNode.next((Node<T>)nodes[1]);
    if (null == lastChild) {
      firstChild=theNode;
    }
 else {
      lastChild.next(theNode);
    }
    int i=1;
    for (; i < nodes.length - 1; i++) {
      Node<T> node=(Node<T>)nodes[i];
      node.parent(this);
      node.prev((Node<T>)nodes[i - 1]);
      node.next((Node<T>)nodes[i + 1]);
    }
    lastChild=(Node<T>)nodes[i];
    lastChild.parent(this);
    lastChild.prev((Node<T>)nodes[i - 1]);
  }
  return this;
}
Program: 80772
Project: 80772
Buggy source:
protected void enhandMethod_Void(){
  mv.visitCode();
  Label l0=new Label();
  Label l1=new Label();
  Label l2=new Label();
  mv.visitTryCatchBlock(l0,l1,l2,"String_Node_Str");
  mv.visitLabel(l0);
  mv.visitTypeInsn(NEW,"String_Node_Str");
  mv.visitInsn(DUP);
  visitX(methodIndex);
  mv.visitVarInsn(ALOAD,0);
  mv.visitFieldInsn(GETSTATIC,myName,"String_Node_Str","String_Node_Str");
  visitX(methodIndex);
  mv.visitInsn(AALOAD);
  mv.visitFieldInsn(GETSTATIC,myName,"String_Node_Str","String_Node_Str");
  visitX(methodIndex);
  mv.visitInsn(AALOAD);
  loadArgsAsArray();
  mv.visitMethodInsn(INVOKESPECIAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
{
    if (Type.getReturnType(desc).equals(Type.VOID_TYPE)) {
      mv.visitInsn(POP);
    }
 else {
      mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
      AsmHelper.checkCast(returnType,mv);
      returnIt();
    }
  }
  mv.visitLabel(l1);
  Label l3=new Label();
  mv.visitJumpInsn(GOTO,l3);
  mv.visitLabel(l2);
  mv.visitVarInsn(ASTORE,3);
  mv.visitVarInsn(ALOAD,3);
  mv.visitInsn(ATHROW);
  mv.visitLabel(l3);
  mv.visitInsn(RETURN);
  mv.visitMaxs(8,4);
  mv.visitEnd();
}

Fixed version (ground truth):
protected void enhandMethod_Void(){
  mv.visitCode();
  Label l0=new Label();
  Label l1=new Label();
  Label l2=new Label();
  mv.visitTryCatchBlock(l0,l1,l2,"String_Node_Str");
  mv.visitLabel(l0);
  mv.visitTypeInsn(NEW,"String_Node_Str");
  mv.visitInsn(DUP);
  visitX(methodIndex);
  mv.visitVarInsn(ALOAD,0);
  mv.visitFieldInsn(GETSTATIC,myName,AsmClassAgent.MethodArray_FieldName,"String_Node_Str");
  visitX(methodIndex);
  mv.visitInsn(AALOAD);
  mv.visitFieldInsn(GETSTATIC,myName,AsmClassAgent.MethodInterceptorList_FieldName,"String_Node_Str");
  visitX(methodIndex);
  mv.visitInsn(AALOAD);
  loadArgsAsArray();
  mv.visitMethodInsn(INVOKESPECIAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
{
    if (Type.getReturnType(desc).equals(Type.VOID_TYPE)) {
      mv.visitInsn(POP);
    }
 else {
      mv.visitMethodInsn(INVOKEVIRTUAL,"String_Node_Str","String_Node_Str","String_Node_Str");
      AsmHelper.checkCast(returnType,mv);
      returnIt();
    }
  }
  mv.visitLabel(l1);
  Label l3=new Label();
  mv.visitJumpInsn(GOTO,l3);
  mv.visitLabel(l2);
  mv.visitVarInsn(ASTORE,3);
  mv.visitVarInsn(ALOAD,3);
  mv.visitInsn(ATHROW);
  mv.visitLabel(l3);
  mv.visitInsn(RETURN);
  mv.visitMaxs(8,4);
  mv.visitEnd();
}
Program: 80773
Project: 80773
Buggy source:
@SuppressWarnings("String_Node_Str") protected <T>Class<T> generate(ClassDefiner cd,Pair2[] pair2s,String newName,Class<T> klass,Constructor<T>[] constructors){
  try {
    return (Class<T>)cd.load(newName);
  }
 catch (  ClassNotFoundException e) {
  }
  Method[] methodArray=new Method[pair2s.length];
  List<MethodInterceptor>[] methodInterceptorList=new List[pair2s.length];
  for (int i=0; i < pair2s.length; i++) {
    Pair2 pair2=pair2s[i];
    methodArray[i]=pair2.method;
    methodInterceptorList[i]=pair2.listeners;
  }
  byte[] bytes=ClassY.enhandClass(klass,newName,methodArray,constructors);
  if (debug)   Files.write(new File(newName),bytes);
  Class<T> newClass=(Class<T>)cd.define(newName,bytes);
  AopToolKit.injectFieldValue(newClass,methodArray,methodInterceptorList);
  return newClass;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected <T>Class<T> generate(ClassDefiner cd,Pair2[] pair2s,String newName,Class<T> klass,Constructor<T>[] constructors){
  try {
    return (Class<T>)cd.load(newName);
  }
 catch (  ClassNotFoundException e) {
  }
  Method[] methodArray=new Method[pair2s.length];
  List<MethodInterceptor>[] methodInterceptorList=new List[pair2s.length];
  for (int i=0; i < pair2s.length; i++) {
    Pair2 pair2=pair2s[i];
    methodArray[i]=pair2.method;
    methodInterceptorList[i]=pair2.listeners;
  }
  byte[] bytes=ClassY.enhandClass(klass,newName,methodArray,constructors);
  if (debug)   Files.write(new File(newName),bytes);
  Class<T> newClass=(Class<T>)cd.define(newName,bytes);
  try {
    Mirror<T> mirror=Mirror.me(newClass);
    mirror.setValue(null,MethodArray_FieldName,methodArray);
    mirror.setValue(null,MethodInterceptorList_FieldName,methodInterceptorList);
  }
 catch (  Throwable e) {
  }
  return newClass;
}
Program: 80774
Project: 80774
Buggy source:
private void addField(){
  AopToolKit.addFields(cw);
}

Fixed version (ground truth):
private void addField(){
  cw.visitField(ACC_PRIVATE + ACC_STATIC,AsmClassAgent.MethodArray_FieldName,"String_Node_Str",null,null).visitEnd();
  cw.visitField(ACC_PRIVATE + ACC_STATIC,AsmClassAgent.MethodInterceptorList_FieldName,"String_Node_Str","String_Node_Str",null).visitEnd();
}
Program: 80775
Project: 80775
Buggy source:
public static boolean isJDK6(){
  InputStream is=null;
  try {
    String classFileName=Lang.class.getName().replace('.','/') + "String_Node_Str";
    is=Lang.class.getResourceAsStream(classFileName);
    if (is == null)     is=Lang.class.getResourceAsStream("String_Node_Str" + classFileName);
    if (is != null && is.available() > 8) {
      is.skip(7);
switch (is.read()) {
case 50:
        return true;
    }
  }
}
 catch (Throwable e) {
}
 finally {
  Streams.safeClose(is);
}
return false;
}

Fixed version (ground truth):
public static boolean isJDK6(){
  InputStream is=null;
  try {
    String classFileName=Lang.class.getName().replace('.','/') + "String_Node_Str";
    is=Lang.class.getResourceAsStream(classFileName);
    if (is == null)     is=Lang.class.getResourceAsStream("String_Node_Str" + classFileName);
    if (is != null && is.available() > 8) {
      is.skip(7);
      return is.read() > 49;
    }
  }
 catch (  Throwable e) {
  }
 finally {
    Streams.safeClose(is);
  }
  return false;
}
Program: 80776
Project: 80776
Buggy source:
public String getRealPath(String path){
  if (path.startsWith("String_Node_Str"))   return new File("String_Node_Str" + path).getAbsolutePath();
  if (path.startsWith("String_Node_Str"))   path=path.substring("String_Node_Str".length());
  if (path.startsWith("String_Node_Str"))   path=path.substring("String_Node_Str".length());
  return new File(path).getAbsolutePath();
}

Fixed version (ground truth):
public String getRealPath(String path){
  if (path.startsWith("String_Node_Str"))   return new File(path.substring("String_Node_Str".length())).getAbsolutePath();
  if (path.startsWith("String_Node_Str"))   return new File(path.substring("String_Node_Str".length())).getAbsolutePath();
  if (path.startsWith("String_Node_Str"))   return new File("String_Node_Str" + path).getAbsolutePath();
  return new File(path).getAbsolutePath();
}
Program: 80777
Project: 80777
Buggy source:
protected IocValue convert(String value){
  IocValue iocValue=new IocValue();
  iocValue.setType(value.substring(0,value.indexOf("String_Node_Str")));
  iocValue.setValue(value.substring(value.indexOf("String_Node_Str") + 1));
  return iocValue;
}

Fixed version (ground truth):
protected IocValue convert(String value){
  IocValue iocValue=new IocValue();
  if (value.indexOf(':') > -1) {
    iocValue.setType(value.substring(0,value.indexOf("String_Node_Str")));
    iocValue.setValue(value.substring(value.indexOf("String_Node_Str") + 1));
  }
 else   iocValue.setValue(value);
  return iocValue;
}
Program: 80779
Project: 80779
Buggy source:
/** 
 * 初始化NutLog,检查全部Log的可用性,选择可用的Log适配器 <p/> <b>加载本类时,该方法已经在静态构造函数中调用,用户无需主动调用.</b> <p/> <b>除非迫不得已,请不要调用本方法<b/>
 */
public static void init(){
  try {
    adapter=new SimplePluginManager<LogAdapter>("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").get();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * 初始化NutLog,检查全部Log的可用性,选择可用的Log适配器 <p/> <b>加载本类时,该方法已经在静态构造函数中调用,用户无需主动调用.</b> <p/> <b>除非迫不得已,请不要调用本方法<b/>
 */
public static void init(){
  try {
    adapter=new SimplePluginManager<LogAdapter>("String_Node_Str","String_Node_Str").get();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 80780
Project: 80780
Buggy source:
@Override protected void log(int level,Object message,Throwable tx){
switch (level) {
case LEVEL_FATAL:
    logger.log(SUPER_FQCN,Level.FATAL,message,tx);
  break;
case LEVEL_ERROR:
logger.log(SUPER_FQCN,Level.ERROR,message,tx);
break;
case LEVEL_WARN:
logger.log(SUPER_FQCN,Level.WARN,message,tx);
break;
case LEVEL_INFO:
logger.log(SUPER_FQCN,Level.INFO,message,tx);
break;
case LEVEL_DEBUG:
logger.log(SUPER_FQCN,Level.DEBUG,message,tx);
break;
case LEVEL_TRACE:
if (hasTrace) logger.log(SUPER_FQCN,Level.TRACE,message,tx);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override protected void log(int level,Object message,Throwable tx){
switch (level) {
case LEVEL_FATAL:
    logger.log(SUPER_FQCN,Level.FATAL,message,tx);
  break;
case LEVEL_ERROR:
logger.log(SUPER_FQCN,Level.ERROR,message,tx);
break;
case LEVEL_WARN:
logger.log(SUPER_FQCN,Level.WARN,message,tx);
break;
case LEVEL_INFO:
logger.log(SUPER_FQCN,Level.INFO,message,tx);
break;
case LEVEL_DEBUG:
logger.log(SUPER_FQCN,Level.DEBUG,message,tx);
break;
case LEVEL_TRACE:
if (hasTrace) logger.log(SUPER_FQCN,Level.TRACE,message,tx);
 else logger.log(SUPER_FQCN,Level.DEBUG,message,tx);
break;
default :
break;
}
}
Program: 80781
Project: 80781
Buggy source:
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);
}

Fixed version (ground truth):
Log4JLogger(String className){
  logger=Logger.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: 80782
Project: 80782
Buggy source:
public boolean canWork(){
  try {
    Class.forName("String_Node_Str",false,Thread.currentThread().getContextClassLoader());
    return isPropertyFileConfigured();
  }
 catch (  Throwable e) {
  }
  return false;
}

Fixed version (ground truth):
public boolean canWork(){
  try {
    Class.forName("String_Node_Str",false,Thread.currentThread().getContextClassLoader());
    return true;
  }
 catch (  Throwable e) {
  }
  return false;
}
Program: 80783
Project: 80783
Buggy source:
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;
}

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 == 95) {
      sb.append((char)b);
    }
 else     if ((b >= 0 && b <= 47) || (b >= 58 && b <= 64) || (b >= 91 && b <= 96)|| (b >= 123 && b <= 160)) {
      break;
    }
 else {
      sb.append((char)b);
    }
  }
  return i - 1;
}
Program: 80784
Project: 80784
Buggy source:
/** 
 * 将集合编程变成指定类型的列表
 * @param coll 集合对象
 * @param classOfList 列表类型
 * @return 列表对象
 */
public static <E>List<E> collection2list(Collection<E> coll,Class<List<E>> classOfList){
  if (coll instanceof List<?>)   return (List<E>)coll;
  List<E> list;
  try {
    list=(null == classOfList ? new ArrayList<E>(coll.size()) : classOfList.newInstance());
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
  for (Iterator<E> it=coll.iterator(); it.hasNext(); ) {
    list.add(it.next());
  }
  return list;
}

Fixed version (ground truth):
/** 
 * 将集合编程变成指定类型的列表
 * @param col 集合对象
 * @param classOfList 列表类型
 * @return 列表对象
 */
public static <E>List<E> collection2list(Collection<?> col,Class<E> eleType){
  if (null == col)   return null;
  List<E> list=new ArrayList<E>(col.size());
  for (  Object obj : col)   list.add(Castors.me().castTo(obj,eleType));
  return list;
}
Program: 80786
Project: 80786
Buggy source:
/** 
 * 将集合变成指定类型的数组
 * @param coll 集合对象
 * @param eleType 数组元素类型
 * @return 数组
 */
public static Object collection2array(Collection<?> coll,Class<?> eleType){
  if (null == coll)   return null;
  Object re=Array.newInstance(eleType,coll.size());
  int i=0;
  for (Iterator<?> it=coll.iterator(); it.hasNext(); ) {
    Object obj=it.next();
    if (null == obj)     Array.set(re,i++,null);
 else     Array.set(re,i++,Castors.me().castTo(obj,eleType));
  }
  return re;
}

Fixed version (ground truth):
/** 
 * 将集合变成指定类型的数组
 * @param col 集合对象
 * @param eleType 数组元素类型
 * @return 数组
 */
@SuppressWarnings("String_Node_Str") public static <E>E[] collection2array(Collection<?> col,Class<E> eleType){
  if (null == col)   return null;
  Object re=Array.newInstance(eleType,col.size());
  int i=0;
  for (Iterator<?> it=col.iterator(); it.hasNext(); ) {
    Object obj=it.next();
    if (null == obj)     Array.set(re,i++,null);
 else     Array.set(re,i++,Castors.me().castTo(obj,eleType));
  }
  return (E[])re;
}
Program: 80787
Project: 80787
Buggy source:
private <T>T getAs(Class<T> toType,String key,T dft){
  Object obj=get(key);
  if (null == obj)   return dft;
  return Castors.me().castTo(obj,toType);
}

Fixed version (ground truth):
public <T>T getAs(Class<T> toType,String key,T dft){
  Object obj=get(key);
  if (null == obj)   return dft;
  return Castors.me().castTo(obj,toType);
}
Program: 80788
Project: 80788
Buggy source:
public Object[] adapt(ServletContext sc,HttpServletRequest request,HttpServletResponse response,String[] pathArgs){
  String str;
  try {
    str=Lang.readAll(new InputStreamReader(request.getInputStream(),Encoding.CHARSET_UTF8));
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
  Map<String,Object> map=Lang.map(str);
  Object[] args=new Object[injs.length];
  int i=fillPathArgs(request,response,pathArgs,args);
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,request,response,map);
  }
  return args;
}

Fixed version (ground truth):
public Object[] adapt(ServletContext sc,HttpServletRequest request,HttpServletResponse response,String[] pathArgs){
  String str;
  try {
    str=Lang.readAll(new InputStreamReader(request.getInputStream(),Encoding.CHARSET_UTF8));
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
  Object[] args=new Object[injs.length];
  int i=fillPathArgs(request,response,pathArgs,args);
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,request,response,str);
  }
  return args;
}
Program: 80789
Project: 80789
Buggy source:
public View make(Ioc ioc,String type,String value){
  type=type.toLowerCase();
  if (VIEW_JSP.equals(type))   return new JspView(value);
  if (VIEW_JSON.equals(type))   if (Strings.isBlank(value))   return new UTF8JsonView(JsonFormat.compact());
 else   return new UTF8JsonView(Json.fromJson(JsonFormat.class,value));
  if (VIEW_REDIRECT.equals(type) || VIEW_REDIRECT2.equals(type))   return new ServerRedirectView(value);
  if (VIEW_FORWARD.equals(type) || VIEW_FORWARD2.equals(type))   return new ForwardView(value);
  if (VIEW_VOID.equals(type))   return new VoidView();
  if (VIEW_IOC.equals(type))   return ioc.get(View.class,value);
  if (VIEW_HTTP.equals(type))   return new HttpStatusView(Integer.parseInt(value));
  if (VIEW_STRING.equals(type))   return new RawView(value);
  return null;
}

Fixed version (ground truth):
public View make(Ioc ioc,String type,String value){
  type=type.toLowerCase();
  if (VIEW_JSP.equals(type))   return new JspView(value);
  if (VIEW_JSON.equals(type))   if (Strings.isBlank(value))   return new UTF8JsonView(JsonFormat.compact());
 else   return new UTF8JsonView(Json.fromJson(JsonFormat.class,value));
  if (VIEW_REDIRECT.equals(type) || VIEW_REDIRECT2.equals(type))   return new ServerRedirectView(value);
  if (VIEW_FORWARD.equals(type) || VIEW_FORWARD2.equals(type))   return new ForwardView(value);
  if (VIEW_VOID.equals(type))   return new VoidView();
  if (VIEW_IOC.equals(type))   return ioc.get(View.class,value);
  if (VIEW_HTTP.equals(type))   return new HttpStatusView(Integer.parseInt(value));
  if (VIEW_RAW.equals(type))   return new RawView(value);
  return null;
}
Program: 80791
Project: 80791
Buggy source:
/** 
 * 执行根据流来加载sql内容的操作
 * @param stream
 * @throws IOException
 * @author mawenming at 2010-4-10 上午10:04:17
 */
private void loadSQL(Reader stream) throws IOException {
  BufferedReader bufferedReader=null;
  try {
    bufferedReader=new BufferedReader(stream);
    SqlFileBuilder p=new SqlFileBuilder(bufferedReader);
    Iterator<String> it=p.keys().iterator();
    _sql_keys=new ArrayList<String>(p.map.size());
    while (it.hasNext()) {
      String key=it.next();
      String value=Strings.trim(p.get(key));
      addSql(key,value);
    }
  }
  finally {
    Streams.safeClose(bufferedReader);
    Streams.safeClose(stream);
  }
}

Fixed version (ground truth):
/** 
 * 执行根据字符流来加载sql内容的操作
 * @param reader
 * @throws IOException
 * @author mawenming at 2010-4-10 上午10:04:17
 */
protected void loadSQL(Reader reader) throws IOException {
  BufferedReader bufferedReader=null;
  try {
    bufferedReader=new BufferedReader(reader);
    SqlFileBuilder p=new SqlFileBuilder(bufferedReader);
    Iterator<String> it=p.keys().iterator();
    _sql_keys=new ArrayList<String>(p.map.size());
    while (it.hasNext()) {
      String key=it.next();
      String value=Strings.trim(p.get(key));
      addSql(key,value);
    }
  }
  finally {
    Streams.safeClose(bufferedReader);
    Streams.safeClose(reader);
  }
}
Program: 80792
Project: 80792
Buggy source:
public void refresh(){
  List<NutResource> nrs=new LinkedList<NutResource>();
  for (  String path : paths) {
    File f=Files.findFile(path);
    if (null == f)     continue;
    if (!f.getAbsolutePath().contains("String_Node_Str") && f.isFile()) {
      nrs.add(new FileResource(f.getParentFile(),f));
      if (autoscan == false)       continue;
    }
    List<NutResource> list=Scans.me().scan(path,regex);
    String parent=path;
    int pos=path.lastIndexOf('/');
    if (pos == -1)     pos=path.lastIndexOf('\\');
    if (pos > 0)     parent=path.substring(0,pos);
    if (Strings.isBlank(parent)) {
      nrs.addAll(list);
    }
 else {
      for (      NutResource nr : list)       if (autoscan) {
        if (nr.getName().startsWith(parent)) {
          nrs.add(nr);
        }
      }
 else {
        if (nr.getName().equals(path)) {
          nrs.add(nr);
        }
      }
    }
  }
  buildSQLMaps(nrs);
}

Fixed version (ground truth):
public void refresh(){
  List<InputStream> list=Scans.me().loadResource(null,paths);
  _sql_map=new HashMap<String,String>();
  for (  InputStream ins : list) {
    Reader r=new InputStreamReader(ins);
    try {
      loadSQL(r);
    }
 catch (    IOException e) {
      throw Lang.wrapThrow(e);
    }
  }
}
Program: 80793
Project: 80793
Buggy source:
public FileSqlManager(String... paths){
  this.paths=paths;
  this.autoscan=true;
}

Fixed version (ground truth):
public FileSqlManager(String... paths){
  this.paths=paths;
}
Program: 80794
Project: 80794
Buggy source:
public JsonLoader(String... paths){
  this.setMap(new HashMap<String,Map<String,Object>>());
  try {
    for (    String path : paths) {
      File f=Files.findFile(path);
      if (null != f && f.isFile()) {
        loadFromInputStream(new FileInputStream(f));
        continue;
      }
      List<NutResource> rsList=Scans.me().scan(path,"String_Node_Str");
      for (      NutResource nr : rsList) {
        loadFromInputStream(nr.getInputStream());
      }
      if (rsList.size() < 1)       throw Lang.makeThrow(RuntimeException.class,"String_Node_Str",path);
    }
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public JsonLoader(String... paths){
  this.setMap(new HashMap<String,Map<String,Object>>());
  List<InputStream> list=Scans.me().loadResource("String_Node_Str",paths);
  for (  InputStream ins : list)   loadFromInputStream(ins);
}
Program: 80795
Project: 80795
Buggy source:
public XmlIocLoader(String... fileNames){
  try {
    DocumentBuilder builder=Lang.xmls();
    Document document;
    for (    String fileName : fileNames) {
      document=builder.parse(Files.findFileAsStream(fileName));
      document.normalizeDocument();
      NodeList nodeListZ=((Element)document.getDocumentElement()).getChildNodes();
      for (int i=0; i < nodeListZ.getLength(); i++) {
        if (nodeListZ.item(i) instanceof Element)         paserBean((Element)nodeListZ.item(i),false);
      }
    }
    handleParent();
    if (LOG.isDebugEnabled())     LOG.debugf("String_Node_Str",Json.toJson(iocMap));
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public XmlIocLoader(String... fileNames){
  try {
    DocumentBuilder builder=Lang.xmls();
    Document document;
    List<InputStream> list=Scans.me().loadResource("String_Node_Str",fileNames);
    for (    InputStream ins : list) {
      document=builder.parse(ins);
      document.normalizeDocument();
      NodeList nodeListZ=((Element)document.getDocumentElement()).getChildNodes();
      for (int i=0; i < nodeListZ.getLength(); i++) {
        if (nodeListZ.item(i) instanceof Element)         paserBean((Element)nodeListZ.item(i),false);
      }
      Streams.safeClose(ins);
    }
    handleParent();
    if (LOG.isDebugEnabled())     LOG.debugf("String_Node_Str",Json.toJson(iocMap));
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80796
Project: 80796
Buggy source:
@Test public void test_dynamic_insert(){
  pojos.init();
  ((NutDao)dao).setSqlManager(new FileSqlManager("String_Node_Str").setAutoscan(false));
  int platoonId=23;
  try {
    pojos.initPlatoon(platoonId);
    Sql sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",12);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",13);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",14);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",15);
    dao.execute(sql);
    TableName.run(platoonId,new Atom(){
      public void run(){
        assertEquals(4,dao.count(Tank.class));
      }
    }
);
  }
 catch (  SqlNotFoundException e) {
  }
 finally {
    pojos.dropPlatoon(platoonId);
  }
}

Fixed version (ground truth):
@Test public void test_dynamic_insert(){
  pojos.init();
  ((NutDao)dao).setSqlManager(new FileSqlManager("String_Node_Str"));
  int platoonId=23;
  try {
    pojos.initPlatoon(platoonId);
    Sql sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",12);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",13);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",14);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",15);
    dao.execute(sql);
    TableName.run(platoonId,new Atom(){
      public void run(){
        assertEquals(4,dao.count(Tank.class));
      }
    }
);
  }
 catch (  SqlNotFoundException e) {
  }
 finally {
    pojos.dropPlatoon(platoonId);
  }
}
Program: 80797
Project: 80797
Buggy source:
public Object remove(Object arg0){
  return map.remove(arg0);
}

Fixed version (ground truth):
public Object remove(Object key){
  return map.remove(key.toString().toLowerCase());
}
Program: 80798
Project: 80798
Buggy source:
public boolean containsValue(Object arg0){
  return map.containsValue(arg0);
}

Fixed version (ground truth):
public boolean containsValue(Object value){
  return map.containsValue(value);
}
Program: 80799
Project: 80799
Buggy source:
public Object put(String arg0,Object arg1){
  return map.put(arg0,arg1);
}

Fixed version (ground truth):
public Object put(String name,Object value){
  return map.put(name.toLowerCase(),value);
}
Program: 80800
Project: 80800
Buggy source:
public void putAll(Map<? extends String,? extends Object> arg0){
  map.putAll(arg0);
}

Fixed version (ground truth):
public void putAll(Map<? extends String,? extends Object> out){
  for (  Entry<? extends String,? extends Object> entry : out.entrySet())   map.put(entry.getKey().toLowerCase(),entry.getValue());
}
Program: 80801
Project: 80801
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);
      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);
  }
}

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,rs.getString(i));
      }
 else {
        re.set(name,rs.getObject(i));
      }
    }
    return re;
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80802
Project: 80802
Buggy source:
/** 
 * 设置值
 * @param name 字段名
 * @param value 字段值
 * @return 记录本身
 */
public Record set(String name,Object value){
  map.put(name,value);
  return this;
}

Fixed version (ground truth):
/** 
 * 设置值
 * @param name 字段名
 * @param value 字段值
 * @return 记录本身
 */
public Record set(String name,Object value){
  map.put(name.toLowerCase(),value);
  return this;
}
Program: 80803
Project: 80803
Buggy source:
public Set<java.util.Map.Entry<String,Object>> entrySet(){
  return map.entrySet();
}

Fixed version (ground truth):
public Set<Entry<String,Object>> entrySet(){
  return map.entrySet();
}
Program: 80804
Project: 80804
Buggy source:
public boolean containsKey(Object arg0){
  return map.containsKey(arg0);
}

Fixed version (ground truth):
public boolean containsKey(Object key){
  return map.containsKey(key);
}
Program: 80805
Project: 80805
Buggy source:
public boolean equals(Object arg0){
  return map.equals(arg0);
}

Fixed version (ground truth):
public boolean equals(Object out){
  return map.equals(out);
}
Program: 80806
Project: 80806
Buggy source:
public int updateIgnoreNull(final Object obj){
  final int[] re={0};
  FieldFilter.create(obj.getClass(),true).run(new Atom(){
    public void run(){
      re[0]=update(obj);
    }
  }
);
  return re[0];
}

Fixed version (ground truth):
public int updateIgnoreNull(final Object obj){
  if (null == obj)   return 0;
  Object first=Lang.first(obj);
  if (null == first)   return 0;
  final int[] re={0};
  FieldFilter.create(first.getClass(),true).run(new Atom(){
    public void run(){
      re[0]=update(obj);
    }
  }
);
  return re[0];
}
Program: 80807
Project: 80807
Buggy source:
/** 
 * 根据一段字符串，生成一个List 对象。
 * @param str 参照 JSON 标准的字符串，但是可以没有前后的中括号
 * @return List 对象
 */
@SuppressWarnings("String_Node_Str") public static List<Object> list(String str){
  if (null == str)   return null;
  if ((str.length() > 0 && str.charAt(0) == '[') && str.endsWith("String_Node_Str"))   return (List<Object>)Json.fromJson(str);
  return (List<Object>)Json.fromJson("String_Node_Str" + str + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * 较方便的创建一个列表，比如： <pre> List《Pet》 pets = Lang.list(pet1, pet2, pet3); </pre>
 * @param eles 可变参数
 * @return 列表对象
 */
public static <T>List<T> list(T... eles){
  List<T> list=new ArrayList<T>(eles.length);
  for (  T ele : eles)   list.add(ele);
  return list;
}
Program: 80808
Project: 80808
Buggy source:
@Test public void test_first4_map_collection(){
  assertNull(Lang.first(new HashMap<String,String>()));
  Map<?,?> map1=Lang.map("String_Node_Str");
  assertTrue(map1.entrySet().contains(Lang.first(map1)));
  assertNull(Lang.first(new ArrayList<String>()));
  List<Object> l=Lang.list("String_Node_Str");
  assertEquals(1,Lang.first(l));
}

Fixed version (ground truth):
@Test public void test_first4_map_collection(){
  assertNull(Lang.first(new HashMap<String,String>()));
  Map<?,?> map1=Lang.map("String_Node_Str");
  assertTrue(map1.entrySet().contains(Lang.first(map1)));
  assertNull(Lang.first(new ArrayList<String>()));
  List<Object> l=Lang.list4("String_Node_Str");
  assertEquals(1,Lang.first(l));
}
Program: 80809
Project: 80809
Buggy source:
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  String paramName=param.value();
  if (File.class.isAssignableFrom(type))   return new FileInjector(paramName);
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(paramName);
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(paramName);
  if (List.class.isAssignableFrom(type))   return new MapListInjector(paramName);
  if (type.isArray())   return new MapArrayInjector(type.getComponentType(),paramName);
  if ("String_Node_Str".equals(paramName)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new MapReferInjector(null,type);
  }
 else   if (paramName.startsWith("String_Node_Str") && paramName.length() > 2) {
    return new MapReferInjector(paramName.substring(2),type);
  }
  return new MapItemInjector(paramName,type);
}

Fixed version (ground truth):
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  String paramName=param.value();
  if (File.class.isAssignableFrom(type))   return new FileInjector(paramName);
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(paramName);
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(paramName);
  if (InputStream.class.isAssignableFrom(type))   return new InputStreamInjector(paramName);
  if (Reader.class.isAssignableFrom(type))   return new ReaderInjector(paramName);
  if (List.class.isAssignableFrom(type))   return new MapListInjector(paramName);
  if (type.isArray())   return new MapArrayInjector(type.getComponentType(),paramName);
  if ("String_Node_Str".equals(paramName)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new MapReferInjector(null,type);
  }
 else   if (paramName.startsWith("String_Node_Str") && paramName.length() > 2) {
    return new MapReferInjector(paramName.substring(2),type);
  }
  return new MapItemInjector(paramName,type);
}
Program: 80810
Project: 80810
Buggy source:
@SuppressWarnings("String_Node_Str") public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=((Map<String,Object>)refer).get(name);
  if (obj == null)   return null;
  if (obj instanceof TempFile) {
    return ((TempFile)obj).getFile();
  }
 else {
    List<?> list=(List<?>)obj;
    if (list.isEmpty())     return null;
 else     return ((TempFile)list.get(0)).getFile();
  }
}

Fixed version (ground truth):
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  return getFile(refer);
}
Program: 80811
Project: 80811
Buggy source:
public View make(Ioc ioc,String type,String value){
  type=type.toLowerCase();
  if (VIEW_JSP.equals(type))   return new JspView(value);
  if (VIEW_JSON.equals(type))   if (Strings.isBlank(value))   return new UTF8JsonView(JsonFormat.compact());
 else   return new UTF8JsonView(Json.fromJson(JsonFormat.class,value));
  if (VIEW_REDIRECT.equals(type) || VIEW_REDIRECT2.equals(type))   return new ServerRedirectView(value);
  if (VIEW_VOID.equals(type))   return new VoidView();
  if (VIEW_IOC.equals(type))   return ioc.get(View.class,value);
  if (VIEW_HTTP.equals(type))   return new HttpStatusView(Integer.parseInt(value));
  return null;
}

Fixed version (ground truth):
public View make(Ioc ioc,String type,String value){
  type=type.toLowerCase();
  if (VIEW_JSP.equals(type))   return new JspView(value);
  if (VIEW_JSON.equals(type))   if (Strings.isBlank(value))   return new UTF8JsonView(JsonFormat.compact());
 else   return new UTF8JsonView(Json.fromJson(JsonFormat.class,value));
  if (VIEW_REDIRECT.equals(type) || VIEW_REDIRECT2.equals(type))   return new ServerRedirectView(value);
  if (VIEW_FORWARD.equals(type) || VIEW_FORWARD2.equals(type))   return new ForwardView(value);
  if (VIEW_VOID.equals(type))   return new VoidView();
  if (VIEW_IOC.equals(type))   return ioc.get(View.class,value);
  if (VIEW_HTTP.equals(type))   return new HttpStatusView(Integer.parseInt(value));
  return null;
}
Program: 80812
Project: 80812
Buggy source:
public JspView(String name){
  if (!Strings.isBlank(name)) {
    path=normalizePath(name,"String_Node_Str");
  }
}

Fixed version (ground truth):
public JspView(String name){
  super(name);
}
Program: 80813
Project: 80813
Buggy source:
private static RuntimeException makeSetValueException(Class<?> type,String name,Object value,Exception e){
  return new FailToSetValueException(String.format("String_Node_Str",value,type.getName(),name,e.getMessage()));
}

Fixed version (ground truth):
private static RuntimeException makeSetValueException(Class<?> type,String name,Object value,Exception e){
  if (e instanceof FailToSetValueException) {
    return (FailToSetValueException)e;
  }
  return new FailToSetValueException(String.format("String_Node_Str",value,type.getName(),name,e.getMessage()));
}
Program: 80814
Project: 80814
Buggy source:
/** 
 * 为对象的一个字段设值。优先调用 setter 方法。
 * @param obj 对象
 * @param fieldName 字段名
 * @param value 值
 * @throws FailToSetValueException
 */
public void setValue(Object obj,String fieldName,Object value) throws FailToSetValueException {
  try {
    this.getSetter(fieldName,value.getClass()).invoke(obj,value);
  }
 catch (  Exception e) {
    try {
      Field field=this.getField(fieldName);
      setValue(obj,field,value);
    }
 catch (    Exception e1) {
      throw makeSetValueException(obj.getClass(),fieldName,value,e1);
    }
  }
}

Fixed version (ground truth):
/** 
 * 为对象的一个字段设值。优先调用 setter 方法。
 * @param obj 对象
 * @param fieldName 字段名
 * @param value 值
 * @throws FailToSetValueException
 */
public void setValue(Object obj,String fieldName,Object value) throws FailToSetValueException {
  if (null == value) {
    try {
      setValue(obj,this.getField(fieldName),value);
    }
 catch (    Exception e1) {
      throw makeSetValueException(obj.getClass(),fieldName,value,e1);
    }
  }
 else {
    try {
      this.getSetter(fieldName,value.getClass()).invoke(obj,value);
    }
 catch (    Exception e) {
      try {
        setValue(obj,this.getField(fieldName),value);
      }
 catch (      Exception e1) {
        throw makeSetValueException(obj.getClass(),fieldName,value,e1);
      }
    }
  }
}
Program: 80815
Project: 80815
Buggy source:
@Test public void test_setValue_Boolean_and_Character(){
  SV sv=new SV();
  sv.ok=true;
  sv.cobj=Character.valueOf('F');
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  assertNull(sv.ok);
  assertNull(sv.cobj);
}

Fixed version (ground truth):
@Test public void test_setValue_Boolean_and_Character(){
  SV sv=new SV();
  sv.ok=true;
  sv.cobj=Character.valueOf('F');
  sv.intobj=30;
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  assertNull(sv.ok);
  assertNull(sv.cobj);
  assertNull(sv.intobj);
}
Program: 80816
Project: 80816
Buggy source:
@Override public java.util.Date cast(String src,Class<?> toType,String... args){
  try {
    return dateTimeFormat.parse(src);
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@Override public java.util.Date cast(String src,Class<?> toType,String... args){
  try {
    return dateFormat.parse(src);
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80817
Project: 80817
Buggy source:
public void refresh(){
  List<NutResource> nrs=new LinkedList<NutResource>();
  for (  String path : paths) {
    File f=Files.findFile(path);
    if (null == f)     continue;
    if (f.isFile()) {
      nrs.add(new FileResource(f.getParentFile(),f));
      if (autoscan == false)       continue;
    }
    List<NutResource> list=Scans.me().scan(path,regex);
    String parent=path;
    int pos=path.lastIndexOf('/');
    if (pos == -1)     pos=path.lastIndexOf('\\');
    if (pos > 0)     parent=path.substring(0,pos);
    if (Strings.isBlank(parent)) {
      nrs.addAll(list);
    }
 else {
      for (      NutResource nr : list)       if (autoscan) {
        if (nr.getName().startsWith(parent)) {
          nrs.add(nr);
        }
      }
 else {
        if (nr.getName().equals(path)) {
          nrs.add(nr);
        }
      }
    }
  }
  buildSQLMaps(nrs);
}

Fixed version (ground truth):
public void refresh(){
  List<NutResource> nrs=new LinkedList<NutResource>();
  for (  String path : paths) {
    File f=Files.findFile(path);
    if (null == f)     continue;
    if (!f.getAbsolutePath().contains("String_Node_Str") && f.isFile()) {
      nrs.add(new FileResource(f.getParentFile(),f));
      if (autoscan == false)       continue;
    }
    List<NutResource> list=Scans.me().scan(path,regex);
    String parent=path;
    int pos=path.lastIndexOf('/');
    if (pos == -1)     pos=path.lastIndexOf('\\');
    if (pos > 0)     parent=path.substring(0,pos);
    if (Strings.isBlank(parent)) {
      nrs.addAll(list);
    }
 else {
      for (      NutResource nr : list)       if (autoscan) {
        if (nr.getName().startsWith(parent)) {
          nrs.add(nr);
        }
      }
 else {
        if (nr.getName().equals(path)) {
          nrs.add(nr);
        }
      }
    }
  }
  buildSQLMaps(nrs);
}
Program: 80818
Project: 80818
Buggy source:
protected List<NutResource> scanInDir(final Pattern regex,final String base,File f,final boolean ignoreHidden){
  final List<NutResource> list=new ArrayList<NutResource>();
  if (null == f || (ignoreHidden && f.isHidden()) || (!f.exists()))   return list;
  if (!f.isDirectory())   f=f.getParentFile();
  Disks.visitFile(f,new FileVisitor(){
    public void visit(    File file){
      list.add(new FileResource(base,file));
    }
  }
,new FileFilter(){
    public boolean accept(    File theFile){
      if (ignoreHidden && theFile.isHidden())       return false;
      if (theFile.isDirectory())       return true;
      return regex == null || regex.matcher(theFile.getName()).find();
    }
  }
);
  return list;
}

Fixed version (ground truth):
protected List<NutResource> scanInDir(final Pattern regex,final String base,File f,final boolean ignoreHidden){
  final List<NutResource> list=new ArrayList<NutResource>();
  if (null == f || (ignoreHidden && f.isHidden()) || (!f.exists()))   return list;
  if (!f.isDirectory())   f=f.getParentFile();
  Disks.visitFile(f,new FileVisitor(){
    public void visit(    File file){
      list.add(new FileResource(base,file));
    }
  }
,new FileFilter(){
    public boolean accept(    File theFile){
      if (ignoreHidden && theFile.isHidden())       return false;
      if (theFile.isDirectory()) {
        String fnm=theFile.getName().toLowerCase();
        if ("String_Node_Str".equals(fnm) || "String_Node_Str".equals(fnm))         return false;
        return true;
      }
      return regex == null || regex.matcher(theFile.getName()).find();
    }
  }
);
  return list;
}
Program: 80819
Project: 80819
Buggy source:
public boolean accept(File theFile){
  if (ignoreHidden && theFile.isHidden())   return false;
  if (theFile.isDirectory())   return true;
  return regex == null || regex.matcher(theFile.getName()).find();
}

Fixed version (ground truth):
public boolean accept(File theFile){
  if (ignoreHidden && theFile.isHidden())   return false;
  if (theFile.isDirectory()) {
    String fnm=theFile.getName().toLowerCase();
    if ("String_Node_Str".equals(fnm) || "String_Node_Str".equals(fnm))     return false;
    return true;
  }
  return regex == null || regex.matcher(theFile.getName()).find();
}
Program: 80820
Project: 80820
Buggy source:
@Test public void testString2JavaDate() throws FailToCastObjectException {
  java.util.Date date=Castors.me().cast("String_Node_Str",String.class,java.util.Date.class);
  Calendar cal=Calendar.getInstance();
  cal.setTime(date);
  assertEquals(2008,cal.get(Calendar.YEAR));
  assertEquals(5,cal.get(Calendar.MONTH));
  assertEquals(12,cal.get(Calendar.DAY_OF_MONTH));
  assertEquals(15,cal.get(Calendar.HOUR_OF_DAY));
  assertEquals(28,cal.get(Calendar.MINUTE));
  assertEquals(35,cal.get(Calendar.SECOND));
}

Fixed version (ground truth):
@Test public void testString2JavaDate() throws FailToCastObjectException {
  java.util.Date date=Castors.me().castTo("String_Node_Str",java.util.Date.class);
  Calendar cal=Calendar.getInstance();
  cal.setTime(date);
  assertEquals(2008,cal.get(Calendar.YEAR));
  assertEquals(5,cal.get(Calendar.MONTH));
  assertEquals(12,cal.get(Calendar.DAY_OF_MONTH));
  assertEquals(0,cal.get(Calendar.HOUR_OF_DAY));
  assertEquals(0,cal.get(Calendar.MINUTE));
  assertEquals(0,cal.get(Calendar.SECOND));
}
Program: 80822
Project: 80822
Buggy source:
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    try {
      return ClassLoader.getSystemClassLoader().loadClass(className);
    }
 catch (    ClassNotFoundException e2) {
      try {
        return getParent().loadClass(className);
      }
 catch (      ClassNotFoundException e3) {
      }
    }
  }
  return super.loadClass(className);
}

Fixed version (ground truth):
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    try {
      return ClassLoader.getSystemClassLoader().loadClass(className);
    }
 catch (    ClassNotFoundException e2) {
      try {
        return getParent().loadClass(className);
      }
 catch (      ClassNotFoundException e3) {
      }
    }
catch (    SecurityException e2) {
      try {
        return getParent().loadClass(className);
      }
 catch (      ClassNotFoundException e3) {
      }
    }
  }
  return super.loadClass(className);
}
Program: 80823
Project: 80823
Buggy source:
public SqlNotFoundException(String key,String[] paths){
  super(String.format("String_Node_Str",key,Castors.me().castToString(paths)));
}

Fixed version (ground truth):
public SqlNotFoundException(String key){
  super(String.format("String_Node_Str",key));
}
Program: 80825
Project: 80825
Buggy source:
int _deleteSelf(Entity<?> entity,Object obj){
  if (null != obj) {
    EntityField idnf=entity.getIdentifiedField();
    if (null == idnf) {
      Object[] args=evalArgsByPks(entity,obj);
      if (null != args) {
        Sql sql=sqlMaker.deletex(entity,args);
        execute(sql);
        return sql.getUpdateCount();
      }
      throw DaoException.create(obj,"String_Node_Str","String_Node_Str",null);
    }
    if (idnf.isId()) {
      int id=Castors.me().castTo(idnf.getValue(obj),Integer.class);
      return delete(obj.getClass(),id);
    }
 else     if (idnf.isName()) {
      String name=idnf.getValue(obj).toString();
      return delete(obj.getClass(),name);
    }
 else {
      throw DaoException.create(obj,"String_Node_Str","String_Node_Str",new Exception("String_Node_Str"));
    }
  }
  return 0;
}

Fixed version (ground truth):
int _deleteSelf(Entity<?> entity,Object obj){
  if (null != obj) {
    EntityField idnf=entity.getIdentifiedField();
    if (null == idnf) {
      Object[] args=evalArgsByPks(entity,obj);
      if (null != args) {
        Sql sql=sqlMaker.deletex(entity,args);
        execute(sql);
        return sql.getUpdateCount();
      }
      throw DaoException.create(obj,"String_Node_Str","String_Node_Str",null);
    }
    if (idnf.isId()) {
      long id=Castors.me().castTo(idnf.getValue(obj),Long.class);
      return delete(obj.getClass(),id);
    }
 else     if (idnf.isName()) {
      String name=idnf.getValue(obj).toString();
      return delete(obj.getClass(),name);
    }
 else {
      throw DaoException.create(obj,"String_Node_Str","String_Node_Str",new Exception("String_Node_Str"));
    }
  }
  return 0;
}
Program: 80826
Project: 80826
Buggy source:
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return new String(s.toString().getBytes(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return URLEncoder.encode(s.toString(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}