nus-yam/ex-repair huggingface dataset:
Program: 92394
Project: 92394
Buggy source:
/** 
 * Fully merges pluginContainers with their plugins, their executions and their configuration 
 * @param targetPlugin
 * @param sourcePlugin
 * @param context
 */
private void mergePluginContainers(PluginContainer targetContainer,PluginContainer sourceContainer,Map<Object,Object> context){
  List<Plugin> plugins=sourceContainer.getPlugins();
  for (  Plugin sourcePlugin : plugins) {
    Plugin targetPlugin=targetContainer.getPluginsAsMap().get(sourcePlugin.getKey());
    if (targetPlugin == null) {
      targetContainer.getPlugins().add(sourcePlugin);
    }
 else {
      for (      PluginExecution sourceExecution : sourcePlugin.getExecutions()) {
        PluginExecution targetPluginExecution=targetPlugin.getExecutionsAsMap().get(sourceExecution.getId());
        if (targetPluginExecution == null) {
          targetPlugin.addExecution(sourceExecution);
        }
 else {
          super.mergePluginExecution(targetPluginExecution,sourceExecution,false,context);
        }
      }
      if (targetPlugin.getConfiguration() == null) {
        targetPlugin.setConfiguration(sourcePlugin.getConfiguration());
      }
 else {
        super.mergePlugin(targetPlugin,sourcePlugin,false,context);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Fully merges pluginContainers with their plugins, their executions and their configuration 
 * @param targetPlugin
 * @param sourcePlugin
 * @param context
 */
private void mergePluginContainers(PluginContainer targetContainer,PluginContainer sourceContainer,Map<Object,Object> context,boolean addTargetPlugin){
  List<Plugin> plugins=sourceContainer.getPlugins();
  for (  Plugin sourcePlugin : plugins) {
    Plugin targetPlugin=targetContainer.getPluginsAsMap().get(sourcePlugin.getKey());
    if (targetPlugin == null) {
      if (addTargetPlugin) {
        targetContainer.getPlugins().add(sourcePlugin);
      }
    }
 else {
      for (      PluginExecution sourceExecution : sourcePlugin.getExecutions()) {
        PluginExecution targetPluginExecution=targetPlugin.getExecutionsAsMap().get(sourceExecution.getId());
        if (targetPluginExecution == null) {
          targetPlugin.addExecution(sourceExecution);
        }
 else {
          super.mergePluginExecution(targetPluginExecution,sourceExecution,false,context);
        }
      }
      if (targetPlugin.getConfiguration() == null) {
        targetPlugin.setConfiguration(sourcePlugin.getConfiguration());
      }
 else {
        super.mergePlugin(targetPlugin,sourcePlugin,false,context);
      }
    }
  }
}
Program: 92395
Project: 92395
Buggy source:
private DiscoverabilityView getView(Endpoint ep){
  DiscoverabilityView view=null;
  List<DiscoverabilityView> views=_db.getResults(ep,DiscoverabilityView.class,DiscoverabilityView.SCHEMA$);
  if (views.size() != 1) {
    Log.warn("String_Node_Str",views.size());
  }
  if (views.size() == 0) {
    view=new DiscoverabilityView();
    view.setEndpoint(ep);
    view.setSD(false);
    view.setVoID(false);
    view.setServerName("String_Node_Str");
    view.setLastUpdate(-1L);
    _db.insert(view);
  }
 else {
    view=views.get(0);
  }
  return view;
}

Fixed version (ground truth):
private DiscoverabilityView getView(Endpoint ep){
  DiscoverabilityView view=null;
  List<DiscoverabilityView> views=new ArrayList<DiscoverabilityView>();
  if (_db != null) {
    views=_db.getResults(ep,DiscoverabilityView.class,DiscoverabilityView.SCHEMA$);
  }
  if (views.size() != 1) {
    Log.warn("String_Node_Str",views.size());
  }
  if (views.size() == 0) {
    view=new DiscoverabilityView();
    view.setEndpoint(ep);
    view.setSD(false);
    view.setVoID(false);
    view.setServerName("String_Node_Str");
    view.setLastUpdate(-1L);
    if (_db != null)     _db.insert(view);
  }
 else {
    view=views.get(0);
  }
  return view;
}
Program: 92398
Project: 92398
Buggy source:
private Lang getLangFromType(String type){
  if (type.contains("String_Node_Str") || type.contains("String_Node_Str"))   return Lang.TTL;
  if (type.contains("String_Node_Str") || type.contains("String_Node_Str"))   return Lang.RDFXML;
  if (type.contains("String_Node_Str"))   return Lang.NTRIPLES;
  if (type.contains("String_Node_Str"))   return Lang.N3;
  return Lang.RDFXML;
}

Fixed version (ground truth):
private Lang getLangFromType(String type){
  if (type.contains("String_Node_Str") || type.contains("String_Node_Str"))   return Lang.TTL;
  if (type.contains("String_Node_Str") || type.contains("String_Node_Str"))   return Lang.RDFXML;
  if (type.contains("String_Node_Str"))   return Lang.RDFXML;
  if (type.contains("String_Node_Str"))   return Lang.N3;
  return Lang.RDFXML;
}
Program: 92399
Project: 92399
Buggy source:
private void test(Endpoint ep) throws Exception {
  Task<DResult> t=TaskFactory.create(CONSTANTS.DTASK,ep,m,null);
  DResult res=t.call();
  System.out.println(res);
  m.insert(res);
}

Fixed version (ground truth):
private void test(Endpoint ep) throws Exception {
  Task<DResult> t=TaskFactory.create(CONSTANTS.DTASK,ep,m,null);
  DResult res=t.call();
  System.out.println(res);
}
Program: 92400
Project: 92400
Buggy source:
@Before public void setUp() throws Exception {
  SPARQLESProperties.init(new File("String_Node_Str"));
  m=new MongoDBManager();
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  SPARQLESProperties.init(new File("String_Node_Str"));
}
Program: 92401
Project: 92401
Buggy source:
@After public void tearDown() throws Exception {
  m.close();
}

Fixed version (ground truth):
@After public void tearDown() throws Exception {
}
Program: 92402
Project: 92402
Buggy source:
private void reschedule(Task task,ScheduleIterator iter){
  Date time=iter.next();
  if (time.getTime() < System.currentTimeMillis()) {
    log.error("String_Node_Str");
    return;
  }
  if (task instanceof EndpointTask) {
    EndpointTask t=(EndpointTask)task;
    Endpoint ep=_dbm.getEndpoint(t.getEndpoint());
    if (ep == null) {
      log.warn("String_Node_Str",ep);
      return;
    }
    t.setEndpoint(ep);
  }
  schedule(task,iter);
  Object[] s={task,time,iter};
  log.info("String_Node_Str",s);
}

Fixed version (ground truth):
private void reschedule(Task task,ScheduleIterator iter){
  Date time=iter.next();
  if (time.getTime() < System.currentTimeMillis()) {
    log.error("String_Node_Str");
    return;
  }
  if (task instanceof EndpointTask) {
    EndpointTask t=(EndpointTask)task;
    Endpoint ep=_dbm.getEndpoint(t.getEndpoint());
    if (ep == null) {
      log.warn("String_Node_Str",ep);
      return;
    }
    t.setEndpoint(ep);
  }
  schedule(task,iter,time);
  Object[] s={task,time,iter};
  log.info("String_Node_Str",s);
}
Program: 92403
Project: 92403
Buggy source:
public void schedule(Task task,ScheduleIterator iter){
  Date time=iter.next();
  long startTime=time.getTime() - System.currentTimeMillis();
  SchedulerTimerTask t=new SchedulerTimerTask(task,iter);
  if (task instanceof ATask)   _monitor.submitA(ASERVICE.schedule(t,startTime,TimeUnit.MILLISECONDS));
 else   _monitor.submit(SERVICE.schedule(t,startTime,TimeUnit.MILLISECONDS));
  log.info("String_Node_Str",task,time);
  log.debug("String_Node_Str",task,time,iter);
}

Fixed version (ground truth):
public void schedule(Task task,ScheduleIterator iter,Date time){
  long startTime=time.getTime() - System.currentTimeMillis();
  SchedulerTimerTask t=new SchedulerTimerTask(task,iter);
  if (task instanceof ATask)   _monitor.submitA(ASERVICE.schedule(t,startTime,TimeUnit.MILLISECONDS));
 else   _monitor.submit(SERVICE.schedule(t,startTime,TimeUnit.MILLISECONDS));
  log.info("String_Node_Str",task,time,iter);
}
Program: 92404
Project: 92404
Buggy source:
@Override public void run(){
  try {
    while (!shutdown) {
synchronized (this) {
        wait(5000);
        connMgr.closeExpiredConnections();
        connMgr.closeIdleConnections(30,TimeUnit.SECONDS);
        Log.info("String_Node_Str");
      }
    }
  }
 catch (  InterruptedException ex) {
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    while (!shutdown) {
synchronized (this) {
        wait(60000);
        connMgr.closeExpiredConnections();
        connMgr.closeIdleConnections(30,TimeUnit.SECONDS);
      }
    }
  }
 catch (  InterruptedException ex) {
  }
}
Program: 92409
Project: 92409
Buggy source:
public int skipSPARQLResults(ResultSet results,String queryFile,Endpoint ep,Long start){
  int sols=0;
  while (results.hasNext()) {
    QuerySolution qs=results.nextSolution();
    toString(qs,sols == 0);
    sols++;
  }
  return sols;
}

Fixed version (ground truth):
public int skipSPARQLResults(ResultSet results,String queryFile,Endpoint ep,Long start){
  int sols=0;
  while (results.hasNext()) {
    QuerySolution qs=results.nextSolution();
    sols++;
  }
  return sols;
}
Program: 92410
Project: 92410
Buggy source:
/** 
 * Returns the default schedule element for the endpoints
 * @param ep
 * @return
 */
public static Schedule defaultSchedule(Endpoint ep){
  Schedule s=new Schedule();
  s.setEndpoint(ep);
  s.setATask(taskSchedule.get(ATASK));
  return s;
}

Fixed version (ground truth):
/** 
 * Returns the default schedule element for the endpoints
 * @param ep
 * @return
 */
public static Schedule defaultSchedule(Endpoint ep){
  Schedule s=new Schedule();
  s.setEndpoint(ep);
  s.setATask(taskSchedule.get(ATASK));
  s.setPTask(taskSchedule.get(PTASK));
  return s;
}
Program: 92411
Project: 92411
Buggy source:
@Override public Index call() throws Exception {
  log.info("String_Node_Str");
  Collection<Endpoint> datahub=DatahubAccess.checkEndpointList();
  if (datahub.size() == 0)   return null;
  Collection<Endpoint> db=_dbm.get(Endpoint.class,Endpoint.SCHEMA$);
  TreeSet<Endpoint> ckan=new TreeSet<Endpoint>(new EndpointComparator());
  TreeSet<Endpoint> sparqles=new TreeSet<Endpoint>(new EndpointComparator());
  ckan.addAll(datahub);
  sparqles.addAll(db);
  int newEPs=0, upEPs=0;
  for (  Endpoint ep : ckan) {
    if (!sparqles.contains(ep)) {
      log.info("String_Node_Str",ep);
      newEPs++;
      _dbm.insert(ep);
      Schedule sch=_s.defaultSchedule(ep);
      _dbm.insert(sch);
      _s.initSchedule(sch);
    }
 else {
      log.info("String_Node_Str",ep);
      _dbm.update(ep);
    }
  }
  for (  Endpoint ep : sparqles) {
    if (!ckan.contains(ep)) {
      log.info("String_Node_Str",ep);
      _dbm.update(ep);
    }
  }
  return null;
}

Fixed version (ground truth):
@Override public Index call() throws Exception {
  log.info("String_Node_Str");
  Collection<Endpoint> datahub=DatahubAccess.checkEndpointList();
  if (datahub.size() == 0)   return null;
  Collection<Endpoint> db=_dbm.get(Endpoint.class,Endpoint.SCHEMA$);
  TreeSet<Endpoint> ckan=new TreeSet<Endpoint>(new EndpointComparator());
  TreeSet<Endpoint> sparqles=new TreeSet<Endpoint>(new EndpointComparator());
  ckan.addAll(datahub);
  sparqles.addAll(db);
  int newEPs=0, upEPs=0;
  for (  Endpoint ep : ckan) {
    if (!sparqles.contains(ep)) {
      log.info("String_Node_Str",ep);
      newEPs++;
      _dbm.insert(ep);
      Schedule sch=_s.defaultSchedule(ep);
      _dbm.insert(sch);
      _s.initSchedule(sch);
    }
 else {
      log.info("String_Node_Str",ep);
      _dbm.update(ep);
    }
  }
  for (  Endpoint ep : sparqles) {
    if (!ckan.contains(ep)) {
      log.info("String_Node_Str",ep);
      _dbm.cleanup(ep);
    }
  }
  return null;
}
Program: 92412
Project: 92412
Buggy source:
private AResult testSelect(EndpointResult epr){
  AResult result=new AResult();
  result.setEndpointResult(epr);
  long start=System.currentTimeMillis();
  try {
    QueryExecution qe=QueryManager.getExecution(epr.getEndpoint(),SELECTQUERY);
    boolean response=qe.execSelect().hasNext();
    if (response) {
      result.setResponseTime((System.currentTimeMillis() - start));
      if ((System.currentTimeMillis() - start) > 20000) {
        result.setIsAvailable(false);
        result.setExplanation("String_Node_Str");
      }
 else {
        result.setIsAvailable(response);
        result.setExplanation("String_Node_Str");
      }
      log.debug("String_Node_Str",epr.getEndpoint().getUri().toString());
      return result;
    }
 else {
      result.setIsAvailable(response);
      log.debug("String_Node_Str",epr.getEndpoint().getUri().toString());
      return result;
    }
  }
 catch (  Exception e1) {
    result.setIsAvailable(false);
    String failureExplanation="String_Node_Str";
    failureExplanation=e1.getMessage().replaceAll("String_Node_Str","String_Node_Str");
    failureExplanation=failureExplanation.replaceAll("String_Node_Str","String_Node_Str");
    failureExplanation=failureExplanation.replaceAll("String_Node_Str","String_Node_Str");
    failureExplanation=failureExplanation.replaceAll("String_Node_Str","String_Node_Str");
    if (failureExplanation.contains("String_Node_Str"))     result.setIsPrivate(true);
    result.setException(LogFormater.toString(e1));
    result.setExplanation("String_Node_Str" + failureExplanation);
    log.warn("String_Node_Str",epr.getEndpoint().getUri(),e1);
    return result;
  }
}

Fixed version (ground truth):
private AResult testSelect(EndpointResult epr){
  AResult result=new AResult();
  result.setEndpointResult(epr);
  long start=System.currentTimeMillis();
  try {
    QueryExecution qe=QueryManager.getExecution(epr.getEndpoint(),SELECTQUERY);
    boolean response=qe.execSelect().hasNext();
    if (response) {
      result.setResponseTime((System.currentTimeMillis() - start));
      if ((System.currentTimeMillis() - start) > 20000) {
        result.setIsAvailable(false);
        result.setExplanation("String_Node_Str");
      }
 else {
        result.setIsAvailable(response);
        result.setExplanation("String_Node_Str");
      }
      log.debug("String_Node_Str",epr.getEndpoint().getUri().toString());
      return result;
    }
 else {
      result.setIsAvailable(response);
      log.debug("String_Node_Str",epr.getEndpoint().getUri().toString());
      return result;
    }
  }
 catch (  Exception e1) {
    result.setIsAvailable(false);
    result.setException(LogFormater.toString(e1));
    if (e1.getMessage().contains("String_Node_Str"))     result.setIsPrivate(true);
    log.warn("String_Node_Str",epr.getEndpoint().getUri(),e1);
    return result;
  }
}
Program: 92413
Project: 92413
Buggy source:
@Test public void testInsertEP(){
  m.initEndpointCollection();
  m.setup();
  Endpoint e=Endpoints.DBPEDIA;
  assertTrue(m.insert(e));
  assertEquals(1,m.get(Endpoint.class,Endpoint.SCHEMA$).size());
  assertTrue(m.insert(e));
  assertEquals(1,m.get(Endpoint.class,Endpoint.SCHEMA$).size());
}

Fixed version (ground truth):
@Test public void testInsertEP(){
  m.initEndpointCollection();
  m.setup();
  Endpoint e=Endpoints.DBPEDIA;
  assertTrue(m.insert(e));
  assertEquals(1,m.get(Endpoint.class,Endpoint.SCHEMA$).size());
  assertTrue(m.remove(e,Endpoint.class));
  assertEquals(0,m.get(Endpoint.class,Endpoint.SCHEMA$).size());
}
Program: 92414
Project: 92414
Buggy source:
private static Endpoint checkForDataset(Endpoint ep,String datasetId,CloseableHttpClient httpClient){
  log.debug("String_Node_Str",datasetId,ep);
  HttpGet getRequest=null;
  try {
    getRequest=new HttpGet("String_Node_Str" + datasetId);
    CloseableHttpResponse response=httpClient.execute(getRequest);
    if (response.getStatusLine().getStatusCode() != 200) {
      throw new RuntimeException("String_Node_Str" + response.getStatusLine().getStatusCode());
    }
    String respString=EntityUtils.toString(response.getEntity());
    response.close();
    JsonFactory factory=new JsonFactory();
    ObjectMapper mapper=new ObjectMapper(factory);
    JsonNode rootNode=mapper.readTree(respString);
    String ckan_url=rootNode.findPath("String_Node_Str").getTextValue();
    String title=rootNode.findPath("String_Node_Str").getTextValue().trim();
    Dataset d=new Dataset();
    d.setLabel(title);
    d.setUri(ckan_url);
    List<Dataset> l=ep.getDatasets();
    l.add(d);
    ep.setDatasets(l);
    return ep;
  }
 catch (  Exception e) {
    log.warn("String_Node_Str",e);
  }
  return ep;
}

Fixed version (ground truth):
private static Endpoint checkForDataset(Endpoint ep,String datasetId,CloseableHttpClient httpClient){
  log.debug("String_Node_Str",datasetId,ep);
  HttpGet getRequest=null;
  try {
    getRequest=new HttpGet("String_Node_Str" + datasetId);
    CloseableHttpResponse response=httpClient.execute(getRequest);
    if (response.getStatusLine().getStatusCode() != 200) {
      throw new RuntimeException("String_Node_Str" + response.getStatusLine().getStatusCode());
    }
    String respString=EntityUtils.toString(response.getEntity());
    response.close();
    JsonFactory factory=new JsonFactory();
    ObjectMapper mapper=new ObjectMapper(factory);
    JsonNode rootNode=mapper.readTree(respString);
    String ckan_url=rootNode.findPath("String_Node_Str").getTextValue();
    List<JsonNode> titles=rootNode.findValues("String_Node_Str");
    String title=null;
    for (    JsonNode s : titles) {
      if (!s.toString().contains("String_Node_Str"))       title=s.asText();
    }
    Dataset d=new Dataset();
    d.setLabel(title);
    d.setUri(ckan_url);
    List<Dataset> l=ep.getDatasets();
    l.add(d);
    return ep;
  }
 catch (  Exception e) {
    log.warn("String_Node_Str",e);
  }
  return ep;
}
Program: 92416
Project: 92416
Buggy source:
private void performance(Endpoint ep,PAnalyser p){
  TreeSet<PResult> res=new TreeSet<PResult>(new Comparator<PResult>(){
    public int compare(    PResult o1,    PResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<PResult> epRes=_db.getResults(ep,PResult.class,PResult.SCHEMA$);
  for (  PResult epres : epRes) {
    res.add(epres);
  }
  if (_onlyLast) {
    p.analyse(res.last());
  }
 else {
    for (    PResult ares : res) {
      p.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}

Fixed version (ground truth):
private void performance(Endpoint ep,PAnalyser p){
  TreeSet<PResult> res=new TreeSet<PResult>(new Comparator<PResult>(){
    public int compare(    PResult o1,    PResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<PResult> epRes=_db.getResults(ep,PResult.class,PResult.SCHEMA$);
  for (  PResult epres : epRes) {
    res.add(epres);
  }
  log.info("String_Node_Str",epRes.size());
  if (_onlyLast && epRes.size() != 0) {
    p.analyse(res.last());
  }
 else {
    for (    PResult ares : res) {
      p.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}
Program: 92417
Project: 92417
Buggy source:
private void interoperability(Endpoint ep,FAnalyser f){
  TreeSet<FResult> res=new TreeSet<FResult>(new Comparator<FResult>(){
    public int compare(    FResult o1,    FResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<FResult> epRes=_db.getResults(ep,FResult.class,FResult.SCHEMA$);
  for (  FResult epres : epRes) {
    res.add(epres);
  }
  if (_onlyLast) {
    f.analyse(res.last());
  }
 else {
    for (    FResult ares : res) {
      f.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}

Fixed version (ground truth):
private void interoperability(Endpoint ep,FAnalyser f){
  TreeSet<FResult> res=new TreeSet<FResult>(new Comparator<FResult>(){
    public int compare(    FResult o1,    FResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<FResult> epRes=_db.getResults(ep,FResult.class,FResult.SCHEMA$);
  for (  FResult epres : epRes) {
    res.add(epres);
  }
  log.info("String_Node_Str",epRes.size());
  if (_onlyLast && epRes.size() != 0) {
    f.analyse(res.last());
  }
 else {
    for (    FResult ares : res) {
      f.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}
Program: 92418
Project: 92418
Buggy source:
private void availability(Endpoint ep,AAnalyser a){
  TreeSet<AResult> res=new TreeSet<AResult>(new Comparator<AResult>(){
    public int compare(    AResult o1,    AResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<AResult> epRes=_db.getResults(ep,AResult.class,AResult.SCHEMA$);
  for (  AResult epres : epRes) {
    res.add(epres);
  }
  if (_onlyLast) {
    a.analyse(res.last());
  }
 else {
    for (    AResult ares : res) {
      a.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}

Fixed version (ground truth):
private void availability(Endpoint ep,AAnalyser a){
  TreeSet<AResult> res=new TreeSet<AResult>(new Comparator<AResult>(){
    public int compare(    AResult o1,    AResult o2){
      int diff=o1.getEndpointResult().getStart().compareTo(o2.getEndpointResult().getStart());
      return diff;
    }
  }
);
  List<AResult> epRes=_db.getResults(ep,AResult.class,AResult.SCHEMA$);
  for (  AResult epres : epRes) {
    res.add(epres);
  }
  if (_onlyLast && epRes.size() != 0) {
    a.analyse(res.last());
  }
 else {
    for (    AResult ares : res) {
      a.analyse(ares);
    }
  }
  log.info("String_Node_Str",ep,epRes.size());
}
Program: 92419
Project: 92419
Buggy source:
@Override public V call(){
}

Fixed version (ground truth):
@Override public V call(){
  long start=System.currentTimeMillis();
  _epr.setStart(start);
  try {
    sparqles.utils.LogHandler.run(log,this.getClass().getSimpleName(),_epr.getEndpoint().getUri().toString());
    V v=process(_epr);
    if (_dbm != null && !_dbm.insertResult(v)) {
      log.warn("String_Node_Str");
    }
    if (_fm != null && !_fm.writeResult(v)) {
      log.warn("String_Node_Str");
    }
    long end=System.currentTimeMillis();
    sparqles.utils.LogHandler.success(log,this.getClass().getSimpleName(),_epr.getEndpoint().getUri().toString(),end - start);
    _epr.setEnd(end);
    return v;
  }
 catch (  Exception e) {
    sparqles.utils.LogHandler.error(log,this.getClass().getSimpleName(),_epr.getEndpoint().getUri().toString(),e);
  }
  _epr.setEnd(System.currentTimeMillis());
  return null;
}
Program: 92421
Project: 92421
Buggy source:
@Override public void doFilterInternal(HttpServletRequest req,HttpServletResponse res,FilterChain fc) throws ServletException, IOException {
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + useDefaultDatabaseName);
  MultiTenantMongoDbFactory.clearDatabaseNameForCurrentThread();
  String tenant=null;
  Cookie tenantCookie=WebUtils.getCookie(req,"String_Node_Str");
  if (tenantCookie != null) {
    tenant=tenantCookie.getValue();
    logger.debug("String_Node_Str");
  }
 else {
    tenant=req.getHeader("String_Node_Str");
    logger.debug("String_Node_Str");
    if (org.apache.commons.lang.StringUtils.isNotBlank(tenant)) {
      tenantCookie=new Cookie("String_Node_Str",tenant);
      tenantCookie.setPath("String_Node_Str");
      res.addCookie(tenantCookie);
    }
 else {
      if (Boolean.valueOf(useDefaultDatabaseName)) {
        logger.warn("String_Node_Str");
        tenant=defaultDatabase;
      }
 else {
        throw new MissingTenantException("String_Node_Str");
      }
    }
  }
  logger.debug("String_Node_Str" + tenant);
  MultiTenantMongoDbFactory.setDatabaseNameForCurrentThread(tenant);
  fc.doFilter(req,res);
}

Fixed version (ground truth):
@Override public void doFilterInternal(HttpServletRequest req,HttpServletResponse res,FilterChain fc) throws ServletException, IOException {
  logger.debug("String_Node_Str");
  logger.debug("String_Node_Str" + useDefaultDatabaseName);
  MultiTenantMongoDbFactory.clearDatabaseNameForCurrentThread();
  String tenant=req.getHeader("String_Node_Str");
  Cookie tenantCookie=WebUtils.getCookie(req,"String_Node_Str");
  if (StringUtils.isBlank(tenant) && tenantCookie == null) {
    if (Boolean.valueOf(useDefaultDatabaseName)) {
      logger.warn("String_Node_Str");
      tenant=defaultDatabase;
    }
 else {
      throw new MissingTenantException("String_Node_Str");
    }
  }
 else   if (StringUtils.isBlank(tenant) && tenantCookie != null) {
    tenant=tenantCookie.getValue();
    logger.debug("String_Node_Str");
  }
 else   if (StringUtils.isNotBlank(tenant) && tenantCookie == null) {
    tenantCookie=new Cookie("String_Node_Str",tenant);
    tenantCookie.setPath("String_Node_Str");
    res.addCookie(tenantCookie);
    logger.debug("String_Node_Str");
  }
 else {
    String tenantValueFromCookie=tenantCookie.getValue();
    if (!tenant.equals(tenantValueFromCookie)) {
      tenantCookie=new Cookie("String_Node_Str",tenant);
      tenantCookie.setPath("String_Node_Str");
      res.addCookie(tenantCookie);
    }
  }
  logger.debug("String_Node_Str" + tenant);
  MultiTenantMongoDbFactory.setDatabaseNameForCurrentThread(tenant);
  fc.doFilter(req,res);
}
Program: 92423
Project: 92423
Buggy source:
/** 
 * Verifies and creates the dir if needed (OR dies if impossible)
 * @param configKey the configured path
 * @param defaultPath the default path if the configured path is bad
 * @return the directory
 */
private File verifyDir(String configKey,String defaultPath){
  String dirStr=this.config.getString(configKey);
  File fileDir;
  if (StringUtils.isBlank(dirStr)) {
    dirStr=defaultPath;
    fileDir=new File(appHome(),dirStr);
  }
 else {
    dirStr=StringUtils.trim(dirStr);
    if (StringUtils.startsWith(dirStr,"String_Node_Str")) {
      fileDir=new File(dirStr);
    }
 else {
      fileDir=new File(appHome(),dirStr);
    }
  }
  if (!fileDir.exists()) {
    try {
      if (fileDir.mkdirs()) {
        logger.info("String_Node_Str" + configKey + "String_Node_Str"+ fileDir.getAbsolutePath());
      }
 else {
        throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
      }
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath() + "String_Node_Str"+ e);
    }
  }
 else   if (!fileDir.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
  }
 else   if (!fileDir.canRead()) {
    throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
  }
 else {
    logger.info("String_Node_Str" + configKey + "String_Node_Str"+ fileDir.getAbsolutePath());
  }
  this.config.setProperty(configKey,fileDir.getAbsolutePath());
  return fileDir;
}

Fixed version (ground truth):
/** 
 * Verifies and creates the dir if needed (OR dies if impossible)
 * @param configKey the configured path
 * @param defaultPath the default path if the configured path is bad
 * @return the directory
 */
private File verifyDir(String configKey,String defaultPath){
  String dirStr=this.config.getString(configKey);
  File fileDir;
  if (StringUtils.isBlank(dirStr)) {
    dirStr=defaultPath;
    fileDir=new File(appHome(),dirStr);
  }
 else {
    dirStr=StringUtils.trim(dirStr);
    if (StringUtils.startsWith(dirStr,SLASH)) {
      fileDir=new File(dirStr);
    }
 else {
      fileDir=new File(appHome(),dirStr);
    }
  }
  if (!fileDir.exists()) {
    try {
      if (fileDir.mkdirs()) {
        logger.info("String_Node_Str" + configKey + "String_Node_Str"+ fileDir.getAbsolutePath());
      }
 else {
        throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
      }
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath() + "String_Node_Str"+ e);
    }
  }
 else   if (!fileDir.isDirectory()) {
    throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
  }
 else   if (!fileDir.canRead()) {
    throw new RuntimeException("String_Node_Str" + fileDir.getAbsolutePath());
  }
 else {
    logger.info("String_Node_Str" + configKey + "String_Node_Str"+ fileDir.getAbsolutePath());
  }
  this.config.setProperty(configKey,fileDir.getAbsolutePath());
  return fileDir;
}
Program: 92424
Project: 92424
Buggy source:
public UnexpectedCharException(int index,char c){
  sper("String_Node_Str" + c + "String_Node_Str"+ index+ "String_Node_Str");
}

Fixed version (ground truth):
public UnexpectedCharException(int index,char c){
  super("String_Node_Str" + c + "String_Node_Str"+ index+ "String_Node_Str");
}
Program: 92425
Project: 92425
Buggy source:
@Override Option<MatchResult> unapplyToken(Token token){
  if (token instanceof Token.KeywordToken) {
    final Token.KeywordToken keyword=Token.KeywordToken.class.cast(token);
    final Option<MatchResult> unapply=this.value.unapply(keyword.value());
    if (unapply.isSome()) {
      return Option.Some(new MatchResult(token).with(unapply.value()));
    }
  }
  return Option.None();
}

Fixed version (ground truth):
@Override Option<MatchResult> unapplyToken(Token token){
  if (token instanceof Token.FloatToken) {
    return Option.Some(new MatchResult(token));
  }
 else {
    return Option.None();
  }
}
Program: 92426
Project: 92426
Buggy source:
@Override public Option<MatchResult> unapply(TokenStream tokenStream){
  final Token token;
  try {
    token=tokenStream.nextToken();
  }
 catch (  IOException|UnexpectedCharException e) {
    return Option.None();
  }
  if (token instanceof Token.FloatToken) {
    return Option.Some(new MatchResult(token));
  }
 else {
    return Option.None();
  }
}

Fixed version (ground truth):
@Override public Option<MatchResult> unapply(TokenStream tokenStream){
  final TokenStream secundary=tokenStream.secundary();
  final Option<MatchResult> unapply=aCase.unapply(secundary);
  if (unapply.isSome()) {
    tokenStream.synchronizeWith(secundary);
    final Option<Object> returnedObject=Option.Some(unapply.value().matchedObject());
    return matchFully(tokenStream,Option.Some(new MatchResult(returnedObject).with(unapply.value())));
  }
 else {
    return Option.Some(new MatchResult(Option.None()));
  }
}
Program: 92427
Project: 92427
Buggy source:
@Override public Object apply(Token.KeywordToken o) throws Exception {
  final Object value=o.value();
  if (value.equals("String_Node_Str")) {
    return handler.aNull();
  }
  if (value.equals("String_Node_Str")) {
    return handler.aBoolean(false);
  }
  if (value.equals("String_Node_Str")) {
    return handler.aBoolean(true);
  }
  throw new IllegalArgumentException();
}

Fixed version (ground truth):
@Override public Object apply(Token.KeywordToken o) throws Exception {
  return handler.aBoolean(false);
}
Program: 92429
Project: 92429
Buggy source:
@Test public void shouldMatchJSONObject(){
  final String jsonValue="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  TestCase.assertTrue(JSon.validate(JSon.stream(jsonValue)));
}

Fixed version (ground truth):
@Test public void shouldMatchJSONObject(){
  final String jsonValue=getJsonSample();
  TestCase.assertTrue(JSon.validate(JSon.stream(jsonValue)));
}
Program: 92430
Project: 92430
Buggy source:
@Test public void shouldBuildJSONObject(){
  final String jsonValue="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  final Object json=JSon.withHandler(new POJOBuilder()).match(JSon.stream(jsonValue));
  TestCase.assertNotNull(json);
  TestCase.assertEquals(HashMap.class,json.getClass());
}

Fixed version (ground truth):
@Test public void shouldBuildJSONObject(){
  final String jsonValue=getJsonSample();
  final Object json=JSon.withHandler(new POJOBuilder()).match(JSon.stream(jsonValue));
  TestCase.assertNotNull(json);
  TestCase.assertEquals(HashMap.class,json.getClass());
}
Program: 92431
Project: 92431
Buggy source:
@Test public void shouldBuildGSONObject(){
  final String jsonValue="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  final Object json=JSon.withHandler(new GSonBuilder()).match(JSon.stream(jsonValue));
  TestCase.assertNotNull(json);
  TestCase.assertEquals(JsonObject.class,json.getClass());
}

Fixed version (ground truth):
@Test public void shouldBuildGSONObject(){
  final String jsonValue=getJsonSample();
  final Object json=JSon.withHandler(new GSonBuilder()).match(JSon.stream(jsonValue));
  TestCase.assertNotNull(json);
  TestCase.assertEquals(JsonObject.class,json.getClass());
}
Program: 92432
Project: 92432
Buggy source:
@Override public Option<MatchResult> unapply(String s){
  final Matcher matcher=expression.matcher(s);
  if (matcher.matches()) {
    final List<String> strings=new ArrayList<>();
    for (int i=0; i < matcher.groupCount(); i+=1) {
      strings.add(s.substring(matcher.start(i),matcher.end(i)));
    }
    return new Option.Some<>(new MatchResult(strings));
  }
 else {
    return new Option.None<>();
  }
}

Fixed version (ground truth):
@Override public Option<MatchResult> unapply(String s){
  final Matcher matcher=expression.matcher(s);
  if (matcher.matches()) {
    final List<String> strings=new ArrayList<>();
    for (int i=0; i <= matcher.groupCount(); i+=1) {
      strings.add(s.substring(matcher.start(i),matcher.end(i)));
    }
    return new Option.Some<>(new MatchResult(strings));
  }
 else {
    return new Option.None<>();
  }
}
Program: 92433
Project: 92433
Buggy source:
@Test public void shouldNotMatchSubStringUsingRegex() throws Exception {
  final Matcher<String,Boolean> matcher=Matcher.create();
  matcher.caseOf(var.of(Regex("String_Node_Str"))).then.value(true);
  matcher.caseOf(_).then.value(false);
  TestCase.assertFalse(matcher.match("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldNotMatchSubStringUsingRegex() throws Exception {
  final Matcher<String,Boolean> matcher=Matcher.create();
  matcher.caseOf(Regex("String_Node_Str")).then.value(true);
  matcher.caseOf(_).then.value(false);
  TestCase.assertFalse(matcher.match("String_Node_Str"));
}
Program: 92434
Project: 92434
Buggy source:
@Test public void shouldMatchSubStringUsingRegex() throws Exception {
  final Matcher<String,Boolean> matcher=Matcher.create();
  matcher.caseOf(var.of(Regex("String_Node_Str"))).then.value(true);
  matcher.caseOf(_).then.value(false);
  TestCase.assertTrue(matcher.match("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void shouldMatchSubStringUsingRegex() throws Exception {
  final Matcher<String,Boolean> matcher=Matcher.create();
  matcher.caseOf(var.of(Regex("String_Node_Str"))).then.function(new Function<List<String>,Boolean>(){
    public Boolean apply(    List<String> strings){
      return strings.get(1).equals("String_Node_Str");
    }
  }
);
  matcher.caseOf(_).then.value(false);
  TestCase.assertTrue(matcher.match("String_Node_Str"));
}
Program: 92435
Project: 92435
Buggy source:
/** 
 * Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. Working time line looks like: +---------+-----------------+--------+------------------ delay  |                 | period | +---------+-timer-work-time-+--------+------------------ \ next fire time
 */
public final int scheduleAtFixedRate(Runnable task,long delay,long period,TimeUnit timeUnit){
  return schedule_i(task,timeUnit.toMicros(delay),timeUnit.toMicros(period),false);
}

Fixed version (ground truth):
/** 
 * Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. Working time line looks like: +---------+-----------------+--------+------------------ delay  |                 | period | +---------+-timer-work-time-+--------+------------------ \ next fire time
 */
public final int scheduleAtFixedRate(Runnable task,long delay,long period,TimeUnit timeUnit){
  return schedule_i(task,timeUnit.toMillis(delay),timeUnit.toMillis(period),false);
}
Program: 92436
Project: 92436
Buggy source:
/** 
 * Schedules the specified task for execution after the specified delay.
 */
public final int schedule(Runnable task,long delay,TimeUnit unit){
  return schedule_i(task,unit.toMicros(delay),0,false);
}

Fixed version (ground truth):
/** 
 * Schedules the specified task for execution after the specified delay.
 */
public final int schedule(Runnable task,long delay,TimeUnit unit){
  return schedule_i(task,unit.toMillis(delay),0,false);
}
Program: 92437
Project: 92437
Buggy source:
private void run_i(){
  if (s_logger.isLoggable(Level.FINE))   s_logger.fine("String_Node_Str");
  m_lock.lock();
  try {
    while (!m_sortedTimers.isEmpty()) {
      final Map.Entry<Long,TimerInfo> firstEntry=m_sortedTimers.firstEntry();
      assert(firstEntry != null);
      final long currentTime=System.currentTimeMillis();
      if (firstEntry.getKey() <= currentTime) {
        TimerInfo timerInfo=firstEntry.getValue();
        assert(timerInfo != null);
        do {
          assert(timerInfo.threadID == 0);
          final TimerInfo next=timerInfo.next;
          timerInfo.prev=null;
          timerInfo.next=null;
          timerInfo.threadID=-1;
          m_threadPool.execute(timerInfo);
          timerInfo=next;
        }
 while (timerInfo != null);
        m_sortedTimers.remove(firstEntry.getKey());
      }
 else {
        final long sleepTime=(firstEntry.getKey() - currentTime);
        try {
          m_cond.awaitNanos(TimeUnit.MICROSECONDS.toNanos(sleepTime * 1000));
        }
 catch (        InterruptedException ex) {
          s_logger.warning(ex.toString());
        }
      }
    }
  }
  finally {
    m_lock.unlock();
  }
  if (s_logger.isLoggable(Level.FINE))   s_logger.fine("String_Node_Str");
}

Fixed version (ground truth):
private void run_i(){
  if (s_logger.isLoggable(Level.FINE))   s_logger.fine("String_Node_Str");
  m_lock.lock();
  try {
    while (!m_sortedTimers.isEmpty()) {
      final Map.Entry<Long,TimerInfo> firstEntry=m_sortedTimers.firstEntry();
      assert(firstEntry != null);
      final long currentTime=System.currentTimeMillis();
      if (firstEntry.getKey() <= currentTime) {
        TimerInfo timerInfo=firstEntry.getValue();
        assert(timerInfo != null);
        do {
          assert(timerInfo.threadID == 0);
          final TimerInfo next=timerInfo.next;
          timerInfo.prev=null;
          timerInfo.next=null;
          timerInfo.threadID=-1;
          m_threadPool.execute(timerInfo);
          timerInfo=next;
        }
 while (timerInfo != null);
        m_sortedTimers.remove(firstEntry.getKey());
      }
 else {
        final long sleepTime=(firstEntry.getKey() - currentTime);
        try {
          m_cond.awaitNanos(TimeUnit.MILLISECONDS.toNanos(sleepTime));
        }
 catch (        InterruptedException ex) {
          s_logger.warning(ex.toString());
        }
      }
    }
  }
  finally {
    m_lock.unlock();
  }
  if (s_logger.isLoggable(Level.FINE))   s_logger.fine("String_Node_Str");
}
Program: 92438
Project: 92438
Buggy source:
/** 
 * Schedules the specified task for repeated dynamic-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. Working time line looks like: +---------+----------+----------+------------------ delay  |  period  |  period  | +---------+-timer-work-time-+---+------------------ \ next fire time So timer will be executed exactly at a (delay + period*n) time, skipping time if timer handler execution took too much time.
 */
public final int scheduleAtDynamicRate(Runnable task,long delay,long period,TimeUnit timeUnit){
  return schedule_i(task,timeUnit.toMicros(delay),timeUnit.toMicros(period),true);
}

Fixed version (ground truth):
/** 
 * Schedules the specified task for repeated dynamic-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. Working time line looks like: +---------+----------+----------+------------------ delay  |  period  |  period  | +---------+-timer-work-time-+---+------------------ \ next fire time So timer will be executed exactly at a (delay + period*n) time, skipping time if timer handler execution took too much time.
 */
public final int scheduleAtDynamicRate(Runnable task,long delay,long period,TimeUnit timeUnit){
  return schedule_i(task,timeUnit.toMillis(delay),timeUnit.toMillis(period),true);
}
Program: 92439
Project: 92439
Buggy source:
private void run(){
  m_done.set(3);
  final ThreadPool threadPool=new ThreadPool("String_Node_Str",4);
  threadPool.start();
  final TimerQueue timerQueue=new TimerQueue(threadPool);
  final Timer1 timer1=new Timer1(timerQueue);
  timerQueue.schedule(timer1,100,TimeUnit.MICROSECONDS);
  final long test2Period=500;
  final Timer2 timer2=new Timer2(timerQueue,test2Period);
  timerQueue.scheduleAtFixedRate(timer2,100,test2Period,TimeUnit.MICROSECONDS);
  final long test3Period=110;
  final Timer3 timer3=new Timer3(timerQueue,test3Period,300);
  timerQueue.scheduleAtDynamicRate(timer3,0,test3Period,TimeUnit.MICROSECONDS);
  final Timer4 timer4=new Timer4();
  timerQueue.schedule(timer4,300,TimeUnit.MICROSECONDS);
  try {
    int rc=timerQueue.cancel(timer4);
    if (rc != 0)     throw new RuntimeException("String_Node_Str");
    m_sema.acquire();
    threadPool.stopAndWait();
  }
 catch (  InterruptedException ex) {
    ex.printStackTrace();
  }
}

Fixed version (ground truth):
private void run(){
  m_done.set(3);
  final ThreadPool threadPool=new ThreadPool("String_Node_Str",4);
  threadPool.start();
  final TimerQueue timerQueue=new TimerQueue(threadPool);
  final Timer1 timer1=new Timer1(timerQueue);
  timerQueue.schedule(timer1,100,TimeUnit.MILLISECONDS);
  final long test2Period=500;
  final Timer2 timer2=new Timer2(timerQueue,test2Period);
  timerQueue.scheduleAtFixedRate(timer2,100,test2Period,TimeUnit.MILLISECONDS);
  final long test3Period=110;
  final Timer3 timer3=new Timer3(timerQueue,test3Period,300);
  timerQueue.scheduleAtDynamicRate(timer3,0,test3Period,TimeUnit.MILLISECONDS);
  final Timer4 timer4=new Timer4();
  timerQueue.schedule(timer4,10,TimeUnit.SECONDS);
  try {
    int rc=timerQueue.cancel(timer4);
    if (rc != 0)     throw new RuntimeException("String_Node_Str");
    m_sema.acquire();
    threadPool.stopAndWait();
  }
 catch (  InterruptedException ex) {
    ex.printStackTrace();
  }
}
Program: 92440
Project: 92440
Buggy source:
public final PooledByteBuffer alloc(int size){
  for (; ; ) {
    int state=m_state;
    if (state == -1)     continue;
    final int offs=(state % m_chunkSize);
    int space=(m_chunkSize - offs);
    if (size <= space) {
      int newState=(state + size);
      int reservedSize=size;
      if (newState <= 0)       newState=(offs + size);
      if ((size % 4) > 0) {
        final int cc=(4 - (size % 4));
        if ((offs + size + cc) <= m_chunkSize) {
          newState+=cc;
          reservedSize+=cc;
        }
      }
      final Chunk chunk=m_chunk;
      if (!s_stateUpdater.compareAndSet(this,state,newState))       continue;
      return new PooledByteBuffer(chunk,offs,size,reservedSize);
    }
 else     if (size <= m_chunkSize) {
      if (!s_stateUpdater.compareAndSet(this,state,-1))       continue;
      m_chunk.release(space + 1);
      m_chunk=m_cache.get();
      final Chunk chunk=m_chunk;
      int newState=(state + space + size);
      int reservedSize=size;
      if (newState <= 0)       newState=size;
      if ((size % 4) > 0) {
        final int cc=(4 - (size % 4));
        if ((size + cc) <= m_chunkSize) {
          newState+=cc;
          reservedSize+=cc;
        }
      }
      m_state=newState;
      return new PooledByteBuffer(chunk,0,size,reservedSize);
    }
 else {
      final ByteBuffer buf=m_useDirectBuffers ? ByteBuffer.allocateDirect(size) : ByteBuffer.allocate(size);
      final Chunk chunk=new Chunk(null,buf);
      PooledByteBuffer ret=new PooledByteBuffer(chunk,0,size,size);
      chunk.release(1);
      return ret;
    }
  }
}

Fixed version (ground truth):
public final PooledByteBuffer alloc(int size){
  return alloc(size,size);
}
Program: 92441
Project: 92441
Buggy source:
protected final String clear(int initialSize){
  for (int idx=0; idx < m_size; idx++) {
    assert(m_cache[idx] != null);
    m_cache[idx]=null;
  }
  final int size=m_size;
  m_size=0;
  if (m_size < initialSize) {
    return "String_Node_Str" + size + "String_Node_Str"+ initialSize+ "String_Node_Str";
  }
 else {
    return "String_Node_Str" + size;
  }
}

Fixed version (ground truth):
protected final String clear(int initialSize){
  for (int idx=0; idx < m_size; idx++) {
    assert(m_cache[idx] != null);
    m_cache[idx]=null;
  }
  final int size=m_size;
  m_size=0;
  if (size < initialSize) {
    return "String_Node_Str" + size + "String_Node_Str"+ initialSize+ "String_Node_Str";
  }
 else {
    return "String_Node_Str" + size;
  }
}
Program: 92442
Project: 92442
Buggy source:
protected void addThread(Thread thread){
  if (s_logger.isLoggable(Level.FINE))   s_logger.log(Level.FINE,m_connector.getAddr().toString());
  m_lock.lock();
  try {
    assert(m_callbackThread == null);
    m_callbackThread=thread;
  }
  finally {
    m_lock.unlock();
  }
}

Fixed version (ground truth):
protected void addThread(Thread thread){
  if (s_logger.isLoggable(Level.FINE))   s_logger.log(Level.FINE,m_connector.getAddr() + "String_Node_Str" + this.toString());
  m_lock.lock();
  try {
    assert(m_callbackThread == null);
    m_callbackThread=thread;
  }
  finally {
    m_lock.unlock();
  }
}
Program: 92443
Project: 92443
Buggy source:
public final void start(SocketChannel socketChannel,boolean connected){
  if (s_logger.isLoggable(Level.FINE)) {
    s_logger.log(Level.FINE,m_connector.getAddr() + "String_Node_Str" + (connected ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str");
  }
  m_socketChannel=socketChannel;
  m_connected=connected;
  m_collider.executeInSelectorThread(new Starter1());
}

Fixed version (ground truth):
public final void start(SocketChannel socketChannel,boolean connected){
  if (s_logger.isLoggable(Level.FINE)) {
    s_logger.log(Level.FINE,m_connector.getAddr() + "String_Node_Str" + (connected ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ this.toString()+ "String_Node_Str");
  }
  m_socketChannel=socketChannel;
  m_connected=connected;
  m_collider.executeInSelectorThread(new Starter1());
}
Program: 92444
Project: 92444
Buggy source:
protected void removeThreadAndReleaseMonitor(Thread thread){
  if (s_logger.isLoggable(Level.FINE))   s_logger.log(Level.FINE,m_connector.getAddr().toString());
  m_lock.lock();
  try {
    assert(m_callbackThread == thread);
    assert(m_state == RUNNING);
    m_callbackThread=null;
    m_state=STOPPED;
    m_socketChannel=null;
    m_selectionKey=null;
    if (m_stop)     m_cond.signalAll();
  }
  finally {
    m_lock.unlock();
  }
  m_collider.removeEmitterNoWait(m_connector);
}

Fixed version (ground truth):
protected void removeThreadAndReleaseMonitor(Thread thread){
  if (s_logger.isLoggable(Level.FINE))   s_logger.log(Level.FINE,m_connector.getAddr() + "String_Node_Str" + this.toString());
  m_lock.lock();
  try {
    assert(m_callbackThread == thread);
    assert((m_state == STARTING_1) || (m_state == RUNNING));
    m_callbackThread=null;
    m_state=STOPPED;
    m_socketChannel=null;
    m_selectionKey=null;
    if (m_stop)     m_cond.signalAll();
  }
  finally {
    m_lock.unlock();
  }
  m_collider.removeEmitterNoWait(m_connector);
}