nus-yam/ex-repair huggingface dataset:
Program: 43422
Project: 43422
Buggy source:
/** 
 * 为一次 HTTP 请求，创建一个可以被表达式引擎接受的上下文对象
 * @param req HTTP 请求对象
 * @param obj 入口函数的返回值
 * @return 上下文对象
 */
@SuppressWarnings("String_Node_Str") public static Context createContext(HttpServletRequest req,Object obj){
  Context context=Lang.context();
  Object servletContext=req.getSession().getServletContext().getAttribute(Loading.CONTEXT_NAME);
  if (servletContext != null) {
    context.putAll((Context)servletContext);
  }
  for (  Object o : req.getParameterMap().keySet()) {
    String key=(String)o;
    context.set(key,req.getParameter(key));
  }
  for (Enumeration<String> en=req.getAttributeNames(); en.hasMoreElements(); ) {
    String tem=en.nextElement();
    context.set(tem,req.getAttribute(tem));
  }
  if (null != obj)   context.set(ViewProcessor.DEFAULT_ATTRIBUTE,obj);
  return context;
}

Fixed version (ground truth):
/** 
 * 为一次 HTTP 请求，创建一个可以被表达式引擎接受的上下文对象
 * @param req HTTP 请求对象
 * @param obj 入口函数的返回值
 * @return 上下文对象
 */
@SuppressWarnings("String_Node_Str") public static Context createContext(HttpServletRequest req,Object obj){
  Context context=Lang.context();
  Object servletContext=req.getSession().getServletContext().getAttribute(Loading.CONTEXT_NAME);
  if (servletContext != null) {
    context.putAll((Context)servletContext);
  }
  Map<String,String> p=new HashMap<String,String>();
  for (  Object o : req.getParameterMap().keySet()) {
    String key=(String)o;
    context.set(key,req.getParameter(key));
    p.put(key,req.getParameter(key));
  }
  context.set("String_Node_Str",p);
  for (Enumeration<String> en=req.getAttributeNames(); en.hasMoreElements(); ) {
    String tem=en.nextElement();
    context.set(tem,req.getAttribute(tem));
  }
  if (null != obj)   context.set(ViewProcessor.DEFAULT_ATTRIBUTE,obj);
  return context;
}
Program: 43423
Project: 43423
Buggy source:
public RequestDispatcher getRequestDispatcher(String arg0){
  throw Lang.noImplement();
}

Fixed version (ground truth):
public RequestDispatcher getRequestDispatcher(String dest){
  return new MockRequestDispatcher(dispatcherTarget,dest);
}
Program: 43424
Project: 43424
Buggy source:
public MockHttpServletRequest(){
  this.headers=new HashMap<String,String>();
}

Fixed version (ground truth):
public MockHttpServletRequest(){
  this.headers=new HashMap<String,String>();
  this.dispatcherTarget=new String[1];
}
Program: 43425
Project: 43425
Buggy source:
protected String evalPath(HttpServletRequest req,Object obj){
  Context context=Lang.context();
  Context expContext=createContext(req,obj);
  for (  Entry<String,ElObj> en : exps.entrySet())   context.set(en.getKey(),en.getValue().eval(expContext).getString());
  return this.dest.render(context).toString();
}

Fixed version (ground truth):
protected String evalPath(HttpServletRequest req,Object obj){
  if (null == dest)   return null;
  Context context=Lang.context();
  Context expContext=createContext(req,obj);
  for (  Entry<String,ElObj> en : exps.entrySet())   context.set(en.getKey(),en.getValue().eval(expContext).getString());
  return Strings.trim(this.dest.render(context).toString());
}
Program: 43426
Project: 43426
Buggy source:
public AbstractPathView(String dest){
  this.dest=new CharSegment(Strings.trim(dest));
  this.exps=new HashMap<String,ElObj>();
  for (  String key : this.dest.keys()) {
    this.exps.put(key,El.compile(key));
  }
}

Fixed version (ground truth):
public AbstractPathView(String dest){
  if (null != dest) {
    this.dest=new CharSegment(Strings.trim(dest));
    this.exps=new HashMap<String,ElObj>();
    for (    String key : this.dest.keys()) {
      this.exps.put(key,El.compile(key));
    }
  }
}
Program: 43427
Project: 43427
Buggy source:
protected String getExt(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * 子类可以覆盖这个方法，给出自己特殊的后缀
 * @return 后缀
 */
protected String getExt(){
  return "String_Node_Str";
}
Program: 43428
Project: 43428
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (Strings.isBlank(path)) {
    path=Mvcs.getRequestPath(req);
    path="String_Node_Str" + Files.renameSuffix(path,getExt());
  }
  RequestDispatcher rd=req.getRequestDispatcher(path);
  if (rd == null)   throw Lang.makeThrow("String_Node_Str",path);
  rd.forward(req,resp);
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  if (Strings.isBlank(path)) {
    path=Mvcs.getRequestPath(req);
    path="String_Node_Str" + (path.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + Files.renameSuffix(path,getExt());
  }
 else   if (path.charAt(0) == '/') {
    String ext=getExt();
    if (!path.toLowerCase().endsWith(ext))     path+=ext;
  }
 else {
    path="String_Node_Str" + path.replace('.','/') + getExt();
  }
  RequestDispatcher rd=req.getRequestDispatcher(path);
  if (rd == null)   throw Lang.makeThrow("String_Node_Str",path);
  rd.forward(req,resp);
}
Program: 43429
Project: 43429
Buggy source:
public ForwardView(String dest){
  super(dest);
}

Fixed version (ground truth):
public ForwardView(String dest){
  super(dest == null ? null : dest.replace('\\','/'));
}
Program: 43430
Project: 43430
Buggy source:
/** 
 * 获取一个Type类型实际对应的Class
 */
@SuppressWarnings("String_Node_Str") public static Class<?> getTypeClass(Type type){
  Class<?> clazz=null;
  if (type instanceof ParameterizedType) {
    ParameterizedType pt=(ParameterizedType)type;
    clazz=(Class<?>)pt.getRawType();
  }
 else   if (type instanceof Class<?>) {
    clazz=(Class<?>)type;
  }
 else   if (type instanceof GenericArrayType) {
    GenericArrayType gat=(GenericArrayType)type;
    return getTypeClass(gat.getGenericComponentType());
  }
 else   if (type instanceof TypeVariable) {
    TypeVariable tv=(TypeVariable)type;
    Type[] ts=tv.getBounds();
    if (ts != null && ts.length > 0)     return getTypeClass(ts[0]);
  }
 else   if (type instanceof WildcardType) {
    WildcardType wt=(WildcardType)type;
    Type[] t_low=wt.getLowerBounds();
    if (t_low.length > 0)     return getTypeClass(t_low[0]);
    Type[] t_up=wt.getUpperBounds();
    return getTypeClass(t_up[0]);
  }
  return clazz;
}

Fixed version (ground truth):
/** 
 * 获取一个Type类型实际对应的Class
 */
@SuppressWarnings("String_Node_Str") public static Class<?> getTypeClass(Type type){
  Class<?> clazz=null;
  if (type instanceof ParameterizedType) {
    ParameterizedType pt=(ParameterizedType)type;
    clazz=(Class<?>)pt.getRawType();
  }
 else   if (type instanceof Class<?>) {
    clazz=(Class<?>)type;
  }
 else   if (type instanceof GenericArrayType) {
    GenericArrayType gat=(GenericArrayType)type;
    Class<?> typeClass=getTypeClass(gat.getGenericComponentType());
    return Array.newInstance(typeClass,0).getClass();
  }
 else   if (type instanceof TypeVariable) {
    TypeVariable tv=(TypeVariable)type;
    Type[] ts=tv.getBounds();
    if (ts != null && ts.length > 0)     return getTypeClass(ts[0]);
  }
 else   if (type instanceof WildcardType) {
    WildcardType wt=(WildcardType)type;
    Type[] t_low=wt.getLowerBounds();
    if (t_low.length > 0)     return getTypeClass(t_low[0]);
    Type[] t_up=wt.getUpperBounds();
    return getTypeClass(t_up[0]);
  }
  return clazz;
}
Program: 43431
Project: 43431
Buggy source:
@Override public void init(NutConfig config,ActionInfo ai) throws Throwable {
  method=ai.getMethod();
  moduleType=ai.getModuleType();
  if (!Strings.isBlank(ai.getInjectName()))   injectName=ai.getInjectName();
}

Fixed version (ground truth):
@Override public void init(NutConfig config,ActionInfo ai) throws Throwable {
  method=ai.getMethod();
  moduleType=ai.getModuleType();
  if (Strings.isBlank(ai.getInjectName())) {
    moduleObj=Mirror.me(moduleType).born();
  }
 else {
    injectName=ai.getInjectName();
  }
}
Program: 43432
Project: 43432
Buggy source:
public void process(ActionContext ac) throws Throwable {
  RequestIocContext reqContext=null;
  try {
    if (null == injectName) {
      ac.setModule(Mirror.me(moduleType).born());
    }
 else {
      Ioc ioc=ac.getIoc();
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",injectName);
      Object obj;
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(ac.getRequest());
        SessionIocContext sessionContext=new SessionIocContext(ac.getRequest().getSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        obj=((Ioc2)ioc).get(moduleType,injectName,myContext);
      }
 else       obj=ioc.get(moduleType,injectName);
      ac.setModule(obj);
    }
    ac.setMethod(method);
    doNext(ac);
  }
  finally {
    if (reqContext != null)     try {
      reqContext.depose();
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void process(ActionContext ac) throws Throwable {
  RequestIocContext reqContext=null;
  try {
    if (null != moduleObj) {
      ac.setModule(moduleObj);
    }
 else {
      Ioc ioc=ac.getIoc();
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",injectName);
      Object obj;
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(ac.getRequest());
        SessionIocContext sessionContext=new SessionIocContext(ac.getRequest().getSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        obj=((Ioc2)ioc).get(moduleType,injectName,myContext);
      }
 else       obj=ioc.get(moduleType,injectName);
      ac.setModule(obj);
    }
    ac.setMethod(method);
    doNext(ac);
  }
  finally {
    if (reqContext != null)     try {
      reqContext.depose();
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}
Program: 43433
Project: 43433
Buggy source:
public void process(ActionContext ac) throws Throwable {
  Object re=ac.getMethodReturn();
  Object err=ac.getError();
  if (re != null && re instanceof View) {
    if (re instanceof ViewWrapper)     putRequestAttribute(ac.getRequest(),((ViewWrapper)re).getData());
    ((View)re).render(ac.getRequest(),ac.getResponse(),err);
  }
 else {
    putRequestAttribute(ac.getRequest(),re);
    view.render(ac.getRequest(),ac.getResponse(),null == re ? err : re);
  }
  doNext(ac);
}

Fixed version (ground truth):
public void process(ActionContext ac) throws Throwable {
  Object re=ac.getMethodReturn();
  Object err=ac.getError();
  if (re != null && re instanceof View) {
    if (re instanceof ViewWrapper)     putRequestAttribute(ac.getRequest(),((ViewWrapper)re).getData());
    ((View)re).render(ac.getRequest(),ac.getResponse(),err);
  }
 else {
    putRequestAttribute(ac.getRequest(),null == re ? err : re);
    view.render(ac.getRequest(),ac.getResponse(),null == re ? err : re);
  }
  doNext(ac);
}
Program: 43434
Project: 43434
Buggy source:
/** 
 * @param < T >
 * @param type
 * @return
 * @throws Exception
 */
private Object parseFromCurrentLocation(Type type) throws Exception {
  Class<?> clazz=null;
  ParameterizedType pt=null;
  if (type instanceof Class) {
    clazz=(Class<?>)type;
  }
  if (type instanceof ParameterizedType) {
    pt=(ParameterizedType)type;
    clazz=(Class<?>)pt.getRawType();
  }
  Mirror<?> me=Mirror.me(clazz);
switch (cursor) {
case -1:
    return null;
case '[':
  return parseArray(me,pt);
case '{':
return parseObj(me,pt);
case 'u':
return parseUndefined();
case 'n':
return parseNull();
case '\'':
case '"':
return parseString(me);
case 't':
return parseTrue(me);
case 'f':
return parseFalse(me);
case '.':
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return parseNumber(me);
case 'v':
while (-1 != nextChar()) if ('{' == cursor) return parseFromCurrentLocation(type);
default :
throw makeError("String_Node_Str");
}
}

Fixed version (ground truth):
/** 
 * @param < T >
 * @param type
 * @return
 * @throws Exception
 */
private Object parseFromCurrentLocation(Type type) throws Exception {
  Class<?> clazz=Lang.getTypeClass(type);
  ParameterizedType pt=null;
  if (type instanceof ParameterizedType) {
    pt=(ParameterizedType)type;
    clazz=(Class<?>)pt.getRawType();
  }
  Mirror<?> me=Mirror.me(clazz);
switch (cursor) {
case -1:
    return null;
case '[':
  return parseArray(me,pt);
case '{':
return parseObj(me,pt);
case 'u':
return parseUndefined();
case 'n':
return parseNull();
case '\'':
case '"':
return parseString(me);
case 't':
return parseTrue(me);
case 'f':
return parseFalse(me);
case '.':
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return parseNumber(me);
case 'v':
while (-1 != nextChar()) if ('{' == cursor) return parseFromCurrentLocation(type);
default :
throw makeError("String_Node_Str");
}
}
Program: 43435
Project: 43435
Buggy source:
/** 
 * 获取一个类的某个一个泛型参数
 * @param klass 类
 * @param index 参数下标 （从 0 开始）
 * @return 泛型参数类型
 */
@SuppressWarnings("String_Node_Str") public static <T>Class<T> getTypeParam(Class<?> klass,int index){
  Type[] types=getTypeParams(klass);
  if (index >= 0 && index < types.length) {
    Type t=types[index];
    if (t instanceof Class<?>) {
      return (Class<T>)t;
    }
 else     if (t instanceof ParameterizedType) {
      t=((ParameterizedType)t).getRawType();
      return (Class<T>)t;
    }
    throw Lang.makeThrow("String_Node_Str",t.toString());
  }
  throw Lang.makeThrow("String_Node_Str",index,types.length);
}

Fixed version (ground truth):
/** 
 * 获取一个类的某个一个泛型参数
 * @param klass 类
 * @param index 参数下标 （从 0 开始）
 * @return 泛型参数类型
 */
@SuppressWarnings("String_Node_Str") public static <T>Class<T> getTypeParam(Class<?> klass,int index){
  Type[] types=getTypeParams(klass);
  if (index >= 0 && index < types.length) {
    Type t=types[index];
    Class<T> clazz=(Class<T>)Lang.getTypeClass(t);
    if (clazz == null)     throw Lang.makeThrow("String_Node_Str",t.toString());
    return clazz;
  }
  throw Lang.makeThrow("String_Node_Str",index,types.length);
}
Program: 43436
Project: 43436
Buggy source:
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  int i=0;
  for (; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  Class<?>[] argTypes=method.getParameterTypes();
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,req,resp,null);
    if (args[i] == null && argTypes[i].isPrimitive()) {
      args[i]=getPrimitiveDefaultValue(argTypes[i]);
    }
  }
  return args;
}

Fixed version (ground truth):
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  int i=0;
  for (; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  Class<?>[] argTypes=method.getParameterTypes();
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,req,resp,null);
    if (args[i] == null && argTypes[i].isPrimitive()) {
      args[i]=Lang.getPrimitiveDefaultValue(argTypes[i]);
    }
  }
  return args;
}
Program: 43437
Project: 43437
Buggy source:
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null == name)   return Json.fromJson(type,refer.toString());
  NutMap map=Json.fromJson(NutMap.class,refer.toString());
  Object theObj=map.get(name);
  if (null == theObj)   return null;
  Class<?> clazz=null;
  if (type instanceof ParameterizedType) {
    clazz=(Class<?>)((ParameterizedType)type).getRawType();
  }
  clazz=(Class<?>)type;
  return Castors.me().castTo(theObj,clazz);
}

Fixed version (ground truth):
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null == name)   return Json.fromJson(type,refer.toString());
  NutMap map=Json.fromJson(NutMap.class,refer.toString());
  Object theObj=map.get(name);
  if (null == theObj)   return null;
  Class<?> clazz=Lang.getTypeClass(type);
  return Castors.me().castTo(theObj,clazz);
}
Program: 43438
Project: 43438
Buggy source:
public ActionChain eval(NutConfig config,ActionInfo ai){
  try {
    List<Processor> list=new ArrayList<Processor>();
    for (    String name : co.getProcessors(ai.getChainName())) {
      Processor processor=getProcessorByName(config,name);
      processor.init(config,ai);
      list.add(processor);
    }
    Processor errorProcessor=getProcessorByName(config,co.getErrorProcessor(ai.getChainName()));
    errorProcessor.init(config,ai);
    return new NutActionChain(list,errorProcessor);
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public ActionChain eval(NutConfig config,ActionInfo ai){
  try {
    List<Processor> list=new ArrayList<Processor>();
    for (    String name : co.getProcessors(ai.getChainName())) {
      Processor processor=getProcessorByName(config,name);
      processor.init(config,ai);
      list.add(processor);
    }
    Processor errorProcessor=getProcessorByName(config,co.getErrorProcessor(ai.getChainName()));
    errorProcessor.init(config,ai);
    ActionChain chain=new NutActionChain(list,errorProcessor);
    return chain;
  }
 catch (  Throwable e) {
    if (logger.isDebugEnabled())     logger.debugf("String_Node_Str",ai.getMethod());
    throw Lang.wrapThrow(e);
  }
}
Program: 43439
Project: 43439
Buggy source:
public void init(FilterConfig conf) throws ServletException {
  FilterNutConfig config=new FilterNutConfig(conf);
  String skipMode=Strings.sNull(conf.getInitParameter("String_Node_Str"),"String_Node_Str").toLowerCase();
  if (!"String_Node_Str".equals(skipMode)) {
    handler=new ActionHandler(config);
    String regx=Strings.sNull(config.getInitParameter("String_Node_Str"),IGNORE);
    if (!"String_Node_Str".equalsIgnoreCase(regx)) {
      ignorePtn=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
    }
  }
 else   this.skipMode=true;
}

Fixed version (ground truth):
public void init(FilterConfig conf) throws ServletException {
  FilterNutConfig config=new FilterNutConfig(conf);
  String skipMode=Strings.sNull(conf.getInitParameter("String_Node_Str"),"String_Node_Str").toLowerCase();
  if (!"String_Node_Str".equals(skipMode)) {
    handler=new ActionHandler(config);
    String regx=Strings.sNull(config.getInitParameter("String_Node_Str"),IGNORE);
    if (!"String_Node_Str".equalsIgnoreCase(regx)) {
      ignorePtn=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
    }
  }
 else   this.skipMode=true;
  String doNextFilter=Strings.sNull(conf.getInitParameter("String_Node_Str"),"String_Node_Str").toLowerCase();
  this.doNextFilter="String_Node_Str".equals(doNextFilter);
}
Program: 43440
Project: 43440
Buggy source:
public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  if (!skipMode) {
    RequestPath path=Mvcs.getRequestPathObject((HttpServletRequest)req);
    if (null == ignorePtn || !ignorePtn.matcher(path.getUrl()).find()) {
      if (handler.handle((HttpServletRequest)req,(HttpServletResponse)resp))       return;
    }
  }
 else {
    Mvcs.updateRequestAttributes((HttpServletRequest)req);
  }
  chain.doFilter(req,resp);
}

Fixed version (ground truth):
public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  if (!skipMode) {
    RequestPath path=Mvcs.getRequestPathObject((HttpServletRequest)req);
    if (null == ignorePtn || !ignorePtn.matcher(path.getUrl()).find()) {
      if (handler.handle((HttpServletRequest)req,(HttpServletResponse)resp))       if (!doNextFilter)       return;
    }
  }
  Mvcs.updateRequestAttributes((HttpServletRequest)req);
  chain.doFilter(req,resp);
}
Program: 43441
Project: 43441
Buggy source:
@Override public void process(ActionContext ac) throws Throwable {
  super.process(ac);
  if (log.isDebugEnabled())   log.debug("String_Node_Str",ac.getError());
}

Fixed version (ground truth):
@Override public void process(ActionContext ac) throws Throwable {
  if (log.isDebugEnabled())   log.debug("String_Node_Str",ac.getError());
  super.process(ac);
}
Program: 43443
Project: 43443
Buggy source:
Map<String,Map<String,String>> load(String refer);

Fixed version (ground truth):
Map<String,Map<String,Object>> load(String refer);
Program: 43444
Project: 43444
Buggy source:
private void evalLocalization(NutConfig config,Class<?> mainModule){
  Localization lc=mainModule.getAnnotation(Localization.class);
  if (null != lc) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",lc.value());
    Map<String,Map<String,String>> msgss=Mirror.me(lc.type()).born().load(lc.value());
    config.setAttributeIgnoreNull(Localization.class.getName(),msgss);
  }
 else   if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
private void evalLocalization(NutConfig config,Class<?> mainModule){
  Localization lc=mainModule.getAnnotation(Localization.class);
  if (null != lc) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",lc.value());
    Map<String,Map<String,Object>> msgss=Mirror.me(lc.type()).born().load(lc.value());
    config.setAttributeIgnoreNull(Localization.class.getName(),msgss);
  }
 else   if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
}
Program: 43446
Project: 43446
Buggy source:
public BinElObj append(ElOperator opt,ElObj obj){
  if (null == operator) {
    return setOperator(opt).setRight(obj);
  }
  BinElObj nn=new BinElObj();
  if (opt.isHigherThan(operator)) {
    if (right instanceof BinElObj) {
      setRight(((BinElObj)right).append(opt,obj));
    }
 else {
      nn.setLeft(right).setOperator(opt).setRight(obj);
      setRight(nn);
    }
  }
 else {
    BinElObj on=this;
    while (on.parent != null) {
      on=on.parent;
      if (!on.getOperator().isHigherThan(opt))       break;
    }
    nn.setLeft(on).setOperator(opt).setRight(obj);
  }
  return nn;
}

Fixed version (ground truth):
public BinElObj append(ElOperator opt,ElObj obj){
  if (null == operator) {
    return setOperator(opt).setRight(obj);
  }
  BinElObj nn;
  if (opt.isHigherThan(operator)) {
    if (right instanceof BinElObj) {
      nn=((BinElObj)right).append(opt,obj);
    }
 else {
      nn=new BinElObj();
      nn.setLeft(right).setOperator(opt).setRight(obj);
      setRight(nn);
    }
  }
 else {
    nn=new BinElObj();
    BinElObj on=this;
    while (on.parent != null) {
      if (!on.getOperator().isHigherThan(opt))       break;
      on=on.parent;
    }
    nn.parent=on.parent;
    nn.setLeft(on).setOperator(opt).setRight(obj);
    if (null != nn.parent)     nn.parent.setRight(nn);
  }
  return nn;
}
Program: 43447
Project: 43447
Buggy source:
public List<NutResource> list(String src,String filter){
  final List<NutResource> list=new LinkedList<NutResource>();
  final Pattern regex=null == filter ? null : Pattern.compile(filter);
  File f=Files.findFile(src);
  if (f != null && f.exists()) {
    if (f.isFile())     list.addAll(scanInDir(regex,src,f.getParentFile(),ignoreHidden));
 else     list.addAll(scanInDir(regex,src,f,ignoreHidden));
  }
 else {
    String path=Disks.absolute(src,getClass().getClassLoader(),Encoding.defaultEncoding());
    if (null != path) {
      f=new File(path);
      if (!path.contains("String_Node_Str")) {
        int pos=path.lastIndexOf(src);
        list.addAll(scanInDir(regex,path.substring(0,pos),f,ignoreHidden));
      }
 else {
        JarEntryInfo jeInfo=new JarEntryInfo(path);
        list.addAll(scanInJar(checkSrc(jeInfo.getEntryName()),regex,jeInfo.getJarPath()));
      }
    }
 else {
      String classpath=System.getProperties().getProperty("String_Node_Str");
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + classpath);
      String[] paths=classpath.split(System.getProperties().getProperty("String_Node_Str"));
      for (      String pathZ : paths) {
        if (pathZ.endsWith("String_Node_Str"))         list.addAll(scanInJar(checkSrc(src),regex,pathZ));
 else         list.addAll(scanInDir(regex,pathZ,new File(pathZ + "String_Node_Str" + src),ignoreHidden));
      }
    }
  }
  return list;
}

Fixed version (ground truth):
public List<NutResource> list(String src,String filter){
  final List<NutResource> list=new LinkedList<NutResource>();
  final Pattern regex=null == filter ? null : Pattern.compile(filter);
  File f=Files.findFile(src);
  if (f != null && f.exists()) {
    if (f.isFile())     list.addAll(scanInDir(regex,src,f.getParentFile(),ignoreHidden));
 else     list.addAll(scanInDir(regex,src,f,ignoreHidden));
  }
 else {
    String path=Disks.absolute(src,getClass().getClassLoader(),Encoding.defaultEncoding());
    if (null != path) {
      f=new File(path);
      if (!path.contains("String_Node_Str")) {
        int pos=path.lastIndexOf(src);
        if (pos > 0)         list.addAll(scanInDir(regex,path.substring(0,pos),f,ignoreHidden));
      }
 else {
        JarEntryInfo jeInfo=new JarEntryInfo(path);
        list.addAll(scanInJar(checkSrc(jeInfo.getEntryName()),regex,jeInfo.getJarPath()));
      }
    }
 else {
      String classpath=System.getProperties().getProperty("String_Node_Str");
      if (LOG.isInfoEnabled())       LOG.info("String_Node_Str" + classpath);
      String[] paths=classpath.split(System.getProperties().getProperty("String_Node_Str"));
      for (      String pathZ : paths) {
        if (pathZ.endsWith("String_Node_Str"))         list.addAll(scanInJar(checkSrc(src),regex,pathZ));
 else         list.addAll(scanInDir(regex,pathZ,new File(pathZ + "String_Node_Str" + src),ignoreHidden));
      }
    }
  }
  return list;
}
Program: 43448
Project: 43448
Buggy source:
@Override public String cast(Calendar src,Class<?> toType,String... args){
  return dateTimeFormat.format(src.getTime());
}

Fixed version (ground truth):
@Override public String cast(Calendar src,Class<?> toType,String... args){
  return ((DateFormat)dateTimeFormat.clone()).format(src.getTime());
}
Program: 43449
Project: 43449
Buggy source:
@Override public String cast(java.util.Date src,Class<?> toType,String... args){
  return dateTimeFormat.format(src);
}

Fixed version (ground truth):
@Override public String cast(java.util.Date src,Class<?> toType,String... args){
  return ((DateFormat)dateTimeFormat.clone()).format(src);
}
Program: 43450
Project: 43450
Buggy source:
@Override public String cast(java.sql.Date src,Class<?> toType,String... args){
  return dateFormat.format(new java.util.Date(src.getTime()));
}

Fixed version (ground truth):
@Override public String cast(java.sql.Date src,Class<?> toType,String... args){
  return ((DateFormat)dateFormat.clone()).format(new java.util.Date(src.getTime()));
}
Program: 43451
Project: 43451
Buggy source:
@Override public String cast(java.sql.Time src,Class<?> toType,String... args){
  return timeFormat.format(new java.util.Date(src.getTime()));
}

Fixed version (ground truth):
@Override public String cast(java.sql.Time src,Class<?> toType,String... args){
  return ((DateFormat)timeFormat.clone()).format(new java.util.Date(src.getTime()));
}
Program: 43452
Project: 43452
Buggy source:
@Override public Calendar cast(String src,Class<?> toType,String... args){
  Calendar c=Calendar.getInstance();
  try {
    c.setTime(dateTimeFormat.parse(src));
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
  return c;
}

Fixed version (ground truth):
@Override public Calendar cast(String src,Class<?> toType,String... args){
  Calendar c=Calendar.getInstance();
  try {
    c.setTime(((DateFormat)dateTimeFormat.clone()).parse(src));
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
  return c;
}
Program: 43453
Project: 43453
Buggy source:
@Override public java.util.Date cast(String src,Class<?> toType,String... args){
  try {
    return this.dateTimeFormat.parse(src);
  }
 catch (  ParseException e1) {
    try {
      return dateFormat.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)dateTimeFormat.clone()).parse(src);
  }
 catch (  ParseException e1) {
    try {
      return ((DateFormat)dateFormat.clone()).parse(src);
    }
 catch (    ParseException e) {
      throw Lang.wrapThrow(e);
    }
  }
}
Program: 43454
Project: 43454
Buggy source:
@Override public java.sql.Date cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Date(dateFormat.parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@Override public java.sql.Date cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Date(((DateFormat)dateFormat.clone()).parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43455
Project: 43455
Buggy source:
@Override public java.sql.Time cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Time(timeFormat.parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@Override public java.sql.Time cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Time(((DateFormat)timeFormat.clone()).parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43456
Project: 43456
Buggy source:
@Override public Timestamp cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Timestamp(dateTimeFormat.parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@Override public Timestamp cast(String src,Class<?> toType,String... args){
  try {
    return new java.sql.Timestamp(((DateFormat)dateTimeFormat.clone()).parse(src).getTime());
  }
 catch (  ParseException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43457
Project: 43457
Buggy source:
@Override public String cast(Timestamp src,Class<?> toType,String... args){
  return dateTimeFormat.format(new java.util.Date(src.getTime()));
}

Fixed version (ground truth):
@Override public String cast(Timestamp src,Class<?> toType,String... args){
  return ((DateFormat)dateTimeFormat.clone()).format(new java.util.Date(src.getTime()));
}
Program: 43458
Project: 43458
Buggy source:
public void init(Method method){
  Class<?>[] argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(argTypes[i],param);
    if (null == injs[i])     injs[i]=new ErrorInjector(method,i);
  }
}

Fixed version (ground truth):
public void init(Method method){
  this.method=method;
  Class<?>[] argTypes=method.getParameterTypes();
  injs=new ParamInjector[argTypes.length];
  Annotation[][] annss=method.getParameterAnnotations();
  for (int i=0; i < annss.length; i++) {
    Annotation[] anns=annss[i];
    Param param=null;
    Attr attr=null;
    IocObj iocObj=null;
    for (int x=0; x < anns.length; x++)     if (anns[x] instanceof Param) {
      param=(Param)anns[x];
      break;
    }
 else     if (anns[x] instanceof Attr) {
      attr=(Attr)anns[x];
      break;
    }
 else     if (anns[x] instanceof IocObj) {
      iocObj=(IocObj)anns[x];
      break;
    }
    if (null != attr) {
      injs[i]=evalInjectorByAttrScope(attr);
      continue;
    }
    if (null != iocObj) {
      injs[i]=new IocObjInjector(method.getParameterTypes()[i],iocObj.value());
      continue;
    }
    injs[i]=evalInjectorByParamType(argTypes[i]);
    if (null != injs[i])     continue;
    injs[i]=evalInjector(argTypes[i],param);
    if (null == injs[i])     injs[i]=new ErrorInjector(method,i);
  }
}
Program: 43459
Project: 43459
Buggy source:
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int i=0;
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  for (; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  for (; i < injs.length; i++) {
    args[i]=injs[i].get(sc,req,resp,null);
  }
  return args;
}

Fixed version (ground truth):
public Object[] adapt(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  Object[] args=new Object[injs.length];
  int len=Math.min(args.length,null == pathArgs ? 0 : pathArgs.length);
  for (int i=0; i < len; i++) {
    args[i]=injs[i].get(sc,req,resp,null == pathArgs ? null : pathArgs[i]);
  }
  Class<?>[] argTypes=method.getParameterTypes();
  for (int i=0; i < injs.length; i++) {
    args[i]=injs[i].get(sc,req,resp,null);
    if (args[i] == null && argTypes[i].isPrimitive()) {
      args[i]=getPrimitiveDefaultValue(argTypes[i]);
    }
  }
  return args;
}
Program: 43460
Project: 43460
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.formatSqlFieldValue(ele)).append(',');
        }
      }
);
      sb.setCharAt(sb.length() - 1,')');
    }
 else     sb.append(Sqls.formatSqlFieldValue(value));
  }
 else   if (null == value && op.startsWith("String_Node_Str")) {
    sb.append(' ').append(op).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));
  }
}

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) || "String_Node_Str".equals(op)) {
    sb.append("String_Node_Str").append(op).append("String_Node_Str");
    if (null == value)     throw Lang.makeThrow("String_Node_Str",op,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 && op.startsWith("String_Node_Str")) {
    sb.append(' ').append(op).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: 43461
Project: 43461
Buggy source:
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());
}
}

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 :
if (c >= 256 && format.isAutoUnicode()) writer.append("String_Node_Str").append(Integer.toHexString(c).toUpperCase());
 else writer.append(c);
}
}
writer.append(format.getSeparator());
}
}
Program: 43462
Project: 43462
Buggy source:
private void _insertSelf(Entity<?> entity,Object obj){
  runFieldQuery(entity.getBefores(),obj);
  execute(sqlMaker.insert(entity,obj));
  runFieldQuery(entity.getAfters(),obj);
}

Fixed version (ground truth):
private void _insertSelf(final Entity<?> entity,final Object obj){
  Trans.exec(new Atom(){
    public void run(){
      runFieldQuery(entity.getBefores(),obj);
      execute(sqlMaker.insert(entity,obj));
      runFieldQuery(entity.getAfters(),obj);
    }
  }
);
}
Program: 43465
Project: 43465
Buggy source:
private EntityName evalEntityName(Class<?> type,Class<? extends Annotation> annType,Class<? extends Annotation> dftAnnType){
  Annotation ann=null;
  Class<?> me=type;
  while (null != me && !(me == Object.class)) {
    ann=me.getAnnotation(annType);
    if (ann != null) {
      String v=Mirror.me(annType).invoke(ann,"String_Node_Str").toString();
      if (!Strings.isBlank(v))       return EntityName.create(v);
    }
    me=me.getSuperclass();
  }
  if (null != dftAnnType)   return evalEntityName(type,dftAnnType,null);
  return EntityName.create(type.getSimpleName().toLowerCase());
}

Fixed version (ground truth):
protected EntityName evalEntityName(Class<?> type,Class<? extends Annotation> annType,Class<? extends Annotation> dftAnnType){
  Annotation ann=null;
  Class<?> me=type;
  while (null != me && !(me == Object.class)) {
    ann=me.getAnnotation(annType);
    if (ann != null) {
      String v=Mirror.me(annType).invoke(ann,"String_Node_Str").toString();
      if (!Strings.isBlank(v))       return EntityName.create(v);
    }
    me=me.getSuperclass();
  }
  if (null != dftAnnType)   return evalEntityName(type,dftAnnType,null);
  return EntityName.create(type.getSimpleName().toLowerCase());
}
Program: 43466
Project: 43466
Buggy source:
private boolean isPojoExistsColumnAnnField(Mirror<?> mirror){
  for (  Field f : mirror.getFields())   if (null != f.getAnnotation(Column.class))   return true;
  return false;
}

Fixed version (ground truth):
protected boolean isPojoExistsColumnAnnField(Mirror<?> mirror){
  for (  Field f : mirror.getFields())   if (null != f.getAnnotation(Column.class))   return true;
  return false;
}
Program: 43468
Project: 43468
Buggy source:
private static Field lookupPkByReferField(Mirror<?> mirror,Field fld) throws NoSuchFieldException {
  Mirror<?> fldType=Mirror.me(fld.getType());
  if (fldType.isStringLike()) {
    return mirror.getField(Name.class);
  }
 else   if (fldType.isIntLike()) {
    return mirror.getField(Id.class);
  }
  throw Lang.makeThrow("String_Node_Str",fld.getDeclaringClass().getName(),fld.getName());
}

Fixed version (ground truth):
protected static Field lookupPkByReferField(Mirror<?> mirror,Field fld) throws NoSuchFieldException {
  Mirror<?> fldType=Mirror.me(fld.getType());
  if (fldType.isStringLike()) {
    return mirror.getField(Name.class);
  }
 else   if (fldType.isIntLike()) {
    return mirror.getField(Id.class);
  }
  throw Lang.makeThrow("String_Node_Str",fld.getDeclaringClass().getName(),fld.getName());
}
Program: 43469
Project: 43469
Buggy source:
private ErrorEntitySyntaxException error(Entity<?> entity,String fmt,Object... args){
  return new ErrorEntitySyntaxException(String.format("String_Node_Str",null == entity ? "String_Node_Str" : entity.getType().getName(),String.format(fmt,args)));
}

Fixed version (ground truth):
protected ErrorEntitySyntaxException error(Entity<?> entity,String fmt,Object... args){
  return new ErrorEntitySyntaxException(String.format("String_Node_Str",null == entity ? "String_Node_Str" : entity.getType().getName(),String.format(fmt,args)));
}
Program: 43470
Project: 43470
Buggy source:
public boolean isNameAccepted(String name){
  if (null == nameFilter)   return true;
  if (null == name)   return false;
  return Pattern.matches(nameFilter,name.toLowerCase());
}

Fixed version (ground truth):
public boolean isNameAccepted(String name){
  if (null == nameFilter)   return true;
  if (Strings.isBlank(name))   return true;
  return Pattern.matches(nameFilter,name.toLowerCase());
}
Program: 43471
Project: 43471
Buggy source:
public boolean isContentTypeAccepted(String contentType){
  if (null == contentTypeFilter)   return true;
  if (null == contentType)   return false;
  return Pattern.matches(contentTypeFilter,contentType.toLowerCase());
}

Fixed version (ground truth):
public boolean isContentTypeAccepted(String contentType){
  if (null == contentTypeFilter)   return true;
  if (Strings.isBlank(contentType))   return true;
  return Pattern.matches(contentTypeFilter,contentType.toLowerCase());
}
Program: 43473
Project: 43473
Buggy source:
public void doChain() throws Throwable {
  if (filters.isEmpty())   return;
  filters.remove(0).filter(this);
}

Fixed version (ground truth):
public void doChain() throws Throwable {
  if (filters.isEmpty())   return;
  ActionFilter filter=filters.remove(0);
  filter.filter(this);
}
Program: 43474
Project: 43474
Buggy source:
public ObjectPairInjector(String prefix,Class<?> type){
  prefix=Strings.isBlank(prefix) ? "String_Node_Str" : Strings.trim(prefix);
  this.mirror=Mirror.me(type);
  Field[] fields=mirror.getFields();
  this.injs=new Injecting[fields.length];
  this.names=new String[fields.length];
  for (int i=0; i < fields.length; i++) {
    Field f=fields[i];
    this.injs[i]=mirror.getInjecting(f.getName());
    Param param=f.getAnnotation(Param.class);
    String nm=null == param ? f.getName() : param.value();
    this.names[i]=prefix + nm;
  }
}

Fixed version (ground truth):
public ObjectPairInjector(String prefix,Class<?> type){
  prefix=Strings.isBlank(prefix) ? "String_Node_Str" : Strings.trim(prefix);
  this.mirror=Mirror.me(type);
  fields=mirror.getFields();
  this.injs=new Injecting[fields.length];
  this.names=new String[fields.length];
  for (int i=0; i < fields.length; i++) {
    Field f=fields[i];
    this.injs[i]=mirror.getInjecting(f.getName());
    Param param=f.getAnnotation(Param.class);
    String nm=null == param ? f.getName() : param.value();
    this.names[i]=prefix + nm;
  }
}
Program: 43475
Project: 43475
Buggy source:
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=mirror.born();
  for (int i=0; i < injs.length; i++) {
    String[] ss=req.getParameterValues(names[i]);
    if (null == ss)     continue;
    injs[i].inject(obj,ss);
  }
  return obj;
}

Fixed version (ground truth):
public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=mirror.born();
  for (int i=0; i < injs.length; i++) {
    String[] ss=filterParam(req.getParameterValues(names[i]),i);
    if (null == ss)     continue;
    injs[i].inject(obj,ss);
  }
  return obj;
}
Program: 43477
Project: 43477
Buggy source:
public static RequestPath getRequestPathObject(HttpServletRequest req){
  RequestPath rr=new RequestPath();
  String url=req.getPathInfo();
  if (null == url)   url=req.getServletPath();
  rr.setUrl(url);
  if (null != url) {
    int lio=url.lastIndexOf('.');
    if (lio > 0) {
      rr.setPath(url.substring(0,lio));
      rr.setSuffix(url.substring(lio + 1));
    }
 else {
      rr.setPath(url);
      rr.setSuffix("String_Node_Str");
    }
  }
 else {
    rr.setPath("String_Node_Str");
    rr.setSuffix("String_Node_Str");
  }
  return rr;
}

Fixed version (ground truth):
public static RequestPath getRequestPathObject(HttpServletRequest req){
  RequestPath rr=new RequestPath();
  String url=req.getPathInfo();
  if (null == url)   url=req.getServletPath();
  rr.setUrl(url);
  if (null != url) {
    int lio=0;
    if (!url.endsWith("String_Node_Str")) {
      int ll=url.lastIndexOf('/');
      lio=url.lastIndexOf('.');
      if (lio < ll)       lio=-1;
    }
    if (lio > 0) {
      rr.setPath(url.substring(0,lio));
      rr.setSuffix(url.substring(lio + 1));
    }
 else {
      rr.setPath(url);
      rr.setSuffix("String_Node_Str");
    }
  }
 else {
    rr.setPath("String_Node_Str");
    rr.setSuffix("String_Node_Str");
  }
  return rr;
}
Program: 43478
Project: 43478
Buggy source:
public static RequestPath getRequestPathObject(HttpServletRequest req){
  RequestPath rr=new RequestPath();
  String url=req.getPathInfo();
  if (null == url)   url=req.getServletPath();
  rr.setUrl(url);
  if (null != url) {
    int lio=0;
    if (!url.endsWith("String_Node_Str")) {
      int ll=url.lastIndexOf('/');
      lio=url.lastIndexOf('.');
      if (lio < ll)       lio=-1;
    }
    if (lio > 0) {
      rr.setPath(url.substring(0,lio));
      rr.setSuffix(url.substring(lio + 1));
    }
 else {
      rr.setPath(url);
      rr.setSuffix("String_Node_Str");
    }
  }
 else {
    rr.setPath("String_Node_Str");
    rr.setSuffix("String_Node_Str");
  }
  return rr;
}

Fixed version (ground truth):
/** 
 * 获取当前请求的路径，并去掉后缀
 */
public static RequestPath getRequestPathObject(String url){
  RequestPath rr=new RequestPath();
  rr.setUrl(url);
  if (null != url) {
    int lio=url.lastIndexOf('.');
    if (lio > 0) {
      rr.setPath(url.substring(0,lio));
      rr.setSuffix(url.substring(lio + 1));
    }
 else {
      rr.setPath(url);
      rr.setSuffix("String_Node_Str");
    }
  }
 else {
    rr.setPath("String_Node_Str");
    rr.setSuffix("String_Node_Str");
  }
  return rr;
}
Program: 43479
Project: 43479
Buggy source:
public void init(FilterConfig conf) throws ServletException {
  config=new FilterNutConfig(conf);
  String skipMode=Strings.sNull(conf.getInitParameter("String_Node_Str"),"String_Node_Str").toLowerCase();
  if (!"String_Node_Str".equals(skipMode)) {
    Loading ing=Inits.init(config,true);
    if (null != ing)     urls=ing.getUrls();
    String regx=Strings.sNull(config.getInitParameter("String_Node_Str"),IGNORE);
    if (!"String_Node_Str".equalsIgnoreCase(regx)) {
      ignorePtn=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
    }
  }
}

Fixed version (ground truth):
public void init(FilterConfig conf) throws ServletException {
  FilterNutConfig config=new FilterNutConfig(conf);
  String skipMode=Strings.sNull(conf.getInitParameter("String_Node_Str"),"String_Node_Str").toLowerCase();
  if (!"String_Node_Str".equals(skipMode)) {
    nutMvc.init(config);
    String regx=Strings.sNull(config.getInitParameter("String_Node_Str"),IGNORE);
    if (!"String_Node_Str".equalsIgnoreCase(regx)) {
      ignorePtn=Pattern.compile(regx,Pattern.CASE_INSENSITIVE);
    }
  }
}