nus-yam/ex-repair huggingface dataset:
Program: 80532
Project: 80532
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(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);
  addComment(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);
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  addComment(dao,en);
  return true;
}
Program: 80533
Project: 80533
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(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;
}

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");
  }
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  createRelation(dao,en);
  return true;
}
Program: 80534
Project: 80534
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(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);
  addComment(dao,en,COMMENT_COLUMN);
  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()));
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  createRelation(dao,en);
  addComment(dao,en,COMMENT_COLUMN);
  return true;
}
Program: 80535
Project: 80535
Buggy source:
/** 
 * 将一个图片文件读入内存
 * @param imgFile 图片文件
 * @return 图片对象
 */
public static BufferedImage read(File imgFile){
  try {
    return ImageIO.read(imgFile);
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
/** 
 * 将一个图片文件读入内存
 * @param imgFile 图片文件
 * @return 图片对象
 */
public static BufferedImage read(Object img){
  try {
    if (img instanceof File)     return ImageIO.read((File)img);
 else     if (img instanceof URL)     return ImageIO.read((URL)img);
 else     if (img instanceof InputStream)     return ImageIO.read((InputStream)img);
    throw Lang.makeThrow("String_Node_Str" + img);
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80536
Project: 80536
Buggy source:
private void _runPreparedStatement(Connection conn,DaoStatement st,Object[][] paramMatrix) throws SQLException {
  ValueAdaptor[] adaptors=st.getAdaptors();
  if (adaptors.length != paramMatrix[0].length)   throw Lang.makeThrow("String_Node_Str");
  boolean statIsClosed=false;
  String sql=st.toPreparedStatement();
  PreparedStatement pstat=null;
  if (log.isDebugEnabled())   log.debug(st);
  try {
    pstat=conn.prepareStatement(sql);
    if (paramMatrix.length == 1) {
      for (int i=0; i < paramMatrix[0].length; i++) {
        adaptors[i].set(pstat,paramMatrix[0][i],i + 1);
      }
      pstat.execute();
      st.getContext().setUpdateCount(pstat.getUpdateCount());
      pstat.close();
      statIsClosed=true;
    }
 else {
      boolean oldAutoCommit=conn.getAutoCommit();
      conn.setAutoCommit(false);
      for (      Object[] params : paramMatrix) {
        for (int i=0; i < params.length; i++) {
          adaptors[i].set(pstat,params[i],i + 1);
        }
        pstat.addBatch();
      }
      int[] counts=pstat.executeBatch();
      pstat.close();
      statIsClosed=true;
      conn.commit();
      conn.setAutoCommit(oldAutoCommit);
      int sum=0;
      for (      int i : counts)       sum+=i;
      st.getContext().setUpdateCount(sum);
    }
  }
  finally {
    if (!statIsClosed)     Daos.safeClose(pstat);
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str");
}

Fixed version (ground truth):
private void _runPreparedStatement(Connection conn,DaoStatement st,Object[][] paramMatrix) throws SQLException {
  ValueAdaptor[] adaptors=st.getAdaptors();
  if (adaptors.length != paramMatrix[0].length)   throw Lang.makeThrow("String_Node_Str");
  boolean statIsClosed=false;
  String sql=st.toPreparedStatement();
  PreparedStatement pstat=null;
  if (log.isDebugEnabled())   log.debug(st);
  try {
    pstat=conn.prepareStatement(sql);
    if (paramMatrix.length == 1) {
      for (int i=0; i < paramMatrix[0].length; i++) {
        adaptors[i].set(pstat,paramMatrix[0][i],i + 1);
      }
      pstat.execute();
      st.getContext().setUpdateCount(pstat.getUpdateCount());
      pstat.close();
      statIsClosed=true;
    }
 else {
      for (      Object[] params : paramMatrix) {
        for (int i=0; i < params.length; i++) {
          adaptors[i].set(pstat,params[i],i + 1);
        }
        pstat.addBatch();
      }
      int[] counts=pstat.executeBatch();
      pstat.close();
      statIsClosed=true;
      int sum=0;
      for (      int i : counts)       sum+=i;
      st.getContext().setUpdateCount(sum);
    }
  }
  finally {
    if (!statIsClosed)     Daos.safeClose(pstat);
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str");
}
Program: 80537
Project: 80537
Buggy source:
protected static void scanModuleInPackage(Set<Class<?>> modules,String packageName){
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",packageName);
  List<Class<?>> subs=Scans.me().scanPackage(packageName);
  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());
    }
  }
}

Fixed version (ground truth):
protected static void scanModuleInPackage(Set<Class<?>> modules,String packageName){
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",packageName);
  List<Class<?>> subs=Scans.me().scanPackage(packageName);
  checkModule(modules,subs);
}
Program: 80538
Project: 80538
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<?>>();
  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;
}

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) {
      URL jarLocation=type.getProtectionDomain().getCodeSource().getLocation();
      if (log.isDebugEnabled())       log.debugf("String_Node_Str",jarLocation);
      scanModuleInPackageByJar(jarLocation,modules,type);
    }
 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: 80539
Project: 80539
Buggy source:
private <T>Pair2[] findMatchedMethod(Class<T> klass){
  Method[] all=Mirror.me(klass).getAllDeclaredMethodsWithoutTop();
  List<Pair2> p2=new ArrayList<Pair2>();
  for (  Method m : all) {
    int mod=m.getModifiers();
    if (mod == 0 || Modifier.isStatic(mod) || Modifier.isPrivate(mod))     continue;
    ArrayList<MethodInterceptor> mls=new ArrayList<MethodInterceptor>();
    for (    Pair p : pairs)     if (p.matcher.match(m))     mls.add(p.listener);
    if (mls.size() > 0)     p2.add(new Pair2(m,mls));
  }
  return p2.toArray(new Pair2[p2.size()]);
}

Fixed version (ground truth):
private <T>Pair2[] findMatchedMethod(Class<T> klass){
  Method[] all=Mirror.me(klass).getAllDeclaredMethodsWithoutTop();
  List<Pair2> p2=new ArrayList<Pair2>();
  for (  Method m : all) {
    int mod=m.getModifiers();
    if (mod == 0 || Modifier.isStatic(mod) || Modifier.isPrivate(mod) || Modifier.isFinal(mod) || Modifier.isAbstract(mod))     continue;
    ArrayList<MethodInterceptor> mls=new ArrayList<MethodInterceptor>();
    for (    Pair p : pairs)     if (p.matcher.match(m))     mls.add(p.listener);
    if (mls.size() > 0)     p2.add(new Pair2(m,mls));
  }
  return p2.toArray(new Pair2[p2.size()]);
}
Program: 80540
Project: 80540
Buggy source:
@Override protected String evalFieldType(MappingField mf){
switch (mf.getColumnType()) {
case INT:
    if (mf.getWidth() > 0)     return "String_Node_Str" + mf.getWidth() + "String_Node_Str";
  return "String_Node_Str";
case FLOAT:
if (mf.getWidth() > 0 && mf.getPrecision() > 0) {
  return "String_Node_Str" + mf.getWidth() + "String_Node_Str"+ mf.getPrecision()+ "String_Node_Str";
}
if (mf.getTypeMirror().isDouble()) return "String_Node_Str";
return "String_Node_Str";
}
return super.evalFieldType(mf);
}

Fixed version (ground truth):
@Override protected String evalFieldType(MappingField mf){
switch (mf.getColumnType()) {
case INT:
    if (mf.getWidth() > 0)     return "String_Node_Str" + mf.getWidth() + "String_Node_Str";
  return "String_Node_Str";
case FLOAT:
if (mf.getWidth() > 0 && mf.getPrecision() > 0) {
  return "String_Node_Str" + mf.getWidth() + "String_Node_Str"+ mf.getPrecision()+ "String_Node_Str";
}
if (mf.getTypeMirror().isDouble()) return "String_Node_Str";
return "String_Node_Str";
case BINARY:
return "String_Node_Str";
}
return super.evalFieldType(mf);
}
Program: 80541
Project: 80541
Buggy source:
public void set(PreparedStatement stat,Object obj,int i) throws SQLException {
  if (null == obj) {
    stat.setString(i,null);
  }
 else {
    String v=Castors.me().castToString(obj);
    stat.setString(i,v);
  }
}

Fixed version (ground truth):
public void set(PreparedStatement stat,Object obj,int index) throws SQLException {
  if (null == obj) {
    stat.setNull(index,Types.BINARY);
  }
 else {
    stat.setBytes(index,(byte[])obj);
  }
}
Program: 80542
Project: 80542
Buggy source:
public static ValueAdaptor getAdaptor(Mirror<?> mirror){
  if (mirror.isStringLike())   return Jdbcs.Adaptor.asString;
  if (mirror.isInt())   return Jdbcs.Adaptor.asInteger;
  if (mirror.isBoolean())   return Jdbcs.Adaptor.asBoolean;
  if (mirror.isLong())   return Jdbcs.Adaptor.asLong;
  if (mirror.isEnum())   return Jdbcs.Adaptor.asEnumChar;
  if (mirror.isChar())   return Jdbcs.Adaptor.asChar;
  if (mirror.isOf(Timestamp.class))   return Jdbcs.Adaptor.asTimestamp;
  if (mirror.isByte())   return Jdbcs.Adaptor.asByte;
  if (mirror.isShort())   return Jdbcs.Adaptor.asShort;
  if (mirror.isFloat())   return Jdbcs.Adaptor.asFloat;
  if (mirror.isDouble())   return Jdbcs.Adaptor.asDouble;
  if (mirror.isOf(BigDecimal.class))   return Jdbcs.Adaptor.asBigDecimal;
  if (mirror.isOf(Calendar.class))   return Jdbcs.Adaptor.asCalendar;
  if (mirror.isOf(java.util.Date.class))   return Jdbcs.Adaptor.asDate;
  if (mirror.isOf(java.sql.Date.class))   return Jdbcs.Adaptor.asSqlDate;
  if (mirror.isOf(java.sql.Time.class))   return Jdbcs.Adaptor.asSqlTime;
  if (mirror.isOf(Blob.class))   return new BlobValueAdaptor(conf.getPool());
  if (mirror.isOf(Clob.class))   return new ClobValueAdaptor(conf.getPool());
  return Jdbcs.Adaptor.asString;
}

Fixed version (ground truth):
public static ValueAdaptor getAdaptor(Mirror<?> mirror){
  if (mirror.isStringLike())   return Jdbcs.Adaptor.asString;
  if (mirror.isInt())   return Jdbcs.Adaptor.asInteger;
  if (mirror.isBoolean())   return Jdbcs.Adaptor.asBoolean;
  if (mirror.isLong())   return Jdbcs.Adaptor.asLong;
  if (mirror.isEnum())   return Jdbcs.Adaptor.asEnumChar;
  if (mirror.isChar())   return Jdbcs.Adaptor.asChar;
  if (mirror.isOf(Timestamp.class))   return Jdbcs.Adaptor.asTimestamp;
  if (mirror.isByte())   return Jdbcs.Adaptor.asByte;
  if (mirror.isShort())   return Jdbcs.Adaptor.asShort;
  if (mirror.isFloat())   return Jdbcs.Adaptor.asFloat;
  if (mirror.isDouble())   return Jdbcs.Adaptor.asDouble;
  if (mirror.isOf(BigDecimal.class))   return Jdbcs.Adaptor.asBigDecimal;
  if (mirror.isOf(Calendar.class))   return Jdbcs.Adaptor.asCalendar;
  if (mirror.isOf(java.util.Date.class))   return Jdbcs.Adaptor.asDate;
  if (mirror.isOf(java.sql.Date.class))   return Jdbcs.Adaptor.asSqlDate;
  if (mirror.isOf(java.sql.Time.class))   return Jdbcs.Adaptor.asSqlTime;
  if (mirror.isOf(Blob.class))   return new BlobValueAdaptor(conf.getPool());
  if (mirror.isOf(Clob.class))   return new ClobValueAdaptor(conf.getPool());
  if (mirror.getType().isArray() && mirror.getType().getComponentType() == byte.class) {
    return Jdbcs.Adaptor.asBytes;
  }
  return Jdbcs.Adaptor.asString;
}
Program: 80543
Project: 80543
Buggy source:
public Object get(ResultSet rs,String colName) throws SQLException {
  return rs.getObject(colName);
}

Fixed version (ground truth):
public Object get(ResultSet rs,String colName) throws SQLException {
  return rs.getBytes(colName);
}
Program: 80544
Project: 80544
Buggy source:
/** 
 * 判断两个输入流是否严格相等
 */
public static boolean equals(InputStream sA,InputStream sB) throws IOException {
  int dA;
  while ((dA=sA.read()) != -1) {
    if (dA != sB.read())     return false;
  }
  return sB.read() == -1;
}

Fixed version (ground truth):
/** 
 * 判断两个输入流是否严格相等
 */
public static boolean equals(InputStream sA,InputStream sB) throws IOException {
  int dA;
  while ((dA=sA.read()) != -1) {
    int dB=sB.read();
    if (dA != dB)     return false;
  }
  return sB.read() == -1;
}
Program: 80545
Project: 80545
Buggy source:
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  final Entity<?> en=pojo.getEntity();
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=en.getObject(rs,context.getFieldMatcher());
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    if (each instanceof Loop)     if (!((Loop<?>)each).begin())     return 0;
    ing.doLoop(rs,pojo.getContext());
    if (each instanceof Loop)     ((Loop<?>)each).end();
  }
 catch (  ExitLoop e) {
  }
catch (  LoopException e) {
    throw new SQLException(e.getCause());
  }
  return ing.getIndex() + 1;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  final Entity<?> en=pojo.getEntity();
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=en.getObject(rs,context.getFieldMatcher());
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    if (each instanceof Loop)     if (!((Loop<?>)each).begin())     return 0;
    ing.doLoop(rs,pojo.getContext());
    if (each instanceof Loop)     ((Loop<?>)each).end();
  }
 catch (  ExitLoop e) {
  }
catch (  LoopException e) {
    SQLException e2=new SQLException();
    e2.initCause(e.getCause());
    throw e2;
  }
  return ing.getIndex() + 1;
}
Program: 80546
Project: 80546
Buggy source:
public SqlExpressionGroup andNotEquals(String name,Object val){
  return and(eq(name,val).not());
}

Fixed version (ground truth):
public SqlExpressionGroup andNotEquals(String name,Object val){
  if (null == val)   return andNotIsNull(name);
  return and(eq(name,val).not());
}
Program: 80547
Project: 80547
Buggy source:
public SqlExpressionGroup andEquals(String name,Object val){
  return and(eq(name,val));
}

Fixed version (ground truth):
public SqlExpressionGroup andEquals(String name,Object val){
  if (null == val)   return andIsNull(name);
  return and(eq(name,val));
}
Program: 80548
Project: 80548
Buggy source:
public void addComment(Dao dao,Entity<?> en,String commentTable,String commentColumn){
  if (!en.hasTableComment() && !en.hasColumnComment()) {
    return;
  }
  List<Sql> sqls=new ArrayList<Sql>();
  if (en.hasTableComment()) {
    Sql tableCommentSQL=Sqls.create(commentTable);
    tableCommentSQL.vars().set("String_Node_Str",en.getTableName()).set("String_Node_Str",en.getTableComment());
    sqls.add(tableCommentSQL);
  }
  if (en.hasColumnComment()) {
    for (    MappingField mf : en.getMappingFields()) {
      if (mf.hasColumnComment()) {
        Sql columnCommentSQL=Sqls.create(commentColumn);
        columnCommentSQL.vars().set("String_Node_Str",en.getTableName()).set("String_Node_Str",mf.getColumnName()).set("String_Node_Str",mf.getColumnComment());
        sqls.add(columnCommentSQL);
      }
    }
  }
  dao.execute(sqls.toArray(new Sql[sqls.size()]));
}

Fixed version (ground truth):
public void addComment(Dao dao,Entity<?> en,String commentTable,String commentColumn){
  if (!en.hasTableComment() && !en.hasColumnComment()) {
    return;
  }
  List<Sql> sqls=new ArrayList<Sql>();
  if (en.hasTableComment()) {
    Sql tableCommentSQL=Sqls.create(Strings.isBlank(commentTable) ? DEFAULT_COMMENT_TABLE : commentTable);
    tableCommentSQL.vars().set("String_Node_Str",en.getTableName()).set("String_Node_Str",en.getTableComment());
    sqls.add(tableCommentSQL);
  }
  if (en.hasColumnComment()) {
    for (    MappingField mf : en.getMappingFields()) {
      if (mf.hasColumnComment()) {
        Sql columnCommentSQL=Sqls.create(Strings.isBlank(commentColumn) ? DEFAULT_COMMENT_COLUMN : commentColumn);
        columnCommentSQL.vars().set("String_Node_Str",en.getTableName()).set("String_Node_Str",mf.getColumnName()).set("String_Node_Str",mf.getColumnComment());
        sqls.add(columnCommentSQL);
      }
    }
  }
  dao.execute(sqls.toArray(new Sql[sqls.size()]));
}
Program: 80549
Project: 80549
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(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);
  addComment(dao,en,COMMENT_TABLE,COMMENT_COLUMN);
  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);
  addComment(dao,en);
  return true;
}
Program: 80550
Project: 80550
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(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()));
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  createRelation(dao,en);
  addComment(dao,en,COMMENT_TABLE,COMMENT_COLUMN);
  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()));
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  createRelation(dao,en);
  addComment(dao,en);
  return true;
}
Program: 80552
Project: 80552
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(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;
}

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);
  addComment(dao,en,COMMENT_COLUMN);
  return true;
}
Program: 80553
Project: 80553
Buggy source:
protected String toStatement(Object[][] mtrx,String sql){
  StringBuilder sb=new StringBuilder();
  String[] ss=sql.split("String_Node_Str");
  int i;
  for (i=0; i < mtrx[0].length; i++) {
    sb.append(ss[i]);
    sb.append(Sqls.formatFieldValue(mtrx[0][i]));
  }
  if (i < ss.length)   sb.append(ss[i]);
  return sb.toString();
}

Fixed version (ground truth):
protected String toStatement(Object[][] mtrx,String sql){
  StringBuilder sb=new StringBuilder();
  String[] ss=sql.split("String_Node_Str");
  int i=0;
  if (mtrx.length > 0) {
    for (; i < mtrx[0].length; i++) {
      sb.append(ss[i]);
      sb.append(Sqls.formatFieldValue(mtrx[0][i]));
    }
  }
  if (i < ss.length)   sb.append(ss[i]);
  return sb.toString();
}
Program: 80554
Project: 80554
Buggy source:
public Object[][] getParamMatrix(){
  Object[][] re=new Object[rows.size()][adaptors.length];
  int i=0;
  for (  VarSet row : rows) {
    Object[] cols=re[i++];
    for (    String name : literal.getParamIndexes().names()) {
      Object value=row.get(name);
      int[] is=literal.getParamIndexes().getOrderIndex(name);
      for (      int x : is)       cols[x]=value;
    }
  }
  return re;
}

Fixed version (ground truth):
public Object[][] getParamMatrix(){
  if (rows.size() > 0) {
    VarSet vs=rows.get(rows.size() - 1);
    while (null != vs) {
      if (vs.keys().size() == 0) {
        rows.remove(vs);
        vs=null;
        if (rows.size() > 0)         vs=rows.get(rows.size() - 1);
      }
 else {
        break;
      }
    }
  }
  Object[][] re=new Object[rows.size()][adaptors.length];
  int i=0;
  for (  VarSet row : rows) {
    Object[] cols=re[i++];
    for (    String name : literal.getParamIndexes().names()) {
      Object value=row.get(name);
      int[] is=literal.getParamIndexes().getOrderIndex(name);
      for (      int x : is)       cols[x]=value;
    }
  }
  return re;
}
Program: 80555
Project: 80555
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.length() > 0 && path.charAt(0) == '/') {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.length() > 0 && path.charAt(0) == '/') {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=Mvcs.getRequestPath(req);
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}
Program: 80556
Project: 80556
Buggy source:
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  final Entity<?> en=pojo.getEntity();
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=en.getObject(rs,context.getFieldMatcher());
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    ing.doLoop(rs,pojo.getContext());
  }
 catch (  ExitLoop e) {
  }
  return ing.getIndex() + 1;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  final Entity<?> en=pojo.getEntity();
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=en.getObject(rs,context.getFieldMatcher());
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    if (each instanceof Loop)     if (!((Loop<?>)each).begin())     return 0;
    ing.doLoop(rs,pojo.getContext());
    if (each instanceof Loop)     ((Loop<?>)each).end();
  }
 catch (  ExitLoop e) {
  }
catch (  LoopException e) {
    throw new SQLException(e.getCause());
  }
  return ing.getIndex() + 1;
}
Program: 80557
Project: 80557
Buggy source:
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=Record.create(rs);
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    ing.doLoop(rs,pojo.getContext());
  }
 catch (  ExitLoop e) {
  }
  return ing.getIndex() + 1;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object invoke(Connection conn,ResultSet rs,Pojo pojo) throws SQLException {
  final Each<Object> each=pojo.getContext().attr(Each.class);
  if (null == each)   return null;
  ResultSetLooping ing=new ResultSetLooping(){
    protected boolean createObject(    int index,    ResultSet rs,    SqlContext context,    int rowCount){
      Object obj=Record.create(rs);
      try {
        each.invoke(index,obj,rowCount);
      }
 catch (      LoopException e) {
        throw Lang.wrapThrow(e);
      }
      return false;
    }
  }
;
  try {
    if (each instanceof Loop)     if (!((Loop<?>)each).begin())     return 0;
    ing.doLoop(rs,pojo.getContext());
    if (each instanceof Loop)     ((Loop<?>)each).end();
  }
 catch (  ExitLoop e) {
  }
catch (  LoopException e) {
    throw new SQLException(e.getCause());
  }
  return ing.getIndex() + 1;
}
Program: 80559
Project: 80559
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.length() > 0 && path.charAt(0) == '/') {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=Mvcs.getRequestPath(req);
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.length() > 0 && path.charAt(0) == '/') {
    path=req.getContextPath() + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}
Program: 80560
Project: 80560
Buggy source:
public int joinParams(Entity<?> en,Object obj,Object[] params,int off){
  List<MappingField> mfs=_mfs(en);
  for (  MappingField mf : mfs)   params[off++]=mf.getValue(obj);
  return off;
}

Fixed version (ground truth):
public int joinParams(Entity<?> en,Object obj,Object[] params,int off){
  List<MappingField> mfs=_mfs(en);
  for (  MappingField mf : mfs) {
    Object v=mf.getValue(obj);
    params[off++]=null == v ? mf.getDefaultValue(obj) : v;
  }
  return off;
}
Program: 80561
Project: 80561
Buggy source:
/** 
 * 获取一个目录下所有的文件。隐藏文件会被忽略。
 * @param dir 目录
 * @param suffix 文件后缀名。如果为 null，则获取全部文件
 * @return 文件数组
 */
public static File[] files(File dir,final String suffix){
  return dir.listFiles(new FileFilter(){
    public boolean accept(    File f){
      return !f.isHidden() && f.isFile() && (null == suffix || f.getName().endsWith(suffix));
    }
  }
);
}

Fixed version (ground truth):
/** 
 * 获取一个目录下所有的文件(不递归，仅仅一层)。隐藏文件会被忽略。
 * @param dir 目录
 * @param suffix 文件后缀名。如果为 null，则获取全部文件
 * @return 文件数组
 */
public static File[] files(File dir,final String suffix){
  return dir.listFiles(new FileFilter(){
    public boolean accept(    File f){
      return !f.isHidden() && f.isFile() && (null == suffix || f.getName().endsWith(suffix));
    }
  }
);
}
Program: 80562
Project: 80562
Buggy source:
@Test public void update_with_null_links(){
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.updateWith(p,null);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals("String_Node_Str",p.getLeaderName());
}

Fixed version (ground truth):
@Test public void update_with_null_links(){
  pojos.initData();
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.updateWith(p,null);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals("String_Node_Str",p.getLeaderName());
}
Program: 80563
Project: 80563
Buggy source:
@Test public void test_updateIgnoreNull_by_list(){
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  String name=p.getLeaderName();
  assertNotNull(name);
  p.setLeaderName(null);
  int re=dao.updateIgnoreNull(Lang.list(p));
  assertEquals(1,re);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals(name,p.getLeaderName());
  p.setLeaderName(null);
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertNull(p.getLeaderName());
}

Fixed version (ground truth):
@Test public void test_updateIgnoreNull_by_list(){
  pojos.initData();
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  String name=p.getLeaderName();
  assertNotNull(name);
  p.setLeaderName(null);
  int re=dao.updateIgnoreNull(Lang.list(p));
  assertEquals(1,re);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals(name,p.getLeaderName());
  p.setLeaderName(null);
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertNull(p.getLeaderName());
}
Program: 80564
Project: 80564
Buggy source:
@Test public void test_updateIgnoreNull(){
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  String name=p.getLeaderName();
  assertNotNull(name);
  p.setLeaderName(null);
  int re=dao.updateIgnoreNull(p);
  assertEquals(1,re);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals(name,p.getLeaderName());
  p.setLeaderName(null);
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertNull(p.getLeaderName());
}

Fixed version (ground truth):
@Test public void test_updateIgnoreNull(){
  pojos.initData();
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  p.setLeaderName("String_Node_Str");
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  String name=p.getLeaderName();
  assertNotNull(name);
  p.setLeaderName(null);
  int re=dao.updateIgnoreNull(p);
  assertEquals(1,re);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals(name,p.getLeaderName());
  p.setLeaderName(null);
  dao.update(p);
  p=dao.fetch(Platoon.class,"String_Node_Str");
  assertNull(p.getLeaderName());
}
Program: 80565
Project: 80565
Buggy source:
@Test public void batch_update_relation(){
  dao.updateRelation(Fighter.class,"String_Node_Str",Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(13,dao.count("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
@Test public void batch_update_relation(){
  pojos.initData();
  dao.updateRelation(Fighter.class,"String_Node_Str",Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(13,dao.count("String_Node_Str",Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str")));
}
Program: 80566
Project: 80566
Buggy source:
@Test public void batch_update_partly(){
  int re=dao.update(Fighter.class,Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(1,re);
  int maxId=dao.getMaxId(Fighter.class);
  re=dao.update(Fighter.class,Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str",maxId - 5));
  assertEquals(5,re);
  assertEquals(re,dao.count(Fighter.class,Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
@Test public void batch_update_partly(){
  pojos.initData();
  int re=dao.update(Fighter.class,Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertEquals(1,re);
  int maxId=dao.getMaxId(Fighter.class);
  re=dao.update(Fighter.class,Chain.make("String_Node_Str","String_Node_Str"),Cnd.where("String_Node_Str","String_Node_Str",maxId - 5));
  assertEquals(5,re);
  assertEquals(re,dao.count(Fighter.class,Cnd.where("String_Node_Str","String_Node_Str","String_Node_Str")));
}
Program: 80567
Project: 80567
Buggy source:
@Test public void fetch_by_name_ignorecase(){
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals("String_Node_Str",p.getName());
}

Fixed version (ground truth):
@Test public void fetch_by_name_ignorecase(){
  pojos.initData();
  Platoon p=dao.fetch(Platoon.class,"String_Node_Str");
  assertEquals("String_Node_Str",p.getName());
}
Program: 80568
Project: 80568
Buggy source:
@Test public void batch_update_all(){
  dao.update(Fighter.class,Chain.make("String_Node_Str",Fighter.TYPE.SU_35.name()),null);
  assertEquals(13,dao.count(Fighter.class,Cnd.where("String_Node_Str","String_Node_Str",Fighter.TYPE.SU_35.name())));
}

Fixed version (ground truth):
@Test public void batch_update_all(){
  pojos.initData();
  dao.update(Fighter.class,Chain.make("String_Node_Str",Fighter.TYPE.SU_35.name()),null);
  assertEquals(13,dao.count(Fighter.class,Cnd.where("String_Node_Str","String_Node_Str",Fighter.TYPE.SU_35.name())));
}
Program: 80569
Project: 80569
Buggy source:
public AtMap(){
  ats=new HashMap<String,String>();
}

Fixed version (ground truth):
public AtMap(){
  ats=new HashMap<String,String>();
  methods=new HashMap<String,Method>();
}