nus-yam/ex-repair huggingface dataset:
Program: 80706
Project: 80706
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: 80707
Project: 80707
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: 80708
Project: 80708
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: 80709
Project: 80709
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: 80710
Project: 80710
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: 80711
Project: 80711
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: 80712
Project: 80712
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: 80713
Project: 80713
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: 80714
Project: 80714
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: 80715
Project: 80715
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: 80716
Project: 80716
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: 80717
Project: 80717
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: 80719
Project: 80719
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: 80720
Project: 80720
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: 80721
Project: 80721
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: 80723
Project: 80723
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: 80724
Project: 80724
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: 80726
Project: 80726
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: 80727
Project: 80727
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: 80728
Project: 80728
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: 80729
Project: 80729
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: 80731
Project: 80731
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: 80732
Project: 80732
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: 80734
Project: 80734
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: 80735
Project: 80735
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);
    }
  }
}
Program: 80736
Project: 80736
Buggy source:
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(config.getServletContext(),(HttpServletRequest)req,(HttpServletResponse)resp);
        return;
      }
    }
  }
  chain.doFilter(req,resp);
}

Fixed version (ground truth):
public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain) throws IOException, ServletException {
  Mvcs.updateRequestAttributes((HttpServletRequest)req);
  RequestPath path=Mvcs.getRequestPathObject((HttpServletRequest)req);
  if (null == ignorePtn || !ignorePtn.matcher(path.getUrl()).find()) {
    try {
      if (nutMvc.handle((HttpServletRequest)req,(HttpServletResponse)resp)) {
        return;
      }
    }
 catch (    InitException e) {
    }
  }
  chain.doFilter(req,resp);
}
Program: 80737
Project: 80737
Buggy source:
public void destroy(){
  if (null != urls)   Inits.destroy(config);
}

Fixed version (ground truth):
public void destroy(){
  nutMvc.destroy();
}
Program: 80738
Project: 80738
Buggy source:
@Override public void init() throws ServletException {
  if (log.isInfoEnabled()) {
    URL me=Thread.currentThread().getContextClassLoader().getResource(NutServlet.class.getName().replace('.','/') + "String_Node_Str");
    log.infof("String_Node_Str",Nutz.version(),me);
  }
  config=new ServletNutConfig(getServletConfig());
  Loading ing=Inits.init(config,false);
  urls=ing.getUrls();
  ok=true;
}

Fixed version (ground truth):
@Override public void init() throws ServletException {
  nutMvc.init(new ServletNutConfig(getServletConfig()));
  ok=true;
}
Program: 80739
Project: 80739
Buggy source:
@Override protected void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  if (null == urls) {
    if (log.isErrorEnabled())     log.error("String_Node_Str");
    return;
  }
  Mvcs.updateRequestAttributes(req);
  String path=Mvcs.getRequestPath(req);
  if (log.isInfoEnabled())   log.info("String_Node_Str" + path);
  ActionInvoking ing=urls.get(path);
  if (null == ing || null == ing.getInvoker())   resp.setStatus(404);
 else   ing.invoke(config.getServletContext(),req,resp);
}

Fixed version (ground truth):
@Override protected void service(HttpServletRequest req,HttpServletResponse resp) throws ServletException, IOException {
  try {
    if (!nutMvc.handle(req,resp)) {
      resp.setStatus(404);
    }
  }
 catch (  InitException e) {
    return;
  }
}
Program: 80740
Project: 80740
Buggy source:
public void destroy(){
  if (config.getMainModule() != null)   Inits.destroy(config);
}

Fixed version (ground truth):
public void destroy(){
  nutMvc.destroy();
}
Program: 80741
Project: 80741
Buggy source:
private void parseArgs(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList argsNodeList=beanElement.getElementsByTagName(TAG_ARGS);
  if (argsNodeList.getLength() > 0) {
    Element argsElement=(Element)argsNodeList.item(0);
    NodeList argNodeList=argsElement.getChildNodes();
    for (int i=0; i < argNodeList.getLength(); i++) {
      if (argNodeList.item(i) instanceof Element)       iocObject.addArg(parseX((Element)argNodeList.item(i)));
    }
  }
}

Fixed version (ground truth):
protected void parseArgs(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList argsNodeList=beanElement.getElementsByTagName(TAG_ARGS);
  if (argsNodeList.getLength() > 0) {
    Element argsElement=(Element)argsNodeList.item(0);
    NodeList argNodeList=argsElement.getChildNodes();
    for (int i=0; i < argNodeList.getLength(); i++) {
      if (argNodeList.item(i) instanceof Element)       iocObject.addArg(parseX((Element)argNodeList.item(i)));
    }
  }
}
Program: 80742
Project: 80742
Buggy source:
private void parseEvents(Element beanElement,IocObject iocObject){
  NodeList eventsNodeList=beanElement.getElementsByTagName("String_Node_Str");
  if (eventsNodeList.getLength() > 0) {
    Element eventsElement=(Element)eventsNodeList.item(0);
    IocEventSet iocEventSet=new IocEventSet();
    NodeList fetchNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (fetchNodeList.getLength() > 0)     iocEventSet.setFetch(((Element)fetchNodeList.item(0)).getTextContent());
    NodeList createNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (createNodeList.getLength() > 0)     iocEventSet.setCreate(((Element)createNodeList.item(0)).getTextContent());
    NodeList deposeNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (deposeNodeList.getLength() > 0)     iocEventSet.setDepose(((Element)deposeNodeList.item(0)).getTextContent());
    if (iocEventSet.getCreate() == null)     if (iocEventSet.getDepose() == null)     if (iocEventSet.getFetch() == null)     return;
    iocObject.setEvents(iocEventSet);
  }
}

Fixed version (ground truth):
protected void parseEvents(Element beanElement,IocObject iocObject){
  NodeList eventsNodeList=beanElement.getElementsByTagName("String_Node_Str");
  if (eventsNodeList.getLength() > 0) {
    Element eventsElement=(Element)eventsNodeList.item(0);
    IocEventSet iocEventSet=new IocEventSet();
    NodeList fetchNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (fetchNodeList.getLength() > 0)     iocEventSet.setFetch(((Element)fetchNodeList.item(0)).getTextContent());
    NodeList createNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (createNodeList.getLength() > 0)     iocEventSet.setCreate(((Element)createNodeList.item(0)).getTextContent());
    NodeList deposeNodeList=eventsElement.getElementsByTagName("String_Node_Str");
    if (deposeNodeList.getLength() > 0)     iocEventSet.setDepose(((Element)deposeNodeList.item(0)).getTextContent());
    if (iocEventSet.getCreate() == null)     if (iocEventSet.getDepose() == null)     if (iocEventSet.getFetch() == null)     return;
    iocObject.setEvents(iocEventSet);
  }
}
Program: 80743
Project: 80743
Buggy source:
private boolean check(List<String> parentList,String currentBeanId){
  if (parentList.contains(currentBeanId))   return false;
  String parentBeanId=parentMap.get(currentBeanId);
  if (parentBeanId == null)   return true;
  parentList.add(currentBeanId);
  return check(parentList,parentBeanId);
}

Fixed version (ground truth):
protected boolean check(List<String> parentList,String currentBeanId){
  if (parentList.contains(currentBeanId))   return false;
  String parentBeanId=parentMap.get(currentBeanId);
  if (parentBeanId == null)   return true;
  parentList.add(currentBeanId);
  return check(parentList,parentBeanId);
}
Program: 80744
Project: 80744
Buggy source:
public XmlIocLoader(String... fileNames){
  try {
    DocumentBuilder builder=Lang.xmls();
    Document document;
    List<NutResource> list=Scans.me().loadResource("String_Node_Str",fileNames);
    for (    NutResource nr : list) {
      InputStream ins=nr.getInputStream();
      document=builder.parse(ins);
      document.normalizeDocument();
      NodeList nodeListZ=((Element)document.getDocumentElement()).getChildNodes();
      for (int i=0; i < nodeListZ.getLength(); i++) {
        if (nodeListZ.item(i) instanceof Element)         paserBean((Element)nodeListZ.item(i),false);
      }
      Streams.safeClose(ins);
    }
    handleParent();
    if (LOG.isDebugEnabled())     LOG.debugf("String_Node_Str",Json.toJson(iocMap));
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public XmlIocLoader(String... fileNames){
  try {
    DocumentBuilder builder=Lang.xmls();
    Document document;
    List<NutResource> list=Scans.me().loadResource(getScanPatten(),fileNames);
    for (    NutResource nr : list) {
      InputStream ins=nr.getInputStream();
      document=builder.parse(ins);
      document.normalizeDocument();
      NodeList nodeListZ=((Element)document.getDocumentElement()).getChildNodes();
      for (int i=0; i < nodeListZ.getLength(); i++) {
        if (nodeListZ.item(i) instanceof Element)         paserBean((Element)nodeListZ.item(i),false);
      }
      Streams.safeClose(ins);
    }
    handleParent();
    if (LOG.isDebugEnabled())     LOG.debugf("String_Node_Str",Json.toJson(iocMap));
  }
 catch (  Throwable e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80745
Project: 80745
Buggy source:
private Map<String,?> paserMap(Element element){
  Map<String,Object> map=new HashMap<String,Object>();
  if (element.hasChildNodes()) {
    NodeList nodeList=element.getElementsByTagName(ITEM_TAG);
    for (int i=0; i < nodeList.getLength(); i++) {
      if (nodeList.item(i) instanceof Element) {
        Element elementItem=(Element)nodeList.item(i);
        String key=elementItem.getAttribute("String_Node_Str");
        if (map.containsKey(key))         throw new IllegalArgumentException("String_Node_Str");
        NodeList list=elementItem.getChildNodes();
        for (int j=0; j < list.getLength(); j++) {
          if (list.item(j) instanceof Element) {
            map.put(key,list.item(j).getTextContent());
            break;
          }
        }
        if (!map.containsKey(key))         map.put(key,null);
      }
    }
  }
  return map;
}

Fixed version (ground truth):
protected Map<String,?> paserMap(Element element){
  Map<String,Object> map=new HashMap<String,Object>();
  if (element.hasChildNodes()) {
    NodeList nodeList=element.getElementsByTagName(ITEM_TAG);
    for (int i=0; i < nodeList.getLength(); i++) {
      if (nodeList.item(i) instanceof Element) {
        Element elementItem=(Element)nodeList.item(i);
        String key=elementItem.getAttribute("String_Node_Str");
        if (map.containsKey(key))         throw new IllegalArgumentException("String_Node_Str");
        NodeList list=elementItem.getChildNodes();
        for (int j=0; j < list.getLength(); j++) {
          if (list.item(j) instanceof Element) {
            map.put(key,list.item(j).getTextContent());
            break;
          }
        }
        if (!map.containsKey(key))         map.put(key,null);
      }
    }
  }
  return map;
}
Program: 80746
Project: 80746
Buggy source:
private void parseFields(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList fieldNodeList=beanElement.getElementsByTagName(TAG_FIELD);
  if (fieldNodeList.getLength() > 0) {
    int len=fieldNodeList.getLength();
    for (int i=0; i < len; i++) {
      Element fieldElement=(Element)fieldNodeList.item(i);
      IocField iocField=new IocField();
      iocField.setName(fieldElement.getAttribute("String_Node_Str"));
      if (fieldElement.hasChildNodes()) {
        NodeList nodeList=fieldElement.getChildNodes();
        for (int j=0; j < nodeList.getLength(); j++) {
          if (nodeList.item(j) instanceof Element) {
            iocField.setValue(parseX((Element)nodeList.item(j)));
            break;
          }
        }
      }
      iocObject.addField(iocField);
    }
  }
}

Fixed version (ground truth):
protected void parseFields(Element beanElement,IocObject iocObject) throws Throwable {
  NodeList fieldNodeList=beanElement.getElementsByTagName(TAG_FIELD);
  if (fieldNodeList.getLength() > 0) {
    int len=fieldNodeList.getLength();
    for (int i=0; i < len; i++) {
      Element fieldElement=(Element)fieldNodeList.item(i);
      IocField iocField=new IocField();
      iocField.setName(fieldElement.getAttribute("String_Node_Str"));
      if (fieldElement.hasChildNodes()) {
        NodeList nodeList=fieldElement.getChildNodes();
        for (int j=0; j < nodeList.getLength(); j++) {
          if (nodeList.item(j) instanceof Element) {
            iocField.setValue(parseX((Element)nodeList.item(j)));
            break;
          }
        }
      }
      iocObject.addField(iocField);
    }
  }
}
Program: 80748
Project: 80748
Buggy source:
private IocObject paserBean(Element beanElement,boolean innerBean) throws Throwable {
  String beanId;
  if (innerBean) {
    beanId="String_Node_Str" + innerId;
    innerId++;
  }
 else   beanId=beanElement.getAttribute("String_Node_Str");
  if (beanId == null)   throw Lang.makeThrow("String_Node_Str");
  if (iocMap.containsKey(beanId))   throw Lang.makeThrow("String_Node_Str" + beanId);
  if (LOG.isDebugEnabled())   LOG.debugf("String_Node_Str",beanId);
  IocObject iocObject=new IocObject();
  String beanType=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanType))   iocObject.setType(Lang.loadClass(beanType));
  String beanScope=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanScope))   iocObject.setScope(beanScope);
  String beanParent=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanParent))   parentMap.put(beanId,beanParent);
  parseArgs(beanElement,iocObject);
  parseFields(beanElement,iocObject);
  parseEvents(beanElement,iocObject);
  iocMap.put(beanId,iocObject);
  if (LOG.isDebugEnabled())   LOG.debugf("String_Node_Str",beanId);
  return iocObject;
}

Fixed version (ground truth):
protected IocObject paserBean(Element beanElement,boolean innerBean) throws Throwable {
  String beanId;
  if (innerBean) {
    beanId="String_Node_Str" + innerId;
    innerId++;
  }
 else   beanId=beanElement.getAttribute("String_Node_Str");
  if (beanId == null)   throw Lang.makeThrow("String_Node_Str");
  if (iocMap.containsKey(beanId))   throw Lang.makeThrow("String_Node_Str" + beanId);
  if (LOG.isDebugEnabled())   LOG.debugf("String_Node_Str",beanId);
  IocObject iocObject=new IocObject();
  String beanType=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanType))   iocObject.setType(Lang.loadClass(beanType));
  String beanScope=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanScope))   iocObject.setScope(beanScope);
  String beanParent=beanElement.getAttribute("String_Node_Str");
  if (!Strings.isBlank(beanParent))   parentMap.put(beanId,beanParent);
  parseArgs(beanElement,iocObject);
  parseFields(beanElement,iocObject);
  parseEvents(beanElement,iocObject);
  iocMap.put(beanId,iocObject);
  if (LOG.isDebugEnabled())   LOG.debugf("String_Node_Str",beanId);
  return iocObject;
}
Program: 80749
Project: 80749
Buggy source:
private void handleParent(){
  for (  String parentId : parentMap.values())   if (!iocMap.containsKey(parentId))   throw Lang.makeThrow("String_Node_Str",parentId);
  List<String> parentList=new ArrayList<String>();
  for (  Entry<String,String> entry : parentMap.entrySet()) {
    if (!check(parentList,entry.getKey()))     throw Lang.makeThrow("String_Node_Str",entry.getKey());
    parentList.clear();
  }
  while (parentMap.size() != 0) {
    Iterator<Entry<String,String>> it=parentMap.entrySet().iterator();
    while (it.hasNext()) {
      Entry<String,String> entry=it.next();
      String beanId=entry.getKey();
      String parentId=entry.getValue();
      if (parentMap.get(parentId) == null) {
        IocObject newIocObject=Iocs.mergeWith(iocMap.get(beanId),iocMap.get(parentId));
        iocMap.put(beanId,newIocObject);
        it.remove();
      }
    }
  }
}

Fixed version (ground truth):
protected void handleParent(){
  for (  String parentId : parentMap.values())   if (!iocMap.containsKey(parentId))   throw Lang.makeThrow("String_Node_Str",parentId);
  List<String> parentList=new ArrayList<String>();
  for (  Entry<String,String> entry : parentMap.entrySet()) {
    if (!check(parentList,entry.getKey()))     throw Lang.makeThrow("String_Node_Str",entry.getKey());
    parentList.clear();
  }
  while (parentMap.size() != 0) {
    Iterator<Entry<String,String>> it=parentMap.entrySet().iterator();
    while (it.hasNext()) {
      Entry<String,String> entry=it.next();
      String beanId=entry.getKey();
      String parentId=entry.getValue();
      if (parentMap.get(parentId) == null) {
        IocObject newIocObject=Iocs.mergeWith(iocMap.get(beanId),iocMap.get(parentId));
        iocMap.put(beanId,newIocObject);
        it.remove();
      }
    }
  }
}
Program: 80750
Project: 80750
Buggy source:
private List<IocValue> paserCollection(Element element) throws Throwable {
  List<IocValue> list=new ArrayList<IocValue>();
  if (element.hasChildNodes()) {
    NodeList nodeList=element.getChildNodes();
    for (int i=0; i < nodeList.getLength(); i++) {
      Node node=nodeList.item(i);
      if (node instanceof Element) {
        list.add((IocValue)parseX((Element)node));
      }
    }
  }
  return list;
}

Fixed version (ground truth):
protected List<IocValue> paserCollection(Element element) throws Throwable {
  List<IocValue> list=new ArrayList<IocValue>();
  if (element.hasChildNodes()) {
    NodeList nodeList=element.getChildNodes();
    for (int i=0; i < nodeList.getLength(); i++) {
      Node node=nodeList.item(i);
      if (node instanceof Element) {
        list.add((IocValue)parseX((Element)node));
      }
    }
  }
  return list;
}
Program: 80751
Project: 80751
Buggy source:
private void pojo2Json(Object obj) throws IOException {
  if (null == obj)   return;
  Class<? extends Object> type=obj.getClass();
  ToJson tj=type.getAnnotation(ToJson.class);
  String myMethodName=Strings.sNull(null == tj ? null : tj.value(),"String_Node_Str");
  Method myMethod;
  try {
    myMethod=type.getMethod(myMethodName);
    Object re=myMethod.invoke(obj);
    writer.append(String.valueOf(re));
    return;
  }
 catch (  Exception e1) {
    try {
      myMethod=type.getMethod(myMethodName,JsonFormat.class);
      Object re=myMethod.invoke(obj,format);
      writer.append(String.valueOf(re));
      return;
    }
 catch (    Exception e) {
    }
  }
  Mirror<?> me=Mirror.me(type);
  Field[] fields=me.getFields();
  appendBraceBegin();
  increaseFormatIndent();
  ArrayList<Pair> list=new ArrayList<Pair>(fields.length);
  for (  Field f : fields) {
    String name=f.getName();
    try {
      Object value=me.getValue(obj,name);
      if (!this.isIgnore(name,value))       list.add(new Pair(name,value));
    }
 catch (    FailToGetValueException e) {
    }
  }
  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):
private void pojo2Json(Object obj) throws IOException {
  if (null == obj)   return;
  Class<? extends Object> type=obj.getClass();
  ToJson tj=type.getAnnotation(ToJson.class);
  String myMethodName=Strings.sNull(null == tj ? null : tj.value(),"String_Node_Str");
  try {
    Method myMethod=type.getMethod(myMethodName);
    if (!myMethod.isAccessible())     myMethod.setAccessible(true);
    Object re=myMethod.invoke(obj);
    writer.append(String.valueOf(re));
    return;
  }
 catch (  Exception e1) {
    try {
      Method myMethod=type.getMethod(myMethodName,JsonFormat.class);
      if (!myMethod.isAccessible())       myMethod.setAccessible(true);
      Object re=myMethod.invoke(obj,format);
      writer.append(String.valueOf(re));
      return;
    }
 catch (    Exception e) {
    }
  }
  Mirror<?> me=Mirror.me(type);
  Field[] fields=me.getFields();
  appendBraceBegin();
  increaseFormatIndent();
  ArrayList<Pair> list=new ArrayList<Pair>(fields.length);
  for (  Field f : fields) {
    String name=f.getName();
    try {
      Object value=me.getValue(obj,name);
      if (!this.isIgnore(name,value))       list.add(new Pair(name,value));
    }
 catch (    FailToGetValueException e) {
    }
  }
  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();
}
Program: 80752
Project: 80752
Buggy source:
/** 
 * @param path 全路径
 * @return 文件或者目录名
 */
public static String getName(String path){
  if (!Strings.isBlank(path)) {
    int pos=path.replace('\\','/').lastIndexOf('/');
    if (pos > 0)     return path.substring(pos);
  }
  return path;
}

Fixed version (ground truth):
/** 
 * @param path 全路径
 * @return 文件或者目录名
 */
public static String getName(String path){
  if (!Strings.isBlank(path)) {
    int pos=path.replace('\\','/').lastIndexOf('/');
    if (pos > 0)     return path.substring(pos + 1);
  }
  return path;
}
Program: 80753
Project: 80753
Buggy source:
public static StringGenerator sg(int min,int max){
  return new StringGenerator(min,max);
}

Fixed version (ground truth):
public static StringGenerator sg(int len){
  return new StringGenerator(len,len);
}
Program: 80754
Project: 80754
Buggy source:
public E next(){
  return stack.innerGet(i++);
}

Fixed version (ground truth):
public E next(){
  if (i >= stack.offset && i < stack.cursor)   return stack.innerGet(i++);
  return null;
}
Program: 80755
Project: 80755
Buggy source:
LinkedArrayIterator(LinkedArray<E> stack){
  this.stack=stack;
  i=0;
}

Fixed version (ground truth):
LinkedArrayIterator(LinkedArray<E> stack){
  this.stack=stack;
  i=stack.offset;
}
Program: 80756
Project: 80756
Buggy source:
public boolean hasNext(){
  return (stack.cursor - i + stack.offset) > 0;
}

Fixed version (ground truth):
public boolean hasNext(){
  return i < stack.cursor;
}
Program: 80757
Project: 80757
Buggy source:
public LinkedArray(Class<T> eleType,int size){
  this.eleType=eleType;
  if (size < 0)   Lang.makeThrow("String_Node_Str");
  this.width=size;
  cache=new ArrayList<T[]>();
}

Fixed version (ground truth):
public LinkedArray(Class<T> eleType,int size){
  this.eleType=eleType;
  if (size <= 0)   Lang.makeThrow("String_Node_Str");
  this.width=size;
  cache=new ArrayList<T[]>();
}
Program: 80758
Project: 80758
Buggy source:
public LinkedIntArray(int size){
  if (size < 0)   Lang.makeThrow("String_Node_Str");
  this.width=size;
  cache=new ArrayList<int[]>();
}

Fixed version (ground truth):
public LinkedIntArray(int size){
  if (size <= 0)   Lang.makeThrow("String_Node_Str");
  this.width=size;
  cache=new ArrayList<int[]>();
}
Program: 80759
Project: 80759
Buggy source:
protected Object getValue(IocMaking ing,Object obj) throws Exception {
  if (null == args || args.length == 0) {
    return method.invoke(obj);
  }
  Object[] fas=new Object[args.length];
  for (int i=0; i < args.length; i++)   fas[i]=args[i].getValue(ing,null);
  return method.invoke(obj,fas);
}

Fixed version (ground truth):
protected Object getValue(IocMaking ing,Object obj) throws Exception {
  if (method != null) {
    if (null == args || args.length == 0)     return method.invoke(obj);
    Object[] fas=new Object[args.length];
    for (int i=0; i < args.length; i++)     fas[i]=args[i].getValue(ing,null);
    return method.invoke(obj,fas);
  }
  return field.get(null);
}
Program: 80760
Project: 80760
Buggy source:
public StaticFunctionNode(String className,String name,ChainNode[] args){
  try {
    Mirror<?> mirror=Mirror.me((Class<?>)Lang.loadClass(className));
    if (null == args || args.length == 0) {
      try {
        method=mirror.getGetter(name);
      }
 catch (      NoSuchMethodException e) {
        throw Lang.makeThrow("String_Node_Str",name,mirror);
      }
    }
 else {
      Method[] ms=mirror.findMethods(name,args.length);
      if (0 == ms.length)       throw Lang.makeThrow("String_Node_Str",name,mirror);
      this.args=args;
      this.method=ms[0];
    }
    if (!Modifier.isStatic(method.getModifiers()))     throw Lang.makeThrow("String_Node_Str",name,mirror);
  }
 catch (  ClassNotFoundException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public StaticFunctionNode(String className,String name,ChainNode[] args){
  try {
    Mirror<?> mirror=Mirror.me(Lang.loadClass(className));
    if (null == args || args.length == 0) {
      try {
        method=mirror.getGetter(name);
      }
 catch (      NoSuchMethodException e) {
        try {
          field=mirror.getField(name);
          if (!Modifier.isStatic(field.getModifiers()))           throw Lang.makeThrow("String_Node_Str",name,mirror);
          return;
        }
 catch (        NoSuchFieldException e1) {
          throw Lang.makeThrow("String_Node_Str",name,mirror);
        }
      }
    }
 else {
      Method[] ms=mirror.findMethods(name,args.length);
      if (0 == ms.length)       throw Lang.makeThrow("String_Node_Str",name,mirror);
      this.args=args;
      this.method=ms[0];
    }
    if (!Modifier.isStatic(method.getModifiers()))     throw Lang.makeThrow("String_Node_Str",name,mirror);
  }
 catch (  ClassNotFoundException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80761
Project: 80761
Buggy source:
protected String asString(){
  StringBuilder sb=new StringBuilder();
  if (null != args && args.length > 0) {
    sb.append(args[0].toString());
    for (int i=1; i < args.length; i++)     sb.append("String_Node_Str").append(args[i].toString());
  }
  return String.format("String_Node_Str",method.getDeclaringClass().getName(),method.getName(),sb);
}

Fixed version (ground truth):
protected String asString(){
  StringBuilder sb=new StringBuilder();
  if (null != args && args.length > 0) {
    sb.append(args[0].toString());
    for (int i=1; i < args.length; i++)     sb.append("String_Node_Str").append(args[i].toString());
  }
  if (method != null)   return String.format("String_Node_Str",method.getDeclaringClass().getName(),method.getName(),sb);
 else   return String.format("String_Node_Str",field.getDeclaringClass().getName(),field.getName(),sb);
}
Program: 80762
Project: 80762
Buggy source:
/** 
 * 执行过滤
 * @param request 当前的请求对象
 * @param method 即将调用的入口函数
 * @return <ul><li>null - 过滤去通过，可以继续执行后续操作 <li>View 对象实例 - 过滤器认为应该终止操作，用这个视图对象来直接渲染 HTTP响应 </ul>
 */
View match(HttpServletRequest request,Method method);

Fixed version (ground truth):
/** 
 * 执行过滤
 * @param sc Servlet 上下文对象
 * @param request 当前的请求对象
 * @param method 即将调用的入口函数
 * @return <ul><li>null - 过滤去通过，可以继续执行后续操作 <li>View 对象实例 - 过滤器认为应该终止操作，用这个视图对象来直接渲染 HTTP响应 </ul>
 */
View match(ServletContext sc,HttpServletRequest request,Method method);
Program: 80763
Project: 80763
Buggy source:
public View match(HttpServletRequest request,Method method){
  Object obj=request.getSession().getAttribute(name);
  if (null == obj)   return new ServerRedirectView(path);
  return null;
}

Fixed version (ground truth):
public View match(ServletContext sc,HttpServletRequest request,Method method){
  Object obj=request.getSession().getAttribute(name);
  if (null == obj)   return new ServerRedirectView(path);
  return null;
}
Program: 80765
Project: 80765
Buggy source:
/** 
 * 初始化NutLog,检查全部Log的可用性,选择可用的Log适配器 <p/><b>加载本类时,该方法已经在静态构造函数中调用,用户无需主动调用.</b> <p/><b>除非迫不得已,请不要调用本方法<b/>
 */
public static void init(){
  try {
    adapter=new SimplePluginManager<LogAdapter>("String_Node_Str","String_Node_Str","String_Node_Str").get();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * 初始化NutLog,检查全部Log的可用性,选择可用的Log适配器 <p/> <b>加载本类时,该方法已经在静态构造函数中调用,用户无需主动调用.</b> <p/> <b>除非迫不得已,请不要调用本方法<b/>
 */
public static void init(){
  try {
    adapter=new SimplePluginManager<LogAdapter>("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str").get();
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 80766
Project: 80766
Buggy source:
/** 
 * Get a Log by name
 * @param className the name of Log
 * @return Log 
 * @throws NullPointerException when className is null, maybe it will case NPE
 */
public static Log getLog(String className){
  return adapter.getLogger(className);
}

Fixed version (ground truth):
/** 
 * Get a Log by name
 * @param className the name of Log
 * @return Log
 * @throws NullPointerException when className is null, maybe it will case NPE
 */
public static Log getLog(String className){
  return adapter.getLogger(className);
}
Program: 80767
Project: 80767
Buggy source:
public boolean canWork(){
  try {
    Class.forName(LOG4J_CLASS_NAME,true,Thread.currentThread().getContextClassLoader());
  }
 catch (  ClassNotFoundException e) {
    return false;
  }
  return isPropertyFileConfigured();
}

Fixed version (ground truth):
public boolean canWork(){
  try {
    Class.forName("String_Node_Str",false,Thread.currentThread().getContextClassLoader());
    return isPropertyFileConfigured();
  }
 catch (  Throwable e) {
  }
  return false;
}
Program: 80768
Project: 80768
Buggy source:
public SimplePluginManager(Class<? extends T>... classNames) throws PluginException {
  for (  Class<? extends T> pluginClass : classNames)   loadPlugin(pluginClass);
}

Fixed version (ground truth):
public SimplePluginManager(Class<? extends T>... classNames) throws PluginException {
  if (classNames != null)   for (  Class<? extends T> pluginClass : classNames)   loadPlugin(pluginClass);
}
Program: 80769
Project: 80769
Buggy source:
@SuppressWarnings("String_Node_Str") private void loadPlugin(String pluginClassName) throws PluginException {
  try {
    if (pluginClassName != null)     loadPlugin((Class<? extends T>)Lang.loadClass(pluginClassName));
  }
 catch (  ClassNotFoundException e) {
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void loadPlugin(String pluginClassName) throws PluginException {
  try {
    if (pluginClassName != null)     loadPlugin((Class<? extends T>)Lang.loadClass(pluginClassName));
  }
 catch (  Throwable e) {
  }
}
Program: 80770
Project: 80770
Buggy source:
public boolean isFile(){
  return null != getContentType() && null != getFileLocalPath();
}

Fixed version (ground truth):
public boolean isFile(){
  return null != getFileLocalPath();
}