nus-yam/ex-repair huggingface dataset:
Program: 43371
Project: 43371
Buggy source:
public static Set<Class<?>> scanModules(Class<?> mainModule){
  Modules ann=mainModule.getAnnotation(Modules.class);
  boolean scan=null == ann ? false : ann.scanPackage();
  List<Class<?>> list=new LinkedList<Class<?>>();
  list.add(mainModule);
  if (null != ann) {
    for (    Class<?> module : ann.value()) {
      list.add(module);
    }
  }
  Set<Class<?>> modules=new HashSet<Class<?>>();
  for (  Class<?> type : list) {
    if (scan) {
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",type.getPackage().getName());
      List<Class<?>> subs=Scans.me().scanPackage(type);
      for (      Class<?> sub : subs) {
        if (isModule(sub)) {
          if (log.isDebugEnabled())           log.debugf("String_Node_Str",sub.getName());
          modules.add(sub);
        }
 else         if (log.isTraceEnabled()) {
          log.tracef("String_Node_Str",sub.getName());
        }
      }
    }
 else {
      if (isModule(type)) {
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",type.getName());
        modules.add(type);
      }
 else       if (log.isTraceEnabled()) {
        log.tracef("String_Node_Str",type.getName());
      }
    }
  }
  return modules;
}

Fixed version (ground truth):
public static Set<Class<?>> scanModules(Class<?> mainModule){
  Modules ann=mainModule.getAnnotation(Modules.class);
  boolean scan=null == ann ? false : ann.scanPackage();
  List<Class<?>> list=new LinkedList<Class<?>>();
  list.add(mainModule);
  if (null != ann) {
    for (    Class<?> module : ann.value()) {
      list.add(module);
    }
  }
  Set<Class<?>> modules=new HashSet<Class<?>>();
  if (null != ann && ann.packages() != null && ann.packages().length > 0) {
    for (    String packageName : ann.packages())     scanModuleInPackage(modules,packageName);
  }
  for (  Class<?> type : list) {
    if (scan)     scanModuleInPackage(modules,type.getPackage().getName());
 else {
      if (isModule(type)) {
        if (log.isDebugEnabled())         log.debugf("String_Node_Str",type.getName());
        modules.add(type);
      }
 else       if (log.isTraceEnabled()) {
        log.tracef("String_Node_Str",type.getName());
      }
    }
  }
  return modules;
}
Program: 43373
Project: 43373
Buggy source:
public static List<MappingField> getFieldsForUpdate(Entity<?> en,FieldMatcher fm,Object refer){
  List<MappingField> re=new ArrayList<MappingField>(en.getMappingFields().size());
  for (  MappingField mf : en.getMappingFields()) {
    if (mf.isPk()) {
      if (en.getPkType() == PkType.ID && mf.isId())       continue;
      if (en.getPkType() == PkType.NAME && mf.isName())       continue;
      if (en.getPkType() == PkType.COMPOSITE && mf.isCompositePk())       continue;
    }
    if (!mf.isAutoIncreasement() && !mf.isReadonly())     if (null != fm && null != refer && fm.isIgnoreNull() && null == mf.getValue(refer))     continue;
    if (null == fm || fm.match(mf.getName()))     re.add(mf);
  }
  return re;
}

Fixed version (ground truth):
public static List<MappingField> getFieldsForUpdate(Entity<?> en,FieldMatcher fm,Object refer){
  List<MappingField> re=new ArrayList<MappingField>(en.getMappingFields().size());
  for (  MappingField mf : en.getMappingFields()) {
    if (mf.isPk()) {
      if (en.getPkType() == PkType.ID && mf.isId())       continue;
      if (en.getPkType() == PkType.NAME && mf.isName())       continue;
      if (en.getPkType() == PkType.COMPOSITE && mf.isCompositePk())       continue;
    }
    if (mf.isReadonly() || mf.isAutoIncreasement())     continue;
 else     if (null != fm && null != refer && fm.isIgnoreNull() && null == mf.getValue(refer))     continue;
    if (null == fm || fm.match(mf.getName()))     re.add(mf);
  }
  return re;
}
Program: 43374
Project: 43374
Buggy source:
public JsonEntity(Mirror<?> mirror){
  Field[] flds=mirror.getFields();
  fields=new ArrayList<JsonEntityField>(flds.length);
  for (  Field fld : flds) {
    JsonEntityField ef=new JsonEntityField(mirror,fld);
    fields.add(ef);
  }
  try {
    borning=mirror.getBorning();
  }
 catch (  BorningException e) {
    err=e;
  }
}

Fixed version (ground truth):
public JsonEntity(Mirror<?> mirror){
  Field[] flds=mirror.getFields();
  fields=new ArrayList<JsonEntityField>(flds.length);
  for (  Field fld : flds) {
    JsonEntityField ef=JsonEntityField.eval(mirror,fld);
    if (null != ef)     fields.add(ef);
  }
  try {
    borning=mirror.getBorning();
  }
 catch (  BorningException e) {
    err=e;
  }
}
Program: 43375
Project: 43375
Buggy source:
public JsonEntityField(Mirror<?> mirror,Field fld){
  this.injecting=mirror.getInjecting(fld.getName());
  this.ejecting=mirror.getEjecting(fld.getName());
  this.genericType=fld.getGenericType();
  JsonField jf=fld.getAnnotation(JsonField.class);
  if (null != jf)   name=jf.value();
 else   name=fld.getName();
}

Fixed version (ground truth):
private JsonEntityField(){
}
Program: 43376
Project: 43376
Buggy source:
/** 
 * 从一个 ResultSet 中获取一个对象。 <p> 因为 Dao 接口可以知道一个 POJO 的映射细节，这个函数可以帮你节省一点体力。
 * @param classOfT
 * @param rs
 * @param fm
 * @return 对象
 */
<T>T getObject(Class<T> classOfT,ResultSet rs,FieldMatcher fm);

Fixed version (ground truth):
/** 
 * 从一个 ResultSet 中获取一个对象。 <p> 因为 Dao 接口可以知道一个 POJO 的映射细节，这个函数可以帮你节省一点体力。
 * @param classOfT 对象类型
 * @param rs 结果集
 * @param fm 字段过滤器
 * @return 对象
 */
<T>T getObject(Class<T> classOfT,ResultSet rs,FieldMatcher fm);
Program: 43377
Project: 43377
Buggy source:
public static ElObj oLong(Long v){
  return new StaticElObj(new LongElValue(v));
}

Fixed version (ground truth):
public static ElObj oLong(Long v){
  return new StaticElObj(new NumberElValue(v));
}
Program: 43378
Project: 43378
Buggy source:
public static ElObj oInt(Integer v){
  return new StaticElObj(new IntegerElValue(v));
}

Fixed version (ground truth):
public static ElObj oInt(Integer v){
  return new StaticElObj(new NumberElValue(v));
}
Program: 43379
Project: 43379
Buggy source:
public static ElObj oFloat(Float v){
  return new StaticElObj(new FloatElValue(v));
}

Fixed version (ground truth):
public static ElObj oFloat(Float v){
  return new StaticElObj(new NumberElValue(v));
}
Program: 43380
Project: 43380
Buggy source:
public ElValue make(Object obj){
  if (obj instanceof ElValue)   return (ElValue)obj;
  if (null == obj)   return new NullElValue();
  if (obj instanceof Map<?,?>)   return new MapElValue((Map<?,?>)obj);
  if (obj instanceof List<?>)   return new ListElValue((List<?>)obj);
  if (obj instanceof Collection<?>)   return new CollectionElValue((List<?>)obj);
  if (obj.getClass().isArray()) {
    return new ArrayElValue(obj);
  }
  Mirror<?> mirror=Mirror.me(obj);
  if (mirror.isStringLike())   return new StringElValue(obj.toString());
  if (mirror.isLong())   return new LongElValue((Long)obj);
  if (mirror.isIntLike())   return new IntegerElValue((Integer)obj);
  if (mirror.isBoolean())   return (Boolean)obj ? El.TRUE : El.FALSE;
  if (mirror.isFloat())   return new FloatElValue((Float)obj);
  return new PojoElValue<Object>(obj);
}

Fixed version (ground truth):
public ElValue make(Object obj){
  if (obj instanceof ElValue)   return (ElValue)obj;
  if (null == obj)   return new NullElValue();
  if (obj instanceof Map<?,?>)   return new MapElValue((Map<?,?>)obj);
  if (obj instanceof List<?>)   return new ListElValue((List<?>)obj);
  if (obj instanceof Collection<?>)   return new CollectionElValue((List<?>)obj);
  if (obj.getClass().isArray()) {
    return new ArrayElValue(obj);
  }
  Mirror<?> mirror=Mirror.me(obj);
  if (mirror.isStringLike())   return new StringElValue(obj.toString());
  if (mirror.isLong())   return new NumberElValue((Long)obj);
  if (mirror.isIntLike())   return new NumberElValue((Integer)obj);
  if (mirror.isBoolean())   return (Boolean)obj ? El.TRUE : El.FALSE;
  if (mirror.isFloat())   return new NumberElValue((Float)obj);
  return new PojoElValue<Object>(obj);
}
Program: 43381
Project: 43381
Buggy source:
public ElValue getProperty(ElValue val){
  Object v=val.get();
  if (v instanceof Integer) {
    return El.wrap(Array.get(obj,((Integer)v).intValue()));
  }
 else   if ("String_Node_Str".equals(val.getString())) {
    return El.wrap(Array.getLength(obj));
  }
  throw new ElException("String_Node_Str",val.getString());
}

Fixed version (ground truth):
public ElValue getProperty(ElValue val){
  Object v=val.get();
  if (v instanceof BigDecimal) {
    return El.wrap(Array.get(obj,((BigDecimal)v).intValue()));
  }
 else   if ("String_Node_Str".equals(val.getString())) {
    return El.wrap(Array.getLength(obj));
  }
  throw new ElException("String_Node_Str",val.getString());
}
Program: 43382
Project: 43382
Buggy source:
/** 
 * 将字符串，变成数字对象，现支持的格式为： <ul> <li>null - 整数 0</li> <li>23.78 - 浮点 Float</li> <li>0x45 - 16进制整数 Integer</li> <li>78L - 长整数 Long</li> <li>69 - 普通整数 Integer</li> </ul>
 * @param s 参数
 * @return 数字对象
 */
public static Number str2number(String s){
  if (null == s) {
    return 0;
  }
  s=s.toUpperCase();
  if (s.indexOf('.') != -1) {
    return Float.valueOf(s);
  }
  if (s.startsWith("String_Node_Str")) {
    return Integer.valueOf(s.substring(2),16);
  }
  if (s.charAt(s.length() - 1) == 'L') {
    return Long.valueOf(s.substring(0,s.length() - 1));
  }
  return Integer.valueOf(s);
}

Fixed version (ground truth):
/** 
 * 将字符串，变成数字对象，现支持的格式为： <ul> <li>null - 整数 0</li> <li>23.78 - 浮点 Float</li> <li>0x45 - 16进制整数 Integer</li> <li>78L - 长整数 Long</li> <li>69 - 普通整数 Integer</li> </ul>
 * @param s 参数
 * @return 数字对象
 */
public static Number str2number(String s){
  if (null == s) {
    return 0;
  }
  s=s.toUpperCase();
  if (s.indexOf('.') != -1) {
    return Float.valueOf(s);
  }
  if (s.startsWith("String_Node_Str")) {
    return Integer.valueOf(s.substring(2),16);
  }
  if (s.charAt(s.length() - 1) == 'L') {
    return Long.valueOf(s.substring(0,s.length() - 1));
  }
  Long re=Long.parseLong(s);
  if (Integer.MAX_VALUE >= re && re >= Integer.MIN_VALUE)   return re.intValue();
  return re;
}
Program: 43384
Project: 43384
Buggy source:
public List<NutResource> loadResource(String regex,String... paths){
  List<NutResource> list=new LinkedList<NutResource>();
  try {
    for (    String path : paths) {
      File f=Files.findFile(path);
      if (null == f || f.isDirectory()) {
        list.addAll(scan(path,regex));
      }
 else       if (f.isFile()) {
        list.add(new FileResource(f));
      }
 else       if (f.getAbsolutePath().contains("String_Node_Str")) {
        list.add(new JarEntryResource(new JarEntryInfo(f.getAbsolutePath())));
      }
    }
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
  if (list.size() < 1 && paths.length > 0)   throw Lang.makeThrow(RuntimeException.class,"String_Node_Str",regex,Castors.me().castToString(paths));
  return list;
}

Fixed version (ground truth):
public List<NutResource> loadResource(String regex,String... paths){
  List<NutResource> list=new LinkedList<NutResource>();
  for (  String path : paths) {
    File f=Files.findFile(path);
    if (null == f || f.isDirectory()) {
      list.addAll(scan(path,regex));
    }
 else     if (f.isFile()) {
      list.add(new FileResource(f));
    }
 else     if (isInJar(f)) {
      NutResource nutResource=makeJarNutResource(f);
      if (nutResource != null) {
        list.add(nutResource);
      }
 else {
        if (!path.replace('\\','/').endsWith("String_Node_Str"))         path+='/';
        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 list;
}
Program: 43385
Project: 43385
Buggy source:
protected List<NutResource> scanInJar(String src,Pattern regex,String jarPath){
  List<NutResource> list=new ArrayList<NutResource>();
  try {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",jarPath,regex,src);
    JarFile jar=new JarFile(jarPath);
    Enumeration<JarEntry> ens=jar.entries();
    while (ens.hasMoreElements()) {
      JarEntry jen=ens.nextElement();
      if (jen.isDirectory())       continue;
      String name=jen.getName();
      if (name.startsWith(src) && (null != regex && regex.matcher(name).find())) {
        list.add(new JarEntryResource(jar,jen,jen.getName().substring(src.length())));
      }
    }
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",list.size(),jarPath,regex,src);
  }
 catch (  Throwable e) {
    if (log.isWarnEnabled())     log.warn("String_Node_Str" + jarPath + "String_Node_Str",e);
  }
  return list;
}

Fixed version (ground truth):
protected List<NutResource> scanInJar(String src,Pattern regex,String jarPath){
  List<NutResource> list=new ArrayList<NutResource>();
  try {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",jarPath,regex,src);
    JarFile jar=new JarFile(jarPath);
    Enumeration<JarEntry> ens=jar.entries();
    while (ens.hasMoreElements()) {
      JarEntry jen=ens.nextElement();
      if (jen.isDirectory())       continue;
      String name=jen.getName();
      if (name.startsWith(src) && (null == regex || regex.matcher(name).find())) {
        list.add(new JarEntryResource(jar,jen,jen.getName().substring(src.length())));
      }
    }
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",list.size(),jarPath,regex,src);
  }
 catch (  Throwable e) {
    if (log.isWarnEnabled())     log.warn("String_Node_Str" + jarPath + "String_Node_Str",e);
  }
  return list;
}
Program: 43386
Project: 43386
Buggy source:
public List<NutResource> list(String src,String filter){
  final List<NutResource> list=new LinkedList<NutResource>();
  final Pattern regex=null == filter ? null : Pattern.compile(filter);
  File f=Files.findFile(src);
  if (f != null && f.exists()) {
    if (f.isFile())     list.addAll(scanInDir(regex,f.getParentFile(),ignoreHidden));
 else     list.addAll(scanInDir(regex,f,ignoreHidden));
  }
 else {
    String path=Disks.absolute(src,getClass().getClassLoader(),Encoding.defaultEncoding());
    if (null != path) {
      f=new File(path);
      if (!path.contains("String_Node_Str")) {
        int pos=path.lastIndexOf(src);
        if (pos > 0)         list.addAll(scanInDir(regex,f,ignoreHidden));
      }
 else {
        JarEntryInfo jeInfo=new JarEntryInfo(path);
        list.addAll(scanInJar(checkSrc(jeInfo.getEntryName()),regex,jeInfo.getJarPath()));
      }
    }
 else {
      String classpath=System.getProperties().getProperty("String_Node_Str");
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + classpath);
      String[] paths=classpath.split(System.getProperties().getProperty("String_Node_Str"));
      for (      String pathZ : paths) {
        if (pathZ.endsWith("String_Node_Str"))         list.addAll(scanInJar(checkSrc(src),regex,pathZ));
 else         list.addAll(scanInDir(regex,new File(pathZ + "String_Node_Str" + src),ignoreHidden));
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public List<NutResource> list(String src,String filter){
  final List<NutResource> list=new LinkedList<NutResource>();
  final Pattern regex=null == filter ? null : Pattern.compile(filter);
  File f=Files.findFile(src);
  if (f != null && f.exists()) {
    if (f.isFile())     list.addAll(scanInDir(regex,f.getParentFile(),ignoreHidden));
 else     list.addAll(scanInDir(regex,f,ignoreHidden));
  }
 else {
    String path=Disks.absolute(src,getClass().getClassLoader(),Encoding.defaultEncoding());
    if (null != path) {
      f=new File(path);
      if (!path.contains("String_Node_Str")) {
        int pos=path.lastIndexOf(src);
        if (pos > 0)         list.addAll(scanInDir(regex,f,ignoreHidden));
      }
 else {
        JarEntryInfo jeInfo=new JarEntryInfo(path);
        list.addAll(scanInJar(checkSrc(jeInfo.getEntryName()),regex,jeInfo.getJarPath()));
      }
    }
 else {
      try {
        Enumeration<URL> en=getClass().getClassLoader().getResources(src);
        if (en != null) {
          while (en.hasMoreElements()) {
            JarEntryInfo jeInfo=new JarEntryInfo(en.nextElement().getPath());
            list.addAll(scanInJar(checkSrc(jeInfo.getEntryName()),regex,jeInfo.getJarPath()));
          }
        }
      }
 catch (      Throwable e) {
        e.printStackTrace();
      }
    }
  }
  return list;
}
Program: 43387
Project: 43387
Buggy source:
public <T>T insertRelation(T obj,String regex){
  EntityOperator opt=__opt(obj);
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T insertRelation(T obj,String regex){
  EntityOperator opt=_optBy(obj);
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}
Program: 43388
Project: 43388
Buggy source:
public <T>T insertWith(T obj,String regex){
  EntityOperator opt=__opt(obj);
  opt.entity.visitOne(obj,regex,doInsert(opt));
  opt.addInsert();
  opt.entity.visitMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T insertWith(T obj,String regex){
  EntityOperator opt=_optBy(obj);
  opt.entity.visitOne(obj,regex,doInsert(opt));
  opt.addInsert();
  opt.entity.visitMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}
Program: 43389
Project: 43389
Buggy source:
public <T>T insertLinks(T obj,String regex){
  EntityOperator opt=__opt(obj);
  opt.entity.visitOne(obj,regex,doInsert(opt));
  opt.entity.visitMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T insertLinks(T obj,String regex){
  EntityOperator opt=_optBy(obj);
  opt.entity.visitOne(obj,regex,doInsert(opt));
  opt.entity.visitMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsert(opt));
  opt.entity.visitManyMany(obj,regex,doInsertRelation(opt));
  opt.exec();
  return obj;
}
Program: 43390
Project: 43390
Buggy source:
public int update(Class<?> classOfT,Chain chain,Condition cnd){
  Entity<?> en=holder.getEntity(classOfT);
  return update(en.getTableName(),chain.updateBy(en),cnd);
}

Fixed version (ground truth):
public int update(Class<?> classOfT,Chain chain,Condition cnd){
  EntityOperator opt=_opt(classOfT);
  opt.addUpdate(chain,cnd);
  opt.exec();
  return opt.getUpdateCount();
}
Program: 43391
Project: 43391
Buggy source:
public int delete(Object obj){
  EntityOperator opt=__opt(obj);
  opt.addDeleteSelfOnly();
  opt.exec();
  return opt.getUpdateCount();
}

Fixed version (ground truth):
public int delete(Object obj){
  EntityOperator opt=_optBy(obj);
  opt.addDeleteSelfOnly();
  opt.exec();
  return opt.getUpdateCount();
}
Program: 43392
Project: 43392
Buggy source:
public int updateIgnoreNull(final Object obj){
  EntityOperator opt=__opt(obj);
  opt.addUpdateForIgnoreNull(opt.entity,obj,FieldFilter.get(opt.entity.getType()));
  opt.exec();
  return opt.getUpdateCount();
}

Fixed version (ground truth):
public int updateIgnoreNull(final Object obj){
  EntityOperator opt=_optBy(obj);
  opt.addUpdateForIgnoreNull(opt.entity,obj,FieldFilter.get(opt.entity.getType()));
  opt.exec();
  return opt.getUpdateCount();
}
Program: 43393
Project: 43393
Buggy source:
public int deleteLinks(Object obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitMany(obj,regex,doDelete(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByLinkedField(opt));
  opt.entity.visitManyMany(obj,regex,doDelete(opt));
  opt.entity.visitOne(obj,regex,doDelete(opt));
  return opt.exec().getUpdateCount();
}

Fixed version (ground truth):
public int deleteLinks(Object obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitMany(obj,regex,doDelete(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByLinkedField(opt));
  opt.entity.visitManyMany(obj,regex,doDelete(opt));
  opt.entity.visitOne(obj,regex,doDelete(opt));
  return opt.exec().getUpdateCount();
}
Program: 43394
Project: 43394
Buggy source:
public <T>T clearLinks(T obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitMany(obj,regex,doClear(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByHostField(opt));
  opt.entity.visitOne(obj,regex,doClear(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T clearLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitMany(obj,regex,doClear(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByHostField(opt));
  opt.entity.visitOne(obj,regex,doClear(opt));
  opt.exec();
  return obj;
}
Program: 43395
Project: 43395
Buggy source:
public <T>T updateLinks(T obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitOne(obj,regex,doUpdate(opt));
  opt.entity.visitMany(obj,regex,doUpdate(opt));
  opt.entity.visitManyMany(obj,regex,doUpdate(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T updateLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitOne(obj,regex,doUpdate(opt));
  opt.entity.visitMany(obj,regex,doUpdate(opt));
  opt.entity.visitManyMany(obj,regex,doUpdate(opt));
  opt.exec();
  return obj;
}
Program: 43396
Project: 43396
Buggy source:
public <T>T updateWith(T obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitOne(obj,regex,doUpdate(opt));
  opt.addUpdate();
  opt.entity.visitMany(obj,regex,doUpdate(opt));
  opt.entity.visitManyMany(obj,regex,doUpdate(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T updateWith(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitOne(obj,regex,doUpdate(opt));
  opt.addUpdate();
  opt.entity.visitMany(obj,regex,doUpdate(opt));
  opt.entity.visitManyMany(obj,regex,doUpdate(opt));
  opt.exec();
  return obj;
}
Program: 43397
Project: 43397
Buggy source:
public <T>T fetchLinks(T obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitMany(obj,regex,doFetch(opt));
  opt.entity.visitManyMany(obj,regex,doFetch(opt));
  opt.entity.visitOne(obj,regex,doFetch(opt));
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T fetchLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitMany(obj,regex,doFetch(opt));
  opt.entity.visitManyMany(obj,regex,doFetch(opt));
  opt.entity.visitOne(obj,regex,doFetch(opt));
  opt.exec();
  return obj;
}
Program: 43398
Project: 43398
Buggy source:
public <T>T fastInsert(T obj){
  EntityOperator opt=__opt(obj);
  opt.addInsertSelfOnly();
  opt.exec();
  return obj;
}

Fixed version (ground truth):
public <T>T fastInsert(T obj){
  EntityOperator opt=_optBy(obj);
  opt.addInsertSelfOnly();
  opt.exec();
  return obj;
}
Program: 43399
Project: 43399
Buggy source:
public int deleteWith(Object obj,String regex){
  EntityOperator opt=this.__opt(obj);
  opt.entity.visitMany(obj,regex,doDelete(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByLinkedField(opt));
  opt.entity.visitManyMany(obj,regex,doDelete(opt));
  opt.addDeleteSelfOnly();
  opt.entity.visitOne(obj,regex,doDelete(opt));
  return opt.exec().getUpdateCount();
}

Fixed version (ground truth):
public int deleteWith(Object obj,String regex){
  EntityOperator opt=this._optBy(obj);
  opt.entity.visitMany(obj,regex,doDelete(opt));
  opt.entity.visitManyMany(obj,regex,doClearRelationByLinkedField(opt));
  opt.entity.visitManyMany(obj,regex,doDelete(opt));
  opt.addDeleteSelfOnly();
  opt.entity.visitOne(obj,regex,doDelete(opt));
  return opt.exec().getUpdateCount();
}
Program: 43400
Project: 43400
Buggy source:
public Pojo append(PItem... itemAry){
  if (null != itemAry)   for (  PItem item : itemAry) {
    items.add(item);
    item.setPojo(this);
  }
  return this;
}

Fixed version (ground truth):
public Pojo append(PItem... itemAry){
  if (null != itemAry)   for (  PItem item : itemAry) {
    if (null != item) {
      items.add(item);
      item.setPojo(this);
    }
  }
  return this;
}
Program: 43401
Project: 43401
Buggy source:
public static PItem[] cnd(Condition cnd){
  List<PItem> list=new LinkedList<PItem>();
  if (null == cnd) {
  }
  if (cnd instanceof Criteria) {
    list.add((Criteria)cnd);
  }
 else {
    list.add(new ConditionPItem(cnd));
  }
  return list.toArray(new PItem[list.size()]);
}

Fixed version (ground truth):
public static PItem[] cnd(Condition cnd){
  List<PItem> list=new LinkedList<PItem>();
  if (null == cnd) {
  }
 else   if (cnd instanceof Criteria) {
    list.add((Criteria)cnd);
  }
 else {
    list.add(new ConditionPItem(cnd));
  }
  return list.toArray(new PItem[list.size()]);
}
Program: 43402
Project: 43402
Buggy source:
public void injectValue(Object obj,ResultSet rs){
  try {
    this.setValue(obj,adaptor.get(rs,columnName));
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public void injectValue(Object obj,ResultSet rs){
  try {
    this.setValue(obj,adaptor.get(rs,columnName));
  }
 catch (  SQLException e) {
  }
}
Program: 43403
Project: 43403
Buggy source:
@SuppressWarnings({"String_Node_Str"}) public void render(Object obj) throws IOException {
  if (null == obj) {
    writer.write("String_Node_Str");
  }
 else   if (obj instanceof Class) {
    string2Json(((Class<?>)obj).getName());
  }
 else   if (obj instanceof Mirror) {
    string2Json(((Mirror<?>)obj).getType().getName());
  }
 else {
    Mirror mr=Mirror.me(obj.getClass());
    if (mr.isEnum()) {
      string2Json(((Enum)obj).name());
    }
 else     if (mr.isNumber() || mr.isBoolean() || mr.isChar()) {
      writer.append(obj.toString());
    }
 else     if (mr.isStringLike()) {
      string2Json(obj.toString());
    }
 else     if (mr.isDateTimeLike()) {
      string2Json(format.getCastors().castToString(obj));
    }
 else     if (memo.containsKey(obj)) {
      writer.append("String_Node_Str");
    }
 else {
      memo.put(obj,null);
      if (obj instanceof Map)       map2Json((Map)obj);
 else       if (obj instanceof Collection)       coll2Json((Collection)obj);
 else       if (obj.getClass().isArray())       array2Json(obj);
 else {
        pojo2Json(obj);
      }
      memo.remove(obj);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) public void render(Object obj) throws IOException {
  if (null == obj) {
    writer.write("String_Node_Str");
  }
 else   if (obj instanceof Class) {
    string2Json(((Class<?>)obj).getName());
  }
 else   if (obj instanceof Mirror) {
    string2Json(((Mirror<?>)obj).getType().getName());
  }
 else {
    Mirror mr=Mirror.me(obj.getClass());
    if (mr.isEnum()) {
      string2Json(((Enum)obj).name());
    }
 else     if (mr.isNumber() || mr.isBoolean()) {
      writer.append(obj.toString());
    }
 else     if (mr.isStringLike() || mr.isChar()) {
      string2Json(obj.toString());
    }
 else     if (mr.isDateTimeLike()) {
      string2Json(format.getCastors().castToString(obj));
    }
 else     if (memo.containsKey(obj)) {
      writer.append("String_Node_Str");
    }
 else {
      memo.put(obj,null);
      if (obj instanceof Map)       map2Json((Map)obj);
 else       if (obj instanceof Collection)       coll2Json((Collection)obj);
 else       if (obj.getClass().isArray())       array2Json(obj);
 else {
        pojo2Json(obj);
      }
      memo.remove(obj);
    }
  }
}
Program: 43404
Project: 43404
Buggy source:
public ElValue isNEQ(ElValue ta){
  throw new ElException("String_Node_Str",getClass().getSimpleName(),"String_Node_Str");
}

Fixed version (ground truth):
public ElValue isNEQ(ElValue ta){
  if (obj != ta.get())   return El.TRUE;
  return El.FALSE;
}
Program: 43405
Project: 43405
Buggy source:
public ElValue isEquals(ElValue ta){
  throw new ElException("String_Node_Str",getClass().getSimpleName(),"String_Node_Str");
}

Fixed version (ground truth):
public ElValue isEquals(ElValue ta){
  if (obj == ta.get())   return El.TRUE;
  return El.FALSE;
}
Program: 43406
Project: 43406
Buggy source:
@SuppressWarnings("String_Node_Str") public OptSymbolLoader(){
  root=new OptNode();
  List<Class<?>> optTypes=Scans.me().scanPackage(AbstractOperator.class);
  for (  Class<?> optType : optTypes) {
    if (!Modifier.isAbstract(optType.getModifiers()) && ElOperator.class.isAssignableFrom(optType) && null == optType.getAnnotation(OptHidden.class)) {
      Class<? extends ElOperator> theType=(Class<? extends ElOperator>)optType;
      ElOperator optObj=El.opt(theType);
      char[] cs=optObj.getString().toCharArray();
      OptNode on=root;
      for (      char c : cs) {
        on=on.addNode(c);
      }
      if (on.getOperator() != null) {
        throw Lang.makeThrow("String_Node_Str",on.getOperator().getClass().getName(),optType.getName());
      }
      on.setOperator(optObj);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public OptSymbolLoader(){
  root=new OptNode();
  if (optTypes.size() == 0) {
synchronized (optTypes) {
      if (optTypes.size() == 0) {
        List<Class<?>> optTypes=Scans.me().scanPackage(AbstractOperator.class);
        for (        Class<?> optType : optTypes) {
          if (!Modifier.isAbstract(optType.getModifiers()) && ElOperator.class.isAssignableFrom(optType) && null == optType.getAnnotation(OptHidden.class)) {
            OptSymbolLoader.optTypes.add(optType);
          }
        }
      }
    }
  }
  for (  Class<?> optType : optTypes) {
    Class<? extends ElOperator> theType=(Class<? extends ElOperator>)optType;
    ElOperator optObj=El.opt(theType);
    char[] cs=optObj.getString().toCharArray();
    OptNode on=root;
    for (    char c : cs) {
      on=on.addNode(c);
    }
    if (on.getOperator() != null) {
      throw Lang.makeThrow("String_Node_Str",on.getOperator().getClass().getName(),optType.getName());
    }
    on.setOperator(optObj);
  }
}
Program: 43407
Project: 43407
Buggy source:
@SuppressWarnings("String_Node_Str") private <T>T parseArray(Mirror<T> me,ParameterizedType type) throws Exception {
  Type tt=null;
  boolean reurnAsList=true;
  List list=null;
  if (null == me) {
    list=new LinkedList();
  }
 else   if (me.getType().isArray()) {
    list=new LinkedList();
    reurnAsList=false;
    tt=me.getType().getComponentType();
  }
 else   if (List.class.isAssignableFrom(me.getType())) {
    reurnAsList=true;
    if (me.is(List.class))     list=new LinkedList();
 else     list=(List)me.born();
    tt=type.getActualTypeArguments()[0];
  }
 else {
    throw makeError(String.format("String_Node_Str",me.getType().getName()));
  }
  nextChar();
  skipCommentsAndBlank();
  while (cursor != -1 && cursor != ']') {
    Object o=parseFromCurrentLocation(tt);
    list.add(o);
    skipCommentsAndBlank();
    if (cursor == ']')     break;
    if (cursor != ',')     throw makeError("String_Node_Str");
    nextChar();
    skipCommentsAndBlank();
  }
  nextChar();
  if (reurnAsList)   return (T)list;
  Object ary=Array.newInstance((Class<?>)tt,list.size());
  int i=0;
  for (Iterator it=list.iterator(); it.hasNext(); )   Array.set(ary,i++,Castors.me().castTo(it.next(),(Class<?>)tt));
  return (T)ary;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T>T parseArray(Mirror<T> me,ParameterizedType type) throws Exception {
  Type tt=null;
  boolean reurnAsList=true;
  List list=null;
  if (null == me) {
    list=new LinkedList();
  }
 else   if (me.getType().isArray()) {
    list=new LinkedList();
    reurnAsList=false;
    tt=me.getType().getComponentType();
  }
 else   if (List.class.isAssignableFrom(me.getType())) {
    reurnAsList=true;
    if (me.is(List.class))     list=new LinkedList();
 else     list=(List)me.born();
    if (type != null && type.getActualTypeArguments() != null)     tt=type.getActualTypeArguments()[0];
  }
 else {
    throw makeError(String.format("String_Node_Str",me.getType().getName()));
  }
  nextChar();
  skipCommentsAndBlank();
  while (cursor != -1 && cursor != ']') {
    Object o=parseFromCurrentLocation(tt);
    list.add(o);
    skipCommentsAndBlank();
    if (cursor == ']')     break;
    if (cursor != ',')     throw makeError("String_Node_Str");
    nextChar();
    skipCommentsAndBlank();
  }
  nextChar();
  if (reurnAsList)   return (T)list;
  Object ary=Array.newInstance((Class<?>)tt,list.size());
  int i=0;
  for (Iterator it=list.iterator(); it.hasNext(); )   Array.set(ary,i++,Castors.me().castTo(it.next(),(Class<?>)tt));
  return (T)ary;
}
Program: 43408
Project: 43408
Buggy source:
public void rollback() throws SQLException {
  if (null == sp)   conn.rollback();
 else   conn.rollback(sp);
}

Fixed version (ground truth):
public void rollback() throws SQLException {
  if (null != sp)   conn.rollback(sp);
}
Program: 43410
Project: 43410
Buggy source:
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  int i=0;
  for (; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  Class<?>[] argTypes=method.getParameterTypes();
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,req,resp,null);
    if (args[i] == null && argTypes[i].isPrimitive()) {
      args[i]=Lang.getPrimitiveDefaultValue(argTypes[i]);
    }
  }
  return args;
}

Fixed version (ground truth):
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  int i=0;
  for (; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  Class<?>[] argTypes=method.getParameterTypes();
  Object obj=getReferObject(sc,req,resp,pathArgs);
  for (; i < injs.length; i++) {
    System.out.println("String_Node_Str" + i + "String_Node_Str"+ injs[i].getClass());
    args[i]=injs[i].get(sc,req,resp,obj);
    if (args[i] == null && argTypes[i].isPrimitive()) {
      args[i]=Lang.getPrimitiveDefaultValue(argTypes[i]);
    }
  }
  return args;
}
Program: 43411
Project: 43411
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 (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 ObjectPairInjector(null,type);
  }
 else   if (paramName.startsWith("String_Node_Str") && paramName.length() > 2) {
    return new ObjectPairInjector(null,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 super.evalInjector(type,param);
  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);
  return super.evalInjector(type,param);
}
Program: 43412
Project: 43412
Buggy source:
@Test public void test_base(){
  resp=get("String_Node_Str");
  assertNotNull(resp);
  assertEquals(200,resp.getStatus());
  assertEquals(getContextPath(),resp.getContent());
}

Fixed version (ground truth):
@Test public void test_base(){
  get("String_Node_Str");
  assertNotNull(resp);
  assertEquals(200,resp.getStatus());
  assertEquals(getContextPath(),resp.getContent());
}
Program: 43413
Project: 43413
Buggy source:
public Response post(String path,Map<String,Object> params){
  resp=Sender.create(Request.create("String_Node_Str" + getContextPath() + path,METHOD.POST,params,null)).send();
  assertNotNull(resp);
  return resp;
}

Fixed version (ground truth):
public Response post(String path,Map<String,Object> params){
  resp=Sender.create(Request.create(getBaseURL() + path,METHOD.POST,params,null)).send();
  assertNotNull(resp);
  return resp;
}
Program: 43414
Project: 43414
Buggy source:
public Response get(String path){
  resp=Http.get("String_Node_Str" + getContextPath() + path);
  assertNotNull(resp);
  return resp;
}

Fixed version (ground truth):
public Response get(String path){
  resp=Http.get(getBaseURL() + path);
  assertNotNull(resp);
  return resp;
}
Program: 43415
Project: 43415
Buggy source:
protected void parseArgs(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList argsNodeList=beanElement.getElementsByTagName(TAG_ARGS);
  if (argsNodeList.getLength() > 0) {
    Element argsElement=(Element)argsNodeList.item(0);
    NodeList argNodeList=argsElement.getChildNodes();
    for (int i=0; i < argNodeList.getLength(); i++) {
      if (argNodeList.item(i) instanceof Element)       iocObject.addArg(parseX((Element)argNodeList.item(i)));
    }
  }
}

Fixed version (ground truth):
protected void parseArgs(Element beanElement,IocObject iocObject) throws Throwable {
  List<Element> list=getChildNodesByTagName(beanElement,TAG_ARGS);
  if (list.size() > 0) {
    Element argsElement=list.get(0);
    NodeList argNodeList=argsElement.getChildNodes();
    for (int i=0; i < argNodeList.getLength(); i++) {
      if (argNodeList.item(i) instanceof Element)       iocObject.addArg(parseX((Element)argNodeList.item(i)));
    }
  }
}
Program: 43416
Project: 43416
Buggy source:
protected void parseEvents(Element beanElement,IocObject iocObject){
  NodeList eventsNodeList=beanElement.getElementsByTagName("String_Node_Str");
  if (eventsNodeList.getLength() > 0) {
    Element eventsElement=(Element)eventsNodeList.item(0);
    IocEventSet iocEventSet=new IocEventSet();
    NodeList fetchNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (fetchNodeList.getLength() > 0)     iocEventSet.setFetch(((Element)fetchNodeList.item(0)).getTextContent());
    NodeList createNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (createNodeList.getLength() > 0)     iocEventSet.setCreate(((Element)createNodeList.item(0)).getTextContent());
    NodeList deposeNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (deposeNodeList.getLength() > 0)     iocEventSet.setDepose(((Element)deposeNodeList.item(0)).getTextContent());
    if (iocEventSet.getCreate() == null)     if (iocEventSet.getDepose() == null)     if (iocEventSet.getFetch() == null)     return;
    iocObject.setEvents(iocEventSet);
  }
}

Fixed version (ground truth):
protected void parseEvents(Element beanElement,IocObject iocObject){
  List<Element> elist=getChildNodesByTagName(beanElement,"String_Node_Str");
  if (elist.size() > 0) {
    Element eventsElement=elist.get(0);
    IocEventSet iocEventSet=new IocEventSet();
    elist=getChildNodesByTagName(eventsElement,"String_Node_Str");
    if (elist.size() > 0)     iocEventSet.setFetch(elist.get(0).getTextContent());
    elist=getChildNodesByTagName(eventsElement,"String_Node_Str");
    if (elist.size() > 0)     iocEventSet.setCreate(elist.get(0).getTextContent());
    elist=getChildNodesByTagName(eventsElement,"String_Node_Str");
    if (elist.size() > 0)     iocEventSet.setDepose(elist.get(0).getTextContent());
    if (iocEventSet.getCreate() == null)     if (iocEventSet.getDepose() == null)     if (iocEventSet.getFetch() == null)     return;
    iocObject.setEvents(iocEventSet);
  }
}
Program: 43417
Project: 43417
Buggy source:
protected Map<String,?> paserMap(Element element){
  Map<String,Object> map=new HashMap<String,Object>();
  if (element.hasChildNodes()) {
    NodeList nodeList=element.getElementsByTagName(ITEM_TAG);
    for (int i=0; i < nodeList.getLength(); i++) {
      if (nodeList.item(i) instanceof Element) {
        Element elementItem=(Element)nodeList.item(i);
        String key=elementItem.getAttribute("String_Node_Str");
        if (map.containsKey(key))         throw new IllegalArgumentException("String_Node_Str");
        NodeList list=elementItem.getChildNodes();
        for (int j=0; j < list.getLength(); j++) {
          if (list.item(j) instanceof Element) {
            map.put(key,list.item(j).getTextContent());
            break;
          }
        }
        if (!map.containsKey(key))         map.put(key,null);
      }
    }
  }
  return map;
}

Fixed version (ground truth):
protected Map<String,?> paserMap(Element element) throws Throwable {
  Map<String,Object> map=new HashMap<String,Object>();
  if (element.hasChildNodes()) {
    List<Element> elist=getChildNodesByTagName(element,ITEM_TAG);
    for (    Element elementItem : elist) {
      String key=elementItem.getAttribute("String_Node_Str");
      if (map.containsKey(key))       throw new IllegalArgumentException("String_Node_Str");
      NodeList list=elementItem.getChildNodes();
      for (int j=0; j < list.getLength(); j++) {
        if (list.item(j) instanceof Element) {
          map.put(key,parseX((Element)list.item(j)));
          break;
        }
      }
      if (!map.containsKey(key))       map.put(key,null);
    }
  }
  return map;
}
Program: 43418
Project: 43418
Buggy source:
protected void parseFields(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList fieldNodeList=beanElement.getElementsByTagName(TAG_FIELD);
  if (fieldNodeList.getLength() > 0) {
    int len=fieldNodeList.getLength();
    for (int i=0; i < len; i++) {
      Element fieldElement=(Element)fieldNodeList.item(i);
      IocField iocField=new IocField();
      iocField.setName(fieldElement.getAttribute("String_Node_Str"));
      if (fieldElement.hasChildNodes()) {
        NodeList nodeList=fieldElement.getChildNodes();
        for (int j=0; j < nodeList.getLength(); j++) {
          if (nodeList.item(j) instanceof Element) {
            iocField.setValue(parseX((Element)nodeList.item(j)));
            break;
          }
        }
      }
      iocObject.addField(iocField);
    }
  }
}

Fixed version (ground truth):
protected void parseFields(Element beanElement,IocObject iocObject) throws Throwable {
  List<Element> list=getChildNodesByTagName(beanElement,TAG_FIELD);
  for (  Element fieldElement : list) {
    IocField iocField=new IocField();
    iocField.setName(fieldElement.getAttribute("String_Node_Str"));
    if (fieldElement.hasChildNodes()) {
      NodeList nodeList=fieldElement.getChildNodes();
      for (int j=0; j < nodeList.getLength(); j++) {
        if (nodeList.item(j) instanceof Element) {
          iocField.setValue(parseX((Element)nodeList.item(j)));
          break;
        }
      }
    }
    iocObject.addField(iocField);
  }
}
Program: 43419
Project: 43419
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj instanceof Pair<?>)   if (Strings.equals(((Pair<?>)obj).name,name))   Lang.equals(((Pair<?>)obj).value,value);
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj instanceof Pair<?>)   if (Strings.equals(((Pair<?>)obj).name,name))   return Lang.equals(((Pair<?>)obj).value,value);
  return false;
}
Program: 43420
Project: 43420
Buggy source:
public static Pair<String> create(String s){
  String[] ss=Strings.splitIgnoreBlank(s,"String_Node_Str");
  String name=null;
  String value=null;
  String pattern=PTN_3;
  if (null != ss)   if (ss.length == 1) {
    name=ss[0];
  }
 else   if (ss.length == 2) {
    name=ss[0];
    if (ss[1].length() > 0) {
      if (ss[1].charAt(0) == '"') {
        value=ss[1].substring(1,ss[1].length() - 2);
        pattern=PTN_3;
      }
 else       if (ss[1].charAt(0) == '\'') {
        value=ss[1].substring(1,ss[1].length() - 2);
        pattern=PTN_2;
      }
 else {
        value=ss[1];
        pattern=PTN_1;
      }
    }
  }
  Pair<String> re=new Pair<String>(name,value);
  re.pattern=pattern;
  return re;
}

Fixed version (ground truth):
public static Pair<String> create(String s){
  String[] ss=Strings.splitIgnoreBlank(s,"String_Node_Str");
  String name=null;
  String value=null;
  String pattern=PTN_3;
  if (null != ss)   if (ss.length == 1) {
    name=ss[0];
  }
 else   if (ss.length == 2) {
    name=ss[0];
    if (ss[1].length() > 0) {
      if (ss[1].charAt(0) == '"') {
        value=ss[1].substring(1,ss[1].length() - 1);
        pattern=PTN_3;
      }
 else       if (ss[1].charAt(0) == '\'') {
        value=ss[1].substring(1,ss[1].length() - 1);
        pattern=PTN_2;
      }
 else {
        value=ss[1];
        pattern=PTN_1;
      }
    }
  }
  Pair<String> re=new Pair<String>(name,value);
  re.pattern=pattern;
  return re;
}
Program: 43421
Project: 43421
Buggy source:
public Sql insert(Entity<?> en,Object obj){
  StringBuilder fields=new StringBuilder();
  StringBuilder values=new StringBuilder();
  FieldMatcher fm=FieldFilter.get(en.getType());
  Map<String,Object> map=new HashMap<String,Object>();
  for (Iterator<EntityField> it=en.fields().iterator(); it.hasNext(); ) {
    EntityField ef=it.next();
    String fn=ef.getName();
    if (ef.isSerial() || ef.isReadonly())     continue;
    Object value=ef.getValue(obj);
    if (null != fm) {
      if (fm.isIgnoreNull() && null == value)       continue;
 else       if (!fm.match(fn))       continue;
    }
 else     if (null == value) {
      if (ef.hasDefaultValue())       value=ef.getDefaultValue(obj);
 else       continue;
    }
    fields.append(',').append(ef.getColumnName());
    values.append("String_Node_Str").append(fn);
    map.put(fn,value);
  }
  fields.deleteCharAt(0);
  values.deleteCharAt(0);
  Sql sql=Sqls.create(format("String_Node_Str",en.getTableName(),fields,values)).setEntity(en);
  sql.params().putAll(map);
  return sql;
}

Fixed version (ground truth):
public Sql insert(Entity<?> en,Object obj){
  StringBuilder fields=new StringBuilder();
  StringBuilder values=new StringBuilder();
  FieldMatcher fm=FieldFilter.get(en.getType());
  Map<String,Object> map=new HashMap<String,Object>();
  for (Iterator<EntityField> it=en.fields().iterator(); it.hasNext(); ) {
    EntityField ef=it.next();
    String fn=ef.getName();
    if (ef.isSerial() || ef.isReadonly())     continue;
    Object value=ef.getValue(obj);
    if (null != fm) {
      if (fm.isIgnoreNull() && null == value)       continue;
 else       if (!fm.match(fn))       continue;
    }
 else     if (null == value) {
      if (ef.hasDefaultValue())       value=ef.getDefaultValue(obj);
 else       continue;
    }
    fields.append(',').append(ef.getColumnName());
    values.append("String_Node_Str").append(fn);
    map.put(fn,value);
  }
  if (fields.length() == 0)   throw Lang.makeThrow(DaoException.class,"String_Node_Str",en.getTableName());
  fields.deleteCharAt(0);
  values.deleteCharAt(0);
  Sql sql=Sqls.create(format("String_Node_Str",en.getTableName(),fields,values)).setEntity(en);
  sql.params().putAll(map);
  return sql;
}