nus-yam/ex-repair huggingface dataset:
Program: 80570
Project: 80570
Buggy source:
public AtMap add(String key,String actionPath){
  if (actionPath.endsWith("String_Node_Str"))   actionPath=actionPath.substring(0,actionPath.length() - 2);
  ats.put(Strings.trim(key),Strings.trim(actionPath));
  return this;
}

Fixed version (ground truth):
public void add(String key,String actionPath){
  if (actionPath.endsWith("String_Node_Str"))   actionPath=actionPath.substring(0,actionPath.length() - 2);
  ats.put(Strings.trim(key),Strings.trim(actionPath));
}
Program: 80572
Project: 80572
Buggy source:
public int deleteLinks(Object obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return 0;
  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,final String regex){
  if (null == obj)   return 0;
  final int[] re=new int[1];
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitMany(ele,regex,doDelete(opt));
      opt.entity.visitManyMany(ele,regex,doClearRelationByLinkedField(opt));
      opt.entity.visitManyMany(ele,regex,doDelete(opt));
      opt.entity.visitOne(ele,regex,doDelete(opt));
      re[0]+=opt.exec().getUpdateCount();
    }
  }
);
  return re[0];
}
Program: 80573
Project: 80573
Buggy source:
public <T>T clearLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return null;
  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,final String regex){
  if (null == obj)   return null;
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitMany(ele,regex,doClear(opt));
      opt.entity.visitManyMany(ele,regex,doClearRelationByHostField(opt));
      opt.entity.visitOne(ele,regex,doClear(opt));
      opt.exec();
    }
  }
);
  return obj;
}
Program: 80574
Project: 80574
Buggy source:
public <T>T updateLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return null;
  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,final String regex){
  if (null == obj)   return null;
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitOne(ele,regex,doUpdate(opt));
      opt.entity.visitMany(ele,regex,doUpdate(opt));
      opt.entity.visitManyMany(ele,regex,doUpdate(opt));
      opt.exec();
    }
  }
);
  return obj;
}
Program: 80575
Project: 80575
Buggy source:
public <T>T updateWith(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return null;
  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,final String regex){
  if (null == obj)   return null;
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitOne(ele,regex,doUpdate(opt));
      opt.addUpdate();
      opt.entity.visitMany(ele,regex,doUpdate(opt));
      opt.entity.visitManyMany(ele,regex,doUpdate(opt));
      opt.exec();
    }
  }
);
  return obj;
}
Program: 80576
Project: 80576
Buggy source:
public <T>T fetchLinks(T obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return null;
  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,final String regex){
  if (null == obj)   return null;
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitMany(ele,regex,doFetch(opt));
      opt.entity.visitManyMany(ele,regex,doFetch(opt));
      opt.entity.visitOne(ele,regex,doFetch(opt));
      opt.exec();
    }
  }
);
  return obj;
}
Program: 80577
Project: 80577
Buggy source:
public int deleteWith(Object obj,String regex){
  EntityOperator opt=this._optBy(obj);
  if (null == opt)   return 0;
  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,final String regex){
  if (null == obj)   return 0;
  final int[] re=new int[1];
  Lang.each(obj,new Each<Object>(){
    public void invoke(    int index,    Object ele,    int length) throws ExitLoop, ContinueLoop, LoopException {
      EntityOperator opt=_optBy(ele);
      if (null == opt)       return;
      opt.entity.visitMany(ele,regex,doDelete(opt));
      opt.entity.visitManyMany(ele,regex,doClearRelationByLinkedField(opt));
      opt.entity.visitManyMany(ele,regex,doDelete(opt));
      opt.addDeleteSelfOnly();
      opt.entity.visitOne(ele,regex,doDelete(opt));
      re[0]+=opt.exec().getUpdateCount();
    }
  }
);
  return re[0];
}
Program: 80578
Project: 80578
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);
switch (meta.getColumnType(i)) {
case Types.TIMESTAMP:
{
          re.set(name,re.getTimestamp(name));
          break;
        }
case Types.CLOB:
{
        re.set(name,rs.getString(i));
        break;
      }
default :
    re.set(name,rs.getObject(i));
  break;
}
re.setSqlType(name,meta.getColumnType(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);
switch (meta.getColumnType(i)) {
case Types.TIMESTAMP:
{
          re.set(name,rs.getTimestamp(name));
          break;
        }
case Types.CLOB:
{
        re.set(name,rs.getString(i));
        break;
      }
default :
    re.set(name,rs.getObject(i));
  break;
}
re.setSqlType(name,meta.getColumnType(i));
}
return re;
}
 catch (SQLException e) {
throw Lang.wrapThrow(e);
}
}
Program: 80579
Project: 80579
Buggy source:
public static Condition format(String format,Object... args){
  return new SimpleCondition(format,args);
}

Fixed version (ground truth):
public static Condition format(String format,Object... args){
  return Strings.isBlank(format) ? null : new SimpleCondition(format,args);
}
Program: 80580
Project: 80580
Buggy source:
public static Condition wrap(String sql,Object value){
  return new SimpleCondition(new CharSegment(sql).setBy(value));
}

Fixed version (ground truth):
public static Condition wrap(String sql,Object value){
  return Strings.isBlank(sql) ? null : new SimpleCondition(new CharSegment(sql).setBy(value));
}
Program: 80581
Project: 80581
Buggy source:
@Override public Object getValue(Object obj){
  Object value=super.getValue(obj);
  System.out.println("String_Node_Str" + value);
  if (value == null)   return getDefaultValue(obj);
  return value;
}

Fixed version (ground truth):
@Override public Object getValue(Object obj){
  Object value=super.getValue(obj);
  if (value == null)   return getDefaultValue(obj);
  return value;
}
Program: 80582
Project: 80582
Buggy source:
@Test public void fetch_record(){
  Record re=dao.fetch("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  Pet pet=re.toPojo(Pet.class);
  assertEquals(5,re.getColumnCount());
  assertEquals(4,pet.getId());
  assertEquals("String_Node_Str",pet.getName());
}

Fixed version (ground truth):
@Test public void fetch_record(){
  Record re=dao.fetch("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  Pet pet=re.toPojo(Pet.class);
  assertEquals(6,re.getColumnCount());
  assertEquals(4,pet.getId());
  assertEquals("String_Node_Str",pet.getName());
}
Program: 80583
Project: 80583
Buggy source:
@Override protected String evalFieldType(MappingField mf){
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0)     return "String_Node_Str";
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
 else   if (mf.getColumnType() == ColType.BOOLEAN)   return "String_Node_Str";
  return super.evalFieldType(mf);
}

Fixed version (ground truth):
@Override protected String evalFieldType(MappingField mf){
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0)     return "String_Node_Str";
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
  return super.evalFieldType(mf);
}
Program: 80584
Project: 80584
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>Mirror<T> getMirror(Class<T> type,String name){
  if (MethodInterceptor.class.isAssignableFrom(type) || type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX) || AopConfigration.IOCNAME.equals(name)|| AopConfigration.class.isAssignableFrom(type))   return Mirror.me(type);
  try {
    return (Mirror<T>)Mirror.me(cd.load(type.getName() + ClassAgent.CLASSNAME_SUFFIX));
  }
 catch (  ClassNotFoundException e) {
  }
  if (aopConfigration == null)   if (ioc.has(AopConfigration.IOCNAME))   aopConfigration=ioc.get(AopConfigration.class,AopConfigration.IOCNAME);
 else   aopConfigration=new AnnotationAopConfigration();
  List<InterceptorPair> interceptorPairs=aopConfigration.getInterceptorPairList(ioc,type);
  if (interceptorPairs == null || interceptorPairs.size() < 1)   return Mirror.me(type);
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  return Mirror.me(agent.define(cd,type));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>Mirror<T> getMirror(Class<T> type,String name){
  if (MethodInterceptor.class.isAssignableFrom(type) || type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX) || AopConfigration.IOCNAME.equals(name)|| AopConfigration.class.isAssignableFrom(type)) {
    return Mirror.me(type);
  }
  try {
    return (Mirror<T>)Mirror.me(cd.load(type.getName() + ClassAgent.CLASSNAME_SUFFIX));
  }
 catch (  ClassNotFoundException e) {
  }
  if (aopConfigration == null)   if (ioc.has(AopConfigration.IOCNAME))   aopConfigration=ioc.get(AopConfigration.class,AopConfigration.IOCNAME);
 else   aopConfigration=new AnnotationAopConfigration();
  List<InterceptorPair> interceptorPairs=aopConfigration.getInterceptorPairList(ioc,type);
  if (interceptorPairs == null || interceptorPairs.size() < 1) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",type);
    return Mirror.me(type);
  }
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  return Mirror.me(agent.define(cd,type));
}
Program: 80585
Project: 80585
Buggy source:
public String getDefaultValue(Object obj){
  if (null == defaultValue)   return null;
  String re;
  if (null == obj)   re=defaultValue.toString();
 else   re=defaultValue.render(new EntityObjectContext(getEntity(),obj)).toString();
  return re.replace("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public String getDefaultValue(Object obj){
  if (null == defaultValue)   return null;
  String re;
  if (null == obj || defaultValue.keyCount() == 0)   re=defaultValue.toString();
 else   re=defaultValue.render(new EntityObjectContext(getEntity(),obj)).toString();
  return re;
}
Program: 80586
Project: 80586
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isNotNull() || mf.isPk())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.isPk() && en.getPks().size() == 1) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(',');
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  if (en.getPks().size() > 1) {
    sb=new StringBuilder();
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append("String_Node_Str").append(mf.getColumnName());
    }
    sb.append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append(mf.getColumnName()).append("String_Node_Str");
    }
    sb.setCharAt(sb.length() - 1,')');
    dao.execute(Sqls.create(sb.toString()));
  }
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isNotNull() || mf.isPk())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.isPk() && en.getPks().size() == 1) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(',');
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  if (en.getPks().size() > 1) {
    sb=new StringBuilder();
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append("String_Node_Str").append(mf.getColumnName());
    }
    sb.append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append(mf.getColumnName()).append("String_Node_Str");
    }
    sb.setCharAt(sb.length() - 1,')');
    dao.execute(Sqls.create(sb.toString()));
  }
  createRelation(dao,en);
  return true;
}
Program: 80587
Project: 80587
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
 else       if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
 else       if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80588
Project: 80588
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  if (en.hasMeta(META_ENGINE)) {
    sb.append("String_Node_Str" + en.getMeta(META_ENGINE));
  }
  if (en.hasMeta(META_CHARSET)) {
    sb.append("String_Node_Str" + en.getMeta(META_CHARSET));
  }
 else {
    sb.append("String_Node_Str");
  }
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  if (en.hasMeta(META_ENGINE)) {
    sb.append("String_Node_Str" + en.getMeta(META_ENGINE));
  }
  if (en.hasMeta(META_CHARSET)) {
    sb.append("String_Node_Str" + en.getMeta(META_CHARSET));
  }
 else {
    sb.append("String_Node_Str");
  }
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80590
Project: 80590
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    if (mf.isId() && mf.isAutoIncreasement()) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(' ').append(evalFieldType(mf));
      if (mf.isName() && en.getPkType() != PkType.NAME) {
        sb.append("String_Node_Str");
      }
 else {
        if (mf.isUnsigned())         sb.append("String_Node_Str");
        if (mf.isNotNull())         sb.append("String_Node_Str");
        if (mf.isAutoIncreasement())         throw Lang.noImplement();
        if (mf.hasDefaultValue())         sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
      }
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append(String.format("String_Node_Str",en.getTableName()));
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    if (mf.isId() && mf.isAutoIncreasement()) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append(' ').append(evalFieldType(mf));
      if (mf.isName() && en.getPkType() != PkType.NAME) {
        sb.append("String_Node_Str");
      }
 else {
        if (mf.isUnsigned())         sb.append("String_Node_Str");
        if (mf.isNotNull())         sb.append("String_Node_Str");
        if (mf.isAutoIncreasement())         throw Lang.noImplement();
        if (mf.hasDefaultValue())         sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
      }
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append(String.format("String_Node_Str",en.getTableName()));
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80591
Project: 80591
Buggy source:
@Override public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  if (en.getPks().size() > 1 && en.getPkType() == PkType.ID) {
    return false;
  }
  boolean mPks=en.getPks().size() > 1;
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    if (mf.isId() && en.getPkType() == PkType.ID) {
      sb.append("String_Node_Str");
      continue;
    }
 else     sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isPk() && !mPks) {
        sb.append("String_Node_Str");
      }
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (mPks) {
    sb.append('\n');
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
@Override public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  if (en.getPks().size() > 1 && en.getPkType() == PkType.ID) {
    return false;
  }
  boolean mPks=en.getPks().size() > 1;
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    if (mf.isId() && en.getPkType() == PkType.ID) {
      sb.append("String_Node_Str");
      continue;
    }
 else     sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isPk() && !mPks) {
        sb.append("String_Node_Str");
      }
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (mPks) {
    sb.append('\n');
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80592
Project: 80592
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(mf.getDefaultValue(null)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isUnsigned())       sb.append("String_Node_Str");
      if (mf.isNotNull())       sb.append("String_Node_Str");
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
    }
    sb.append(',');
  }
  List<MappingField> pks=en.getPks();
  if (!pks.isEmpty()) {
    sb.append('\n');
    sb.append("String_Node_Str");
    for (    MappingField pk : pks) {
      sb.append(pk.getColumnName()).append(',');
    }
    sb.setCharAt(sb.length() - 1,')');
    sb.append("String_Node_Str");
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80593
Project: 80593
Buggy source:
@Override protected String evalFieldType(MappingField mf){
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0)     return "String_Node_Str";
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
  return super.evalFieldType(mf);
}

Fixed version (ground truth):
@Override protected String evalFieldType(MappingField mf){
  if (mf.getColumnType() == ColType.INT) {
    int width=mf.getWidth();
    if (width <= 0)     return "String_Node_Str";
 else     if (width <= 4) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
 else     if (width <= 8) {
      return "String_Node_Str" + (width * 4) + "String_Node_Str";
    }
    return "String_Node_Str" + (width * 4) + "String_Node_Str";
  }
 else   if (mf.getColumnType() == ColType.BOOLEAN)   return "String_Node_Str";
  return super.evalFieldType(mf);
}
Program: 80594
Project: 80594
Buggy source:
public void setData(String data){
  this.data=data.getBytes(Encoding.CHARSET_UTF8);
}

Fixed version (ground truth):
public void setData(String data){
  try {
    this.data=data.getBytes(Encoding.UTF8);
  }
 catch (  UnsupportedEncodingException e) {
  }
}
Program: 80595
Project: 80595
Buggy source:
public InputStream getInputStream(){
  if (null == data) {
    StringBuilder sb=new StringBuilder();
    for (    String key : params.keySet()) {
      sb.append(key).append('=').append(params.get(key)).append('&');
    }
    sb.setCharAt(sb.length() - 1,'\n');
    byte[] bytes=sb.toString().getBytes(Encoding.CHARSET_UTF8);
    return new ByteInputStream(bytes);
  }
  return null == data ? null : new ByteInputStream(data);
}

Fixed version (ground truth):
public InputStream getInputStream(){
  if (null == data) {
    StringBuilder sb=new StringBuilder();
    for (    String key : params.keySet()) {
      sb.append(key).append('=').append(params.get(key)).append('&');
    }
    sb.setCharAt(sb.length() - 1,'\n');
    byte[] bytes=null;
    try {
      bytes=sb.toString().getBytes(Encoding.UTF8);
    }
 catch (    UnsupportedEncodingException e) {
    }
    return new ByteInputStream(bytes);
  }
  return null == data ? null : new ByteInputStream(data);
}
Program: 80596
Project: 80596
Buggy source:
/** 
 * 整合两个整数数组为一个数组
 * @param ary 整数数组
 * @param is 变参
 * @return 新的整合过的数组
 */
public static int[] join(int[] ary,int... is){
  if (null == ary)   return is;
  int[] re=Arrays.copyOf(ary,ary.length + is.length);
  int i=ary.length;
  for (  int num : is)   re[i++]=num;
  return re;
}

Fixed version (ground truth):
/** 
 * 整合两个整数数组为一个数组 <b>这个方法在JDK5不可用!!<b/>
 * @param ary 整数数组
 * @param is 变参
 * @return 新的整合过的数组
 */
public static int[] join(int[] ary,int... is){
  if (null == ary)   return is;
  int[] re=Arrays.copyOf(ary,ary.length + is.length);
  int i=ary.length;
  for (  int num : is)   re[i++]=num;
  return re;
}
Program: 80597
Project: 80597
Buggy source:
public void write(String str){
  if (!atom.socket.isClosed())   try {
    atom.ops.write(str.getBytes(Encoding.CHARSET_UTF8));
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public void write(String str){
  if (!atom.socket.isClosed())   try {
    atom.ops.write(str.getBytes(Encoding.UTF8));
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80598
Project: 80598
Buggy source:
@Test public void test_pathargs(){
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
}

Fixed version (ground truth):
@Test public void test_pathargs(){
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
  get("String_Node_Str");
  assertEquals("String_Node_Str",resp.getContent());
}
Program: 80600
Project: 80600
Buggy source:
/** 
 * 转换成操作树
 */
private Deque<Object> OperatorTree(Queue<Object> rpn){
  Deque<Object> operand=new LinkedList<Object>();
  while (!rpn.isEmpty()) {
    if (rpn.peek() instanceof Operator) {
      Operator opt=(Operator)rpn.poll();
      opt.wrap(operand);
      operand.addFirst(opt);
      continue;
    }
    if (rpn.peek() instanceof IdentifierObj) {
      ((IdentifierObj)rpn.peek()).setEc(ec);
    }
    operand.addFirst(rpn.poll());
  }
  return operand;
}

Fixed version (ground truth):
/** 
 * 转换成操作树
 */
private LinkedList<Object> OperatorTree(Queue<Object> rpn){
  LinkedList<Object> operand=new LinkedList<Object>();
  while (!rpn.isEmpty()) {
    if (rpn.peek() instanceof Operator) {
      Operator opt=(Operator)rpn.poll();
      opt.wrap(operand);
      operand.addFirst(opt);
      continue;
    }
    if (rpn.peek() instanceof IdentifierObj) {
      ((IdentifierObj)rpn.peek()).setEc(ec);
    }
    operand.addFirst(rpn.poll());
  }
  return operand;
}
Program: 80601
Project: 80601
Buggy source:
/** 
 * 计算
 */
private Object calculate(Deque<Object> el2){
  if (el2.peek() instanceof Operator) {
    Operator obj=(Operator)el2.peek();
    return obj.calculate();
  }
  if (el2.peek() instanceof IdentifierObj) {
    return ((IdentifierObj)el2.peek()).fetchVal();
  }
  return el2.peek();
}

Fixed version (ground truth):
/** 
 * 计算
 */
private Object calculate(LinkedList<Object> el2){
  if (el2.peek() instanceof Operator) {
    Operator obj=(Operator)el2.peek();
    return obj.calculate();
  }
  if (el2.peek() instanceof IdentifierObj) {
    return ((IdentifierObj)el2.peek()).fetchVal();
  }
  return el2.peek();
}
Program: 80602
Project: 80602
Buggy source:
public synchronized void load(Reader reader) throws IOException {
  BufferedReader tr=null;
  if (reader instanceof BufferedReader)   tr=(BufferedReader)reader;
 else   tr=new BufferedReader(reader);
  this.clear();
  String s;
  while (null != (s=tr.readLine())) {
    if (Strings.isBlank(s))     continue;
    if (s.length() > 0 && s.charAt(0) == '#')     continue;
    int pos;
    char c='0';
    for (pos=0; pos < s.length(); pos++) {
      c=s.charAt(pos);
      if (c == '=' || c == ':')       break;
    }
    if (c == '=') {
      String name=s.substring(0,pos);
      maps.put(name,s.substring(pos + 1));
      keys.add(name);
    }
 else     if (c == ':') {
      String name=s.substring(0,pos);
      StringBuffer sb=new StringBuffer();
      sb.append(s.substring(pos + 1));
      String ss;
      while (null != (ss=tr.readLine())) {
        if (ss.length() > 0 && ss.charAt(0) == '#')         break;
        sb.append("String_Node_Str" + ss);
      }
      maps.put(name,sb.toString());
      keys.add(name);
      if (null == ss)       return;
    }
 else {
      maps.put(s,null);
      keys.add(s);
    }
  }
}

Fixed version (ground truth):
public synchronized void load(Reader reader) throws IOException {
  BufferedReader tr=null;
  if (reader instanceof BufferedReader)   tr=(BufferedReader)reader;
 else   tr=new BufferedReader(reader);
  this.clear();
  String s;
  while (null != (s=tr.readLine())) {
    if (Strings.isBlank(s))     continue;
    if (s.length() > 0 && s.trim().charAt(0) == '#')     continue;
    int pos;
    char c='0';
    for (pos=0; pos < s.length(); pos++) {
      c=s.charAt(pos);
      if (c == '=' || c == ':')       break;
    }
    if (c == '=') {
      String name=s.substring(0,pos);
      maps.put(name,s.substring(pos + 1));
      keys.add(name);
    }
 else     if (c == ':') {
      String name=s.substring(0,pos);
      StringBuffer sb=new StringBuffer();
      sb.append(s.substring(pos + 1));
      String ss;
      while (null != (ss=tr.readLine())) {
        if (ss.length() > 0 && ss.charAt(0) == '#')         break;
        sb.append("String_Node_Str" + ss);
      }
      maps.put(name,sb.toString());
      keys.add(name);
      if (null == ss)       return;
    }
 else {
      maps.put(s,null);
      keys.add(s);
    }
  }
}
Program: 80603
Project: 80603
Buggy source:
public Object parse(Reader reader){
  this.reader=reader;
  try {
    if (!tryNextChar())     return null;
    skipCommentsAndBlank();
    if (cursor == 'v') {
      OUTER:       while (true) {
        nextChar();
switch (cursor) {
case '{':
          break OUTER;
      }
    }
  }
  return parseFromHere();
}
 catch (IOException e) {
  throw Lang.wrapThrow(e);
}
}

Fixed version (ground truth):
public Object parse(Reader reader){
  if (reader == null)   return null;
  this.reader=reader;
  try {
    if (!tryNextChar())     return null;
    skipCommentsAndBlank();
    if (cursor == 'v') {
      OUTER:       while (true) {
        nextChar();
switch (cursor) {
case '{':
          break OUTER;
      }
    }
  }
  return parseFromHere();
}
 catch (IOException e) {
  throw Lang.wrapThrow(e);
}
}
Program: 80604
Project: 80604
Buggy source:
@SuppressWarnings("String_Node_Str") public void doRun() throws IOException {
  StringBuilder sb=new StringBuilder();
  line=br.readLine();
  while (null != line) {
    sb.append(line).append('\n');
    if (Strings.isBlank(line))     break;
    line=br.readLine();
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + sb);
  try {
    LinkedHashMap<String,Object> map=Json.fromJson(LinkedHashMap.class,sb);
    SocketAction action=saTable.get(map.get("String_Node_Str").toString());
    if (null != action) {
      SocketContext context=new SocketContext(this);
      if (action instanceof JsonAction)       ((JsonAction)action).run(map,context);
 else       action.run(context);
    }
 else {
      Writer writer=Streams.utf8w(ops);
      Map<String,Object> x=new HashMap<String,Object>();
      x.put("String_Node_Str",false);
      x.put("String_Node_Str","String_Node_Str");
      Json.toJson(writer,x);
      try {
        writer.close();
      }
 catch (      IOException e) {
        if (log.isWarnEnabled())         log.warn("String_Node_Str",e);
      }
    }
  }
 catch (  JsonException e) {
    if (log.isWarnEnabled())     log.warnf("String_Node_Str",e.getMessage(),sb);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void doRun() throws IOException {
  StringBuilder sb=new StringBuilder();
  line=br.readLine();
  while (null != line) {
    sb.append(line).append('\n');
    if (Strings.isBlank(line))     break;
    line=br.readLine();
  }
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + sb);
  try {
    LinkedHashMap<String,Object> map=Json.fromJson(LinkedHashMap.class,br);
    SocketAction action=saTable.get(map.get("String_Node_Str").toString());
    if (null != action) {
      SocketContext context=new SocketContext(this);
      if (action instanceof JsonAction)       ((JsonAction)action).run(map,context);
 else       action.run(context);
    }
 else {
      Writer writer=Streams.utf8w(ops);
      Map<String,Object> x=new HashMap<String,Object>();
      x.put("String_Node_Str",false);
      x.put("String_Node_Str","String_Node_Str");
      Json.toJson(writer,x);
      try {
        writer.close();
      }
 catch (      IOException e) {
        if (log.isWarnEnabled())         log.warn("String_Node_Str",e);
      }
    }
  }
 catch (  JsonException e) {
  }
}
Program: 80605
Project: 80605
Buggy source:
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  JsonField jf=fld.getAnnotation(JsonField.class);
  if (null != jf && jf.ignore())   return null;
  JsonEntityField jef=new JsonEntityField();
  jef.injecting=mirror.getInjecting(fld.getName());
  jef.ejecting=mirror.getEjecting(fld.getName());
  jef.genericType=fld.getGenericType();
  if (null != jf && !Strings.isBlank(jf.value()))   jef.name=jf.value();
 else   jef.name=fld.getName();
  return jef;
}

Fixed version (ground truth):
public static JsonEntityField eval(Mirror<?> mirror,Field fld){
  JsonField jf=fld.getAnnotation(JsonField.class);
  if (null != jf && jf.ignore())   return null;
  JsonEntityField jef=new JsonEntityField();
  jef.injecting=mirror.getInjecting(fld.getName());
  jef.genericType=fld.getGenericType();
  if (null != jf && !Strings.isBlank(jf.by()))   jef.ejecting=new EjectBySimpleEL(jf.by());
 else   jef.ejecting=mirror.getEjecting(fld.getName());
  if (null != jf && !Strings.isBlank(jf.value()))   jef.name=jf.value();
 else   jef.name=fld.getName();
  return jef;
}
Program: 80606
Project: 80606
Buggy source:
@Test public void test_enum(){
  Random<Color> r=new EnumRandom<Color>(){
  }
;
  Set<Color> re=new HashSet<Color>(Arrays.asList(Color.values()));
  Set<Color> rs=new HashSet<Color>();
  for (int j=0; j < 4; j++) {
    for (int i=0; i < 4; i++)     rs.add(r.next());
    assertTrue(Lang.equals(re,rs));
  }
}

Fixed version (ground truth):
@Ignore("String_Node_Str") @Test public void test_enum(){
  Random<Color> r=new EnumRandom<Color>(){
  }
;
  Set<Color> re=new HashSet<Color>(Arrays.asList(Color.values()));
  Set<Color> rs=new HashSet<Color>();
  for (int j=0; j < 4; j++) {
    for (int i=0; i < 4; i++)     rs.add(r.next());
    assertTrue(Lang.equals(re,rs));
  }
}
Program: 80607
Project: 80607
Buggy source:
public void visit(final Object obj,final LinkField lnk){
  Object value=lnk.getValue(obj);
  if (Lang.length(value) == 0)   return;
  lnk.updateLinkedField(obj,value);
  final Entity<?> en=lnk.getLinkedEntity();
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      opt.addInsert(en,ele);
      opt.add(Pojos.createRun(new PojoCallback(){
        public Object invoke(        Connection conn,        ResultSet rs,        Pojo pojo) throws SQLException {
          lnk.saveLinkedField(obj,pojo.getOperatingObject());
          return pojo.getOperatingObject();
        }
      }
).setOperatingObject(ele));
    }
  }
);
}

Fixed version (ground truth):
public void visit(final Object obj,final LinkField lnk){
  final Object value=lnk.getValue(obj);
  if (Lang.length(value) == 0)   return;
  opt.add(Pojos.createRun(new PojoCallback(){
    public Object invoke(    Connection conn,    ResultSet rs,    Pojo pojo) throws SQLException {
      lnk.updateLinkedField(obj,value);
      return pojo.getOperatingObject();
    }
  }
).setOperatingObject(obj));
  final Entity<?> en=lnk.getLinkedEntity();
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      opt.addInsert(en,ele);
      opt.add(Pojos.createRun(new PojoCallback(){
        public Object invoke(        Connection conn,        ResultSet rs,        Pojo pojo) throws SQLException {
          lnk.saveLinkedField(obj,pojo.getOperatingObject());
          return pojo.getOperatingObject();
        }
      }
).setOperatingObject(ele));
    }
  }
);
}
Program: 80608
Project: 80608
Buggy source:
@Test public void fetch_record(){
  Record re=dao.fetch("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  Pet pet=re.toPojo(Pet.class);
  assertEquals(4,re.getColumnCount());
  assertEquals(4,pet.getId());
  assertEquals("String_Node_Str",pet.getName());
}

Fixed version (ground truth):
@Test public void fetch_record(){
  Record re=dao.fetch("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  Pet pet=re.toPojo(Pet.class);
  assertEquals(5,re.getColumnCount());
  assertEquals(4,pet.getId());
  assertEquals("String_Node_Str",pet.getName());
}
Program: 80609
Project: 80609
Buggy source:
private void parseSp(StringBuilder sb) throws IOException {
  nextChar();
switch (cursor) {
case 'n':
    sb.append('\n');
  break;
case 'r':
sb.append('\r');
break;
case 't':
sb.append('\t');
break;
case '\\':
sb.append('\\');
break;
case '\'':
sb.append('\'');
break;
case '\"':
sb.append('\"');
break;
case 'u':
char[] hex=new char[4];
for (int i=0; i < 4; i++) hex[i]=(char)nextChar();
sb.append((char)Integer.valueOf(new String(hex),16).intValue());
break;
case 'b':
sb.append(' ');
break;
case 'f':
sb.append('\f');
break;
default :
throw unexpectedChar();
}
}

Fixed version (ground truth):
private void parseSp(StringBuilder sb) throws IOException {
  nextChar();
switch (cursor) {
case 'n':
    sb.append('\n');
  break;
case 'r':
sb.append('\r');
break;
case 't':
sb.append('\t');
break;
case '\\':
sb.append('\\');
break;
case '\'':
sb.append('\'');
break;
case '\"':
sb.append('\"');
break;
case '/':
sb.append('/');
break;
case 'u':
char[] hex=new char[4];
for (int i=0; i < 4; i++) hex[i]=(char)nextChar();
sb.append((char)Integer.valueOf(new String(hex),16).intValue());
break;
case 'b':
sb.append(' ');
break;
case 'f':
sb.append('\f');
break;
default :
throw unexpectedChar();
}
}