nus-yam/ex-repair huggingface dataset:
Program: 80827
Project: 80827
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>T get(Class<T> classOfT,IocMaking ing){
  Object obj=weaver.weave(ing);
  if (null != fetch)   fetch.trigger(obj);
  return (T)obj;
}

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

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

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

Fixed version (ground truth):
public ObjectProxy fetch(String name){
  Object re=session.getAttribute(name);
  if (re == null)   return null;
  if (re instanceof ObjectProxy)   return (ObjectProxy)re;
  return new ObjectProxy().setObj(re);
}
Program: 80832
Project: 80832
Buggy source:
@Override public Number cast(String src,Class<?> toType,String... args){
  try {
    return (Number)Mirror.me(toType).getWrapperClass().getConstructor(String.class).newInstance(Strings.isBlank(src) ? "String_Node_Str" : src);
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
}

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

Fixed version (ground truth):
/** 
 * @param req 请求对象
 * @param resp 响应对象
 * @param refer 这个参考字段，如果有值，表示是路径参数的值，那么它比 request 里的参数优先
 * @return 注入值
 */
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null != refer)   return Castors.me().castTo(refer,type);
  String[] params=req.getParameterValues(name);
  return Castors.me().castTo(params,type);
}
Program: 80834
Project: 80834
Buggy source:
@SuppressWarnings("String_Node_Str") public <T>Mirror<T> getMirror(Class<T> type,String name){
  if (MethodInterceptor.class.isAssignableFrom(type))   return Mirror.me(type);
  if (type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX))   return Mirror.me(type);
  if (AopConfigration.IOCNAME.equals(name))   return Mirror.me(type);
  try {
    return (Mirror<T>)Mirror.me(cd.load(type.getName() + ClassAgent.CLASSNAME_SUFFIX));
  }
 catch (  ClassNotFoundException e) {
  }
  if (aopConfigration == null)   if (ioc.has(AopConfigration.IOCNAME))   aopConfigration=ioc.get(AopConfigration.class,AopConfigration.IOCNAME);
 else   aopConfigration=new AnnotationAopConfigration();
  List<InterceptorPair> interceptorPairs=aopConfigration.getInterceptorPairList(ioc,type);
  if (interceptorPairs == null || interceptorPairs.size() < 1)   return Mirror.me(type);
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  return Mirror.me(agent.define(cd,type));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public <T>Mirror<T> getMirror(Class<T> type,String name){
  if (MethodInterceptor.class.isAssignableFrom(type))   return Mirror.me(type);
  if (type.getName().endsWith(ClassAgent.CLASSNAME_SUFFIX))   return Mirror.me(type);
  if (AopConfigration.IOCNAME.equals(name))   return Mirror.me(type);
  if (AopConfigration.class.isAssignableFrom(type))   return Mirror.me(type);
  try {
    return (Mirror<T>)Mirror.me(cd.load(type.getName() + ClassAgent.CLASSNAME_SUFFIX));
  }
 catch (  ClassNotFoundException e) {
  }
  if (aopConfigration == null)   if (ioc.has(AopConfigration.IOCNAME))   aopConfigration=ioc.get(AopConfigration.class,AopConfigration.IOCNAME);
 else   aopConfigration=new AnnotationAopConfigration();
  List<InterceptorPair> interceptorPairs=aopConfigration.getInterceptorPairList(ioc,type);
  if (interceptorPairs == null || interceptorPairs.size() < 1)   return Mirror.me(type);
  ClassAgent agent=new AsmClassAgent();
  for (  InterceptorPair interceptorPair : interceptorPairs)   agent.addInterceptor(interceptorPair.getMethodMatcher(),interceptorPair.getMethodInterceptor());
  return Mirror.me(agent.define(cd,type));
}
Program: 80837
Project: 80837
Buggy source:
public UploadAdaptor(String path,int buffer,String charset,int poolSize){
  this.charset=charset;
  this.pool=new NutFilePool(path,poolSize);
  this.buffer=buffer;
}

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

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

Fixed version (ground truth):
/** 
 * 对流的解析
 * @param req
 * @param charset
 * @param tmps
 * @throws UploadException
 * @throws UploadOutOfSizeException
 * @throws UploadUnsupportedFileNameException
 * @throws UploadUnsupportedFileTypeException
 */
Map<String,Object> parse(HttpServletRequest req,UploadingContext context) throws UploadException, UploadOutOfSizeException, UploadUnsupportedFileNameException, UploadUnsupportedFileTypeException ;
Program: 80841
Project: 80841
Buggy source:
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return new String(Encoding.CHARSET_UTF8.encode(s.toString()).array(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public static String encode(Object s){
  if (null == s)   return "String_Node_Str";
  try {
    return new String(s.toString().getBytes(),Encoding.CHARSET_UTF8.name());
  }
 catch (  UnsupportedEncodingException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 80842
Project: 80842
Buggy source:
/** 
 * 将数据写入文件,成功就返回true,失败就返回false
 * @param file 需要写入的文件
 * @param data 需要写入的数据
 * @return true 如果写入成功
 */
public static boolean write(File file,byte data[]){
  try {
    FileOutputStream fos=new FileOutputStream(file);
    fos.write(data);
    fos.flush();
    fos.close();
  }
 catch (  Throwable e) {
    return false;
  }
  return true;
}

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

Fixed version (ground truth):
/** 
 * 将一个字节数组写入一个输出流。 <p> <b style=color:red>注意</b>，它并不会关闭输出流
 * @param ops 输出流
 * @param bytes 字节数组
 * @throws IOException
 */
public static void write(OutputStream ops,byte[] bytes) throws IOException {
  if (null == ops || null == bytes)   return;
  ops.write(bytes);
}
Program: 80844
Project: 80844
Buggy source:
public void setProductName(String productName){
  this.productName=productName;
  String proName=productName.toLowerCase();
  if ("String_Node_Str".equals(proName)) {
    type=DB.H2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.PSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.MYSQL;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.ORACLE;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.DB2;
  }
 else   if (proName.startsWith("String_Node_Str")) {
    type=DB.SQLSERVER;
  }
 else {
    type=DB.OTHER;
  }
}

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

Fixed version (ground truth):
public Pager make(DatabaseMeta meta,int pageNumber,int pageSize){
  if (pageNumber < 1 || pageSize <= 0)   return null;
  Pager pager;
  if (meta.isMySql() || meta.isH2() || meta.isSQLite()) {
    pager=new MysqlPager();
  }
 else   if (meta.isPostgresql()) {
    pager=new PostgresqlPager();
  }
 else   if (meta.isOracle()) {
    pager=new OraclePager();
  }
 else   if (meta.isSqlServer()) {
    if (meta.getVersion().contains("String_Node_Str"))     pager=new SqlServer2000Pager();
 else     pager=new SqlServer2005Pager();
  }
 else   if (meta.isDB2()) {
    pager=new DB2Pager();
  }
 else {
    pager=new OtherPager();
  }
  pager.setPageNumber(pageNumber);
  pager.setPageSize(pageSize);
  return pager;
}
Program: 80846
Project: 80846
Buggy source:
public void invoke(int i,Object ele,int length) throws ExitLoop, LoopException {
  sb.append(Sqls.formatFieldValue(ele)).append(',');
}

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

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

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

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

Fixed version (ground truth):
/** 
 * 将 SQL 的字段值进行转意，可以用来防止 SQL 注入攻击
 * @param s 字段值
 * @return 格式化后的 Sql 字段值，可以直接拼装在 SQL 里面
 */
public static CharSequence escapeFieldValue(CharSequence s){
  if (null == s)   return null;
  return ES_FLD_VAL.escape(s);
}
Program: 80851
Project: 80851
Buggy source:
public ActionInvoker getInvoker(){
  return invoker;
}

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

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

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

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

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

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

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

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

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

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

Fixed version (ground truth):
private void string2Json(String s) throws IOException {
  if (null == s)   writer.append("String_Node_Str");
 else {
    char[] cs=s.toCharArray();
    writer.append(format.getSeparator());
    for (    char c : cs) {
switch (c) {
case '"':
        writer.append("String_Node_Str");
      break;
case '\n':
    writer.append("String_Node_Str");
  break;
case '\t':
writer.append("String_Node_Str");
break;
case '\r':
writer.append("String_Node_Str");
break;
case '\\':
writer.append("String_Node_Str");
break;
default :
writer.append(c);
}
}
writer.append(format.getSeparator());
}
}
Program: 80862
Project: 80862
Buggy source:
public Object get(HttpServletRequest req,HttpServletResponse resp,Object refer){
  Object obj=mirror.born();
  for (int i=0; i < injs.length; i++) {
    Injecting inj=injs[i];
    String s=req.getParameter(names[i]);
    if (null == s)     continue;
    if (Strings.isBlank(s))     s=null;
    inj.inject(obj,s);
  }
  return obj;
}

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

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

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

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

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

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

Fixed version (ground truth):
public String getQueryString(){
  if (params.size() == 0)   return null;
  StringBuilder sb=new StringBuilder();
  for (  Entry<String,String[]> entry : params.entrySet()) {
    if (entry.getValue() == null)     sb.append(entry.getKey()).append("String_Node_Str");
 else     for (    String str : entry.getValue()) {
      sb.append(entry.getKey()).append("String_Node_Str").append(str).append("String_Node_Str");
    }
  }
  return sb.toString();
}
Program: 80870
Project: 80870
Buggy source:
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (File.class.isAssignableFrom(type))   return new FileInjector(param.value());
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(param.value());
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(param.value());
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  return new MapItemInjector(param.value(),type);
}

Fixed version (ground truth):
protected ParamInjector evalInjector(Class<?> type,Param param){
  if (File.class.isAssignableFrom(type))   return new FileInjector(param.value());
  if (FieldMeta.class.isAssignableFrom(type))   return new FileMetaInjector(param.value());
  if (TempFile.class.isAssignableFrom(type))   return new TempFileInjector(param.value());
  if (Map.class.isAssignableFrom(type))   return new MapSelfInjector();
  if (null == param)   return null;
  String pm=param.value();
  if ("String_Node_Str".equals(pm)) {
    if (type.isAssignableFrom(Map.class))     return new MapPairInjector();
    return new MapReferInjector(null,type);
  }
 else   if (pm.startsWith("String_Node_Str") && pm.length() > 2) {
    return new MapReferInjector(pm.substring(2),type);
  }
 else   if (type.isArray())   return new ArrayInjector(pm,type);
  return new MapItemInjector(param.value(),type);
}
Program: 80871
Project: 80871
Buggy source:
Ioc create(ServletConfig config,String[] args);

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

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

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

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

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

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

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

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

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

Fixed version (ground truth):
/** 
 * 关闭时，额外逻辑
 * @param config
 */
void destroy(NutConfig config);
Program: 80881
Project: 80881
Buggy source:
protected void loadIoc() throws Throwable {
  IocBy ib=mainModule.getAnnotation(IocBy.class);
  if (null != ib) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",ib.type().getName());
    ioc=ib.type().newInstance().create(config,ib.args());
    saveToContext(Ioc.class.getName(),ioc);
  }
 else   if (log.isDebugEnabled())   log.debug("String_Node_Str");
}

Fixed version (ground truth):
protected void loadIoc() throws Throwable {
  IocBy ib=mainModule.getAnnotation(IocBy.class);
  if (null != ib) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",ib.type().getName());
    ioc=ib.type().newInstance().create(config,ib.args());
    if (ioc instanceof Ioc2)     ((Ioc2)ioc).addValueProxyMaker(new MvcValueProxyMaker());
    saveToContext(Ioc.class.getName(),ioc);
  }
 else   if (log.isDebugEnabled())   log.debug("String_Node_Str");
}
Program: 80883
Project: 80883
Buggy source:
public T born(){
  try {
    return borning.born(realArgs);
  }
 catch (  Throwable e) {
    throw new BorningException(e,type,realArgs);
  }
}

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

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

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

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? null : (Map<?,?>)obj;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}
Program: 80888
Project: 80888
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? null : (Map<?,?>)obj;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  Mirror<?> mirror=Mirror.me(obj);
  boolean isMap=null != obj && obj instanceof Map<?,?>;
  Map<?,?> map=isMap ? (Map<?,?>)obj : null;
  Set<String> keySet=dest.keys();
  Iterator<String> it=keySet.iterator();
  while (it.hasNext()) {
    String key=it.next();
    Object value=null;
    int length=key.length();
    if (key.startsWith("String_Node_Str") && length > 2) {
      value=req.getParameter(key.substring(2));
    }
 else     if (isMap && key.startsWith("String_Node_Str") && length > 4) {
      value=map.get(key);
    }
 else     if (null != mirror && key.startsWith("String_Node_Str") && length > 4) {
      value=mirror.getValue(obj,key.substring(4));
    }
 else {
      value=obj;
    }
    if (null == value)     value=obj;
    dest.set(key,value);
  }
  String path=dest.toString();
  if (path.startsWith("String_Node_Str") || path.startsWith("String_Node_Str")) {
  }
 else   if (path.startsWith("String_Node_Str")) {
    path=req.getContextPath() + path;
  }
 else {
    String myPath=req.getPathInfo();
    int pos=myPath.lastIndexOf('/');
    if (pos > 0)     path=myPath.substring(0,pos) + "String_Node_Str" + path;
 else     path="String_Node_Str" + path;
  }
  resp.sendRedirect(path);
  resp.flushBuffer();
}
Program: 80889
Project: 80889
Buggy source:
public void addValueProxyMaker(ValueProxyMaker vpm){
  vpms.add(vpm);
}

Fixed version (ground truth):
public void addValueProxyMaker(ValueProxyMaker vpm){
  vpms.add(0,vpm);
}
Program: 80891
Project: 80891
Buggy source:
/** 
 * 如果txt中第一个支付和 firstChar一致,则删除,否则返回 txt <p> 比如: <ul> <li>removeFirst("12345",1) => "2345" <li>removeFirst("ABC",'B') => "ABC" <li>removeFirst("A",'B') => "A" <li>removeFirst("A",'A') => "" </ul>
 * @param str 字符串
 * @param c 第一个个要被截取的字符
 * @return 新字符串
 */
public static String removeFirst(String str,char c){
  if (str == null)   return null;
  if (str.length() == 0)   return "String_Node_Str";
  if (c == str.charAt(0))   return str.substring(1);
  return str;
}

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

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") void render(Object obj) throws IOException {
  if (null == obj) {
    writer.write("String_Node_Str");
  }
 else   if (obj instanceof Class) {
    string2Json(((Class<?>)obj).getName());
  }
 else   if (obj instanceof Mirror) {
    string2Json(((Mirror<?>)obj).getType().getName());
  }
 else {
    Mirror mr=Mirror.me(obj.getClass());
    if (mr.isEnum()) {
      string2Json(((Enum)obj).name());
    }
 else     if (mr.isNumber() || mr.isBoolean() || mr.isChar()) {
      writer.append(obj.toString());
    }
 else     if (mr.isStringLike()) {
      string2Json(obj.toString());
    }
 else     if (mr.isDateTimeLike()) {
      string2Json(format.getCastors().castToString(obj));
    }
 else     if (memo.containsKey(obj)) {
      writer.append("String_Node_Str");
    }
 else {
      memo.put(obj,null);
      if (obj instanceof Map)       map2Json((Map)obj);
 else       if (obj instanceof Collection)       coll2Json((Collection)obj);
 else       if (obj.getClass().isArray())       array2Json(obj);
 else {
        pojo2Json(obj);
      }
      memo.remove(obj);
    }
  }
}
Program: 80893
Project: 80893
Buggy source:
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return getParent().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
  }
  return loadClass(className);
}

Fixed version (ground truth):
public Class<?> load(String className) throws ClassNotFoundException {
  try {
    return Thread.currentThread().getContextClassLoader().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    try {
      return ClassLoader.getSystemClassLoader().loadClass(className);
    }
 catch (    ClassNotFoundException e2) {
      try {
        return getParent().loadClass(className);
      }
 catch (      ClassNotFoundException e3) {
      }
    }
  }
  return loadClass(className);
}
Program: 80894
Project: 80894
Buggy source:
@SuppressWarnings("String_Node_Str") protected <T>Class<T> generate(ClassDefiner cd,Pair2[] pair2s,String newName,Class<T> klass,Constructor<T>[] constructors){
  try {
    return (Class<T>)cd.load(newName);
  }
 catch (  ClassNotFoundException e) {
  }
  try {
    cd.load("String_Node_Str");
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  Method[] methodArray=new Method[pair2s.length];
  List<MethodInterceptor>[] methodInterceptorList=new List[pair2s.length];
  for (int i=0; i < pair2s.length; i++) {
    Pair2 pair2=pair2s[i];
    methodArray[i]=pair2.method;
    methodInterceptorList[i]=pair2.listeners;
  }
  byte[] bytes=ClassY.enhandClass(klass,newName,methodArray,constructors);
  if (debug)   Files.write(new File(newName),bytes);
  Class<T> newClass=(Class<T>)cd.define(newName,bytes);
  AopToolKit.injectFieldValue(newClass,methodArray,methodInterceptorList);
  return newClass;
}

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

Fixed version (ground truth):
public DefaultMirrorFactory(Ioc ioc){
  this.ioc=ioc;
  this.cd=new DefaultClassDefiner(getClass().getClassLoader());
}