nus-yam/ex-repair huggingface dataset:
Program: 53627
Project: 53627
Buggy source:
public static AgentStat merge(AgentStat s1,AgentStat s2){
  AgentStat latest=s1.getTimestamp() > s2.getTimestamp() ? s1 : s2;
  AgentStat stat=new AgentStat(s1.getAgentId(),s1.getTimestamp());
  stat.setGcType(latest.getGcType());
  stat.setGcOldCount(latest.getGcOldCount());
  stat.setGcOldTime(latest.getGcOldTime());
  stat.setHeapUsed(latest.getHeapUsed());
  stat.setHeapMax(maxValue(s1.getHeapMax(),s2.getHeapMax()));
  stat.setNonHeapUsed(latest.getNonHeapUsed());
  stat.setNonHeapMax(maxValue(s1.getNonHeapMax(),s2.getNonHeapMax()));
  stat.setJvmCpuUsage(latest.getJvmCpuUsage());
  stat.setSystemCpuUsage(latest.getSystemCpuUsage());
  stat.setSampledNewCount(addValue(s1.getSampledNewCount(),s2.getSampledNewCount()));
  stat.setSampledContinuationCount(addValue(s1.getSampledContinuationCount(),s2.getSampledContinuationCount()));
  stat.setUnsampledNewCount(addValue(s1.getUnsampledNewCount(),s2.getUnsampledNewCount()));
  stat.setUnsampledContinuationCount(addValue(s1.getUnsampledContinuationCount(),s2.getUnsampledContinuationCount()));
  stat.setHistogramSchema(latest.getHistogramSchema());
  stat.setActiveTraceCounts(latest.getActiveTraceCounts());
  return stat;
}

Fixed version (ground truth):
public static AgentStat merge(AgentStat s1,AgentStat s2,long interval){
  AgentStat latest=s1.getTimestamp() > s2.getTimestamp() ? s1 : s2;
  AgentStat stat=new AgentStat(s1.getAgentId(),latest.getTimestamp());
  stat.setCollectInterval(interval);
  stat.setGcType(latest.getGcType());
  stat.setGcOldCount(latest.getGcOldCount());
  stat.setGcOldTime(latest.getGcOldTime());
  stat.setHeapUsed(latest.getHeapUsed());
  stat.setHeapMax(maxValue(s1.getHeapMax(),s2.getHeapMax()));
  stat.setNonHeapUsed(latest.getNonHeapUsed());
  stat.setNonHeapMax(maxValue(s1.getNonHeapMax(),s2.getNonHeapMax()));
  stat.setJvmCpuUsage(latest.getJvmCpuUsage());
  stat.setSystemCpuUsage(latest.getSystemCpuUsage());
  stat.setSampledNewCount(addValue(s1.getSampledNewCount(),s2.getSampledNewCount()));
  stat.setSampledContinuationCount(addValue(s1.getSampledContinuationCount(),s2.getSampledContinuationCount()));
  stat.setUnsampledNewCount(addValue(s1.getUnsampledNewCount(),s2.getUnsampledNewCount()));
  stat.setUnsampledContinuationCount(addValue(s1.getUnsampledContinuationCount(),s2.getUnsampledContinuationCount()));
  stat.setHistogramSchema(latest.getHistogramSchema());
  stat.setActiveTraceCounts(latest.getActiveTraceCounts());
  return stat;
}
Program: 53628
Project: 53628
Buggy source:
public List<AgentStat> aggregate(){
  if (stats.isEmpty()) {
    return stats;
  }
  List<AgentStat> result=new ArrayList<>();
  AgentStat current=toAggregatedAgentStat(stats.get(0));
  for (  AgentStat stat : stats.subList(1,stats.size())) {
    long timestamp=toAggregatedTimestamp(stat,interval);
    if (current.getTimestamp() == timestamp) {
      current=merge(current,stat);
    }
 else {
      result.add(current);
      current=toAggregatedAgentStat(stat);
    }
  }
  result.add(current);
  return result;
}

Fixed version (ground truth):
public List<AgentStat> aggregate(){
  if (stats.isEmpty()) {
    return stats;
  }
  List<AgentStat> result=new ArrayList<>();
  AgentStat current=toAggregatedAgentStat(stats.get(0));
  for (  AgentStat stat : stats.subList(1,stats.size())) {
    long timestamp=toAggregatedTimestamp(stat,interval);
    if (current.getTimestamp() == timestamp) {
      current=merge(current,stat,interval);
    }
 else {
      result.add(current);
      current=toAggregatedAgentStat(stat);
    }
  }
  current.setCollectInterval(interval);
  result.add(current);
  return result;
}
Program: 53629
Project: 53629
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>Class<? extends T> injectClass(ClassLoader classLoader,String className){
  try {
    if (classLoader == null) {
      return (Class<T>)injectToBootstrapClassLoader(className);
    }
 else     if (classLoader instanceof URLClassLoader) {
      final URLClassLoader urlClassLoader=(URLClassLoader)classLoader;
      return (Class<T>)injectToURLClassLoader(urlClassLoader,className);
    }
 else {
      return (Class<T>)injectToPlainClassLoader(classLoader,className);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",className,classLoader,e);
    throw new PinpointException("String_Node_Str" + className + "String_Node_Str"+ classLoader,e);
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>Class<? extends T> injectClass(ClassLoader classLoader,String className){
  try {
    if (classLoader == null) {
      return (Class<T>)bootstrapClassLoaderHandler.injectClass(null,className);
    }
 else     if (classLoader instanceof URLClassLoader) {
      final URLClassLoader urlClassLoader=(URLClassLoader)classLoader;
      return (Class<T>)urlClassLoaderHandler.injectClass(urlClassLoader,className);
    }
 else {
      return (Class<T>)plainClassLoaderHandler.injectClass(classLoader,className);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",className,classLoader,e);
    throw new PinpointException("String_Node_Str" + className + "String_Node_Str"+ classLoader,e);
  }
}
Program: 53630
Project: 53630
Buggy source:
public JarProfilerPluginClassInjector(PluginConfig pluginConfig){
  if (pluginConfig == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.pluginConfig=pluginConfig;
}

Fixed version (ground truth):
public JarProfilerPluginClassInjector(PluginConfig pluginConfig){
  if (pluginConfig == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.bootstrapClassLoaderHandler=new BootstrapClassLoaderHandler(pluginConfig);
  this.urlClassLoaderHandler=new URLClassLoaderHandler(pluginConfig);
  this.plainClassLoaderHandler=new PlainClassLoaderHandler(pluginConfig);
}
Program: 53631
Project: 53631
Buggy source:
@Override public void start(){
  PinpointThreadFactory flushThreadFactory=new PinpointThreadFactory(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  webSocketFlushThreadPool=new ThreadPoolExecutor(Runtime.getRuntime().availableProcessors(),Integer.MAX_VALUE,DEFAULT_HEALTH_CHECk_DELAY,TimeUnit.MILLISECONDS,new LinkedBlockingQueue<Runnable>(),flushThreadFactory);
  flushTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  healthCheckTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  reactiveTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
}

Fixed version (ground truth):
@Override public void start(){
  PinpointThreadFactory flushThreadFactory=new PinpointThreadFactory(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  webSocketflushExecutor=new SimpleOrderedThreadPool(Runtime.getRuntime().availableProcessors(),65535,flushThreadFactory);
  flushTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  healthCheckTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
  reactiveTimer=new java.util.Timer(ClassUtils.simpleClassName(this) + "String_Node_Str",true);
}
Program: 53632
Project: 53632
Buggy source:
private void sendPingMessage(WebSocketSession session,TextMessage pingMessage){
  try {
    session.sendMessage(pingMessage);
  }
 catch (  Exception e) {
    logger.warn(e.getMessage(),e);
    closeSession(session,CloseStatus.SERVER_ERROR);
  }
}

Fixed version (ground truth):
private void sendPingMessage(WebSocketSession session,TextMessage pingMessage){
  try {
    webSocketflushExecutor.execute(new OrderedWebSocketFlushRunnable(session,pingMessage,true));
  }
 catch (  RuntimeException e) {
    logger.warn("String_Node_Str",e.getMessage(),e);
  }
}
Program: 53633
Project: 53633
Buggy source:
@Override public void stop(){
  for (  PinpointWebSocketResponseAggregator aggregator : aggregatorRepository.values()) {
    if (aggregator != null) {
      aggregator.stop();
    }
  }
  aggregatorRepository.clear();
  if (flushTimer != null) {
    flushTimer.cancel();
  }
  if (healthCheckTimer != null) {
    healthCheckTimer.cancel();
  }
  if (reactiveTimer != null) {
    reactiveTimer.cancel();
  }
  if (webSocketFlushThreadPool != null) {
    webSocketFlushThreadPool.shutdown();
  }
}

Fixed version (ground truth):
@Override public void stop(){
  for (  PinpointWebSocketResponseAggregator aggregator : aggregatorRepository.values()) {
    if (aggregator != null) {
      aggregator.stop();
    }
  }
  aggregatorRepository.clear();
  if (flushTimer != null) {
    flushTimer.cancel();
  }
  if (healthCheckTimer != null) {
    healthCheckTimer.cancel();
  }
  if (reactiveTimer != null) {
    reactiveTimer.cancel();
  }
  if (webSocketflushExecutor != null) {
    webSocketflushExecutor.shutdown();
  }
}
Program: 53634
Project: 53634
Buggy source:
private String createEmptyResponseMessage(String applicationName,long timeStamp){
  StringBuilder emptyJsonMessage=new StringBuilder();
  emptyJsonMessage.append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(APPLICATION_NAME).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(applicationName).append("String_Node_Str").append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(ACTIVE_THREAD_COUNTS).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(TIME_STAMP).append("String_Node_Str").append("String_Node_Str").append(timeStamp);
  emptyJsonMessage.append("String_Node_Str");
  return emptyJsonMessage.toString();
}

Fixed version (ground truth):
private String createEmptyResponseMessage(String applicationName,long timeStamp){
  StringBuilder emptyJsonMessage=new StringBuilder(32);
  emptyJsonMessage.append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(APPLICATION_NAME).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append(applicationName).append("String_Node_Str").append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(ACTIVE_THREAD_COUNTS).append("String_Node_Str").append("String_Node_Str").append("String_Node_Str").append("String_Node_Str");
  emptyJsonMessage.append("String_Node_Str").append(TIME_STAMP).append("String_Node_Str").append("String_Node_Str").append(timeStamp);
  emptyJsonMessage.append("String_Node_Str");
  return emptyJsonMessage.toString();
}
Program: 53635
Project: 53635
Buggy source:
@Override public void flush() throws Exception {
  if ((flushCount.getAndIncrement() % flushLogRecordRate) == 0) {
    logger.info("String_Node_Str",applicationName);
  }
  if (isStopped) {
    return;
  }
  AgentActiveThreadCountList response=new AgentActiveThreadCountList();
synchronized (aggregatorLock) {
    for (    ActiveThreadCountWorker activeThreadCountWorker : activeThreadCountWorkerRepository.values()) {
      String agentId=activeThreadCountWorker.getAgentId();
      AgentActiveThreadCount agentActiveThreadCount=activeThreadCountMap.get(agentId);
      if (agentActiveThreadCount != null) {
        response.add(agentActiveThreadCount);
      }
 else {
        response.add(activeThreadCountWorker.getDefaultFailedResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  flush0(response);
}

Fixed version (ground truth):
@Override public void flush(Executor executor) throws Exception {
  if ((flushCount.getAndIncrement() % flushLogRecordRate) == 0) {
    logger.info("String_Node_Str",applicationName);
  }
  if (isStopped) {
    return;
  }
  AgentActiveThreadCountList response=new AgentActiveThreadCountList();
synchronized (aggregatorLock) {
    for (    ActiveThreadCountWorker activeThreadCountWorker : activeThreadCountWorkerRepository.values()) {
      String agentId=activeThreadCountWorker.getAgentId();
      AgentActiveThreadCount agentActiveThreadCount=activeThreadCountMap.get(agentId);
      if (agentActiveThreadCount != null) {
        response.add(agentActiveThreadCount);
      }
 else {
        response.add(activeThreadCountWorker.getDefaultFailedResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  TextMessage webSocketTextMessage=createWebSocketTextMessage(response);
  if (webSocketTextMessage != null) {
    if (executor == null) {
      flush0(webSocketTextMessage);
    }
 else {
      flushAsync0(webSocketTextMessage,executor);
    }
  }
}
Program: 53636
Project: 53636
Buggy source:
private void flush0(AgentActiveThreadCountList activeThreadCountList){
  Map resultMap=createResultMap(activeThreadCountList,System.currentTimeMillis());
  try {
    TextMessage responseTextMessage=new TextMessage(messageConverter.getResponseTextMessage(ActiveThreadCountHandler.API_ACTIVE_THREAD_COUNT,resultMap));
    for (    WebSocketSession webSocketSession : webSocketSessions) {
      try {
        logger.debug("String_Node_Str",webSocketSession,responseTextMessage);
        webSocketSession.sendMessage(responseTextMessage);
      }
 catch (      Exception e) {
        logger.warn("String_Node_Str",webSocketSession,applicationName,e.getMessage(),e);
      }
    }
  }
 catch (  JsonProcessingException e) {
    logger.warn("String_Node_Str",applicationName,resultMap,e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void flush0(TextMessage webSocketMessage){
  for (  WebSocketSession webSocketSession : webSocketSessions) {
    try {
      logger.debug("String_Node_Str",webSocketSession,webSocketMessage);
      webSocketSession.sendMessage(webSocketMessage);
    }
 catch (    Exception e) {
      logger.warn("String_Node_Str",webSocketSession,webSocketMessage,e.getMessage(),e);
    }
  }
}
Program: 53637
Project: 53637
Buggy source:
void flush() throws Exception ;

Fixed version (ground truth):
void flush(Executor executor) throws Exception ;
Program: 53638
Project: 53638
Buggy source:
public LinkDataDuplexMap select(Application sourceApplication,Range range,SearchOption searchOption){
  if (searchOption == null) {
    throw new NullPointerException("String_Node_Str");
  }
  SearchDepth callerDepth=new SearchDepth(searchOption.getCallerSearchDepth());
  SearchDepth calleeDepth=new SearchDepth(searchOption.getCalleeSearchDepth());
  logger.debug("String_Node_Str",sourceApplication);
  addNextNode(sourceApplication);
  LinkDataDuplexMap linkDataDuplexMap=new LinkDataDuplexMap();
  while (!this.nextQueue.isEmpty()) {
    final List<Application> currentNode=this.nextQueue.copyAndClear();
    logger.debug("String_Node_Str",currentNode.size(),callerDepth.getDepth(),calleeDepth.getDepth(),currentNode);
    LinkDataDuplexMap levelData=selectLink(currentNode,range,callerDepth,calleeDepth);
    linkDataDuplexMap.addLinkDataDuplexMap(levelData);
    callerDepth=callerDepth.nextDepth();
    calleeDepth=calleeDepth.nextDepth();
  }
  if (!emulationLinkMarker.isEmpty()) {
    logger.debug("String_Node_Str",emulationLinkMarker.size());
    checkUnsearchEmulationCalleeNode(linkDataDuplexMap,range);
    fillEmulationLink(linkDataDuplexMap);
  }
  return linkDataDuplexMap;
}

Fixed version (ground truth):
public LinkDataDuplexMap select(Application sourceApplication,Range range,SearchOption searchOption){
  if (searchOption == null) {
    throw new NullPointerException("String_Node_Str");
  }
  SearchDepth callerDepth=new SearchDepth(searchOption.getCallerSearchDepth());
  SearchDepth calleeDepth=new SearchDepth(searchOption.getCalleeSearchDepth());
  logger.debug("String_Node_Str",sourceApplication);
  addNextNode(sourceApplication);
  LinkDataDuplexMap linkDataDuplexMap=new LinkDataDuplexMap();
  while (!this.nextQueue.isEmpty()) {
    final List<Application> currentNode=this.nextQueue.copyAndClear();
    logger.debug("String_Node_Str",currentNode.size(),callerDepth.getDepth(),calleeDepth.getDepth(),currentNode);
    LinkDataDuplexMap levelData=selectLink(currentNode,range,callerDepth,calleeDepth);
    linkDataDuplexMap.addLinkDataDuplexMap(levelData);
    callerDepth=callerDepth.nextDepth();
    calleeDepth=calleeDepth.nextDepth();
  }
  if (!emulationLinkMarker.isEmpty()) {
    logger.debug("String_Node_Str",emulationLinkMarker.size());
    checkUnsearchEmulationCalleeNode(linkDataDuplexMap,range);
    fillEmulationLink(linkDataDuplexMap,range);
  }
  return linkDataDuplexMap;
}
Program: 53640
Project: 53640
Buggy source:
@Override public void handleStreamData(ClientStreamChannelContext streamChannelContext,StreamResponsePacket packet){
  LOGGER.info("String_Node_Str",streamChannelContext,packet);
}

Fixed version (ground truth):
@Override public void handleStreamData(ClientStreamChannelContext streamChannelContext,StreamResponsePacket packet){
  LOGGER.debug("String_Node_Str",streamChannelContext,packet);
}
Program: 53641
Project: 53641
Buggy source:
private void sendPingMessage(WebSocketSession session,TextMessage pingMessage){
  try {
    session.sendMessage(pingMessage);
  }
 catch (  IOException e) {
    logger.warn(e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void sendPingMessage(WebSocketSession session,TextMessage pingMessage){
  try {
    session.sendMessage(pingMessage);
  }
 catch (  Exception e) {
    logger.warn(e.getMessage(),e);
    closeSession(session,CloseStatus.SERVER_ERROR);
  }
}
Program: 53642
Project: 53642
Buggy source:
private void closeSession(WebSocketSession session,CloseStatus status){
  try {
    session.close(status);
  }
 catch (  IOException e) {
    logger.warn(e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void closeSession(WebSocketSession session,CloseStatus status){
  try {
    session.close(status);
  }
 catch (  Exception e) {
    logger.warn(e.getMessage(),e);
  }
}
Program: 53643
Project: 53643
Buggy source:
@Override public void flush() throws Exception {
  logger.info("String_Node_Str",applicationName);
  if (isStopped) {
    return;
  }
  AgentActiveThreadCountList response=new AgentActiveThreadCountList();
synchronized (aggregatorLock) {
    for (    ActiveThreadCountWorker activeThreadCountWorker : activeThreadCountWorkerRepository.values()) {
      String agentId=activeThreadCountWorker.getAgentId();
      AgentActiveThreadCount agentActiveThreadCount=activeThreadCountMap.get(agentId);
      if (agentActiveThreadCount != null) {
        response.add(agentActiveThreadCount);
      }
 else {
        response.add(activeThreadCountWorker.getDefaultFailedResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  flush0(response);
}

Fixed version (ground truth):
@Override public void flush() throws Exception {
  if ((flushCount.getAndIncrement() % flushLogRecordRate) == 0) {
    logger.info("String_Node_Str",applicationName);
  }
  if (isStopped) {
    return;
  }
  AgentActiveThreadCountList response=new AgentActiveThreadCountList();
synchronized (aggregatorLock) {
    for (    ActiveThreadCountWorker activeThreadCountWorker : activeThreadCountWorkerRepository.values()) {
      String agentId=activeThreadCountWorker.getAgentId();
      AgentActiveThreadCount agentActiveThreadCount=activeThreadCountMap.get(agentId);
      if (agentActiveThreadCount != null) {
        response.add(agentActiveThreadCount);
      }
 else {
        response.add(activeThreadCountWorker.getDefaultFailedResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  flush0(response);
}
Program: 53644
Project: 53644
Buggy source:
private void flush0(AgentActiveThreadCountList activeThreadCountList){
  Map resultMap=createResultMap(activeThreadCountList,System.currentTimeMillis());
  try {
    TextMessage responseTextMessage=new TextMessage(messageConverter.getResponseTextMessage(ActiveThreadCountHandler.API_ACTIVE_THREAD_COUNT,resultMap));
    for (    WebSocketSession webSocketSession : webSocketSessions) {
      try {
        logger.debug("String_Node_Str",webSocketSession,responseTextMessage);
        webSocketSession.sendMessage(responseTextMessage);
      }
 catch (      IOException e) {
        logger.warn(e.getMessage(),e);
      }
    }
  }
 catch (  JsonProcessingException e) {
    logger.warn("String_Node_Str",resultMap,e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void flush0(AgentActiveThreadCountList activeThreadCountList){
  Map resultMap=createResultMap(activeThreadCountList,System.currentTimeMillis());
  try {
    TextMessage responseTextMessage=new TextMessage(messageConverter.getResponseTextMessage(ActiveThreadCountHandler.API_ACTIVE_THREAD_COUNT,resultMap));
    for (    WebSocketSession webSocketSession : webSocketSessions) {
      try {
        logger.debug("String_Node_Str",webSocketSession,responseTextMessage);
        webSocketSession.sendMessage(responseTextMessage);
      }
 catch (      Exception e) {
        logger.warn("String_Node_Str",webSocketSession,applicationName,e.getMessage(),e);
      }
    }
  }
 catch (  JsonProcessingException e) {
    logger.warn("String_Node_Str",applicationName,resultMap,e.getMessage(),e);
  }
}
Program: 53645
Project: 53645
Buggy source:
public DefaultAgentOption(final String agentArgs,final Instrumentation instrumentation,final ProfilerConfig profilerConfig,final URL[] pluginJars,final String bootStrapJarPath,final ServiceTypeRegistryService serviceTypeRegistryService,final AnnotationKeyRegistryService annotationKeyRegistryService){
  if (instrumentation == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (profilerConfig == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (pluginJars == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (annotationKeyRegistryService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serviceTypeRegistryService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentArgs=agentArgs;
  this.instrumentation=instrumentation;
  this.profilerConfig=profilerConfig;
  this.pluginJars=pluginJars;
  this.bootStrapJarPath=bootStrapJarPath;
  this.serviceTypeRegistryService=serviceTypeRegistryService;
  this.annotationKeyRegistryService=annotationKeyRegistryService;
}

Fixed version (ground truth):
public DefaultAgentOption(final String agentArgs,final Instrumentation instrumentation,final ProfilerConfig profilerConfig,final URL[] pluginJars,final String bootStrapJarCorePath,final ServiceTypeRegistryService serviceTypeRegistryService,final AnnotationKeyRegistryService annotationKeyRegistryService){
  if (instrumentation == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (profilerConfig == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (pluginJars == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (annotationKeyRegistryService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serviceTypeRegistryService == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentArgs=agentArgs;
  this.instrumentation=instrumentation;
  this.profilerConfig=profilerConfig;
  this.pluginJars=pluginJars;
  this.bootStrapJarCorePath=bootStrapJarCorePath;
  this.serviceTypeRegistryService=serviceTypeRegistryService;
  this.annotationKeyRegistryService=annotationKeyRegistryService;
}
Program: 53647
Project: 53647
Buggy source:
private AgentOption createAgentOption(String agentArgs,Instrumentation instrumentation,ProfilerConfig profilerConfig,URL[] pluginJars,String bootStrapJarPath,ServiceTypeRegistryService serviceTypeRegistryService,AnnotationKeyRegistryService annotationKeyRegistryService){
  return new DefaultAgentOption(agentArgs,instrumentation,profilerConfig,pluginJars,bootStrapJarPath,serviceTypeRegistryService,annotationKeyRegistryService);
}

Fixed version (ground truth):
private AgentOption createAgentOption(String agentArgs,Instrumentation instrumentation,ProfilerConfig profilerConfig,URL[] pluginJars,String bootStrapJarPath,ServiceTypeRegistryService serviceTypeRegistryService,AnnotationKeyRegistryService annotationKeyRegistryService,String bootStrapCoreJar){
  return new DefaultAgentOption(agentArgs,instrumentation,profilerConfig,pluginJars,bootStrapJarPath,serviceTypeRegistryService,annotationKeyRegistryService);
}
Program: 53648
Project: 53648
Buggy source:
protected List<DefaultProfilerPluginContext> loadPlugins(AgentOption agentOption){
  return new ProfilerPluginLoader(this).load(agentOption.getPluginJars());
}

Fixed version (ground truth):
protected List<DefaultProfilerPluginContext> loadPlugins(AgentOption agentOption){
  final ProfilerPluginLoader loader=new ProfilerPluginLoader(this);
  return loader.load(agentOption.getPluginJars());
}
Program: 53650
Project: 53650
Buggy source:
@Override public ClassFileTransformer getTransformer(ClassLoader classLoader,String targetClassName){
  if (transformerMap.isEmpty()) {
    return null;
  }
  final TransformerKey key=new TransformerKey(classLoader,targetClassName);
  final ClassFileTransformer transformer=transformerMap.remove(key);
  if (logger.isDebugEnabled()) {
    logger.info("String_Node_Str",classLoader,targetClassName,transformerMap.size());
  }
  return transformer;
}

Fixed version (ground truth):
@Override public ClassFileTransformer getTransformer(ClassLoader classLoader,String targetClassName){
  if (transformerMap.isEmpty()) {
    return null;
  }
  final TransformerKey key=new TransformerKey(classLoader,targetClassName);
  final ClassFileTransformer transformer=transformerMap.remove(key);
  if (transformer != null) {
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str",classLoader,targetClassName,transformerMap.size());
    }
  }
  return transformer;
}
Program: 53651
Project: 53651
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public <T>Class<? extends T> injectClass(ClassLoader classLoader,String className){
  try {
    if (classLoader == null) {
      return (Class<T>)injectToBootstrapClassLoader(className);
    }
 else     if (classLoader instanceof URLClassLoader) {
      return (Class<T>)injectToURLClassLoader((URLClassLoader)classLoader,className);
    }
 else {
      return (Class<T>)injectToPlainClassLoader(classLoader,className);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",className,classLoader,e);
    throw new PinpointException("String_Node_Str" + className + "String_Node_Str"+ classLoader,e);
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public <T>Class<? extends T> injectClass(ClassLoader classLoader,String className){
  try {
    if (classLoader == null) {
      return (Class<T>)injectToBootstrapClassLoader(className);
    }
 else     if (classLoader instanceof URLClassLoader) {
      final URLClassLoader urlClassLoader=(URLClassLoader)classLoader;
      return (Class<T>)injectToURLClassLoader(urlClassLoader,className);
    }
 else {
      return (Class<T>)injectToPlainClassLoader(classLoader,className);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str",className,classLoader,e);
    throw new PinpointException("String_Node_Str" + className + "String_Node_Str"+ classLoader,e);
  }
}
Program: 53653
Project: 53653
Buggy source:
private Class<?> injectToBootstrapClassLoader(String className) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
synchronized (lock) {
    if (this.injectedToRoot == false) {
      this.injectedToRoot=true;
      instrumentation.appendToBootstrapClassLoaderSearch(pluginJar);
      classPool.appendToBootstrapClassPath(pluginJar.getName());
    }
  }
  return Class.forName(className,false,null);
}

Fixed version (ground truth):
private Class<?> injectToBootstrapClassLoader(String className) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
synchronized (lock) {
    if (this.injectedToRoot == false) {
      this.injectedToRoot=true;
      pluginConfig.getInstrumentation().appendToBootstrapClassLoaderSearch(pluginConfig.getPluginJarFile());
      pluginConfig.getClassPool().appendToBootstrapClassPath(pluginConfig.getPluginJarFile().getName());
    }
  }
  return Class.forName(className,false,null);
}
Program: 53654
Project: 53654
Buggy source:
private Class<?> injectToURLClassLoader(URLClassLoader classLoader,String className) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
  final URL[] urls=classLoader.getURLs();
  if (urls != null) {
    boolean hasPluginJar=false;
    for (    URL url : urls) {
      final String externalForm=url.toExternalForm();
      if (pluginJarURLExternalForm.equals(externalForm)) {
        hasPluginJar=true;
        break;
      }
    }
    if (!hasPluginJar) {
      ADD_URL.invoke(classLoader,pluginJarURL);
    }
  }
  return classLoader.loadClass(className);
}

Fixed version (ground truth):
private Class<?> injectToURLClassLoader(URLClassLoader classLoader,String className) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException, ClassNotFoundException {
  final URL[] urls=classLoader.getURLs();
  if (urls != null) {
    boolean hasPluginJar=false;
    for (    URL url : urls) {
      final String externalForm=url.toExternalForm();
      if (pluginConfig.getPluginJarURLExternalForm().equals(externalForm)) {
        hasPluginJar=true;
        break;
      }
    }
    if (!hasPluginJar) {
      ADD_URL.invoke(classLoader,pluginConfig.getPluginJar());
    }
  }
  return classLoader.loadClass(className);
}
Program: 53655
Project: 53655
Buggy source:
private JarProfilerPluginClassInjector(Instrumentation instrumentation,InstrumentClassPool classPool,URL pluginJarURL,JarFile pluginJar){
  this.instrumentation=instrumentation;
  this.classPool=classPool;
  this.pluginJarURL=pluginJarURL;
  this.pluginJarURLExternalForm=pluginJarURL.toExternalForm();
  this.pluginJar=pluginJar;
}

Fixed version (ground truth):
public JarProfilerPluginClassInjector(PluginConfig pluginConfig){
  if (pluginConfig == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.pluginConfig=pluginConfig;
}
Program: 53656
Project: 53656
Buggy source:
@Override public Set<AgentInfo> getAgentsByApplicationName(String applicationName,long timestamp,long timeDiff){
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (timeDiff > timestamp) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long eventTimestampFloor=timestamp - timeDiff;
  List<String> agentIds=this.applicationIndexDao.selectAgentIds(applicationName);
  List<AgentInfo> unfilteredAgentInfos=this.agentInfoDao.getAgentInfos(agentIds,timestamp);
  if (unfilteredAgentInfos == null || unfilteredAgentInfos.isEmpty()) {
    return Collections.emptySet();
  }
  this.agentLifeCycleDao.populateAgentStatuses(unfilteredAgentInfos,timestamp);
  Set<AgentInfo> filteredAgentInfos=new HashSet<>();
  for (  AgentInfo agentInfo : unfilteredAgentInfos) {
    AgentStatus agentStatus=agentInfo.getStatus();
    if (AgentLifeCycleState.UNKNOWN == agentStatus.getState() || eventTimestampFloor <= agentStatus.getEventTimestamp()) {
      filteredAgentInfos.add(agentInfo);
    }
  }
  return filteredAgentInfos;
}

Fixed version (ground truth):
@Override public Set<AgentInfo> getAgentsByApplicationName(String applicationName,long timestamp,long timeDiff){
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (timeDiff > timestamp) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long eventTimestampFloor=timestamp - timeDiff;
  List<String> agentIds=this.applicationIndexDao.selectAgentIds(applicationName);
  List<AgentInfo> unfilteredAgentInfos=this.agentInfoDao.getAgentInfos(agentIds,timestamp);
  if (unfilteredAgentInfos == null || unfilteredAgentInfos.isEmpty()) {
    return Collections.emptySet();
  }
  CollectionUtils.filter(unfilteredAgentInfos,PredicateUtils.notNullPredicate());
  this.agentLifeCycleDao.populateAgentStatuses(unfilteredAgentInfos,timestamp);
  Set<AgentInfo> filteredAgentInfos=new HashSet<>();
  for (  AgentInfo agentInfo : unfilteredAgentInfos) {
    AgentStatus agentStatus=agentInfo.getStatus();
    if (AgentLifeCycleState.UNKNOWN == agentStatus.getState() || eventTimestampFloor <= agentStatus.getEventTimestamp()) {
      filteredAgentInfos.add(agentInfo);
    }
  }
  return filteredAgentInfos;
}
Program: 53657
Project: 53657
Buggy source:
private boolean isAgentRunning(AgentInfo agentInfo){
  return agentInfo.getStatus().getState() == AgentLifeCycleState.RUNNING;
}

Fixed version (ground truth):
private boolean isAgentRunning(AgentInfo agentInfo){
  if (agentInfo.getStatus() != null) {
    return agentInfo.getStatus().getState() == AgentLifeCycleState.RUNNING;
  }
 else {
    return false;
  }
}
Program: 53658
Project: 53658
Buggy source:
public void appendAgentInfo(NodeList nodeList,LinkDataDuplexMap linkDataDuplexMap,AgentInfoService agentInfoService){
  for (  Node node : nodeList.getNodeList()) {
    appendServerInfo(node,linkDataDuplexMap,agentInfoService);
  }
}

Fixed version (ground truth):
public void appendAgentInfo(NodeList nodeList,LinkDataDuplexMap linkDataDuplexMap,AgentInfoPopulator agentInfoPopulator){
  for (  Node node : nodeList.getNodeList()) {
    appendServerInfo(node,linkDataDuplexMap,agentInfoPopulator);
  }
}
Program: 53659
Project: 53659
Buggy source:
private void appendServerInfo(Node node,LinkDataDuplexMap linkDataDuplexMap,AgentInfoService agentInfoService){
  final ServiceType nodeServiceType=node.getServiceType();
  if (nodeServiceType.isUnknown()) {
    return;
  }
  if (nodeServiceType.isTerminal()) {
    ServerBuilder builder=new ServerBuilder();
    for (    LinkData linkData : linkDataDuplexMap.getSourceLinkDataList()) {
      Application toApplication=linkData.getToApplication();
      if (node.getApplication().equals(toApplication)) {
        builder.addCallHistogramList(linkData.getTargetList());
      }
    }
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else   if (nodeServiceType.isWas()) {
    Set<AgentInfo> agentList=agentInfoService.getAgentsByApplicationName(node.getApplication().getName(),range.getTo());
    if (agentList.isEmpty()) {
      logger.warn("String_Node_Str",node.getApplication());
      node.setServerInstanceList(new ServerInstanceList());
      return;
    }
    logger.debug("String_Node_Str",node.getApplication(),agentList);
    ServerBuilder builder=new ServerBuilder();
    agentList=filterAgentInfoByResponseData(agentList,node);
    builder.addAgentInfo(agentList);
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else {
    node.setServerInstanceList(new ServerInstanceList());
  }
}

Fixed version (ground truth):
private void appendServerInfo(Node node,LinkDataDuplexMap linkDataDuplexMap,AgentInfoPopulator agentInfoPopulator){
  final ServiceType nodeServiceType=node.getServiceType();
  if (nodeServiceType.isUnknown()) {
    return;
  }
  if (nodeServiceType.isTerminal()) {
    ServerBuilder builder=new ServerBuilder();
    for (    LinkData linkData : linkDataDuplexMap.getSourceLinkDataList()) {
      Application toApplication=linkData.getToApplication();
      if (node.getApplication().equals(toApplication)) {
        builder.addCallHistogramList(linkData.getTargetList());
      }
    }
    ServerInstanceList serverInstanceList=builder.build();
    node.setServerInstanceList(serverInstanceList);
  }
 else   if (nodeServiceType.isWas()) {
    agentInfoPopulator.addAgentInfos(node);
  }
 else {
    node.setServerInstanceList(new ServerInstanceList());
  }
}
Program: 53660
Project: 53660
Buggy source:
public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap,AgentInfoService agentInfoService,final ResponseHistogramBuilder mapHistogramSummary){
  NodeHistogramDataSource responseSource=new NodeHistogramDataSource(){
    @Override public NodeHistogram createNodeHistogram(    Application application){
      List<ResponseTime> responseHistogram=mapHistogramSummary.getResponseTimeList(application);
      final NodeHistogram nodeHistogram=new NodeHistogram(application,range,responseHistogram);
      return nodeHistogram;
    }
  }
;
  return this.build(linkDataDuplexMap,agentInfoService,responseSource);
}

Fixed version (ground truth):
public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap,final ResponseHistogramBuilder mapHistogramSummary){
  AgentInfoPopulator emptyPopulator=new AgentInfoPopulator(){
    @Override public void addAgentInfos(    Node node){
      node.setServerInstanceList(new ServerInstanceList());
    }
  }
;
  NodeHistogramDataSource responseSource=new NodeHistogramDataSource(){
    @Override public NodeHistogram createNodeHistogram(    Application application){
      List<ResponseTime> responseHistogram=mapHistogramSummary.getResponseTimeList(application);
      final NodeHistogram nodeHistogram=new NodeHistogram(application,range,responseHistogram);
      return nodeHistogram;
    }
  }
;
  return this.build(linkDataDuplexMap,emptyPopulator,responseSource);
}
Program: 53661
Project: 53661
Buggy source:
/** 
 * Returns the information of the agent with its start time closest to the given timestamp
 * @param agentId
 * @param timestamp
 * @return
 */
@Override public AgentInfo getAgentInfo(final String agentId,final long timestamp){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Scan scan=createScan(agentId,timestamp);
  AgentInfo agentInfo=this.hbaseOperations2.find(HBaseTables.AGENTINFO,scan,new AgentInfoResultsExtractor());
  if (agentInfo != null) {
    this.agentLifeCycleDao.populateAgentStatus(agentInfo,timestamp);
  }
  return agentInfo;
}

Fixed version (ground truth):
/** 
 * Returns the information of the agent with its start time closest to the given timestamp
 * @param agentId
 * @param timestamp
 * @return
 */
@Override public AgentInfo getAgentInfo(final String agentId,final long timestamp){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Scan scan=createScan(agentId,timestamp);
  return this.hbaseOperations2.find(HBaseTables.AGENTINFO,scan,new AgentInfoResultsExtractor());
}
Program: 53662
Project: 53662
Buggy source:
@Override public List<AgentInfo> getAgentInfos(List<String> agentIds,long timestamp){
  if (CollectionUtils.isEmpty(agentIds)) {
    return Collections.emptyList();
  }
  List<Scan> scans=new ArrayList<>(agentIds.size());
  for (  String agentId : agentIds) {
    scans.add(createScan(agentId,timestamp));
  }
  List<AgentInfo> agentInfos=this.hbaseOperations2.findParallel(HBaseTables.AGENTINFO,scans,new AgentInfoResultsExtractor());
  this.agentLifeCycleDao.populateAgentStatuses(agentInfos,timestamp);
  return agentInfos;
}

Fixed version (ground truth):
@Override public List<AgentInfo> getAgentInfos(List<String> agentIds,long timestamp){
  if (CollectionUtils.isEmpty(agentIds)) {
    return Collections.emptyList();
  }
  List<Scan> scans=new ArrayList<>(agentIds.size());
  for (  String agentId : agentIds) {
    scans.add(createScan(agentId,timestamp));
  }
  return this.hbaseOperations2.findParallel(HBaseTables.AGENTINFO,scans,new AgentInfoResultsExtractor());
}
Program: 53663
Project: 53663
Buggy source:
@Override public ApplicationAgentList getApplicationAgentList(ApplicationAgentList.Key applicationAgentListKey,String applicationName,long timestamp){
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationAgentListKey == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final List<String> agentIdList=this.applicationIndexDao.selectAgentIds(applicationName);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",agentIdList);
  }
  if (CollectionUtils.isEmpty(agentIdList)) {
    logger.debug("String_Node_Str",applicationName);
    return new ApplicationAgentList(new TreeMap<String,List<AgentInfo>>());
  }
  SortedMap<String,List<AgentInfo>> result=new TreeMap<>();
  List<AgentInfo> agentInfos=this.agentInfoDao.getAgentInfos(agentIdList,timestamp);
  for (  AgentInfo agentInfo : agentInfos) {
    if (agentInfo != null) {
      String hostname=applicationAgentListKey.getKey(agentInfo);
      if (result.containsKey(hostname)) {
        result.get(hostname).add(agentInfo);
      }
 else {
        List<AgentInfo> list=new ArrayList<>();
        list.add(agentInfo);
        result.put(hostname,list);
      }
    }
  }
  for (  List<AgentInfo> agentInfoList : result.values()) {
    Collections.sort(agentInfoList,AgentInfo.AGENT_NAME_ASC_COMPARATOR);
  }
  logger.info("String_Node_Str",result);
  return new ApplicationAgentList(result);
}

Fixed version (ground truth):
@Override public ApplicationAgentList getApplicationAgentList(ApplicationAgentList.Key applicationAgentListKey,String applicationName,long timestamp){
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationAgentListKey == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final List<String> agentIdList=this.applicationIndexDao.selectAgentIds(applicationName);
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str",agentIdList);
  }
  if (CollectionUtils.isEmpty(agentIdList)) {
    logger.debug("String_Node_Str",applicationName);
    return new ApplicationAgentList(new TreeMap<String,List<AgentInfo>>());
  }
  SortedMap<String,List<AgentInfo>> result=new TreeMap<>();
  List<AgentInfo> agentInfos=this.agentInfoDao.getAgentInfos(agentIdList,timestamp);
  this.agentLifeCycleDao.populateAgentStatuses(agentInfos,timestamp);
  for (  AgentInfo agentInfo : agentInfos) {
    if (agentInfo != null) {
      String hostname=applicationAgentListKey.getKey(agentInfo);
      if (result.containsKey(hostname)) {
        result.get(hostname).add(agentInfo);
      }
 else {
        List<AgentInfo> list=new ArrayList<>();
        list.add(agentInfo);
        result.put(hostname,list);
      }
    }
  }
  for (  List<AgentInfo> agentInfoList : result.values()) {
    Collections.sort(agentInfoList,AgentInfo.AGENT_NAME_ASC_COMPARATOR);
  }
  logger.info("String_Node_Str",result);
  return new ApplicationAgentList(result);
}
Program: 53664
Project: 53664
Buggy source:
@Override public AgentInfo getAgentInfo(String agentId,long timestamp){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return this.agentInfoDao.getAgentInfo(agentId,timestamp);
}

Fixed version (ground truth):
@Override public AgentInfo getAgentInfo(String agentId,long timestamp){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  AgentInfo agentInfo=this.agentInfoDao.getAgentInfo(agentId,timestamp);
  if (agentInfo != null) {
    this.agentLifeCycleDao.populateAgentStatus(agentInfo,timestamp);
  }
  return agentInfo;
}
Program: 53665
Project: 53665
Buggy source:
@Override public Set<AgentInfo> getAgentsByApplicationName(String applicationName,long timestamp,long timeDiff){
  if (timeDiff > timestamp) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long eventTimestampFloor=timestamp - timeDiff;
  Set<AgentInfo> unfilteredAgentInfos=this.getAgentsByApplicationName(applicationName,timestamp);
  if (unfilteredAgentInfos == null || unfilteredAgentInfos.isEmpty()) {
    return Collections.emptySet();
  }
  Set<AgentInfo> filteredAgentInfos=new HashSet<>();
  for (  AgentInfo agentInfo : unfilteredAgentInfos) {
    AgentStatus agentStatus=agentInfo.getStatus();
    if (AgentLifeCycleState.UNKNOWN == agentStatus.getState() || eventTimestampFloor <= agentStatus.getEventTimestamp()) {
      filteredAgentInfos.add(agentInfo);
    }
  }
  return filteredAgentInfos;
}

Fixed version (ground truth):
@Override public Set<AgentInfo> getAgentsByApplicationName(String applicationName,long timestamp,long timeDiff){
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (timestamp < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (timeDiff > timestamp) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final long eventTimestampFloor=timestamp - timeDiff;
  List<String> agentIds=this.applicationIndexDao.selectAgentIds(applicationName);
  List<AgentInfo> unfilteredAgentInfos=this.agentInfoDao.getAgentInfos(agentIds,timestamp);
  if (unfilteredAgentInfos == null || unfilteredAgentInfos.isEmpty()) {
    return Collections.emptySet();
  }
  this.agentLifeCycleDao.populateAgentStatuses(unfilteredAgentInfos,timestamp);
  Set<AgentInfo> filteredAgentInfos=new HashSet<>();
  for (  AgentInfo agentInfo : unfilteredAgentInfos) {
    AgentStatus agentStatus=agentInfo.getStatus();
    if (AgentLifeCycleState.UNKNOWN == agentStatus.getState() || eventTimestampFloor <= agentStatus.getEventTimestamp()) {
      filteredAgentInfos.add(agentInfo);
    }
  }
  return filteredAgentInfos;
}
Program: 53668
Project: 53668
Buggy source:
private List<AgentEvent> createAgentEvents(List<AgentEventBo> agentEventBos,boolean includeEventMessage){
  List<AgentEvent> agentEvents=new ArrayList<>(agentEventBos.size());
  PriorityQueue<DurationalAgentEvent> durationalAgentEvents=new PriorityQueue<>(agentEventBos.size(),AgentEvent.EVENT_TIMESTAMP_ASC_COMPARATOR);
  for (  AgentEventBo agentEventBo : agentEventBos) {
    if (agentEventBo.getEventType().isCategorizedAs(AgentEventTypeCategory.DURATIONAL)) {
      durationalAgentEvents.add(createDurationalAgentEvent(agentEventBo,includeEventMessage));
    }
 else {
      agentEvents.add(createAgentEvent(agentEventBo,includeEventMessage));
    }
  }
  long durationStartTimestamp=DurationalAgentEvent.UNKNOWN_TIMESTAMP;
  while (!durationalAgentEvents.isEmpty()) {
    DurationalAgentEvent currentEvent=durationalAgentEvents.remove();
    currentEvent.setDurationStartTimestamp(durationStartTimestamp);
    DurationalAgentEvent nextEvent=durationalAgentEvents.peek();
    if (nextEvent != null) {
      long nextEventTimestamp=nextEvent.getEventTimestamp();
      currentEvent.setDurationEndTimestamp(nextEventTimestamp);
      durationStartTimestamp=nextEventTimestamp;
    }
    agentEvents.add(currentEvent);
  }
  return agentEvents;
}

Fixed version (ground truth):
private List<AgentEvent> createAgentEvents(List<AgentEventBo> agentEventBos,boolean includeEventMessage){
  if (CollectionUtils.isEmpty(agentEventBos)) {
    return Collections.emptyList();
  }
  List<AgentEvent> agentEvents=new ArrayList<>(agentEventBos.size());
  PriorityQueue<DurationalAgentEvent> durationalAgentEvents=new PriorityQueue<>(agentEventBos.size(),AgentEvent.EVENT_TIMESTAMP_ASC_COMPARATOR);
  for (  AgentEventBo agentEventBo : agentEventBos) {
    if (agentEventBo.getEventType().isCategorizedAs(AgentEventTypeCategory.DURATIONAL)) {
      durationalAgentEvents.add(createDurationalAgentEvent(agentEventBo,includeEventMessage));
    }
 else {
      agentEvents.add(createAgentEvent(agentEventBo,includeEventMessage));
    }
  }
  long durationStartTimestamp=DurationalAgentEvent.UNKNOWN_TIMESTAMP;
  while (!durationalAgentEvents.isEmpty()) {
    DurationalAgentEvent currentEvent=durationalAgentEvents.remove();
    currentEvent.setDurationStartTimestamp(durationStartTimestamp);
    DurationalAgentEvent nextEvent=durationalAgentEvents.peek();
    if (nextEvent != null) {
      long nextEventTimestamp=nextEvent.getEventTimestamp();
      currentEvent.setDurationEndTimestamp(nextEventTimestamp);
      durationStartTimestamp=nextEventTimestamp;
    }
    agentEvents.add(currentEvent);
  }
  return agentEvents;
}