nus-yam/ex-repair huggingface dataset:
Program: 43535
Project: 43535
Buggy source:
public int updateIgnoreNull(final Object obj){
  final int[] re={0};
  FieldFilter.create(obj.getClass(),true).run(new Atom(){
    public void run(){
      re[0]=update(obj);
    }
  }
);
  return re[0];
}

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

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

Fixed version (ground truth):
@Test public void test_first4_map_collection(){
  assertNull(Lang.first(new HashMap<String,String>()));
  Map<?,?> map1=Lang.map("String_Node_Str");
  assertTrue(map1.entrySet().contains(Lang.first(map1)));
  assertNull(Lang.first(new ArrayList<String>()));
  List<Object> l=Lang.list4("String_Node_Str");
  assertEquals(1,Lang.first(l));
}
Program: 43538
Project: 43538
Buggy source:
public Object remove(Object arg0){
  return map.remove(arg0);
}

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

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

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

Fixed version (ground truth):
public void putAll(Map<? extends String,? extends Object> out){
  for (  Entry<? extends String,? extends Object> entry : out.entrySet())   map.put(entry.getKey().toLowerCase(),entry.getValue());
}
Program: 43542
Project: 43542
Buggy source:
public static Record create(ResultSet rs){
  try {
    Record re=new Record();
    ResultSetMetaData meta=rs.getMetaData();
    int count=meta.getColumnCount();
    for (int i=1; i <= count; i++) {
      String name=meta.getColumnLabel(i);
      if (meta.getColumnType(i) == Types.CLOB) {
        re.set(name.toLowerCase(),rs.getString(i));
      }
 else {
        re.set(name.toLowerCase(),rs.getObject(i));
      }
    }
    return re;
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public static Record create(ResultSet rs){
  try {
    Record re=new Record();
    ResultSetMetaData meta=rs.getMetaData();
    int count=meta.getColumnCount();
    for (int i=1; i <= count; i++) {
      String name=meta.getColumnLabel(i);
      if (meta.getColumnType(i) == Types.CLOB) {
        re.set(name,rs.getString(i));
      }
 else {
        re.set(name,rs.getObject(i));
      }
    }
    return re;
  }
 catch (  SQLException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43543
Project: 43543
Buggy source:
/** 
 * 设置值
 * @param name 字段名
 * @param value 字段值
 * @return 记录本身
 */
public Record set(String name,Object value){
  map.put(name,value);
  return this;
}

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

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

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

Fixed version (ground truth):
public boolean equals(Object out){
  return map.equals(out);
}
Program: 43547
Project: 43547
Buggy source:
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  String paramName=param.value();
  if (File.class.isAssignableFrom(type))   return new FileInjector(paramName);
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(paramName);
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(paramName);
  if (List.class.isAssignableFrom(type))   return new MapListInjector(paramName);
  if (type.isArray())   return new MapArrayInjector(type.getComponentType(),paramName);
  if ("String_Node_Str".equals(paramName)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new MapReferInjector(null,type);
  }
 else   if (paramName.startsWith("String_Node_Str") && paramName.length() > 2) {
    return new MapReferInjector(paramName.substring(2),type);
  }
  return new MapItemInjector(paramName,type);
}

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

Fixed version (ground truth):
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  return getFile(refer);
}
Program: 43549
Project: 43549
Buggy source:
/** 
 * 执行根据流来加载sql内容的操作
 * @param stream
 * @throws IOException
 * @author mawenming at 2010-4-10 上午10:04:17
 */
private void loadSQL(Reader stream) throws IOException {
  BufferedReader bufferedReader=null;
  try {
    bufferedReader=new BufferedReader(stream);
    SqlFileBuilder p=new SqlFileBuilder(bufferedReader);
    Iterator<String> it=p.keys().iterator();
    _sql_keys=new ArrayList<String>(p.map.size());
    while (it.hasNext()) {
      String key=it.next();
      String value=Strings.trim(p.get(key));
      addSql(key,value);
    }
  }
  finally {
    Streams.safeClose(bufferedReader);
    Streams.safeClose(stream);
  }
}

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

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

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

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

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

Fixed version (ground truth):
@Test public void test_dynamic_insert(){
  pojos.init();
  ((NutDao)dao).setSqlManager(new FileSqlManager("String_Node_Str"));
  int platoonId=23;
  try {
    pojos.initPlatoon(platoonId);
    Sql sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",12);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",13);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",14);
    dao.execute(sql);
    sql=dao.sqls().create("String_Node_Str");
    sql.vars().set("String_Node_Str",platoonId);
    sql.params().set("String_Node_Str","String_Node_Str").set("String_Node_Str",15);
    dao.execute(sql);
    TableName.run(platoonId,new Atom(){
      public void run(){
        assertEquals(4,dao.count(Tank.class));
      }
    }
);
  }
 catch (  SqlNotFoundException e) {
  }
 finally {
    pojos.dropPlatoon(platoonId);
  }
}
Program: 43556
Project: 43556
Buggy source:
@Override public java.util.Date cast(String src,Class<?> toType,String... args){
  try {
    return dateTimeFormat.parse(src);
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}

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

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

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

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

Fixed version (ground truth):
@Test public void testString2JavaDate() throws FailToCastObjectException {
  java.util.Date date=Castors.me().castTo("String_Node_Str",java.util.Date.class);
  Calendar cal=Calendar.getInstance();
  cal.setTime(date);
  assertEquals(2008,cal.get(Calendar.YEAR));
  assertEquals(5,cal.get(Calendar.MONTH));
  assertEquals(12,cal.get(Calendar.DAY_OF_MONTH));
  assertEquals(0,cal.get(Calendar.HOUR_OF_DAY));
  assertEquals(0,cal.get(Calendar.MINUTE));
  assertEquals(0,cal.get(Calendar.SECOND));
}
Program: 43561
Project: 43561
Buggy source:
public View make(Ioc ioc,String type,String value){
  type=type.toLowerCase();
  if (VIEW_JSP.equals(type))   return new JspView(value);
  if (VIEW_JSON.equals(type))   if (Strings.isBlank(value))   return new UTF8JsonView(JsonFormat.compact());
 else   return new UTF8JsonView(Json.fromJson(JsonFormat.class,value));
  if (VIEW_REDIRECT.equals(type) || VIEW_REDIRECT2.equals(type))   return new ServerRedirectView(value);
  if (VIEW_VOID.equals(type))   return new VoidView();
  if (VIEW_IOC.equals(type))   return ioc.get(View.class,value);
  if (VIEW_HTTP.equals(type))   return new HttpStatusView(Integer.parseInt(value));
  return null;
}

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

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

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

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

Fixed version (ground truth):
@Test public void test_setValue_Boolean_and_Character(){
  SV sv=new SV();
  sv.ok=true;
  sv.cobj=Character.valueOf('F');
  sv.intobj=30;
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  Mirror.me(SV.class).setValue(sv,"String_Node_Str",null);
  assertNull(sv.ok);
  assertNull(sv.cobj);
  assertNull(sv.intobj);
}
Program: 43566
Project: 43566
Buggy source:
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    try {
      return ClassLoader.getSystemClassLoader().loadClass(className);
    }
 catch (    ClassNotFoundException e2) {
      try {
        return getParent().loadClass(className);
      }
 catch (      ClassNotFoundException e3) {
      }
    }
  }
  return super.loadClass(className);
}

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

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

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

Fixed version (ground truth):
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return URLEncoder.encode(s.toString(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43571
Project: 43571
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T get(Class<T> classOfT,IocMaking ing){
  Object obj=weaver.weave(ing);
  if (null != fetch)   fetch.trigger(obj);
  return (T)obj;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>T get(Class<T> classOfT,IocMaking ing){
  Object re;
  if (null != obj)   re=obj;
 else   if (null != weaver)   re=weaver.fill(ing,weaver.born(ing));
 else   throw Lang.makeThrow("String_Node_Str",ing.getObjectName());
  if (null != fetch)   fetch.trigger(re);
  return (T)re;
}
Program: 43572
Project: 43572
Buggy source:
public void depose(){
  weaver.depose();
}

Fixed version (ground truth):
public void depose(){
  if (null != obj && null != depose)   depose.trigger(obj);
}
Program: 43574
Project: 43574
Buggy source:
public ObjectProxy fetch(String name){
  Object re=req.getAttribute(name);
  if (re == null)   return null;
  if (re instanceof ObjectProxy)   return (ObjectProxy)re;
  ObjectProxy op=new ObjectProxy();
  StaticWeaver staticWeaver=new StaticWeaver();
  staticWeaver.setObj(re);
  op.setWeaver(staticWeaver);
  return op;
}

Fixed version (ground truth):
public ObjectProxy fetch(String name){
  Object re=req.getAttribute(name);
  if (re == null)   return null;
  if (re instanceof ObjectProxy)   return (ObjectProxy)re;
  return new ObjectProxy().setObj(re);
}
Program: 43575
Project: 43575
Buggy source:
public ObjectProxy fetch(String name){
  Object re=session.getAttribute(name);
  if (re == null)   return null;
  if (re instanceof ObjectProxy)   return (ObjectProxy)re;
  ObjectProxy op=new ObjectProxy();
  StaticWeaver staticWeaver=new StaticWeaver();
  staticWeaver.setObj(re);
  op.setWeaver(staticWeaver);
  return op;
}

Fixed version (ground truth):
public ObjectProxy fetch(String name){
  Object re=session.getAttribute(name);
  if (re == null)   return null;
  if (re instanceof ObjectProxy)   return (ObjectProxy)re;
  return new ObjectProxy().setObj(re);
}
Program: 43576
Project: 43576
Buggy source:
/** 
 * 将数据写入文件,成功就返回true,失败就返回false
 * @param file 需要写入的文件
 * @param data 需要写入的数据
 * @return true 如果写入成功
 */
public static boolean write(File file,byte data[]){
  try {
    FileOutputStream fos=new FileOutputStream(file);
    fos.write(data);
    fos.flush();
    fos.close();
  }
 catch (  Throwable e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * 将内容写到一个文件内，内容对象可以是： <ul> <li>InputStream - 按二进制方式写入 <li>byte[] - 按二进制方式写入 <li>Reader - 按 UTF-8 方式写入 <li>其他对象被 toString() 后按照 UTF-8 方式写入 </ul>
 * @param f 文件
 * @param obj 内容
 */
public static void write(File f,Object obj){
  if (null == f || null == obj)   return;
  if (f.isDirectory())   throw Lang.makeThrow("String_Node_Str",f);
  try {
    if (!f.exists())     Files.createNewFile(f);
    if (obj instanceof InputStream) {
      Streams.writeAndClose(Streams.fileOut(f),(InputStream)obj);
    }
 else     if (obj instanceof byte[]) {
      Streams.writeAndClose(Streams.fileOut(f),(byte[])obj);
    }
 else     if (obj instanceof Reader) {
      Streams.writeAndClose(Streams.fileOutw(f),(Reader)obj);
    }
 else {
      Streams.writeAndClose(Streams.fileOutw(f),obj.toString());
    }
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43577
Project: 43577
Buggy source:
/** 
 * 将一段文本全部写入一个输出流
 * @param ops 输出流
 * @param cs 文本
 * @throws IOException
 */
public static void write(OutputStream ops,CharSequence cs) throws IOException {
  if (null != cs && null != ops)   ops.write(cs.toString().getBytes());
}

Fixed version (ground truth):
/** 
 * 将一个字节数组写入一个输出流。 <p> <b style=color:red>注意</b>，它并不会关闭输出流
 * @param ops 输出流
 * @param bytes 字节数组
 * @throws IOException
 */
public static void write(OutputStream ops,byte[] bytes) throws IOException {
  if (null == ops || null == bytes)   return;
  ops.write(bytes);
}
Program: 43578
Project: 43578
Buggy source:
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return new String(Encoding.CHARSET_UTF8.encode(s.toString()).array(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return new String(s.toString().getBytes(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43581
Project: 43581
Buggy source:
public UploadAdaptor(String path,int buffer,String charset,int poolSize){
  this.charset=charset;
  this.pool=new NutFilePool(path,poolSize);
  this.buffer=buffer;
}

Fixed version (ground truth):
public UploadAdaptor(String path,int buffer,String charset,int poolSize){
  context=new UploadingContext();
  context.setBufferSize(buffer);
  context.setCharset(charset);
  context.setFilePool(new NutFilePool(path,poolSize));
}
Program: 43582
Project: 43582
Buggy source:
public Object[] adapt(HttpServletRequest request,HttpServletResponse response,String[] pathArgs){
  Map<String,Object> map;
  try {
    Uploading ing=new FastUploading(buffer);
    map=ing.parse(request,charset,pool);
  }
 catch (  UploadException e) {
    throw Lang.wrapThrow(e);
  }
  Object[] args=new Object[injs.length];
  int i=fillPathArgs(request,response,pathArgs,args);
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(request,response,map);
  }
  return args;
}

Fixed version (ground truth):
public Object[] adapt(HttpServletRequest request,HttpServletResponse response,String[] pathArgs){
  Map<String,Object> map;
  try {
    Uploading ing=new FastUploading();
    map=ing.parse(request,context);
  }
 catch (  UploadException e) {
    throw Lang.wrapThrow(e);
  }
  Object[] args=new Object[injs.length];
  int i=fillPathArgs(request,response,pathArgs,args);
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(request,response,map);
  }
  return args;
}
Program: 43583
Project: 43583
Buggy source:
/** 
 * 对流的解析
 * @param req
 * @param charset
 * @param tmps
 * @throws UploadException
 */
Map<String,Object> parse(HttpServletRequest req,String charset,FilePool tmps) throws UploadException ;

Fixed version (ground truth):
/** 
 * 对流的解析
 * @param req
 * @param charset
 * @param tmps
 * @throws UploadException
 * @throws UploadOutOfSizeException
 * @throws UploadUnsupportedFileNameException
 * @throws UploadUnsupportedFileTypeException
 */
Map<String,Object> parse(HttpServletRequest req,UploadingContext context) throws UploadException, UploadOutOfSizeException, UploadUnsupportedFileNameException, UploadUnsupportedFileTypeException ;
Program: 43585
Project: 43585
Buggy source:
@Override public Number cast(String src,Class<?> toType,String... args){
  try {
    return (Number)Mirror.me(toType).getWrapperClass().getConstructor(String.class).newInstance(Strings.isBlank(src) ? "String_Node_Str" : src);
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@Override public Number cast(String src,Class<?> toType,String... args){
  if (Strings.isBlank(src)) {
    if (toType.isPrimitive())     return 0;
 else     return null;
  }
  try {
    return (Number)Mirror.me(toType).getWrapperClass().getConstructor(String.class).newInstance(src);
  }
 catch (  Exception e) {
    throw new FailToCastObjectException(String.format("String_Node_Str",src,toType.getName()),e);
  }
}
Program: 43586
Project: 43586
Buggy source:
/** 
 * @param req 请求对象
 * @param resp 响应对象
 * @param refer 这个参考字段，如果有值，表示是路径参数的值，那么它比 request 里的参数优先
 * @return 注入值
 */
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null != refer)   return Castors.me().castTo(refer,type);
  return Castors.me().castTo(req.getParameter(name),type);
}

Fixed version (ground truth):
/** 
 * @param req 请求对象
 * @param resp 响应对象
 * @param refer 这个参考字段，如果有值，表示是路径参数的值，那么它比 request 里的参数优先
 * @return 注入值
 */
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null != refer)   return Castors.me().castTo(refer,type);
  String[] params=req.getParameterValues(name);
  return Castors.me().castTo(params,type);
}
Program: 43587
Project: 43587
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>Mirror<T> getMirror(Class<T> type,String name){
  if (MethodInterceptor.class.isAssignableFrom(type))   return Mirror.me(type);
  if (type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX))   return Mirror.me(type);
  if (AopConfigration.IOCNAME.equals(name))   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))   return Mirror.me(type);
  if (type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX))   return Mirror.me(type);
  if (AopConfigration.IOCNAME.equals(name))   return Mirror.me(type);
  if (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));
}
Program: 43588
Project: 43588
Buggy source:
public ActionInvoker getInvoker(){
  return invoker;
}

Fixed version (ground truth):
public ActionInvoker getInvoker(){
  return pathInfo.getObj();
}
Program: 43589
Project: 43589
Buggy source:
public void invoke(HttpServletRequest req,HttpServletResponse resp){
  invoker.invoke(req,resp,pathArgs);
}

Fixed version (ground truth):
public void invoke(HttpServletRequest req,HttpServletResponse resp){
  getInvoker().invoke(req,resp,pathArgs);
}
Program: 43590
Project: 43590
Buggy source:
public ActionInvoking(ActionInvoker invoker,String[] pathArgs){
  this.invoker=invoker;
  this.pathArgs=pathArgs;
}

Fixed version (ground truth):
public ActionInvoking(PathInfo<ActionInvoker> pathInfo,String[] pathArgs){
  this.pathInfo=pathInfo;
  this.pathArgs=pathArgs;
}
Program: 43591
Project: 43591
Buggy source:
public ActionInvoking get(String path);

Fixed version (ground truth):
/** 
 * @param path 请求路径
 * @return 调用时
 */
public ActionInvoking get(String path);
Program: 43592
Project: 43592
Buggy source:
public int getCursor(){
  return cursor;
}

Fixed version (ground truth):
/** 
 * @return 匹配的步长<ul> <li>-1 - 表示这个路径全部被匹配了 <li>0 - 表示这个路径没有被匹配 <li>>0 - 表示这个路径被一个 * 匹配 </ul>
 */
public int getCursor(){
  return cursor;
}
Program: 43593
Project: 43593
Buggy source:
public String getRemain(){
  return remain;
}

Fixed version (ground truth):
/** 
 * @return 路径中未匹配的部分
 */
public String getRemain(){
  return remain;
}
Program: 43594
Project: 43594
Buggy source:
PathInfo(int i,String remain,T obj){
  this.cursor=i;
  this.remain=remain;
  this.obj=obj;
}

Fixed version (ground truth):
PathInfo(int i,String path,T obj){
  this.path=path;
  this.cursor=i;
  if (i == -1) {
    this.known=path;
    this.remain=null;
  }
 else   if (i == 0) {
    this.known=null;
    this.remain=path;
  }
 else {
    this.known=path.substring(0,i);
    this.remain=path.substring(i);
  }
  this.obj=obj;
}
Program: 43595
Project: 43595
Buggy source:
PathInfo<T> get(String path){
  char[] cs=path.toLowerCase().toCharArray();
  PathNode<T> wild=null;
  PathNode<T> node=this;
  int i=0;
  for (; i < cs.length; i++) {
    if (node.isStar) {
      wild=node;
    }
    char c=cs[i];
    if (null == node.chars)     break;
    int index=Arrays.binarySearch(node.chars,c);
    if (index < 0)     break;
    node=node.children[index];
  }
  if (i == cs.length) {
    return new PathInfo<T>(i,null,node.obj);
  }
 else   if (null != wild && wild.isStar)   return new PathInfo<T>(i,path.substring(i),wild.obj);
  return new PathInfo<T>(0,path,null);
}

Fixed version (ground truth):
PathInfo<T> get(String path){
  char[] cs=path.toLowerCase().toCharArray();
  PathNode<T> wild=null;
  PathNode<T> node=this;
  int i=0;
  for (; i < cs.length; i++) {
    if (node.isStar) {
      wild=node;
    }
    char c=cs[i];
    if (null == node.chars)     break;
    int index=Arrays.binarySearch(node.chars,c);
    if (index < 0)     break;
    node=node.children[index];
  }
  if (i == cs.length) {
    return new PathInfo<T>(-1,path,node.obj);
  }
 else   if (null != wild && wild.isStar)   return new PathInfo<T>(i,path.substring(i),wild.obj);
  return new PathInfo<T>(0,path,null);
}
Program: 43596
Project: 43596
Buggy source:
public ActionInvoking get(String path){
  PathInfo<ActionInvoker> info=root.get(path);
  String[] args=Strings.splitIgnoreBlank(info.getRemain(),"String_Node_Str");
  return new ActionInvoking(info.getObj(),args);
}

Fixed version (ground truth):
public ActionInvoking get(String path){
  PathInfo<ActionInvoker> info=root.get(path);
  String[] args=Strings.splitIgnoreBlank(info.getRemain(),"String_Node_Str");
  return new ActionInvoking(info,args);
}
Program: 43597
Project: 43597
Buggy source:
public JsonFormat(boolean compact){
  this.compact=compact;
  this.indentBy="String_Node_Str";
  this.quoteName=true;
  this.castors=Castors.me();
}

Fixed version (ground truth):
public JsonFormat(boolean compact){
  this.compact=compact;
  this.indentBy="String_Node_Str";
  this.quoteName=true;
  this.castors=Castors.me();
  this.separator='\"';
}
Program: 43598
Project: 43598
Buggy source:
private void string2Json(String s) throws IOException {
  if (null == s)   writer.append("String_Node_Str");
 else {
    char[] cs=s.toCharArray();
    writer.append('"');
    for (    char c : cs) {
switch (c) {
case '"':
        writer.append("String_Node_Str");
      break;
case '\n':
    writer.append("String_Node_Str");
  break;
case '\t':
writer.append("String_Node_Str");
break;
case '\r':
writer.append("String_Node_Str");
break;
case '\\':
writer.append("String_Node_Str");
break;
default :
writer.append(c);
}
}
writer.append('"');
}
}

Fixed version (ground truth):
private void string2Json(String s) throws IOException {
  if (null == s)   writer.append("String_Node_Str");
 else {
    char[] cs=s.toCharArray();
    writer.append(format.getSeparator());
    for (    char c : cs) {
switch (c) {
case '"':
        writer.append("String_Node_Str");
      break;
case '\n':
    writer.append("String_Node_Str");
  break;
case '\t':
writer.append("String_Node_Str");
break;
case '\r':
writer.append("String_Node_Str");
break;
case '\\':
writer.append("String_Node_Str");
break;
default :
writer.append(c);
}
}
writer.append(format.getSeparator());
}
}
Program: 43599
Project: 43599
Buggy source:
public void setProductName(String productName){
  this.productName=productName;
  String proName=productName.toLowerCase();
  if ("String_Node_Str".equals(proName)) {
    type=DB.H2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.PSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.MYSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.ORACLE;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.DB2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.SQLSERVER;
  }
 else {
    type=DB.OTHER;
  }
}

Fixed version (ground truth):
public void setProductName(String productName){
  this.productName=productName;
  String proName=productName.toLowerCase();
  if ("String_Node_Str".equals(proName)) {
    type=DB.H2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.PSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.MYSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.ORACLE;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.DB2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.SQLSERVER;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.SQLITE;
  }
 else {
    type=DB.OTHER;
  }
}
Program: 43600
Project: 43600
Buggy source:
public Pager make(DatabaseMeta meta,int pageNumber,int pageSize){
  if (pageNumber < 1 || pageSize <= 0)   return null;
  Pager pager;
  if (meta.isMySql() || meta.isH2()) {
    pager=new MysqlPager();
  }
 else   if (meta.isPostgresql()) {
    pager=new PostgresqlPager();
  }
 else   if (meta.isOracle()) {
    pager=new OraclePager();
  }
 else   if (meta.isSqlServer()) {
    if (meta.getVersion().contains("String_Node_Str"))     pager=new SqlServer2000Pager();
 else     pager=new SqlServer2005Pager();
  }
 else   if (meta.isDB2()) {
    pager=new DB2Pager();
  }
 else {
    pager=new OtherPager();
  }
  pager.setPageNumber(pageNumber);
  pager.setPageSize(pageSize);
  return pager;
}

Fixed version (ground truth):
public Pager make(DatabaseMeta meta,int pageNumber,int pageSize){
  if (pageNumber < 1 || pageSize <= 0)   return null;
  Pager pager;
  if (meta.isMySql() || meta.isH2() || meta.isSQLite()) {
    pager=new MysqlPager();
  }
 else   if (meta.isPostgresql()) {
    pager=new PostgresqlPager();
  }
 else   if (meta.isOracle()) {
    pager=new OraclePager();
  }
 else   if (meta.isSqlServer()) {
    if (meta.getVersion().contains("String_Node_Str"))     pager=new SqlServer2000Pager();
 else     pager=new SqlServer2005Pager();
  }
 else   if (meta.isDB2()) {
    pager=new DB2Pager();
  }
 else {
    pager=new OtherPager();
  }
  pager.setPageNumber(pageNumber);
  pager.setPageSize(pageSize);
  return pager;
}