nus-yam/ex-repair huggingface dataset:
Program: 43187
Project: 43187
Buggy source:
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isNotNull() || mf.isPk())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.isPk() && en.getPks().size() == 1) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(',');
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  if (en.getPks().size() > 1) {
    sb=new StringBuilder();
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append("String_Node_Str").append(mf.getColumnName());
    }
    sb.append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append(mf.getColumnName()).append("String_Node_Str");
    }
    sb.setCharAt(sb.length() - 1,')');
    dao.execute(Sqls.create(sb.toString()));
  }
  createRelation(dao,en);
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  addComment(dao,en);
  return true;
}

Fixed version (ground truth):
public boolean createEntity(Dao dao,Entity<?> en){
  StringBuilder sb=new StringBuilder("String_Node_Str" + en.getTableName() + "String_Node_Str");
  for (  MappingField mf : en.getMappingFields()) {
    sb.append('\n').append(mf.getColumnName());
    sb.append(' ').append(evalFieldType(mf));
    if (mf.isName() && en.getPkType() != PkType.NAME) {
      sb.append("String_Node_Str");
    }
 else {
      if (mf.isNotNull() || mf.isPk())       sb.append("String_Node_Str");
      if (mf.hasDefaultValue())       sb.append("String_Node_Str").append(getDefaultValue(mf)).append('\'');
      if (mf.isAutoIncreasement())       sb.append("String_Node_Str");
      if (mf.isPk() && en.getPks().size() == 1) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(',');
  }
  sb.setCharAt(sb.length() - 1,')');
  dao.execute(Sqls.create(sb.toString()));
  if (en.getPks().size() > 1) {
    sb=new StringBuilder();
    sb.append("String_Node_Str").append(en.getTableName()).append("String_Node_Str");
    sb.append(makePksName(en));
    sb.append("String_Node_Str");
    for (    MappingField mf : en.getPks()) {
      sb.append(mf.getColumnName()).append("String_Node_Str");
    }
    sb.setCharAt(sb.length() - 1,')');
    dao.execute(Sqls.create(sb.toString()));
  }
  createRelation(dao,en);
  dao.execute(createIndexs(en).toArray(new Sql[0]));
  addComment(dao,en);
  return true;
}
Program: 43189
Project: 43189
Buggy source:
public String getServerInfo(){
  throw Lang.noImplement();
}

Fixed version (ground truth):
public String getServerInfo(){
  return "String_Node_Str";
}
Program: 43190
Project: 43190
Buggy source:
private void _evalFieldMacro(Entity<?> en,List<MappingInfo> infos){
  for (  MappingInfo info : infos) {
    if (null != info.annPrev) {
      en.addBeforeInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annPrev.els(),info.annPrev.value())));
    }
    if (null != info.annNext && en.addAfterInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annNext.els(),info.annNext.value())))) {
      continue;
    }
 else     if (null != info.annId && info.annId.auto()) {
      if (expert != null && !expert.isSupportAutoIncrement()) {
        throw new DaoException("String_Node_Str");
      }
      en.addAfterInsertMacro(expert.fetchPojoId(en,en.getField(info.name)));
    }
  }
}

Fixed version (ground truth):
private void _evalFieldMacro(Entity<?> en,List<MappingInfo> infos){
  for (  MappingInfo info : infos) {
    if (null != info.annPrev) {
      en.addBeforeInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annPrev.els(),info.annPrev.value())));
    }
    if (null != info.annNext && en.addAfterInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annNext.els(),info.annNext.value())))) {
      continue;
    }
 else     if (null != info.annId && info.annId.auto()) {
      if (expert != null && !expert.isSupportAutoIncrement()) {
        log.debug("String_Node_Str");
      }
      en.addAfterInsertMacro(expert.fetchPojoId(en,en.getField(info.name)));
    }
  }
}
Program: 43192
Project: 43192
Buggy source:
public void visit(Object obj,LinkField lnk){
  Object value=lnk.getValue(obj);
  if (value == null) {
    log.infof("String_Node_Str",lnk.getLinkType(),lnk.getEntity().getType().getSimpleName(),lnk.getHostField().getName());
    return;
  }
  final Pojo pojo=opt.maker().makeDelete(lnk.getLinkedEntity());
  pojo.setOperatingObject(value);
  pojo.append(Pojos.Items.cndAuto(lnk.getLinkedEntity(),null));
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      pojo.addParamsBy(ele);
    }
  }
);
  opt.add(pojo);
}

Fixed version (ground truth):
public void visit(Object obj,LinkField lnk){
  Object value=lnk.getValue(obj);
  if (value == null || Lang.length(value) == 0) {
    log.infof("String_Node_Str",lnk.getLinkType(),lnk.getEntity().getType().getSimpleName(),lnk.getHostField().getName());
    return;
  }
  final Pojo pojo=opt.maker().makeDelete(lnk.getLinkedEntity());
  pojo.setOperatingObject(value);
  pojo.append(Pojos.Items.cndAuto(lnk.getLinkedEntity(),null));
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      pojo.addParamsBy(ele);
    }
  }
);
  opt.add(pojo);
}
Program: 43193
Project: 43193
Buggy source:
/** 
 * 根据函数参数类型数组的最后一个类型（一定是数组，表示变参），为最后一个变参生成一个空数组
 * @param pts 函数参数类型列表
 * @return 变参空数组
 */
public static Object[] blankArrayArg(Class<?>[] pts){
  return (Object[])Array.newInstance(pts[pts.length - 1].getComponentType(),0);
}

Fixed version (ground truth):
/** 
 * 根据函数参数类型数组的最后一个类型（一定是数组，表示变参），为最后一个变参生成一个空数组
 * @param pts 函数参数类型列表
 * @return 变参空数组
 */
public static Object blankArrayArg(Class<?>[] pts){
  return Array.newInstance(pts[pts.length - 1].getComponentType(),0);
}
Program: 43194
Project: 43194
Buggy source:
@Test public void testEncode(){
  Response response1=Http.get("String_Node_Str");
  assertTrue("String_Node_Str".equals(response1.getEncodeType()));
  assertTrue(response1.getContent().indexOf("String_Node_Str") > 0);
  Response response2=Http.get("String_Node_Str");
  assertTrue(response2.getContent("String_Node_Str").indexOf("String_Node_Str") > 0);
}

Fixed version (ground truth):
@Test public void testEncode(){
  Response response1=Http.get("String_Node_Str");
  assertEquals("String_Node_Str",response1.getEncodeType());
  assertTrue(response1.getContent().indexOf("String_Node_Str") > 0);
  Response response2=Http.get("String_Node_Str");
  assertTrue(response2.getContent("String_Node_Str").indexOf("String_Node_Str") > 0);
}
Program: 43195
Project: 43195
Buggy source:
public static Throwable unwrapThrow(Throwable e){
  if (e == null)   return null;
  if (e instanceof InvocationTargetException) {
    InvocationTargetException itE=(InvocationTargetException)e;
    if (itE.getTargetException() != null)     return unwrapThrow(itE.getTargetException());
  }
  if (e.getCause() != null)   return unwrapThrow(e.getCause());
  return e;
}

Fixed version (ground truth):
public static Throwable unwrapThrow(Throwable e){
  if (e == null)   return null;
  if (e instanceof InvocationTargetException) {
    InvocationTargetException itE=(InvocationTargetException)e;
    if (itE.getTargetException() != null)     return unwrapThrow(itE.getTargetException());
  }
  if (e instanceof RuntimeException && e.getCause() != null && e.getMessage() == null)   return unwrapThrow(e.getCause());
  return e;
}
Program: 43196
Project: 43196
Buggy source:
public UrlMapping load(NutConfig config){
  if (log.isInfoEnabled()) {
    log.infof("String_Node_Str",Nutz.version());
    log.infof("String_Node_Str",config.getAppName());
  }
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
    log.debugf("String_Node_Str",Encoding.defaultEncoding());
    log.debugf("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
    log.debugf("String_Node_Str",System.getProperties().get("String_Node_Str"));
    log.debugf("String_Node_Str",System.getProperties().get("String_Node_Str"));
    log.debugf("String_Node_Str",System.getProperties().get("String_Node_Str"));
  }
  UrlMapping mapping;
  Stopwatch sw=Stopwatch.begin();
  try {
    Class<?> mainModule=config.getMainModule();
    createContext(config);
    createIoc(config,mainModule);
    mapping=evalUrlMapping(config,mainModule);
    evalLocalization(config,mainModule);
    createSessionProvider(config,mainModule);
    evalSetup(config,mainModule);
  }
 catch (  Exception e) {
    if (log.isErrorEnabled())     log.error("String_Node_Str",e);
    throw Lang.wrapThrow(e,LoadingException.class);
  }
  sw.stop();
  if (log.isInfoEnabled())   log.infof("String_Node_Str",config.getAppName(),sw.getDuration());
  return mapping;
}

Fixed version (ground truth):
public UrlMapping load(NutConfig config){
  if (log.isInfoEnabled()) {
    log.infof("String_Node_Str",Nutz.version());
    log.infof("String_Node_Str",config.getAppName());
  }
  if (log.isDebugEnabled()) {
    Properties sys=System.getProperties();
    log.debug("String_Node_Str");
    log.debugf("String_Node_Str",Encoding.defaultEncoding());
    log.debugf("String_Node_Str",new File("String_Node_Str").getAbsolutePath());
    log.debugf("String_Node_Str",sys.get("String_Node_Str"));
    log.debugf("String_Node_Str",sys.get("String_Node_Str"));
    log.debugf("String_Node_Str",sys.get("String_Node_Str"));
    log.debugf("String_Node_Str",sys.get("String_Node_Str"),sys.get("String_Node_Str"));
    log.debugf("String_Node_Str",config.getServletContext().getServerInfo());
  }
  UrlMapping mapping;
  Stopwatch sw=Stopwatch.begin();
  try {
    Class<?> mainModule=config.getMainModule();
    createContext(config);
    createIoc(config,mainModule);
    mapping=evalUrlMapping(config,mainModule);
    evalLocalization(config,mainModule);
    createSessionProvider(config,mainModule);
    evalSetup(config,mainModule);
  }
 catch (  Exception e) {
    if (log.isErrorEnabled())     log.error("String_Node_Str",e);
    throw Lang.wrapThrow(e,LoadingException.class);
  }
  sw.stop();
  if (log.isInfoEnabled())   log.infof("String_Node_Str",config.getAppName(),sw.getDuration());
  return mapping;
}
Program: 43197
Project: 43197
Buggy source:
@SuppressWarnings("String_Node_Str") public JsonActionChainMakerConfiguretion(String... jsonPaths){
  List<NutResource> list=Scans.me().loadResource("String_Node_Str",jsonPaths);
  try {
    File defaultChainsFile=Files.findFile("String_Node_Str");
    if (defaultChainsFile == null) {
      log.warn("String_Node_Str");
      throw new NutRuntimeException("String_Node_Str");
    }
    map.putAll(Json.fromJsonFile(Map.class,defaultChainsFile));
    for (    NutResource nr : list)     map.putAll(Json.fromJson(Map.class,nr.getReader()));
  }
 catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public JsonActionChainMakerConfiguretion(String... jsonPaths){
  List<NutResource> list=Scans.me().loadResource("String_Node_Str",jsonPaths);
  try {
    File defaultChainsFile=Files.findFile("String_Node_Str");
    if (defaultChainsFile != null && defaultChainsFile.exists())     map.putAll(Json.fromJsonFile(Map.class,defaultChainsFile));
 else {
      if (!Lang.isAndroid) {
        log.warn("String_Node_Str");
        throw new NutRuntimeException("String_Node_Str");
      }
      map.putAll(Json.fromJson(Map.class,new InputStreamReader(getClass().getClassLoader().getResourceAsStream("String_Node_Str"))));
    }
    for (    NutResource nr : list)     map.putAll(Json.fromJson(Map.class,nr.getReader()));
  }
 catch (  IOException e) {
    if (Lang.isAndroid) {
    }
    throw Lang.wrapThrow(e);
  }
}
Program: 43198
Project: 43198
Buggy source:
public void visit(Object obj,LinkField lnk){
  Object value=lnk.getValue(obj);
  final Pojo pojo=opt.maker().makeDelete(lnk.getLinkedEntity());
  pojo.setOperatingObject(value);
  pojo.append(Pojos.Items.cndAuto(lnk.getLinkedEntity(),null));
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      pojo.addParamsBy(ele);
    }
  }
);
  opt.add(pojo);
}

Fixed version (ground truth):
public void visit(Object obj,LinkField lnk){
  Object value=lnk.getValue(obj);
  if (value == null) {
    log.infof("String_Node_Str",lnk.getLinkType(),lnk.getEntity().getType().getSimpleName(),lnk.getHostField().getName());
    return;
  }
  final Pojo pojo=opt.maker().makeDelete(lnk.getLinkedEntity());
  pojo.setOperatingObject(value);
  pojo.append(Pojos.Items.cndAuto(lnk.getLinkedEntity(),null));
  Lang.each(value,new Each<Object>(){
    public void invoke(    int i,    Object ele,    int length) throws ExitLoop, LoopException {
      pojo.addParamsBy(ele);
    }
  }
);
  opt.add(pojo);
}
Program: 43199
Project: 43199
Buggy source:
public int joinParams(Entity<?> en,Object obj,Object[] params,int off){
  if (def == obj && null != obj) {
    params[off++]=def;
  }
 else {
    en=_en(en);
    if (null != obj && null != mf && mf.getEntity() == en && en.getType().isInstance(obj))     params[off++]=mf.getValue(obj);
 else     if (null != def)     params[off++]=def;
 else     if (null != obj)     params[off++]=Castors.me().castTo(obj,colType);
 else     throw Lang.impossible();
  }
  return off;
}

Fixed version (ground truth):
public int joinParams(Entity<?> en,Object obj,Object[] params,int off){
  if (def == obj && null != obj) {
    params[off++]=def;
  }
 else {
    en=_en(en);
    if (null != obj && null != mf && mf.getEntity() == en && en.getType().isInstance(obj))     params[off++]=mf.getValue(obj);
 else     if (null != def)     params[off++]=def;
 else     if (null != obj) {
      params[off++]=Castors.me().castTo(obj,colType);
    }
 else     throw Lang.impossible();
  }
  return off;
}
Program: 43200
Project: 43200
Buggy source:
/** 
 * 子类可以覆盖这个方法，给出自己特殊的后缀
 * @return 后缀
 */
protected String getExt(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * 子类可以覆盖这个方法，给出自己特殊的后缀,必须小写哦
 * @return 后缀
 */
protected String getExt(){
  return "String_Node_Str";
}
Program: 43201
Project: 43201
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  String args="String_Node_Str";
  if (path != null && path.contains("String_Node_Str")) {
    path=path.substring(0,path.indexOf('?'));
    args=path.substring(path.indexOf('?'));
  }
  String ext=getExt();
  if (Strings.isBlank(path)) {
    path=Mvcs.getRequestPath(req);
    path="String_Node_Str" + (path.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + Files.renameSuffix(path,ext);
  }
 else   if (path.charAt(0) == '/') {
    if (!path.toLowerCase().endsWith(ext))     path+=ext;
  }
 else {
    path="String_Node_Str" + path.replace('.','/') + ext;
  }
  path=path + args;
  RequestDispatcher rd=req.getRequestDispatcher(path);
  if (rd == null)   throw Lang.makeThrow("String_Node_Str",path);
  rd.forward(req,resp);
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Exception {
  String path=evalPath(req,obj);
  String args="String_Node_Str";
  if (path != null && path.contains("String_Node_Str")) {
    args=path.substring(path.indexOf('?'));
    path=path.substring(0,path.indexOf('?'));
  }
  String ext=getExt();
  if (Strings.isBlank(path)) {
    path=Mvcs.getRequestPath(req);
    path="String_Node_Str" + (path.startsWith("String_Node_Str") ? "String_Node_Str" : "String_Node_Str") + Files.renameSuffix(path,ext);
  }
 else   if (path.charAt(0) == '/') {
    if (!path.toLowerCase().endsWith(ext))     path+=ext;
  }
 else {
    path="String_Node_Str" + path.replace('.','/') + ext;
  }
  path=path + args;
  RequestDispatcher rd=req.getRequestDispatcher(path);
  if (rd == null)   throw Lang.makeThrow("String_Node_Str",path);
  rd.forward(req,resp);
}
Program: 43202
Project: 43202
Buggy source:
/** 
 * @return 当前类型是不是接口
 */
public boolean isInterface(){
  return null == klass ? null : klass.isInterface();
}

Fixed version (ground truth):
/** 
 * @return 当前类型是不是接口
 */
public boolean isInterface(){
  return klass.isInterface();
}
Program: 43203
Project: 43203
Buggy source:
public Object getReferObject(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    String str=Streams.readAndClose(Streams.utf8r(req.getInputStream()));
    return Json.fromJson(str);
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
}

Fixed version (ground truth):
public Object getReferObject(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,String[] pathArgs){
  try {
    return Json.fromJson(Streams.utf8r(req.getInputStream()));
  }
 catch (  Exception e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43204
Project: 43204
Buggy source:
@SuppressWarnings("String_Node_Str") public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null == name)   return Castors.me().castTo(refer,Lang.getTypeClass(type));
  Map<String,Object> map=(Map<String,Object>)refer;
  Object theObj=map.get(name);
  if (null == theObj)   return null;
  Class<?> clazz=Lang.getTypeClass(type);
  return Castors.me().castTo(theObj,clazz);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Object get(ServletContext sc,HttpServletRequest req,HttpServletResponse resp,Object refer){
  if (null == name)   return Mapl.maplistToObj(refer,type);
  Map<String,Object> map=(Map<String,Object>)refer;
  Object theObj=map.get(name);
  if (null == theObj)   return null;
  return Mapl.maplistToObj(map,type);
}
Program: 43205
Project: 43205
Buggy source:
@Test public void test_deleteWith_many(){
  dao.create(Ask.class,true);
  dao.create(AskReply.class,true);
  Ask ask=new Ask();
  ask.setTemptitle("String_Node_Str");
  ask.setTitle("String_Node_Str");
  List<AskReply> askReplies=new ArrayList<AskReply>();
  askReplies.add(new AskReply(ask.getAskId()));
  askReplies.add(new AskReply(ask.getAskId()));
  ask.setReplys(askReplies);
  dao.insertWith(ask,"String_Node_Str");
  dao.deleteWith(ask,"String_Node_Str");
  assertEquals(0,dao.count(AskReply.class));
}

Fixed version (ground truth):
@Test public void test_deleteWith_many(){
  dao.create(Ask.class,true);
  dao.create(AskReply.class,true);
  Ask ask=new Ask();
  ask.setTemptitle("String_Node_Str");
  ask.setTitle("String_Node_Str");
  List<AskReply> askReplies=new ArrayList<AskReply>();
  askReplies.add(new AskReply(ask.getAskId()));
  askReplies.add(new AskReply(ask.getAskId()));
  ask.setReplys(askReplies);
  dao.insertWith(ask,"String_Node_Str");
  ask.setReplys(null);
  dao.deleteWith(ask,"String_Node_Str");
  assertEquals(2,dao.count(AskReply.class));
  ask=dao.fetchLinks(ask,null);
  dao.deleteWith(ask,"String_Node_Str");
  assertEquals(0,dao.count(AskReply.class));
}
Program: 43206
Project: 43206
Buggy source:
@At({"String_Node_Str","String_Node_Str"}) @Fail("String_Node_Str") public void errParam(@Param("String_Node_Str") long id,AdaptorErrorContext errCtx){
  TestCase.assertNotNull(errCtx);
  TestCase.assertNotNull(errCtx.getErrors()[0]);
}

Fixed version (ground truth):
@At({"String_Node_Str","String_Node_Str"}) public void errParam(@Param("String_Node_Str") long id,AdaptorErrorContext errCtx){
  TestCase.assertNotNull(errCtx);
  TestCase.assertNotNull(errCtx.getErrors()[0]);
}
Program: 43207
Project: 43207
Buggy source:
public ActionInvoker get(ActionContext ac){
  String path=Mvcs.getRequestPath(ac.getRequest());
  ActionInvoker invoker=root.get(ac,path);
  if (invoker != null) {
    ActionChain chain=invoker.getActionChain(ac);
    if (chain != null) {
      if (log.isDebugEnabled()) {
        log.debugf("String_Node_Str",path,chain);
      }
      return invoker;
    }
  }
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",path);
  return null;
}

Fixed version (ground truth):
public ActionInvoker get(ActionContext ac){
  String path=Mvcs.getRequestPath(ac.getRequest());
  ActionInvoker invoker=root.get(ac,path);
  if (invoker != null) {
    ActionChain chain=invoker.getActionChain(ac);
    if (chain != null) {
      if (log.isDebugEnabled()) {
        log.debugf("String_Node_Str",ac.getRequest().getMethod(),path,chain);
      }
      return invoker;
    }
  }
  if (log.isDebugEnabled())   log.debugf("String_Node_Str",path);
  return null;
}
Program: 43208
Project: 43208
Buggy source:
public void process(ActionContext ac) throws Throwable {
  RequestIocContext reqContext=null;
  try {
    if (null != moduleObj) {
      ac.setModule(moduleObj);
    }
 else {
      Ioc ioc=ac.getIoc();
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",injectName,injectName);
      Object obj;
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(ac.getRequest());
        SessionIocContext sessionContext=new SessionIocContext(Mvcs.getHttpSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        Mvcs.setIocContext(myContext);
        obj=((Ioc2)ioc).get(moduleType,injectName,myContext);
      }
 else       obj=ioc.get(moduleType,injectName);
      ac.setModule(obj);
    }
    ac.setMethod(method);
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",ac.getPath(),method);
    doNext(ac);
  }
  finally {
    if (reqContext != null)     try {
      reqContext.depose();
    }
 catch (    Throwable e) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
public void process(ActionContext ac) throws Throwable {
  RequestIocContext reqContext=null;
  try {
    if (null != moduleObj) {
      ac.setModule(moduleObj);
    }
 else {
      Ioc ioc=ac.getIoc();
      if (null == ioc)       throw Lang.makeThrow("String_Node_Str",injectName,injectName);
      Object obj;
      if (ioc instanceof Ioc2) {
        reqContext=new RequestIocContext(ac.getRequest());
        SessionIocContext sessionContext=new SessionIocContext(Mvcs.getHttpSession());
        IocContext myContext=new ComboContext(reqContext,sessionContext);
        Mvcs.setIocContext(myContext);
        obj=((Ioc2)ioc).get(moduleType,injectName,myContext);
      }
 else       obj=ioc.get(moduleType,injectName);
      ac.setModule(obj);
    }
    ac.setMethod(method);
    doNext(ac);
  }
  finally {
    if (reqContext != null)     try {
      reqContext.depose();
    }
 catch (    Throwable e) {
      if (log.isDebugEnabled())       log.debug("String_Node_Str",e);
    }
  }
}
Program: 43210
Project: 43210
Buggy source:
public Method getCallingMethod(){
  return callingMethod;
}

Fixed version (ground truth):
/** 
 * 正在被调用的Method
 */
public Method getCallingMethod(){
  return callingMethod;
}
Program: 43211
Project: 43211
Buggy source:
public Object[] getArgs(){
  return args;
}

Fixed version (ground truth):
/** 
 * 方法调用的参数数组,如果你要改变参数,那么必须保证参数类型与方法参数兼容.
 */
public Object[] getArgs(){
  return args;
}
Program: 43212
Project: 43212
Buggy source:
public FilterConvertImpl(List<String> paths){
  this.paths=paths;
}

Fixed version (ground truth):
public FilterConvertImpl(List<String> paths){
  this.items=paths;
}
Program: 43213
Project: 43213
Buggy source:
protected void DLR(String path,Object item){
  if (clude) {
    if (paths.contains(path)) {
      build.put(path,item,arrayIndex);
    }
  }
}

Fixed version (ground truth):
protected void DLR(String path,Object item){
  if (clude) {
    if (items.contains(path)) {
      build.put(path,item,arrayIndex);
    }
  }
}
Program: 43214
Project: 43214
Buggy source:
protected void LRD(String path,Object item){
  if (clude) {
    return;
  }
  for (  String p : paths) {
    if (!p.startsWith(path) && !path.startsWith(p)) {
      build.put(path,item,arrayIndex);
    }
  }
}

Fixed version (ground truth):
protected void LRD(String path,Object item){
  if (clude) {
    return;
  }
  int isFilter=0;
  for (  String p : items) {
    System.out.println(p + "String_Node_Str" + path);
    if (!(p.equals(path) || path.startsWith((p + "String_Node_Str")) || p.startsWith(path + "String_Node_Str")|| path.startsWith((p + "String_Node_Str"))|| p.startsWith(path + "String_Node_Str"))) {
      isFilter++;
    }
  }
  if (isFilter == items.size()) {
    build.put(path,item,arrayIndex);
  }
}
Program: 43215
Project: 43215
Buggy source:
private void _runPreparedStatement(Connection conn,DaoStatement st,Object[][] paramMatrix) throws SQLException {
  ValueAdaptor[] adaptors=st.getAdaptors();
  if (adaptors.length != paramMatrix[0].length)   throw Lang.makeThrow("String_Node_Str");
  boolean statIsClosed=false;
  String sql=st.toPreparedStatement();
  PreparedStatement pstat=null;
  if (log.isDebugEnabled())   log.debug(st);
  try {
    pstat=conn.prepareStatement(sql);
    if (paramMatrix.length == 1) {
      for (int i=0; i < paramMatrix[0].length; i++) {
        adaptors[i].set(pstat,paramMatrix[0][i],i + 1);
      }
      pstat.execute();
      st.getContext().setUpdateCount(pstat.getUpdateCount());
      pstat.close();
      statIsClosed=true;
    }
 else {
      for (      Object[] params : paramMatrix) {
        for (int i=0; i < params.length; i++) {
          adaptors[i].set(pstat,params[i],i + 1);
        }
        pstat.addBatch();
      }
      int[] counts=pstat.executeBatch();
      pstat.close();
      statIsClosed=true;
      int sum=0;
      for (      int i : counts)       sum+=i;
      st.getContext().setUpdateCount(sum);
    }
  }
  finally {
    if (!statIsClosed)     Daos.safeClose(pstat);
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str");
}

Fixed version (ground truth):
private void _runPreparedStatement(Connection conn,DaoStatement st,Object[][] paramMatrix) throws SQLException {
  ValueAdaptor[] adaptors=st.getAdaptors();
  if (adaptors.length != paramMatrix[0].length)   throw Lang.makeThrow("String_Node_Str");
  boolean statIsClosed=false;
  String sql=st.toPreparedStatement();
  PreparedStatement pstat=null;
  if (log.isDebugEnabled())   log.debug(st);
  try {
    pstat=conn.prepareStatement(sql);
    if (paramMatrix.length == 1) {
      for (int i=0; i < paramMatrix[0].length; i++) {
        adaptors[i].set(pstat,paramMatrix[0][i],i + 1);
      }
      pstat.execute();
      st.getContext().setUpdateCount(pstat.getUpdateCount());
      pstat.close();
      statIsClosed=true;
    }
 else {
      for (      Object[] params : paramMatrix) {
        for (int i=0; i < params.length; i++) {
          adaptors[i].set(pstat,params[i],i + 1);
        }
        pstat.addBatch();
      }
      int[] counts=pstat.executeBatch();
      int sum=0;
      for (      int i : counts)       if (i > 0)       sum+=i;
      if (sum == 0)       sum=pstat.getUpdateCount();
      pstat.close();
      statIsClosed=true;
      st.getContext().setUpdateCount(sum);
    }
  }
  finally {
    if (!statIsClosed)     Daos.safeClose(pstat);
  }
  if (log.isTraceEnabled())   log.trace("String_Node_Str");
}
Program: 43216
Project: 43216
Buggy source:
private void _checkupEntityFieldsWithDatabase(NutEntity<?> en){
  Connection conn=null;
  try {
    conn=Trans.getConnectionAuto(datasource);
    expert.setupEntityField(conn,en);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getType().getName(),en.getTableName(),e.getClass().getName(),e.getMessage());
  }
 finally {
    if (null != conn) {
      try {
        conn.close();
      }
 catch (      SQLException e) {
        if (log.isWarnEnabled())         log.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
private void _checkupEntityFieldsWithDatabase(NutEntity<?> en){
  Connection conn=null;
  try {
    conn=Trans.getConnectionAuto(datasource);
    expert.setupEntityField(conn,en);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getType().getName(),en.getTableName(),e.getClass().getName(),e.getMessage());
  }
 finally {
    Trans.closeConnectionAuto(conn);
  }
}
Program: 43217
Project: 43217
Buggy source:
/** 
 * 如果在事务中,则返回事务的连接,否则直接从数据源取一个新的连接
 * @param ds
 * @return
 * @throws SQLException
 */
public static Connection getConnectionAuto(DataSource ds) throws SQLException {
  if (get() == null)   return ds.getConnection();
 else   return get().getConnection(ds);
}

Fixed version (ground truth):
/** 
 * 如果在事务中,则返回事务的连接,否则直接从数据源取一个新的连接
 */
public static Connection getConnectionAuto(DataSource ds) throws SQLException {
  if (get() == null)   return ds.getConnection();
 else   return get().getConnection(ds);
}
Program: 43218
Project: 43218
Buggy source:
/** 
 * 取得变得的值
 */
public Object fetchVar(){
  if (left instanceof AccessOpt) {
    return ((AccessOpt)left).fetchVar();
  }
  if (left instanceof Operator) {
    return ((Operator)left).calculate();
  }
  if (left instanceof Elobj) {
    Object obj=((Elobj)left).fetchVal();
    if (right instanceof FieldObj) {
      try {
        return Mirror.me(obj).getField(((Elobj)right).getVal());
      }
 catch (      NoSuchFieldException e) {
        throw Lang.wrapThrow(e);
      }
    }
    return obj;
  }
  return left;
}

Fixed version (ground truth):
/** 
 * 取得变得的值
 */
public Object fetchVar(){
  if (left instanceof AccessOpt) {
    return ((AccessOpt)left).fetchVar();
  }
  if (left instanceof Operator) {
    return ((Operator)left).calculate();
  }
  if (left instanceof Elobj) {
    Object obj=((Elobj)left).fetchVal();
    if (right instanceof FieldObj) {
      return Mirror.me(obj).getValue(obj,((Elobj)right).getVal());
    }
    return obj;
  }
  return left;
}
Program: 43219
Project: 43219
Buggy source:
@Test public void testIssue303(){
  Context context=Lang.context();
  Issue303 item=new Issue303("String_Node_Str");
  item.child=new Issue303("String_Node_Str");
  context.set("String_Node_Str",item);
  assertEquals("String_Node_Str",El.eval(context,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testIssue303(){
  Context context=Lang.context();
  Issue303 item=new Issue303("String_Node_Str");
  item.child=new Issue303("String_Node_Str");
  context.set("String_Node_Str",item);
  assertEquals("String_Node_Str",El.eval(context,"String_Node_Str"));
  assertEquals(0,El.eval(context,"String_Node_Str"));
}
Program: 43220
Project: 43220
Buggy source:
public Object run(List<Object> param){
  Object obj=fetchVar();
  Mirror<?> me=null;
  me=Mirror.me(obj);
  if (param.isEmpty()) {
    return me.invoke(obj,right.toString());
  }
  return me.invoke(obj,right.toString(),param.toArray());
}

Fixed version (ground truth):
public Object run(List<Object> param){
  Object obj=fetchVar();
  Mirror<?> me=null;
  if (obj == null)   throw new NullPointerException();
  if (obj instanceof Class) {
    me=Mirror.me(obj);
    try {
      return me.invoke(obj,right.toString(),param.toArray());
    }
 catch (    InvokingException e) {
      throw e;
    }
catch (    Throwable e) {
      if (Lang.unwrapThrow(e) instanceof NoSuchMethodException) {
        me=Mirror.me(obj.getClass().getClass());
        return me.invoke(obj,right.toString(),param.toArray());
      }
      throw Lang.wrapThrow(e);
    }
  }
 else {
    me=Mirror.me(obj);
    return me.invoke(obj,right.toString(),param.toArray());
  }
}
Program: 43221
Project: 43221
Buggy source:
@Test public void testIssue308(){
  Context context=Lang.context();
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  context.set("String_Node_Str",list);
  context.set("String_Node_Str",System.class);
}

Fixed version (ground truth):
@Test public void testIssue308(){
  Context context=Lang.context();
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  context.set("String_Node_Str",list);
  context.set("String_Node_Str",System.class);
  El.eval(context,"String_Node_Str");
}
Program: 43223
Project: 43223
Buggy source:
public FileResource(String base,File file){
  base=Disks.normalize(Disks.getCanonicalPath(base));
  if (!base.endsWith("String_Node_Str"))   base+="String_Node_Str";
  this.name=Disks.normalize(Disks.getCanonicalPath(file.getAbsolutePath()));
  this.name=this.name.substring(this.name.indexOf(base) + base.length()).replace('\\','/');
  this.file=file;
}

Fixed version (ground truth):
public FileResource(String base,File file){
  base=Disks.normalize(Disks.getCanonicalPath(base));
  if (base == null)   base="String_Node_Str";
 else   if (!base.endsWith("String_Node_Str"))   base+="String_Node_Str";
  this.name=Disks.normalize(Disks.getCanonicalPath(file.getAbsolutePath()));
  this.name=this.name.substring(this.name.indexOf(base) + base.length()).replace('\\','/');
  this.file=file;
}
Program: 43224
Project: 43224
Buggy source:
public IdentifierObj(String val){
  this.val=val;
}

Fixed version (ground truth):
public IdentifierObj(String val){
  super(val);
}
Program: 43225
Project: 43225
Buggy source:
/** 
 * 取得变得的值
 */
public Object fetchVar(){
  if (left instanceof AccessOpt) {
    return ((AccessOpt)left).fetchVar();
  }
  if (left instanceof Operator) {
    return ((Operator)left).calculate();
  }
  if (left instanceof Elobj) {
    return ((Elobj)left).fetchVal();
  }
  return left;
}

Fixed version (ground truth):
/** 
 * 取得变得的值
 */
public Object fetchVar(){
  if (left instanceof AccessOpt) {
    return ((AccessOpt)left).fetchVar();
  }
  if (left instanceof Operator) {
    return ((Operator)left).calculate();
  }
  if (left instanceof Elobj) {
    Object obj=((Elobj)left).fetchVal();
    if (right instanceof FieldObj) {
      try {
        return Mirror.me(obj).getField(((Elobj)right).getVal());
      }
 catch (      NoSuchFieldException e) {
        throw Lang.wrapThrow(e);
      }
    }
    return obj;
  }
  return left;
}
Program: 43226
Project: 43226
Buggy source:
private void _evalFieldMacro(Entity<?> en,List<MappingInfo> infos){
  for (  MappingInfo info : infos) {
    if (null != info.annPrev) {
      en.addBeforeInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annPrev.els(),info.annPrev.value())));
    }
    if (null != info.annNext && en.addAfterInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annNext.els(),info.annNext.value())))) {
      continue;
    }
 else     if (null != info.annId && info.annId.auto()) {
      MappingField idField=en.getField(info.name);
      String autoSql="String_Node_Str";
      Pojo autoInfo=new SqlFieldMacro(idField,autoSql);
      autoInfo.setEntity(en);
      en.addAfterInsertMacro(autoInfo);
    }
  }
}

Fixed version (ground truth):
private void _evalFieldMacro(Entity<?> en,List<MappingInfo> infos){
  for (  MappingInfo info : infos) {
    if (null != info.annPrev) {
      en.addBeforeInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annPrev.els(),info.annPrev.value())));
    }
    if (null != info.annNext && en.addAfterInsertMacro(__macro(en.getField(info.name),_annToFieldMacroInfo(info.annNext.els(),info.annNext.value())))) {
      continue;
    }
 else     if (null != info.annId && info.annId.auto()) {
      en.addAfterInsertMacro(expert.fetchPojoId(en,en.getField(info.name)));
    }
  }
}
Program: 43227
Project: 43227
Buggy source:
@Override public String getDatabaseType(){
  return DB.H2.name();
}

Fixed version (ground truth):
public String getDatabaseType(){
  return DB.H2.name();
}
Program: 43228
Project: 43228
Buggy source:
public Object run(List<Object> param){
  Object obj=fetchVar();
  Mirror<?> me=null;
  if (obj instanceof Class) {
    me=Mirror.me((Class<?>)obj);
  }
 else {
    me=Mirror.me(obj);
  }
  if (param.isEmpty()) {
    return me.invoke(obj,right.toString());
  }
  return me.invoke(obj,right.toString(),param.toArray());
}

Fixed version (ground truth):
public Object run(List<Object> param){
  Object obj=fetchVar();
  Mirror<?> me=null;
  me=Mirror.me(obj);
  if (param.isEmpty()) {
    return me.invoke(obj,right.toString());
  }
  return me.invoke(obj,right.toString(),param.toArray());
}
Program: 43229
Project: 43229
Buggy source:
/** 
 * 转换数据,主要是转换负号,方法执行
 */
private Object parseItem(Object item){
  if (paramSize == 0) {
    if (!(item instanceof Operator)) {
      paramSize=1;
    }
  }
 else {
    if (item instanceof CommaOpt) {
      paramSize++;
    }
  }
  if (item instanceof LBracketOpt) {
    if (prev instanceof Elobj) {
      prem=new MethodOpt();
      item=new Object[]{prem,new LBracketOpt()};
      paramSize=0;
      bracket.addFirst(BracketType.Method);
    }
 else {
      bracket.addFirst(BracketType.Default);
    }
  }
  if (item instanceof RBracketOpt) {
switch (bracket.poll()) {
case Method:
      prem.setSize(paramSize);
    paramSize=-1;
  item=new Object[]{new RBracketOpt(),new InvokeMethodOpt()};
prem=null;
break;
default :
break;
}
}
if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
item=new NegativeOpt();
}
prev=item;
return item;
}

Fixed version (ground truth):
/** 
 * 转换数据,主要是转换负号,方法执行
 */
private Object parseItem(Object item){
  if (methods.peek() != null) {
    MethodOpt opt=methods.peek();
    if (opt.getSize() <= 0) {
      if (!(item instanceof CommaOpt) && !(item instanceof RBracketOpt)) {
        opt.setSize(1);
      }
    }
 else {
      if (item instanceof CommaOpt) {
        opt.setSize(opt.getSize() + 1);
      }
    }
  }
  if (item instanceof LBracketOpt) {
    if (prev instanceof Elobj) {
      MethodOpt prem=new MethodOpt();
      item=new Object[]{prem,new LBracketOpt()};
      methods.addFirst(prem);
    }
 else {
      methods.addFirst(null);
    }
  }
  if (item instanceof RBracketOpt) {
    if (methods.poll() != null) {
      item=new Object[]{new RBracketOpt(),new InvokeMethodOpt()};
    }
  }
  if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
    item=new NegativeOpt();
  }
  prev=item;
  return item;
}
Program: 43230
Project: 43230
Buggy source:
private void _checkupEntityFieldsWithDatabase(NutEntity<?> en){
  Connection conn=null;
  try {
    conn=datasource.getConnection();
    expert.setupEntityField(conn,en);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getType().getName(),en.getTableName(),e.getClass().getName(),e.getMessage());
  }
 finally {
    if (null != conn) {
      try {
        conn.close();
      }
 catch (      SQLException e) {
        if (log.isWarnEnabled())         log.warn("String_Node_Str",e);
      }
    }
  }
}

Fixed version (ground truth):
private void _checkupEntityFieldsWithDatabase(NutEntity<?> en){
  Connection conn=null;
  try {
    conn=Trans.getConnectionAuto(datasource);
    expert.setupEntityField(conn,en);
  }
 catch (  Exception e) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",en.getType().getName(),en.getTableName(),e.getClass().getName(),e.getMessage());
  }
 finally {
    if (null != conn) {
      try {
        conn.close();
      }
 catch (      SQLException e) {
        if (log.isWarnEnabled())         log.warn("String_Node_Str",e);
      }
    }
  }
}
Program: 43231
Project: 43231
Buggy source:
public void wrap(Queue<Object> rpn){
  if (rpn.peek() instanceof AccessOpt) {
    left=rpn.poll();
    return;
  }
  if (getSize() <= 0) {
    left=rpn.poll();
  }
 else {
    right=rpn.poll();
    left=rpn.poll();
  }
}

Fixed version (ground truth):
public void wrap(Queue<Object> rpn){
  if (getSize() <= 0) {
    left=rpn.poll();
  }
 else {
    right=rpn.poll();
    left=rpn.poll();
  }
}
Program: 43232
Project: 43232
Buggy source:
/** 
 * 转换数据,主要是转换负号,方法执行
 */
private Object parseItem(Object item){
  paramSize++;
  if (item instanceof LBracketOpt) {
    if (prev instanceof Elobj) {
      prem=new MethodOpt();
      item=new Object[]{prem,new LBracketOpt()};
      paramSize=0;
      bracket.addFirst(BracketType.Method);
    }
 else {
      bracket.addFirst(BracketType.Default);
    }
  }
  if (item instanceof RBracketOpt) {
switch (bracket.poll()) {
case Method:
      prem.setSize(paramSize - 1);
    item=new Object[]{new RBracketOpt(),new InvokeMethodOpt()};
  prem=null;
break;
default :
break;
}
}
if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
item=new NegativeOpt();
}
prev=item;
return item;
}

Fixed version (ground truth):
/** 
 * 转换数据,主要是转换负号,方法执行
 */
private Object parseItem(Object item){
  if (paramSize == 0) {
    if (!(item instanceof Operator)) {
      paramSize=1;
    }
  }
 else {
    if (item instanceof CommaOpt) {
      paramSize++;
    }
  }
  if (item instanceof LBracketOpt) {
    if (prev instanceof Elobj) {
      prem=new MethodOpt();
      item=new Object[]{prem,new LBracketOpt()};
      paramSize=0;
      bracket.addFirst(BracketType.Method);
    }
 else {
      bracket.addFirst(BracketType.Default);
    }
  }
  if (item instanceof RBracketOpt) {
switch (bracket.poll()) {
case Method:
      prem.setSize(paramSize);
    paramSize=-1;
  item=new Object[]{new RBracketOpt(),new InvokeMethodOpt()};
prem=null;
break;
default :
break;
}
}
if (item instanceof SubOpt && NegativeOpt.isNegetive(prev)) {
item=new NegativeOpt();
}
prev=item;
return item;
}
Program: 43233
Project: 43233
Buggy source:
/** 
 * 根据 Java 字段创建一个实体字段信息对象
 * @param pk 复合主键
 * @param field Java 字段
 * @return 字段信息对象
 */
public static MappingInfo createMappingInfo(PK pk,Field field){
  MappingInfo info=create(MappingInfo.class,field);
  info.annPK=pk;
  info.annColumn=field.getAnnotation(Column.class);
  info.annDefine=field.getAnnotation(ColDefine.class);
  info.annDefault=field.getAnnotation(Default.class);
  info.annId=field.getAnnotation(Id.class);
  info.annName=field.getAnnotation(Name.class);
  info.annNext=field.getAnnotation(Next.class);
  info.annPrev=field.getAnnotation(Prev.class);
  info.annReadonly=field.getAnnotation(Readonly.class);
  info.columnComment=field.getAnnotation(Comment.class);
  return info;
}

Fixed version (ground truth):
/** 
 * 根据 Java 字段创建一个实体字段信息对象
 * @param pk 复合主键
 * @param field Java 字段
 * @return 字段信息对象
 */
public static MappingInfo createMappingInfo(PK pk,Field field){
  MappingInfo info=create(MappingInfo.class,field);
  info.annPK=pk;
  info.annColumn=field.getAnnotation(Column.class);
  info.annDefine=field.getAnnotation(ColDefine.class);
  info.annDefault=field.getAnnotation(Default.class);
  info.annId=field.getAnnotation(Id.class);
  info.annName=field.getAnnotation(Name.class);
  info.annNext=field.getAnnotation(Next.class);
  info.annPrev=field.getAnnotation(Prev.class);
  info.annReadonly=field.getAnnotation(Readonly.class);
  info.columnComment=field.getAnnotation(Comment.class);
  if (info.annId != null) {
    if (!Mirror.me(field.getType()).isIntLike())     throw Lang.makeThrow(DaoException.class,"String_Node_Str",field);
  }
  if (info.annName != null)   if (!Mirror.me(field.getType()).isStringLike())   throw Lang.makeThrow(DaoException.class,"String_Node_Str",field);
  return info;
}
Program: 43234
Project: 43234
Buggy source:
public Object get(ResultSet rs,String colName) throws SQLException {
  File f=this.createTempFile();
  Clob clob=rs.getClob(colName);
  if (clob == null)   return null;
  Files.write(f,clob.getAsciiStream());
  return new SimpleClob(f);
}

Fixed version (ground truth):
public Object get(ResultSet rs,String colName) throws SQLException {
  File f=this.createTempFile();
  Clob clob=rs.getClob(colName);
  if (clob == null)   return null;
  Files.write(f,clob.getCharacterStream());
  return new SimpleClob(f);
}
Program: 43235
Project: 43235
Buggy source:
public void truncate(long len) throws SQLException {
  Files.write(file,new Byte[]{});
}

Fixed version (ground truth):
public void truncate(long len) throws SQLException {
  try {
    new RandomAccessFile(file,"String_Node_Str").setLength(len);
  }
 catch (  FileNotFoundException e) {
    throw Lang.wrapThrow(e);
  }
catch (  IOException e) {
    throw Lang.wrapThrow(e);
  }
}
Program: 43236
Project: 43236
Buggy source:
public Object get(ResultSet rs,String colName) throws SQLException {
  File f=this.createTempFile();
  Clob clob=rs.getClob(colName);
  if (clob == null)   return null;
  Files.write(f,clob.getAsciiStream());
  return new SimpleClob(f);
}

Fixed version (ground truth):
public Object get(ResultSet rs,String colName) throws SQLException {
  File f=this.createTempFile();
  Clob clob=rs.getClob(colName);
  if (clob == null)   return null;
  Files.write(f,clob.getCharacterStream());
  return new SimpleClob(f);
}
Program: 43237
Project: 43237
Buggy source:
@Override public boolean dropEntity(Dao dao,Entity<?> en){
  if (super.dropEntity(dao,en)) {
    if (en.getPks().isEmpty())     return true;
    List<Sql> sqls=new ArrayList<Sql>();
    for (    MappingField pk : en.getPks()) {
      String sql=gSQL(DSEQ,en.getTableName(),pk.getColumnName());
      sqls.add(Sqls.create(sql));
    }
    try {
      dao.execute(sqls.toArray(new Sql[sqls.size()]));
      return true;
    }
 catch (    Exception e) {
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean dropEntity(Dao dao,Entity<?> en){
  if (super.dropEntity(dao,en)) {
    if (en.getPks().isEmpty())     return true;
    List<Sql> sqls=new ArrayList<Sql>();
    for (    MappingField pk : en.getPks()) {
      if (pk.isAutoIncreasement()) {
        String sql=gSQL(DSEQ,en.getTableName(),pk.getColumnName());
        sqls.add(Sqls.create(sql));
      }
    }
    try {
      dao.execute(sqls.toArray(new Sql[sqls.size()]));
      return true;
    }
 catch (    Exception e) {
    }
  }
  return false;
}
Program: 43238
Project: 43238
Buggy source:
private void evalLocalization(NutConfig config,Class<?> mainModule){
  Localization lc=mainModule.getAnnotation(Localization.class);
  if (null != lc) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",lc.value());
    Map<String,Map<String,Object>> msgss=Mirror.me(lc.type()).born().load(lc.value());
    Mvcs.setMessageSet(msgss);
  }
 else   if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
}

Fixed version (ground truth):
private void evalLocalization(NutConfig config,Class<?> mainModule){
  Localization lc=mainModule.getAnnotation(Localization.class);
  if (null != lc) {
    if (log.isDebugEnabled())     log.debugf("String_Node_Str",lc.value());
    MessageLoader msgLoader=null;
    if (!Strings.isBlank(lc.beanName())) {
      msgLoader=config.getIoc().get(lc.type(),lc.beanName());
    }
 else {
      msgLoader=Mirror.me(lc.type()).born();
    }
    Map<String,Map<String,Object>> msgss=msgLoader.load(lc.value());
    Mvcs.setMessageSet(msgss);
  }
 else   if (log.isDebugEnabled()) {
    log.debug("String_Node_Str");
  }
}
Program: 43239
Project: 43239
Buggy source:
private ViewMaker[] createViewMakers(Class<?> mainModule) throws Exception {
  Views vms=mainModule.getAnnotation(Views.class);
  ViewMaker[] makers;
  int i=0;
  if (null != vms) {
    makers=new ViewMaker[vms.value().length + 1];
    for (; i < vms.value().length; i++)     makers[i]=Mirror.me(vms.value()[i]).born();
  }
 else {
    makers=new ViewMaker[1];
  }
  makers[i]=new DefaultViewMaker();
  if (log.isDebugEnabled()) {
    StringBuilder sb=new StringBuilder();
    sb.append(makers[0].getClass().getSimpleName());
    for (i=1; i < makers.length; i++)     sb.append(',').append(makers[i].getClass().getSimpleName());
    log.debugf("String_Node_Str",sb);
  }
  return makers;
}

Fixed version (ground truth):
private ViewMaker[] createViewMakers(Class<?> mainModule) throws Exception {
  Views vms=mainModule.getAnnotation(Views.class);
  ViewMaker[] makers;
  int i=0;
  if (null != vms) {
    makers=new ViewMaker[vms.value().length + 1];
    for (; i < vms.value().length; i++)     makers[i]=Mirror.me(vms.value()[i]).born();
  }
 else {
    makers=new ViewMaker[1];
  }
  makers[i]=new DefaultViewMaker();
  if (log.isDebugEnabled()) {
    StringBuilder sb=new StringBuilder();
    sb.append(makers[0].getClass().getSimpleName());
    for (i=0; i < makers.length - 1; i++)     sb.append(',').append(makers[i].getClass().getSimpleName());
    log.debugf("String_Node_Str",sb);
  }
  return makers;
}