nus-yam/ex-repair huggingface dataset:
Program: 43601
Project: 43601
Buggy source:
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=mirror.born();
  for (int i=0; i < injs.length; i++) {
    Injecting inj=injs[i];
    String s=req.getParameter(names[i]);
    if (null == s)     continue;
    if (Strings.isBlank(s))     s=null;
    inj.inject(obj,s);
  }
  return obj;
}

Fixed version (ground truth):
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=mirror.born();
  for (int i=0; i < injs.length; i++) {
    Injecting inj=injs[i];
    String[] ss=req.getParameterValues(names[i]);
    if (null == ss)     continue;
    inj.inject(obj,ss);
  }
  return obj;
}
Program: 43603
Project: 43603
Buggy source:
public Map<String,String[]> getParameterMap(){
  return parameterMap;
}

Fixed version (ground truth):
public Map<String,String[]> getParameterMap(){
  return params;
}
Program: 43604
Project: 43604
Buggy source:
public String getParameter(String key){
  if (parameterMap.containsKey(key)) {
    return parameterMap.get(key)[0];
  }
  return null;
}

Fixed version (ground truth):
public String getParameter(String key){
  if (params.containsKey(key)) {
    return params.get(key)[0];
  }
  return null;
}
Program: 43605
Project: 43605
Buggy source:
public Enumeration<String> getParameterNames(){
  return new Vector<String>(parameterMap.keySet()).elements();
}

Fixed version (ground truth):
public Enumeration<String> getParameterNames(){
  return new Vector<String>(params.keySet()).elements();
}
Program: 43606
Project: 43606
Buggy source:
public void setParameter(String key,String value){
  parameterMap.put(key,new String[]{value});
}

Fixed version (ground truth):
public void setParameter(String key,Number num){
  setParameter(key,num.toString());
}
Program: 43607
Project: 43607
Buggy source:
public String[] getParameterValues(String arg0){
  List<String> pp=new ArrayList<String>(parameterMap.size());
  for (  Entry<String,String[]> strs : parameterMap.entrySet()) {
    for (    String str : strs.getValue()) {
      pp.add(str);
    }
  }
  return pp.toArray(new String[pp.size()]);
}

Fixed version (ground truth):
public String[] getParameterValues(String name){
  Object param=params.get(name);
  return Castors.me().castTo(param,String[].class);
}
Program: 43608
Project: 43608
Buggy source:
public String getQueryString(){
  if (parameterMap.size() == 0)   return null;
  StringBuilder sb=new StringBuilder();
  for (  Entry<String,String[]> entry : parameterMap.entrySet()) {
    if (entry.getValue() == null)     sb.append(entry.getKey()).append("String_Node_Str");
 else     for (    String str : entry.getValue()) {
      sb.append(entry.getKey()).append("String_Node_Str").append(str).append("String_Node_Str");
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
public String getQueryString(){
  if (params.size() == 0)   return null;
  StringBuilder sb=new StringBuilder();
  for (  Entry<String,String[]> entry : params.entrySet()) {
    if (entry.getValue() == null)     sb.append(entry.getKey()).append("String_Node_Str");
 else     for (    String str : entry.getValue()) {
      sb.append(entry.getKey()).append("String_Node_Str").append(str).append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 43609
Project: 43609
Buggy source:
public void invoke(int i,Object ele,int length) throws ExitLoop, LoopException {
  sb.append(Sqls.formatFieldValue(ele)).append(',');
}

Fixed version (ground truth):
public void invoke(int i,Object ele,int length) throws ExitLoop, LoopException {
  sb.append(Sqls.formatSqlFieldValue(ele)).append(',');
}
Program: 43610
Project: 43610
Buggy source:
public void render(final StringBuilder sb,Entity<?> en){
  if (null != en) {
    EntityField ef=en.getField(name);
    sb.append(null != ef ? ef.getColumnName() : name);
  }
 else   sb.append(name);
  if ("String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
    if (null == value)     throw Lang.makeThrow("String_Node_Str",sb);
    if (value instanceof Collection<?> || value.getClass().isArray()) {
      sb.append('(');
      Lang.each(value,new Each<Object>(){
        public void invoke(        int i,        Object ele,        int length) throws ExitLoop, LoopException {
          sb.append(Sqls.formatFieldValue(ele)).append(',');
        }
      }
);
      sb.setCharAt(sb.length() - 1,')');
    }
 else     sb.append(Sqls.formatFieldValue(value));
  }
 else   if (null == value && "String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(op) || "String_Node_Str".equals(op)) {
    sb.append(' ').append(op).append(' ').append(Sqls.formatFieldValue(value));
  }
 else {
    sb.append(op).append(Sqls.formatFieldValue(value));
  }
}

Fixed version (ground truth):
public void render(final StringBuilder sb,Entity<?> en){
  if (null != en) {
    EntityField ef=en.getField(name);
    sb.append(null != ef ? ef.getColumnName() : name);
  }
 else   sb.append(name);
  if ("String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
    if (null == value)     throw Lang.makeThrow("String_Node_Str",sb);
    if (value instanceof Collection<?> || value.getClass().isArray()) {
      sb.append('(');
      Lang.each(value,new Each<Object>(){
        public void invoke(        int i,        Object ele,        int length) throws ExitLoop, LoopException {
          sb.append(Sqls.formatSqlFieldValue(ele)).append(',');
        }
      }
);
      sb.setCharAt(sb.length() - 1,')');
    }
 else     sb.append(Sqls.formatSqlFieldValue(value));
  }
 else   if (null == value && "String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(op) || "String_Node_Str".equals(op)) {
    sb.append(' ').append(op).append(' ').append(Sqls.formatSqlFieldValue(value));
  }
 else {
    sb.append(op).append(Sqls.formatSqlFieldValue(value));
  }
}
Program: 43611
Project: 43611
Buggy source:
/** 
 * @param v 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence formatFieldValue(Object v){
  if (null == v)   return "String_Node_Str";
 else   if (Sqls.isNotNeedQuote(v.getClass()))   return Sqls.escapeFieldValue(v.toString());
 else   return new StringBuilder("String_Node_Str").append(Sqls.escapeFieldValue(v.toString())).append('\'');
}

Fixed version (ground truth):
/** 
 * 格式化值，根据值的类型，生成 SQL 字段值的部分，它会考虑 SQL 注入
 * @param v 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence formatFieldValue(Object v){
  if (null == v)   return "String_Node_Str";
 else   if (Sqls.isNotNeedQuote(v.getClass()))   return Sqls.escapeFieldValue(v.toString());
 else   return new StringBuilder("String_Node_Str").append(Sqls.escapeFieldValue(v.toString())).append('\'');
}
Program: 43612
Project: 43612
Buggy source:
/** 
 * 将 SQL 的 WHERE 条件值进行转意，可以用来防止 SQL 注入攻击
 * @param s 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence escapteConditionValue(CharSequence s){
  if (null == s)   return null;
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (c == '\'')     sb.append('\'').append('\'');
 else     if (c == '\\')     sb.append('\\').append('\\');
 else     if (c == '_')     sb.append('\\').append(c);
 else     if (c == '%')     sb.append('\\').append(c);
 else     sb.append(c);
  }
  return sb;
}

Fixed version (ground truth):
/** 
 * 将 SQL 的 WHERE 条件值进行转意，可以用来防止 SQL 注入攻击
 * @param s 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence escapteConditionValue(CharSequence s){
  if (null == s)   return null;
  return ES_CND_VAL.escape(s);
}
Program: 43613
Project: 43613
Buggy source:
/** 
 * 将 SQL 的字段值进行转意，可以用来防止 SQL 注入攻击
 * @param s 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence escapeFieldValue(CharSequence s){
  if (null == s)   return null;
  StringBuilder sb=new StringBuilder();
  for (int i=0; i < s.length(); i++) {
    char c=s.charAt(i);
    if (c == '\'')     sb.append('\'').append('\'');
 else     if (c == '\\')     sb.append('\\').append('\\');
 else     sb.append(c);
  }
  return sb;
}

Fixed version (ground truth):
/** 
 * 将 SQL 的字段值进行转意，可以用来防止 SQL 注入攻击
 * @param s 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence escapeFieldValue(CharSequence s){
  if (null == s)   return null;
  return ES_FLD_VAL.escape(s);
}
Program: 43614
Project: 43614
Buggy source:
protected void loadIoc() throws Throwable {
  IocBy ib=mainModule.getAnnotation(IocBy.class);
  if (null != ib) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",ib.type().getName());
    ioc=ib.type().newInstance().create(config,ib.args());
    saveToContext(Ioc.class.getName(),ioc);
  }
 else   if (log.isDebugEnabled())   log.debug("String_Node_Str");
}

Fixed version (ground truth):
protected void loadIoc() throws Throwable {
  IocBy ib=mainModule.getAnnotation(IocBy.class);
  if (null != ib) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",ib.type().getName());
    ioc=ib.type().newInstance().create(config,ib.args());
    if (ioc instanceof Ioc2)     ((Ioc2)ioc).addValueProxyMaker(new MvcValueProxyMaker());
    saveToContext(Ioc.class.getName(),ioc);
  }
 else   if (log.isDebugEnabled())   log.debug("String_Node_Str");
}
Program: 43615
Project: 43615
Buggy source:
Ioc create(ServletConfig config,String[] args);

Fixed version (ground truth):
Ioc create(NutConfig config,String[] args);
Program: 43616
Project: 43616
Buggy source:
void load(Class<?> klass);

Fixed version (ground truth):
void load(NutConfig config,Class<?> klass);
Program: 43617
Project: 43617
Buggy source:
/** 
 * 获取当前请求的路径，并去掉后缀
 */
public static String getRequestPath(HttpServletRequest req){
  String path=req.getPathInfo();
  if (null == path)   path=req.getServletPath();
  if (null == path)   return "String_Node_Str";
  int lio=path.lastIndexOf('.');
  if (lio > 0)   path=path.substring(0,lio);
  return path;
}

Fixed version (ground truth):
/** 
 * 获取当前请求的路径，并去掉后缀
 */
public static String getRequestPath(HttpServletRequest req){
  return getRequestPathObject(req).getPath();
}
Program: 43618
Project: 43618
Buggy source:
public void init(FilterConfig config) throws ServletException {
}

Fixed version (ground truth):
public void init(FilterConfig conf) throws ServletException {
  config=new FilterNutConfig(conf);
  Loading ing=Inits.init(config,true);
  if (null != ing)   urls=ing.getUrls();
  String regx=Strings.sNull(config.getAttribute("String_Node_Str"),IGNORE);
  if (!"String_Node_Str".equalsIgnoreCase(regx)) {
    ignorePtn=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
  }
}
Program: 43619
Project: 43619
Buggy source:
public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  Mvcs.updateRequestAttributes((HttpServletRequest)req);
  chain.doFilter(req,resp);
}

Fixed version (ground truth):
public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  Mvcs.updateRequestAttributes((HttpServletRequest)req);
  if (null != urls) {
    RequestPath path=Mvcs.getRequestPathObject((HttpServletRequest)req);
    if (null == ignorePtn || !ignorePtn.matcher(path.getUrl()).find()) {
      ActionInvoking ing=urls.get(path.getPath());
      if (null != ing && null != ing.getInvoker()) {
        if (log.isInfoEnabled())         log.info(path);
        ing.invoke((HttpServletRequest)req,(HttpServletResponse)resp);
        return;
      }
    }
  }
  chain.doFilter(req,resp);
}
Program: 43620
Project: 43620
Buggy source:
public void destroy(){
}

Fixed version (ground truth):
public void destroy(){
  if (null != urls)   Inits.destroy(config);
}
Program: 43621
Project: 43621
Buggy source:
@Override public void init() throws ServletException {
  try {
    if (log.isInfoEnabled()) {
      log.infof("String_Node_Str",Nutz.version());
      log.infof("String_Node_Str",this.getServletName());
    }
    Stopwatch sw=Stopwatch.begin();
    String name=Strings.trim(this.getServletConfig().getInitParameter("String_Node_Str"));
    if (Strings.isEmpty(name)) {
      throw Lang.makeThrow(ServletException.class,"String_Node_Str",this.getClass().getName());
    }
    Class<?> mainModule=Class.forName(name);
    Class<? extends Loading> loadingType;
    LoadingBy lb=mainModule.getAnnotation(LoadingBy.class);
    if (null != lb)     loadingType=lb.value();
 else     loadingType=DefaultLoading.class;
    Loading ing=Mirror.me(loadingType).born(this.getServletConfig());
    ing.load(mainModule);
    urls=ing.getUrls();
    sw.stop();
    if (log.isInfoEnabled())     log.infof("String_Node_Str",this.getServletName(),sw.getDuration());
    ok=true;
  }
 catch (  Throwable e) {
    if (log.isErrorEnabled())     log.error("String_Node_Str",e);
    if (e instanceof ServletException)     throw (ServletException)e;
    throw new ServletException(e);
  }
}

Fixed version (ground truth):
@Override public void init() throws ServletException {
  Loading ing=Inits.init(new ServletNutConfig(getServletConfig()),false);
  urls=ing.getUrls();
  ok=true;
}
Program: 43622
Project: 43622
Buggy source:
public void destroy(){
  if (log.isInfoEnabled())   log.infof("String_Node_Str",this.getServletName());
  Stopwatch sw=Stopwatch.begin();
  try {
    urls=null;
    Setup setup=(Setup)this.getServletContext().getAttribute(Setup.class.getName());
    if (null != setup)     setup.destroy(getServletConfig());
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
 finally {
    super.destroy();
  }
  Ioc ioc=Mvcs.getIoc(this.getServletContext());
  if (null != ioc)   ioc.depose();
  sw.stop();
  if (log.isInfoEnabled())   log.infof("String_Node_Str",this.getServletName(),sw.getDuration());
}

Fixed version (ground truth):
public void destroy(){
  NutConfig config=new ServletNutConfig(getServletConfig());
  if (config.getMainModule() != null)   Inits.destroy(config);
}
Program: 43623
Project: 43623
Buggy source:
/** 
 * 启动时，额外逻辑
 * @param config
 */
void init(ServletConfig config);

Fixed version (ground truth):
/** 
 * 启动时，额外逻辑
 * @param config
 */
void init(NutConfig config);
Program: 43624
Project: 43624
Buggy source:
/** 
 * 关闭时，额外逻辑
 * @param config
 */
void destroy(ServletConfig config);

Fixed version (ground truth):
/** 
 * 关闭时，额外逻辑
 * @param config
 */
void destroy(NutConfig config);
Program: 43625
Project: 43625
Buggy source:
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (File.class.isAssignableFrom(type))   return new FileInjector(param.value());
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(param.value());
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(param.value());
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  return new MapItemInjector(param.value(),type);
}

Fixed version (ground truth):
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (File.class.isAssignableFrom(type))   return new FileInjector(param.value());
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(param.value());
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(param.value());
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  String pm=param.value();
  if ("String_Node_Str".equals(pm)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new MapReferInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new MapReferInjector(pm.substring(2),type);
  }
 else   if (type.isArray())   return new ArrayInjector(pm,type);
  return new MapItemInjector(param.value(),type);
}
Program: 43626
Project: 43626
Buggy source:
public T born(){
  try {
    return borning.born(realArgs);
  }
 catch (  Throwable e) {
    throw new BorningException(e,type,realArgs);
  }
}

Fixed version (ground truth):
public T born(){
  try {
    return borning.born(realArgs);
  }
 catch (  Throwable e) {
    throw new BorningException(Lang.unwrapThrow(e),type,realArgs);
  }
}
Program: 43627
Project: 43627
Buggy source:
private void evalEncoding(Method method,Encoding dftEncoding){
  Encoding encoding=method.getAnnotation(Encoding.class);
  if (null == encoding)   encoding=dftEncoding;
  if (null == encoding) {
    inputCharset=org.nutz.lang.Encoding.defaultEncoding();
    outputCharset=org.nutz.lang.Encoding.defaultEncoding();
  }
 else {
    inputCharset=encoding.input();
    outputCharset=encoding.output();
  }
}

Fixed version (ground truth):
private void evalEncoding(Method method,Encoding dftEncoding){
  Encoding encoding=method.getAnnotation(Encoding.class);
  if (null == encoding)   encoding=dftEncoding;
  if (null == encoding) {
    inputCharset=org.nutz.lang.Encoding.UTF8;
    outputCharset=org.nutz.lang.Encoding.UTF8;
  }
 else {
    inputCharset=encoding.input();
    outputCharset=encoding.output();
  }
}
Program: 43629
Project: 43629
Buggy source:
private static String getJarPath(File dir){
  String fpath=dir.getAbsolutePath();
  int posBegin=fpath.indexOf("String_Node_Str") + 5;
  int posEnd=fpath.lastIndexOf('!');
  if (posBegin > 0 && (posEnd - posBegin) > 0)   return fpath.substring(posBegin,posEnd);
  return null;
}

Fixed version (ground truth):
static String getJarPath(String jarPath){
  int posBegin=jarPath.indexOf("String_Node_Str");
  if (posBegin == -1)   posBegin=0;
 else {
    posBegin+=6;
    if (jarPath.length() <= posBegin)     return null;
    if (jarPath.charAt(posBegin - 1) != '\\')     posBegin--;
  }
  int posEnd=jarPath.lastIndexOf('!');
  if (posBegin >= 0 && (posEnd - posBegin) > 0)   return jarPath.substring(posBegin,posEnd);
  return null;
}
Program: 43631
Project: 43631
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? null : (Map<?,?>)obj;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    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 {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? (Map<?,?>)obj : null;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    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();
}
Program: 43633
Project: 43633
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=(Map<?,?>)obj;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    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 {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? null : (Map<?,?>)obj;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    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();
}
Program: 43634
Project: 43634
Buggy source:
public void addValueProxyMaker(ValueProxyMaker vpm){
  vpms.add(vpm);
}

Fixed version (ground truth):
public void addValueProxyMaker(ValueProxyMaker vpm){
  vpms.add(0,vpm);
}
Program: 43635
Project: 43635
Buggy source:
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return getParent().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
  }
  return 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) {
      }
    }
  }
  return loadClass(className);
}
Program: 43636
Project: 43636
Buggy source:
@SuppressWarnings("String_Node_Str") protected <T>Class<T> generate(ClassDefiner cd,Pair2[] pair2s,String newName,Class<T> klass,Constructor<T>[] constructors){
  try {
    return (Class<T>)cd.load(newName);
  }
 catch (  ClassNotFoundException e) {
  }
  try {
    cd.load("String_Node_Str");
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Method[] methodArray=new Method[pair2s.length];
  List<MethodInterceptor>[] methodInterceptorList=new List[pair2s.length];
  for (int i=0; i < pair2s.length; i++) {
    Pair2 pair2=pair2s[i];
    methodArray[i]=pair2.method;
    methodInterceptorList[i]=pair2.listeners;
  }
  byte[] bytes=ClassY.enhandClass(klass,newName,methodArray,constructors);
  if (debug)   Files.write(new File(newName),bytes);
  Class<T> newClass=(Class<T>)cd.define(newName,bytes);
  AopToolKit.injectFieldValue(newClass,methodArray,methodInterceptorList);
  return newClass;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") protected <T>Class<T> generate(ClassDefiner cd,Pair2[] pair2s,String newName,Class<T> klass,Constructor<T>[] constructors){
  try {
    return (Class<T>)cd.load(newName);
  }
 catch (  ClassNotFoundException e) {
  }
  Method[] methodArray=new Method[pair2s.length];
  List<MethodInterceptor>[] methodInterceptorList=new List[pair2s.length];
  for (int i=0; i < pair2s.length; i++) {
    Pair2 pair2=pair2s[i];
    methodArray[i]=pair2.method;
    methodInterceptorList[i]=pair2.listeners;
  }
  byte[] bytes=ClassY.enhandClass(klass,newName,methodArray,constructors);
  if (debug)   Files.write(new File(newName),bytes);
  Class<T> newClass=(Class<T>)cd.define(newName,bytes);
  AopToolKit.injectFieldValue(newClass,methodArray,methodInterceptorList);
  return newClass;
}
Program: 43637
Project: 43637
Buggy source:
public DefaultMirrorFactory(Ioc ioc){
  this.ioc=ioc;
  this.cd=new DefaultClassDefiner();
}

Fixed version (ground truth):
public DefaultMirrorFactory(Ioc ioc){
  this.ioc=ioc;
  this.cd=new DefaultClassDefiner(getClass().getClassLoader());
}
Program: 43638
Project: 43638
Buggy source:
public XmlFileMirrorFactory(Ioc ioc,String... fileNames) throws ParserConfigurationException, SAXException, IOException {
  this.ioc=ioc;
  this.cd=new DefaultClassDefiner();
  DocumentBuilder builder=Lang.xmls();
  Document document;
  for (  String fileName : fileNames) {
    document=builder.parse(Files.findFile(fileName));
    document.normalizeDocument();
    NodeList nodeListZ=((Element)document.getDocumentElement()).getElementsByTagName("String_Node_Str");
    for (int i=0; i < nodeListZ.getLength(); i++)     parse((Element)nodeListZ.item(i));
  }
}

Fixed version (ground truth):
public XmlFileMirrorFactory(Ioc ioc,String... fileNames) throws ParserConfigurationException, SAXException, IOException {
  this.ioc=ioc;
  this.cd=new DefaultClassDefiner(getClass().getClassLoader());
  DocumentBuilder builder=Lang.xmls();
  Document document;
  for (  String fileName : fileNames) {
    document=builder.parse(Files.findFile(fileName));
    document.normalizeDocument();
    NodeList nodeListZ=((Element)document.getDocumentElement()).getElementsByTagName("String_Node_Str");
    for (int i=0; i < nodeListZ.getLength(); i++)     parse((Element)nodeListZ.item(i));
  }
}
Program: 43639
Project: 43639
Buggy source:
public static ClassDefiner cd(){
  return new DefaultClassDefiner();
}

Fixed version (ground truth):
public static ClassDefiner cd(){
  return new DefaultClassDefiner(Nutzs.class.getClassLoader());
}
Program: 43640
Project: 43640
Buggy source:
Exp(String name,String op,Object value){
  this.name=name;
  this.op=Strings.trim(op);
  if (ptn.matcher(this.op).find())   this.op="String_Node_Str" + this.op + "String_Node_Str";
  this.value=value;
}

Fixed version (ground truth):
Exp(String name,String op,Object value){
  this.name=name;
  this.op=Strings.trim(op);
  if (ptn.matcher(this.op).find())   this.op=this.op.toUpperCase();
  this.value=value;
}
Program: 43641
Project: 43641
Buggy source:
public void render(StringBuilder sb,Entity<?> en){
  if (null != en) {
    EntityField ef=en.getField(name);
    sb.append(null != ef ? ef.getColumnName() : name);
  }
 else   sb.append(name);
  sb.append(op);
  sb.append(Sqls.formatFieldValue(value));
}

Fixed version (ground truth):
public void render(final StringBuilder sb,Entity<?> en){
  if (null != en) {
    EntityField ef=en.getField(name);
    sb.append(null != ef ? ef.getColumnName() : name);
  }
 else   sb.append(name);
  if ("String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
    if (null == value)     throw Lang.makeThrow("String_Node_Str",sb);
    if (value instanceof Collection<?> || value.getClass().isArray()) {
      sb.append('(');
      Lang.each(value,new Each<Object>(){
        public void invoke(        int i,        Object ele,        int length) throws ExitLoop, LoopException {
          sb.append(Sqls.formatFieldValue(ele)).append(',');
        }
      }
);
      sb.setCharAt(sb.length() - 1,')');
    }
 else     sb.append(Sqls.formatFieldValue(value));
  }
 else   if (null == value && "String_Node_Str".equals(op)) {
    sb.append("String_Node_Str");
  }
 else   if ("String_Node_Str".equals(op) || "String_Node_Str".equals(op)) {
    sb.append(' ').append(op).append(' ').append(Sqls.formatFieldValue(value));
  }
 else {
    sb.append(op).append(Sqls.formatFieldValue(value));
  }
}
Program: 43643
Project: 43643
Buggy source:
/** 
 * 根据给定的字节数组，在环中作标记，以便 dump
 * @param bs 数组
 * @return 标记模式
 * @throws IOException
 */
public MarkMode mark(byte[] bs) throws IOException {
  RingItem ri=item;
  int re;
  while ((re=ri.mark(bs)) >= 0 && ri.isDone4Mark()) {
    if (re > 0) {
      if (!ri.next.isLoaded) {
        ri.next.load(ins);
        readed+=ri.next.max;
      }
 else       if (ri.next == this.item) {
        ri.nextmark=ri.r;
        return MarkMode.NOT_FOUND;
      }
      if (ri.next.matchHeadingWithRemain(bs,re)) {
        return MarkMode.FOUND;
      }
 else {
        ri.r=ri.max;
        ri.nextmark=ri.max;
      }
    }
    if (ri.isStreamEnd)     break;
    ri=ri.next;
    if (!ri.isLoaded) {
      ri.load(ins);
      readed+=ri.max;
    }
    if (ri == item)     break;
  }
  if (re == -1)   return MarkMode.FOUND;
  return ri.isStreamEnd ? MarkMode.STREAM_END : MarkMode.NOT_FOUND;
}

Fixed version (ground truth):
/** 
 * 根据给定的字节数组，在环中作标记，以便 dump
 * @param bs 数组
 * @return 标记模式
 * @throws IOException
 */
private MarkMode mark(byte[] bs,int[] fails) throws IOException {
  RingItem ri=item;
  int re;
  while ((re=ri.mark(bs,fails)) >= 0 && ri.isDone4Mark()) {
    if (re > 0) {
      if (!ri.next.isLoaded) {
        ri.next.load(ins);
        readed+=ri.next.max;
      }
 else       if (ri.next == this.item) {
        ri.nextmark=ri.r;
        return MarkMode.NOT_FOUND;
      }
      if (ri.next.matchHeadingWithRemain(bs,re)) {
        return MarkMode.FOUND;
      }
 else {
        ri.r=ri.max;
        ri.nextmark=ri.max;
      }
    }
    if (ri.isStreamEnd)     break;
    ri=ri.next;
    if (!ri.isLoaded) {
      ri.load(ins);
      readed+=ri.max;
    }
    if (ri == item)     break;
  }
  if (re == -1)   return MarkMode.FOUND;
  return ri.isStreamEnd ? MarkMode.STREAM_END : MarkMode.NOT_FOUND;
}
Program: 43644
Project: 43644
Buggy source:
public static RemountBytes create(byte[] bs){
  int[] ps=new int[bs.length];
  for (int i=2; i < bs.length; i++) {
  }
  RemountBytes re=new RemountBytes();
  re.bytes=bs;
  re.pos=ps;
  return re;
}

Fixed version (ground truth):
public static RemountBytes create(byte[] bs){
  int[] fails=new int[bs.length];
  if (bs.length > 1) {
    for (int i=2; i < bs.length; i++) {
      int blueL=1;
      int blueR=i - 1;
      int x=0;
      for (int j=blueL; j <= blueR; j++) {
        byte red=bs[x];
        byte blue=bs[j];
        if (red == blue)         x++;
 else         x=0;
      }
      fails[i]=x;
    }
  }
  RemountBytes re=new RemountBytes();
  re.bytes=bs;
  re.fails=fails;
  return re;
}
Program: 43645
Project: 43645
Buggy source:
/** 
 * 从给定 offs 尽力匹配给出的数组。 <p> 需要注意的是，如果返回的是 >0 的数，内部的标志位将被设置到第一个匹配字符，以便 DUMP 内容。 <br> 所以，如果下一个节点给出的结论是 -1，但是 'l' 并不是0，那么说明这个匹配是失败的，需要将 本节点的 r 置到 max 处。 <p> 返回值 <ul> <li><b>-1</b> - 全部被匹配 <li><b>0</b> - 未发现匹配 <li><b>大于 0</b> - 在缓冲的末尾发现匹配，但是没有匹配全，希望下一个节点继续从这个位置匹配 </ul>
 * @param bs 数组
 * @return -1, 0 或者 +n
 */
int mark(byte[] bs){
  if (!isLoaded)   throw new MarkUnloadedRingItemException();
  byte start=bs[0];
  for (; r < max; r++) {
    if (buffer[r] == start) {
      int re=0;
      int j=r;
      while (true) {
        re++;
        j++;
        if (re >= bs.length || j >= max)         break;
        if (bs[re] != buffer[j])         break;
      }
      if (re == bs.length) {
        nextmark=j;
        return -1;
      }
 else       if (j == max) {
        nextmark=max;
        if (isStreamEnd) {
          r=max;
          return 0;
        }
        return re;
      }
      r=j;
    }
  }
  nextmark=max;
  return 0;
}

Fixed version (ground truth):
/** 
 * 从给定 offs 尽力匹配给出的数组。 <p> 需要注意的是，如果返回的是 >0 的数，内部的标志位将被设置到第一个匹配字符，以便 DUMP 内容。 <br> 所以，如果下一个节点给出的结论是 -1，但是 'l' 并不是0，那么说明这个匹配是失败的，需要将 本节点的 r 置到 max 处。 <p> 返回值 <ul> <li><b>-1</b> - 全部被匹配 <li><b>0</b> - 未发现匹配 <li><b>大于 0</b> - 在缓冲的末尾发现匹配，但是没有匹配全，希望下一个节点继续从这个位置匹配 </ul>
 * @param bs 数组
 * @return -1, 0 或者 +n
 */
int mark(byte[] bs,int[] fails){
  if (!isLoaded)   throw new MarkUnloadedRingItemException();
  byte start=bs[0];
  for (; r < max; r++) {
    if (buffer[r] == start) {
      int re=0;
      int j=r;
      while (true) {
        re++;
        j++;
        if (re == bs.length) {
          nextmark=j;
          return -1;
        }
        if (j == max) {
          nextmark=max;
          if (isStreamEnd) {
            r=max;
            return 0;
          }
          return re;
        }
        if (bs[re] != buffer[j]) {
          re=fails[re];
          if (bs[re] != buffer[j]) {
            break;
          }
 else {
            r+=re == 0 ? 1 : re;
          }
        }
      }
      r=j;
    }
  }
  nextmark=max;
  return 0;
}
Program: 43647
Project: 43647
Buggy source:
@Test public void test_by_buffer2() throws IOException {
  byte[] boundary=Lang.toBytes("String_Node_Str".toCharArray());
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  br.skipMark();
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  assertEquals(25,br.readed);
}

Fixed version (ground truth):
@Test public void test_by_buffer2() throws IOException {
  RemountBytes boundary=RemountBytes.create("String_Node_Str");
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  br.skipMark();
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  assertEquals(25,br.readed);
}
Program: 43648
Project: 43648
Buggy source:
@Test public void test_by_buffer() throws IOException {
  byte[] boundary=Lang.toBytes("String_Node_Str".toCharArray());
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  br.skipMark();
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  assertEquals(27,br.readed);
}

Fixed version (ground truth):
@Test public void test_by_buffer() throws IOException {
  RemountBytes boundary=RemountBytes.create("String_Node_Str");
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  br.skipMark();
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  assertEquals(27,br.readed);
}
Program: 43649
Project: 43649
Buggy source:
@Test public void test_mark_dangerous_char() throws IOException {
  byte[] boundary=Lang.toBytes("String_Node_Str".toCharArray());
  String str="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}

Fixed version (ground truth):
@Test public void test_mark_dangerous_char() throws IOException {
  RemountBytes boundary=RemountBytes.create("String_Node_Str");
  String str="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}
Program: 43650
Project: 43650
Buggy source:
@Test public void test_mark_dangerous_char2() throws IOException {
  byte[] boundary=Lang.toBytes("String_Node_Str".toCharArray());
  String str="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}

Fixed version (ground truth):
@Test public void test_mark_dangerous_char2() throws IOException {
  RemountBytes boundary=RemountBytes.create("String_Node_Str");
  String str="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,10);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}
Program: 43651
Project: 43651
Buggy source:
@Test public void test_cross_ring_item() throws IOException {
  byte[] boundary=Lang.toBytes("String_Node_Str".toCharArray());
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.NOT_FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}

Fixed version (ground truth):
@Test public void test_cross_ring_item() throws IOException {
  RemountBytes boundary=RemountBytes.create("String_Node_Str");
  String str="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  str+="String_Node_Str";
  InputStream ins=Lang.ins(str);
  BufferRing br=new BufferRing(ins,3,5);
  String s;
  MarkMode mode;
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.NOT_FOUND,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
  br.load();
  mode=br.mark(boundary);
  assertEquals(MarkMode.STREAM_END,mode);
  s=br.dumpAsString();
  assertEquals("String_Node_Str",s);
}
Program: 43652
Project: 43652
Buggy source:
@Test public void test_case_A(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.pos[0]);
  assertEquals(0,rb.pos[1]);
  assertEquals(1,rb.pos[2]);
  assertEquals(0,rb.pos[3]);
}

Fixed version (ground truth):
@Test public void test_case_A(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.fails[0]);
  assertEquals(0,rb.fails[1]);
  assertEquals(1,rb.fails[2]);
  assertEquals(0,rb.fails[3]);
}
Program: 43653
Project: 43653
Buggy source:
@Test public void test_case_C(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.pos[0]);
  assertEquals(0,rb.pos[1]);
  assertEquals(0,rb.pos[2]);
  assertEquals(0,rb.pos[3]);
  assertEquals(0,rb.pos[4]);
  assertEquals(0,rb.pos[5]);
  assertEquals(3,rb.pos[6]);
}

Fixed version (ground truth):
@Test public void test_case_C(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.fails[0]);
  assertEquals(0,rb.fails[1]);
  assertEquals(0,rb.fails[2]);
  assertEquals(0,rb.fails[3]);
  assertEquals(1,rb.fails[4]);
  assertEquals(2,rb.fails[5]);
  assertEquals(3,rb.fails[6]);
}
Program: 43654
Project: 43654
Buggy source:
@Test public void test_case_B(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.pos[0]);
  assertEquals(0,rb.pos[1]);
  assertEquals(0,rb.pos[2]);
  assertEquals(0,rb.pos[3]);
  assertEquals(2,rb.pos[4]);
}

Fixed version (ground truth):
@Test public void test_case_B(){
  RemountBytes rb=RB("String_Node_Str");
  assertEquals(0,rb.fails[0]);
  assertEquals(0,rb.fails[1]);
  assertEquals(0,rb.fails[2]);
  assertEquals(1,rb.fails[3]);
  assertEquals(2,rb.fails[4]);
}
Program: 43656
Project: 43656
Buggy source:
/** 
 * 根据请求对象创建参数 MAP， 同时根据 QueryString，为 MAP 设置初始值
 * @param req 请求对象
 * @return 参数 MAP
 */
public static Map<String,Object> createParamsMap(HttpServletRequest req){
  Map<String,Object> params=new HashMap<String,Object>();
  String qs=req.getQueryString();
  if (null != qs) {
    String[] pairs=Strings.splitIgnoreBlank(qs,"String_Node_Str");
    for (    String pair : pairs) {
      String[] pp=pair.split("String_Node_Str");
      if (pp.length > 1)       params.put(pp[0],pp[1]);
 else       params.put(pp[0],null);
    }
  }
  return params;
}

Fixed version (ground truth):
/** 
 * 根据请求对象创建参数 MAP， 同时根据 QueryString，为 MAP 设置初始值
 * @param req 请求对象
 * @return 参数 MAP
 */
public static NutMap createParamsMap(HttpServletRequest req){
  NutMap params=new NutMap();
  String qs=req.getQueryString();
  if (null != qs) {
    String[] pairs=Strings.splitIgnoreBlank(qs,"String_Node_Str");
    for (    String pair : pairs) {
      String[] pp=pair.split("String_Node_Str");
      if (pp.length > 1)       params.put(pp[0],pp[1]);
 else       params.put(pp[0],null);
    }
  }
  return params;
}
Program: 43657
Project: 43657
Buggy source:
/** 
 * 如果txt中第一个支付和 firstChar一致,则删除,否则返回 txt <p> 比如: <ul> <li>removeFirst("12345",1) => "2345" <li>removeFirst("ABC",'B') => "ABC" <li>removeFirst("A",'B') => "A" <li>removeFirst("A",'A') => "" </ul>
 * @param str 字符串
 * @param c 第一个个要被截取的字符
 * @return 新字符串
 */
public static String removeFirst(String str,char c){
  if (str == null)   return null;
  if (str.length() == 0)   return "String_Node_Str";
  if (c == str.charAt(0))   return str.substring(1);
  return str;
}

Fixed version (ground truth):
/** 
 * 如果txt中第一个字符和 firstChar一致,则删除,否则返回 txt <p> 比如: <ul> <li>removeFirst("12345",1) => "2345" <li>removeFirst("ABC",'B') => "ABC" <li>removeFirst("A",'B') => "A" <li>removeFirst("A",'A') => "" </ul>
 * @param str 字符串
 * @param c 第一个个要被截取的字符
 * @return 新字符串
 */
public static String removeFirst(String str,char c){
  if (str == null)   return null;
  if (str.length() == 0)   return "String_Node_Str";
  if (c == str.charAt(0))   return str.substring(1);
  return str;
}
Program: 43658
Project: 43658
Buggy source:
@SuppressWarnings("String_Node_Str") void render(Object obj) throws IOException {
  if (null == obj) {
    writer.write("String_Node_Str");
  }
 else   if (obj instanceof Class) {
    string2Json(((Class<?>)obj).getName());
  }
 else   if (obj instanceof Mirror) {
    string2Json(((Mirror<?>)obj).getType().getName());
  }
 else {
    Mirror mr=Mirror.me(obj.getClass());
    if (mr.isEnum()) {
      string2Json(((Enum)obj).name());
    }
 else     if (mr.isNumber() || mr.isBoolean() || mr.isChar()) {
      writer.append(obj.toString());
    }
 else     if (mr.isStringLike()) {
      string2Json(obj.toString());
    }
 else     if (mr.isDateTimeLike()) {
      string2Json(format.getCastors().castToString(obj));
    }
 else     if (memo.containsKey(obj)) {
      writer.append("String_Node_Str");
    }
 else {
      if (obj instanceof Map)       map2Json((Map)obj);
 else       if (obj instanceof Collection)       coll2Json((Collection)obj);
 else       if (obj.getClass().isArray())       array2Json(obj);
 else {
        memo.put(obj,null);
        pojo2Json(obj);
        memo.remove(obj);
      }
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") void render(Object obj) throws IOException {
  if (null == obj) {
    writer.write("String_Node_Str");
  }
 else   if (obj instanceof Class) {
    string2Json(((Class<?>)obj).getName());
  }
 else   if (obj instanceof Mirror) {
    string2Json(((Mirror<?>)obj).getType().getName());
  }
 else {
    Mirror mr=Mirror.me(obj.getClass());
    if (mr.isEnum()) {
      string2Json(((Enum)obj).name());
    }
 else     if (mr.isNumber() || mr.isBoolean() || mr.isChar()) {
      writer.append(obj.toString());
    }
 else     if (mr.isStringLike()) {
      string2Json(obj.toString());
    }
 else     if (mr.isDateTimeLike()) {
      string2Json(format.getCastors().castToString(obj));
    }
 else     if (memo.containsKey(obj)) {
      writer.append("String_Node_Str");
    }
 else {
      memo.put(obj,null);
      if (obj instanceof Map)       map2Json((Map)obj);
 else       if (obj instanceof Collection)       coll2Json((Collection)obj);
 else       if (obj.getClass().isArray())       array2Json(obj);
 else {
        pojo2Json(obj);
      }
      memo.remove(obj);
    }
  }
}
Program: 43659
Project: 43659
Buggy source:
@SuppressWarnings("String_Node_Str") private void map2Json(Map map) throws IOException {
  if (null == map)   return;
  appendBraceBegin();
  increaseFormatIndent();
  ArrayList<Pair> list=new ArrayList<Pair>(map.size());
  for (  Object key : map.keySet()) {
    String name=null == key ? "String_Node_Str" : key.toString();
    Object value=map.get(name);
    if (!this.isIgnore(name,value))     list.add(new Pair(name,value));
  }
  for (Iterator<Pair> it=list.iterator(); it.hasNext(); ) {
    Pair p=it.next();
    this.appendPair(p.name,p.value);
    if (it.hasNext())     this.appendPairEnd();
  }
  decreaseFormatIndent();
  appendBraceEnd();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void map2Json(Map map) throws IOException {
  if (null == map)   return;
  appendBraceBegin();
  increaseFormatIndent();
  ArrayList<Pair> list=new ArrayList<Pair>(map.size());
  for (  Object key : map.keySet()) {
    String name=null == key ? "String_Node_Str" : key.toString();
    Object value=map.get(key);
    if (!this.isIgnore(name,value))     list.add(new Pair(name,value));
  }
  for (Iterator<Pair> it=list.iterator(); it.hasNext(); ) {
    Pair p=it.next();
    this.appendPair(p.name,p.value);
    if (it.hasNext())     this.appendPairEnd();
  }
  decreaseFormatIndent();
  appendBraceEnd();
}