nus-yam/ex-repair huggingface dataset:
Program: 53579
Project: 53579
Buggy source:
public CommandHeaderTBaseDeserializerFactory(){
  TBaseLocator commandTbaseLocator=commandTbaseLocator=new TCommandRegistry(Arrays.asList(TCommandType.values()));
  TProtocolFactory protocolFactory=new TCompactProtocol.Factory();
  HeaderTBaseDeserializerFactory deserializerFactory=new HeaderTBaseDeserializerFactory(protocolFactory,commandTbaseLocator);
  this.factory=new ThreadLocalHeaderTBaseDeserializerFactory<HeaderTBaseDeserializer>(deserializerFactory);
}

Fixed version (ground truth):
public CommandHeaderTBaseDeserializerFactory(){
  TBaseLocator commandTbaseLocator=new TCommandRegistry(Arrays.asList(TCommandType.values()));
  TProtocolFactory protocolFactory=new TCompactProtocol.Factory();
  HeaderTBaseDeserializerFactory deserializerFactory=new HeaderTBaseDeserializerFactory(protocolFactory,commandTbaseLocator);
  this.factory=new ThreadLocalHeaderTBaseDeserializerFactory<HeaderTBaseDeserializer>(deserializerFactory);
}
Program: 53580
Project: 53580
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,params={"String_Node_Str","String_Node_Str"}) @ResponseBody public List<AgentCountStatistics> selectAgentCount(@RequestParam("String_Node_Str") long from,@RequestParam("String_Node_Str") long to){
  Range range=new Range(DateUtils.timestampToMidNight(from),DateUtils.timestampToMidNight(to),true);
  List<AgentCountStatistics> agentCountStatisticsList=agentStatisticsService.selectAgentCount(range);
  Collections.sort(agentCountStatisticsList,new Comparator<AgentCountStatistics>(){
    @Override public int compare(    AgentCountStatistics o1,    AgentCountStatistics o2){
      o1.getTimestamp();
      o2.getTimestamp();
      if (o1.getTimestamp() > o2.getTimestamp()) {
        return -1;
      }
 else {
        return 1;
      }
    }
  }
);
  return agentCountStatisticsList;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET,params={"String_Node_Str","String_Node_Str"}) @ResponseBody public List<AgentCountStatistics> selectAgentCount(@RequestParam("String_Node_Str") long from,@RequestParam("String_Node_Str") long to){
  Range range=new Range(DateUtils.timestampToMidNight(from),DateUtils.timestampToMidNight(to),true);
  List<AgentCountStatistics> agentCountStatisticsList=agentStatisticsService.selectAgentCount(range);
  Collections.sort(agentCountStatisticsList,new Comparator<AgentCountStatistics>(){
    @Override public int compare(    AgentCountStatistics o1,    AgentCountStatistics o2){
      if (o1.getTimestamp() > o2.getTimestamp()) {
        return -1;
      }
 else {
        return 1;
      }
    }
  }
);
  return agentCountStatisticsList;
}
Program: 53581
Project: 53581
Buggy source:
@Override public int compare(AgentCountStatistics o1,AgentCountStatistics o2){
  o1.getTimestamp();
  o2.getTimestamp();
  if (o1.getTimestamp() > o2.getTimestamp()) {
    return -1;
  }
 else {
    return 1;
  }
}

Fixed version (ground truth):
@Override public int compare(AgentCountStatistics o1,AgentCountStatistics o2){
  if (o1.getTimestamp() > o2.getTimestamp()) {
    return -1;
  }
 else {
    return 1;
  }
}
Program: 53582
Project: 53582
Buggy source:
private PinpointRouteResponse getResponse(Future<ResponseMessage> future,long timeout){
  if (future == null) {
    return new FailedPinpointRouteResponse(TRouteResult.NOT_FOUND,null);
  }
  boolean completed=future.await(DEFAULT_FUTURE_TIMEOUT);
  if (completed) {
    DefaultPinpointRouteResponse response=new DefaultPinpointRouteResponse(future.getResult().getMessage());
    response.parse(commandDeserializerFactory);
    return response;
  }
 else {
    return new FailedPinpointRouteResponse(TRouteResult.TIMEOUT,null);
  }
}

Fixed version (ground truth):
private PinpointRouteResponse getResponse(Future<ResponseMessage> future,long timeout){
  if (future == null) {
    return new FailedPinpointRouteResponse(TRouteResult.NOT_FOUND,null);
  }
  boolean completed=future.await(timeout);
  if (completed) {
    DefaultPinpointRouteResponse response=new DefaultPinpointRouteResponse(future.getResult().getMessage());
    response.parse(commandDeserializerFactory);
    return response;
  }
 else {
    return new FailedPinpointRouteResponse(TRouteResult.TIMEOUT,null);
  }
}
Program: 53584
Project: 53584
Buggy source:
@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.getDefaultFailResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  TextMessage webSocketTextMessage=createWebSocketTextMessage(response);
  if (webSocketTextMessage != null) {
    if (executor == null) {
      flush0(webSocketTextMessage);
    }
 else {
      flushAsync0(webSocketTextMessage,executor);
    }
  }
}

Fixed version (ground truth):
@Override public void flush(Executor executor) throws Exception {
  if ((flushCount.getAndIncrement() % LOG_RECORD_RATE) == 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.getDefaultFailResponse());
      }
    }
    activeThreadCountMap=new HashMap<>(activeThreadCountWorkerRepository.size());
  }
  TextMessage webSocketTextMessage=createWebSocketTextMessage(response);
  if (webSocketTextMessage != null) {
    if (executor == null) {
      flush0(webSocketTextMessage);
    }
 else {
      flushAsync0(webSocketTextMessage,executor);
    }
  }
}
Program: 53585
Project: 53585
Buggy source:
@Inject public DefaultAgentInformationFactory(@AgentId String agentId,@ApplicationName String applicationName,@AgentStartTime long agentStartTime,@AgentServiceType ServiceType serverType){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serverType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentId=checkId(agentId);
  this.applicationName=checkId(applicationName);
  this.serverType=serverType;
  this.agentStartTime=agentStartTime;
}

Fixed version (ground truth):
@Inject public DefaultAgentInformationFactory(@AgentId String agentId,@ApplicationName String applicationName,@AgentStartTime long agentStartTime,@ApplicationServerType ServiceType serverType){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serverType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentId=checkId(agentId);
  this.applicationName=checkId(applicationName);
  this.serverType=serverType;
  this.agentStartTime=agentStartTime;
}
Program: 53586
Project: 53586
Buggy source:
private void bindAgentInformation(String agentId,String applicationName){
  bind(String.class).annotatedWith(AgentId.class).toInstance(agentId);
  bind(String.class).annotatedWith(ApplicationName.class).toInstance(applicationName);
  bind(Long.class).annotatedWith(AgentStartTime.class).toProvider(AgentStartTimeProvider.class);
  bind(ServiceType.class).annotatedWith(AgentServiceType.class).toProvider(AgentServiceTypeProvider.class);
}

Fixed version (ground truth):
private void bindAgentInformation(String agentId,String applicationName){
  bind(String.class).annotatedWith(AgentId.class).toInstance(agentId);
  bind(String.class).annotatedWith(ApplicationName.class).toInstance(applicationName);
  bind(Long.class).annotatedWith(AgentStartTime.class).toProvider(AgentStartTimeProvider.class);
  bind(ServiceType.class).annotatedWith(ApplicationServerType.class).toProvider(ApplicationServerTypeProvider.class);
}
Program: 53588
Project: 53588
Buggy source:
@Inject public AgentInformationProvider(@AgentId String agentId,@ApplicationName String applicationName,@AgentStartTime long agentStartTime,@AgentServiceType ServiceType serverType){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serverType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentId=agentId;
  this.applicationName=applicationName;
  this.agentStartTime=agentStartTime;
  this.serverType=serverType;
}

Fixed version (ground truth):
@Inject public AgentInformationProvider(@AgentId String agentId,@ApplicationName String applicationName,@AgentStartTime long agentStartTime,@ApplicationServerType ServiceType serverType){
  if (agentId == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (applicationName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (serverType == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.agentId=agentId;
  this.applicationName=applicationName;
  this.agentStartTime=agentStartTime;
  this.serverType=serverType;
}
Program: 53589
Project: 53589
Buggy source:
public ApplicationServerTypeResolver(PluginContextLoadResult plugins,@AgentServiceType ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ApplicationTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector)) {
      this.detectors.add(registeredDetectors.remove(orderedDetector));
    }
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}

Fixed version (ground truth):
public ApplicationServerTypeResolver(PluginContextLoadResult plugins,ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ApplicationTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector)) {
      this.detectors.add(registeredDetectors.remove(orderedDetector));
    }
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}
Program: 53590
Project: 53590
Buggy source:
public static <V>boolean isFirst(List<V> list,V object){
  V first=getFirst(list);
  return first.equals(object);
}

Fixed version (ground truth):
public static <V>boolean isFirst(List<V> list,V object){
  V first=getFirst(list);
  if (first == null) {
    return object == null;
  }
  return first.equals(object);
}
Program: 53591
Project: 53591
Buggy source:
public static <V>boolean isLast(List<V> list,V object){
  V last=getLast(list);
  return last.equals(object);
}

Fixed version (ground truth):
public static <V>boolean isLast(List<V> list,V object){
  V last=getLast(list);
  if (last == null) {
    return object == null;
  }
  return last.equals(object);
}
Program: 53592
Project: 53592
Buggy source:
public static <V>V getFirst(List<V> list,V defaultValue){
  int size=list.size();
  if (size > 0) {
    return list.get(0);
  }
 else {
    return defaultValue;
  }
}

Fixed version (ground truth):
public static <V>V getFirst(List<V> list,V defaultValue){
  if (list == null) {
    return defaultValue;
  }
  int size=list.size();
  if (size > 0) {
    return list.get(0);
  }
 else {
    return defaultValue;
  }
}
Program: 53593
Project: 53593
Buggy source:
public static <V>V getLast(List<V> list,V defaultValue){
  int size=list.size();
  if (size > 0) {
    return list.get(size - 1);
  }
 else {
    return defaultValue;
  }
}

Fixed version (ground truth):
public static <V>V getLast(List<V> list,V defaultValue){
  if (list == null) {
    return defaultValue;
  }
  int size=list.size();
  if (size > 0) {
    return list.get(size - 1);
  }
 else {
    return defaultValue;
  }
}
Program: 53594
Project: 53594
Buggy source:
@Test public void serializeTest() throws Exception {
  ThreadInfo[] allThreadInfo=ThreadMXBeanUtils.dumpAllThread();
  AgentActiveThreadDumpList activeThreadDumpList=createThreadDumpList(allThreadInfo);
  String jsonValue=mapper.writeValueAsString(activeThreadDumpList);
  List list=mapper.readValue(jsonValue,List.class);
  Assert.assertTrue(CollectionUtils.isNotEmpty(list));
  Map map=(Map)list.get(0);
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void serializeTest() throws Exception {
  ThreadInfo[] allThreadInfo=ThreadMXBeanUtils.dumpAllThread();
  AgentActiveThreadDumpList activeThreadDumpList=createThreadDumpList(allThreadInfo);
  String jsonValue=mapper.writeValueAsString(activeThreadDumpList);
  List list=mapper.readValue(jsonValue,List.class);
  Assert.assertTrue(CollectionUtils.isNotEmpty(list));
  Map map=(Map)list.get(0);
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
  Assert.assertTrue(map.containsKey("String_Node_Str"));
}
Program: 53595
Project: 53595
Buggy source:
@Test public void test() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  client.getParams().setSoTimeout(SO_TIMEOUT);
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}
Program: 53596
Project: 53596
Buggy source:
@Test public void hostConfig() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  HostConfiguration config=new HostConfiguration();
  config.setHost("String_Node_Str",80,"String_Node_Str");
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(config,method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}

Fixed version (ground truth):
@Test public void hostConfig() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  client.getParams().setSoTimeout(SO_TIMEOUT);
  HostConfiguration config=new HostConfiguration();
  config.setHost("String_Node_Str",80,"String_Node_Str");
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(config,method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}
Program: 53597
Project: 53597
Buggy source:
@Test public void test() throws Exception {
  HttpClient client=new HttpClient();
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}

Fixed version (ground truth):
@Test public void test() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}
Program: 53598
Project: 53598
Buggy source:
@Test public void hostConfig() throws Exception {
  HttpClient client=new HttpClient();
  HostConfiguration config=new HostConfiguration();
  config.setHost("String_Node_Str",80,"String_Node_Str");
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(config,method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}

Fixed version (ground truth):
@Test public void hostConfig() throws Exception {
  HttpClient client=new HttpClient();
  client.getParams().setConnectionManagerTimeout(CONNECTION_TIMEOUT);
  HostConfiguration config=new HostConfiguration();
  config.setHost("String_Node_Str",80,"String_Node_Str");
  GetMethod method=new GetMethod("String_Node_Str");
  method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,new DefaultHttpMethodRetryHandler(3,false));
  method.setQueryString(new NameValuePair[]{new NameValuePair("String_Node_Str","String_Node_Str")});
  try {
    client.executeMethod(config,method);
  }
 catch (  Exception ignored) {
  }
 finally {
    method.releaseConnection();
  }
  PluginTestVerifier verifier=PluginTestVerifierHolder.getInstance();
  verifier.printCache();
}
Program: 53599
Project: 53599
Buggy source:
@Override public InterceptorScope getInterceptorScope(String name){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  InterceptorScope scope=interceptorScopeList.get(name);
  if (scope == null) {
    scope=new DefaultInterceptorScope(name);
    interceptorScopeList.add(name,scope);
  }
  return scope;
}

Fixed version (ground truth):
@Override public InterceptorScope getInterceptorScope(String name){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return interceptorScopePool.add(name);
}
Program: 53600
Project: 53600
Buggy source:
@Override public V get(K key){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  return pool.get(key);
}

Fixed version (ground truth):
@Override public V get(K key){
  if (key == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final V alreadyExist=this.pool.get(key);
  if (alreadyExist != null) {
    return alreadyExist;
  }
  final V newValue=this.objectFactory.create(key);
  final V oldValue=this.pool.putIfAbsent(key,newValue);
  if (oldValue != null) {
    return oldValue;
  }
  return newValue;
}
Program: 53601
Project: 53601
Buggy source:
@Override public InterceptorScope getInterceptorScope(String name){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return interceptorScopePool.add(name);
}

Fixed version (ground truth):
@Override public InterceptorScope getInterceptorScope(String name){
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  return interceptorScopePool.get(name);
}
Program: 53602
Project: 53602
Buggy source:
@Test public void testConcurrentPool() throws Exception {
  InterceptorScopeFactory traceScopeFactory=new InterceptorScopeFactory();
  Pool<String,InterceptorScope> pool=new ConcurrentPool<String,InterceptorScope>(traceScopeFactory);
  final String OBJECT_NAME="String_Node_Str";
  Assert.assertNull(pool.get(OBJECT_NAME));
  InterceptorScope addedScope=pool.add(OBJECT_NAME);
  Assert.assertSame(pool.get(OBJECT_NAME),addedScope);
  InterceptorScope exist=pool.add(OBJECT_NAME);
  Assert.assertSame(exist,addedScope);
}

Fixed version (ground truth):
@Test public void testConcurrentPool() throws Exception {
  InterceptorScopeFactory traceScopeFactory=new InterceptorScopeFactory();
  Pool<String,InterceptorScope> pool=new ConcurrentPool<String,InterceptorScope>(traceScopeFactory);
  final String OBJECT_NAME="String_Node_Str";
  InterceptorScope addedScope=pool.get(OBJECT_NAME);
  Assert.assertSame(pool.get(OBJECT_NAME),addedScope);
  InterceptorScope exist=pool.get(OBJECT_NAME);
  Assert.assertSame(exist,addedScope);
  InterceptorScope another=pool.get("String_Node_Str");
  Assert.assertNotSame(exist,another);
}
Program: 53603
Project: 53603
Buggy source:
private void handleRequestMessage0(WebSocketSession webSocketSession,RequestMessage requestMessage){
  if (serverMapDataFilter != null && serverMapDataFilter.filter(webSocketSession,requestMessage)) {
    closeSession(webSocketSession,serverMapDataFilter.getCloseStatus(requestMessage));
    return;
  }
  String command=requestMessage.getCommand();
  if (API_ACTIVE_THREAD_COUNT.equals(command)) {
    String applicationName=MapUtils.getString(requestMessage.getParams(),APPLICATION_NAME_KEY);
    if (applicationName != null) {
synchronized (lock) {
        if (StringUtils.isEquals(applicationName,(String)webSocketSession.getAttributes().get(APPLICATION_NAME_KEY))) {
          return;
        }
        unbindingResponseAggregator(webSocketSession);
        bindingResponseAggregator(webSocketSession,applicationName);
      }
    }
  }
}

Fixed version (ground truth):
private void handleRequestMessage0(WebSocketSession webSocketSession,RequestMessage requestMessage){
  if (serverMapDataFilter != null && serverMapDataFilter.filter(webSocketSession,requestMessage)) {
    closeSession(webSocketSession,serverMapDataFilter.getCloseStatus(requestMessage));
    return;
  }
  String command=requestMessage.getCommand();
  if (API_ACTIVE_THREAD_COUNT.equals(command)) {
    String applicationName=MapUtils.getString(requestMessage.getParams(),APPLICATION_NAME_KEY);
    if (applicationName != null) {
synchronized (lock) {
        if (StringUtils.isEquals(applicationName,(String)webSocketSession.getAttributes().get(APPLICATION_NAME_KEY))) {
          return;
        }
        unbindingResponseAggregator(webSocketSession);
        if (webSocketSession.isOpen()) {
          bindingResponseAggregator(webSocketSession,applicationName);
        }
 else {
          logger.warn("String_Node_Str");
        }
      }
    }
  }
}
Program: 53604
Project: 53604
Buggy source:
@Override public List<List<SpanBo>> selectSpans(List<TransactionId> transactionIdList){
  List<List<SpanBo>> spanBos=this.master.selectSpans(transactionIdList);
  if (CollectionUtils.isNotEmpty(spanBos)) {
    return spanBos;
  }
  return slave.selectSpans(transactionIdList);
}

Fixed version (ground truth):
@Override public List<List<SpanBo>> selectSpans(List<TransactionId> transactionIdList){
  List<List<SpanBo>> spanBos=this.master.selectSpans(transactionIdList);
  if (CollectionUtils.isNotEmpty(spanBos)) {
    for (    List<SpanBo> spanBo : spanBos) {
      if (CollectionUtils.isNotEmpty(spanBo)) {
        return spanBos;
      }
    }
  }
  return slave.selectSpans(transactionIdList);
}
Program: 53605
Project: 53605
Buggy source:
@Override public List<List<SpanBo>> selectAllSpans(List<TransactionId> transactionIdList){
  List<List<SpanBo>> spanBos=this.master.selectAllSpans(transactionIdList);
  if (CollectionUtils.isNotEmpty(spanBos)) {
    return spanBos;
  }
  return slave.selectAllSpans(transactionIdList);
}

Fixed version (ground truth):
@Override public List<List<SpanBo>> selectAllSpans(List<TransactionId> transactionIdList){
  List<List<SpanBo>> spanBos=this.master.selectAllSpans(transactionIdList);
  if (CollectionUtils.isNotEmpty(spanBos)) {
    for (    List<SpanBo> spanBo : spanBos) {
      if (CollectionUtils.isNotEmpty(spanBo)) {
        return spanBos;
      }
    }
  }
  return slave.selectAllSpans(transactionIdList);
}
Program: 53606
Project: 53606
Buggy source:
public void clear(){
  cache=new Cache();
}

Fixed version (ground truth):
public void clear(){
  cache.clear();
}
Program: 53607
Project: 53607
Buggy source:
public TomcatConfiguration(ProfilerConfig config){
  this.tomcatHidePinpointHeader=config.readBoolean("String_Node_Str",true);
  final String tomcatExcludeURL=config.readString("String_Node_Str","String_Node_Str");
  if (!tomcatExcludeURL.isEmpty()) {
    this.tomcatExcludeUrlFilter=new ExcludePathFilter(tomcatExcludeURL);
  }
}

Fixed version (ground truth):
public TomcatConfiguration(ProfilerConfig config){
  this.tomcatHidePinpointHeader=config.readBoolean("String_Node_Str",true);
  if (config.getTomcatExcludeProfileMethodFilter() == null) {
    this.tomcatExcludeUrlFilter=new SkipFilter<String>();
  }
 else {
    this.tomcatExcludeUrlFilter=config.getTomcatExcludeUrlFilter();
  }
}
Program: 53608
Project: 53608
Buggy source:
public TomcatConfiguration(ProfilerConfig config){
  this.tomcatHidePinpointHeader=config.readBoolean("String_Node_Str",true);
  if (config.getTomcatExcludeProfileMethodFilter() == null) {
    this.tomcatExcludeUrlFilter=new SkipFilter<String>();
  }
 else {
    this.tomcatExcludeUrlFilter=config.getTomcatExcludeUrlFilter();
  }
}

Fixed version (ground truth):
public TomcatConfiguration(ProfilerConfig config){
  this.tomcatHidePinpointHeader=config.readBoolean("String_Node_Str",true);
  Filter<String> tomcatExcludeUrlFilter=config.getTomcatExcludeUrlFilter();
  if (tomcatExcludeUrlFilter == null) {
    this.tomcatExcludeUrlFilter=new SkipFilter<String>();
  }
 else {
    this.tomcatExcludeUrlFilter=tomcatExcludeUrlFilter;
  }
}
Program: 53609
Project: 53609
Buggy source:
@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);
}

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: 53610
Project: 53610
Buggy source:
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);
  }
}

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: 53611
Project: 53611
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 (webSocketflushExecutor != null) {
    webSocketflushExecutor.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: 53612
Project: 53612
Buggy source:
public void afterPropertiesSet(){
  Assert.notNull(metricRegistry,"String_Node_Str");
  Assert.notNull(packetHandlerFactory,"String_Node_Str");
  this.worker=createWorker(workerType,workerThreadSize,workerThreadQueueSize,receiverName + "String_Node_Str");
  if (enableCollectorMetric) {
    this.worker=new MonitoredExecutorService(worker,metricRegistry,receiverName + "String_Node_Str");
  }
 else {
    this.worker=worker;
  }
  final int packetPoolSize=getPacketPoolSize(workerThreadSize,workerThreadQueueSize);
  this.datagramPacketPool=new DefaultObjectPool<>(new DatagramPacketFactory(),packetPoolSize);
  this.io=(ThreadPoolExecutor)Executors.newCachedThreadPool(new PinpointThreadFactory(receiverName + "String_Node_Str",true));
}

Fixed version (ground truth):
public void afterPropertiesSet(){
  Assert.notNull(metricRegistry,"String_Node_Str");
  Assert.notNull(packetHandlerFactory,"String_Node_Str");
  this.worker=createWorker(workerType,workerThreadSize,workerThreadQueueSize,receiverName + "String_Node_Str");
  if (enableCollectorMetric) {
    this.worker=new MonitoredExecutorService(worker,metricRegistry,receiverName + "String_Node_Str");
  }
  final int packetPoolSize=getPacketPoolSize(workerThreadSize,workerThreadQueueSize);
  this.datagramPacketPool=new DefaultObjectPool<>(new DatagramPacketFactory(),packetPoolSize);
  this.io=(ThreadPoolExecutor)Executors.newCachedThreadPool(new PinpointThreadFactory(receiverName + "String_Node_Str",true));
}
Program: 53613
Project: 53613
Buggy source:
private Object[] getParameters(String operation,Object[] args){
  Object[] orgParams=(args[2] == null) ? null : (Object[])args[2];
  if (orgParams == null) {
    return orgParams;
  }
  String[] hiddenParams=pluginConfig.getClientHiddenParams();
  if (hiddenParams == null || hiddenParams.length == 0) {
    return orgParams;
  }
  Object[] params=Arrays.copyOf(orgParams,orgParams.length);
  for (  String op : hiddenParams) {
    Matcher matcher=hiddenParamPattern.matcher(op);
    if (matcher.matches()) {
      if (operation.equals(matcher.group(1))) {
        int idx=Integer.valueOf(matcher.group(2));
        if (idx >= params.length) {
          continue;
        }
        params[idx]="String_Node_Str";
      }
    }
 else {
      if (op.equals(operation)) {
        return new Object[]{"String_Node_Str" + params.length + "String_Node_Str"};
      }
    }
  }
  return params;
}

Fixed version (ground truth):
private Object[] getParameters(String operation,Object[] args){
  Object[] orgParams=(args[2] == null) ? null : (Object[])args[2];
  if (orgParams == null) {
    return null;
  }
  String[] hiddenParams=pluginConfig.getClientHiddenParams();
  if (hiddenParams == null || hiddenParams.length == 0) {
    return orgParams;
  }
  Object[] params=Arrays.copyOf(orgParams,orgParams.length);
  for (  String op : hiddenParams) {
    Matcher matcher=hiddenParamPattern.matcher(op);
    if (matcher.matches()) {
      if (operation.equals(matcher.group(1))) {
        String group=matcher.group(2);
        int idx=Integer.parseInt(group);
        if (idx >= params.length) {
          continue;
        }
        params[idx]="String_Node_Str";
      }
    }
 else {
      if (op.equals(operation)) {
        return new Object[]{"String_Node_Str" + params.length + "String_Node_Str"};
      }
    }
  }
  return params;
}
Program: 53614
Project: 53614
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE) @ResponseBody public Map<String,String> deleteUserGroupMember(@RequestBody UserGroupMemberParam userGroupMember){
  if (StringUtils.isEmpty(userGroupMember.getUserGroupId()) || StringUtils.isEmpty(userGroupMember.getMemberId())) {
    Map<String,String> result=new HashMap<>();
    result.put("String_Node_Str","String_Node_Str");
    result.put("String_Node_Str","String_Node_Str");
    return result;
  }
  if (webProperties.isOpenSource() == false) {
    boolean isValid=checkValid(userGroupMember.getUserId(),userGroupMember.getUserGroupId());
    if (isValid == false) {
      Map<String,String> result=new HashMap<>();
      result.put("String_Node_Str","String_Node_Str");
      result.put("String_Node_Str","String_Node_Str");
      return result;
    }
  }
  userGroupService.deleteMember(userGroupMember);
  Map<String,String> result=new HashMap<>();
  result.put("String_Node_Str","String_Node_Str");
  return result;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.DELETE) @ResponseBody public Map<String,String> deleteUserGroupMember(@RequestBody UserGroupMemberParam userGroupMember,@RequestHeader(value=SSO_USER,required=false) String userId){
  if (StringUtils.isEmpty(userGroupMember.getUserGroupId()) || StringUtils.isEmpty(userGroupMember.getMemberId())) {
    Map<String,String> result=new HashMap<>();
    result.put("String_Node_Str","String_Node_Str");
    result.put("String_Node_Str","String_Node_Str");
    return result;
  }
  if (webProperties.isOpenSource() == false) {
    boolean isValid=checkValid(userId,userGroupMember.getUserGroupId());
    if (isValid == false) {
      Map<String,String> result=new HashMap<>();
      result.put("String_Node_Str","String_Node_Str");
      result.put("String_Node_Str","String_Node_Str");
      return result;
    }
  }
  userGroupService.deleteMember(userGroupMember);
  Map<String,String> result=new HashMap<>();
  result.put("String_Node_Str","String_Node_Str");
  return result;
}
Program: 53615
Project: 53615
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public Map<String,String> insertUserGroupMember(@RequestBody UserGroupMemberParam userGroupMember){
  if (StringUtils.isEmpty(userGroupMember.getMemberId()) || StringUtils.isEmpty(userGroupMember.getUserGroupId())) {
    Map<String,String> result=new HashMap<>();
    result.put("String_Node_Str","String_Node_Str");
    result.put("String_Node_Str","String_Node_Str");
    return result;
  }
  if (webProperties.isOpenSource() == false) {
    boolean isValid=checkValid(userGroupMember.getUserId(),userGroupMember.getUserGroupId());
    if (isValid == false) {
      Map<String,String> result=new HashMap<>();
      result.put("String_Node_Str","String_Node_Str");
      result.put("String_Node_Str","String_Node_Str");
      return result;
    }
  }
  userGroupService.insertMember(userGroupMember);
  Map<String,String> result=new HashMap<>();
  result.put("String_Node_Str","String_Node_Str");
  return result;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.POST) @ResponseBody public Map<String,String> insertUserGroupMember(@RequestBody UserGroupMemberParam userGroupMember,@RequestHeader(value=SSO_USER,required=false) String userId){
  if (StringUtils.isEmpty(userGroupMember.getMemberId()) || StringUtils.isEmpty(userGroupMember.getUserGroupId())) {
    Map<String,String> result=new HashMap<>();
    result.put("String_Node_Str","String_Node_Str");
    result.put("String_Node_Str","String_Node_Str");
    return result;
  }
  if (webProperties.isOpenSource() == false) {
    boolean isValid=checkValid(userId,userGroupMember.getUserGroupId());
    if (isValid == false) {
      Map<String,String> result=new HashMap<>();
      result.put("String_Node_Str","String_Node_Str");
      result.put("String_Node_Str","String_Node_Str");
      return result;
    }
  }
  userGroupService.insertMember(userGroupMember);
  Map<String,String> result=new HashMap<>();
  result.put("String_Node_Str","String_Node_Str");
  return result;
}
Program: 53616
Project: 53616
Buggy source:
@Override public void run(){
  try {
    latch.await();
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (startLatch != null) {
    startLatch.countDown();
  }
  try {
    endLatch.await();
  }
 catch (  InterruptedException e) {
  }
}
Program: 53617
Project: 53617
Buggy source:
public LatchAwaitRunnable(CountDownLatch latch){
  this.latch=latch;
}

Fixed version (ground truth):
public LatchAwaitRunnable(CountDownLatch startLatch,CountDownLatch endLatch){
  this.startLatch=startLatch;
  this.endLatch=endLatch;
}
Program: 53618
Project: 53618
Buggy source:
private void execute(int newBufferSize,ExecutorService executor,CountDownLatch latch){
  for (int i=0; i < newBufferSize; i++) {
    executor.execute(new LatchAwaitRunnable(latch));
  }
}

Fixed version (ground truth):
private void execute(int newBufferSize,ExecutorService executor,CountDownLatch startLatch,CountDownLatch endLatch){
  for (int i=0; i < newBufferSize; i++) {
    executor.execute(new LatchAwaitRunnable(startLatch,endLatch));
  }
}
Program: 53619
Project: 53619
Buggy source:
@Test public void simpleTest() throws InterruptedException {
  int bufferSize=10;
  int newBufferSize=DisruptorExecutors.nextPowerOfTwo(bufferSize);
  ExecutorService executor=DisruptorExecutors.newSingleProducerExecutor(1,newBufferSize,threadFactory,new TimeoutBlockingWaitStrategy(10000,TimeUnit.MILLISECONDS));
  CountDownLatch latch=new CountDownLatch(1);
  execute(newBufferSize,executor,latch);
  List<Runnable> runnableList=executor.shutdownNow();
  latch.countDown();
  Assert.assertEquals(newBufferSize - 1,runnableList.size());
  Assert.assertTrue(executor.isShutdown());
}

Fixed version (ground truth):
@Test public void simpleTest() throws InterruptedException {
  int bufferSize=10;
  int newBufferSize=DisruptorExecutors.nextPowerOfTwo(bufferSize);
  ExecutorService executor=DisruptorExecutors.newSingleProducerExecutor(1,newBufferSize,threadFactory,new TimeoutBlockingWaitStrategy(10000,TimeUnit.MILLISECONDS));
  CountDownLatch startLatch=new CountDownLatch(1);
  CountDownLatch endLatch=new CountDownLatch(1);
  execute(newBufferSize,executor,startLatch,endLatch);
  startLatch.await();
  List<Runnable> runnableList=executor.shutdownNow();
  endLatch.countDown();
  Assert.assertEquals(newBufferSize - 1,runnableList.size());
  Assert.assertTrue(executor.isShutdown());
}
Program: 53620
Project: 53620
Buggy source:
private void addField0(String accessorTypeName,String initValExp) throws InstrumentException {
  try {
    Class<?> accessorType=pluginContext.injectClass(classLoader,accessorTypeName);
    final AccessorAnalyzer accessorAnalyzer=new AccessorAnalyzer();
    final AccessorDetails accessorDetails=accessorAnalyzer.analyze(accessorType);
    final CtField newField=CtField.make("String_Node_Str" + accessorDetails.getFieldType().getName() + "String_Node_Str"+ FIELD_PREFIX+ accessorTypeName.replace('.','_').replace('$','_')+ "String_Node_Str",ctClass);
    if (initValExp == null) {
      ctClass.addField(newField);
    }
 else {
      ctClass.addField(newField,initValExp);
    }
    final CtClass accessorInterface=ctClass.getClassPool().get(accessorTypeName);
    ctClass.addInterface(accessorInterface);
    CtMethod getterMethod=CtNewMethod.getter(accessorDetails.getGetter().getName(),newField);
    ctClass.addMethod(getterMethod);
    CtMethod setterMethod=CtNewMethod.setter(accessorDetails.getSetter().getName(),newField);
    ctClass.addMethod(setterMethod);
  }
 catch (  Exception e) {
    throw new InstrumentException("String_Node_Str" + accessorTypeName + "String_Node_Str"+ e.getMessage(),e);
  }
}

Fixed version (ground truth):
private void addField0(String accessorTypeName,String initValExp) throws InstrumentException {
  try {
    Class<?> accessorType=pluginContext.injectClass(classLoader,accessorTypeName);
    final AccessorAnalyzer accessorAnalyzer=new AccessorAnalyzer();
    final AccessorDetails accessorDetails=accessorAnalyzer.analyze(accessorType);
    Class<?> fieldType=accessorDetails.getFieldType();
    String fieldTypeName=JavaAssistUtils.javaClassNameToObjectName(fieldType.getName());
    final CtField newField=CtField.make("String_Node_Str" + fieldTypeName + "String_Node_Str"+ FIELD_PREFIX+ accessorTypeName.replace('.','_').replace('$','_')+ "String_Node_Str",ctClass);
    if (initValExp == null) {
      ctClass.addField(newField);
    }
 else {
      ctClass.addField(newField,initValExp);
    }
    final CtClass accessorInterface=ctClass.getClassPool().get(accessorTypeName);
    ctClass.addInterface(accessorInterface);
    CtMethod getterMethod=CtNewMethod.getter(accessorDetails.getGetter().getName(),newField);
    ctClass.addMethod(getterMethod);
    CtMethod setterMethod=CtNewMethod.setter(accessorDetails.getSetter().getName(),newField);
    ctClass.addMethod(setterMethod);
  }
 catch (  Exception e) {
    throw new InstrumentException("String_Node_Str" + accessorTypeName + "String_Node_Str"+ e.getMessage(),e);
  }
}
Program: 53621
Project: 53621
Buggy source:
@Override public void addGetter(String getterTypeName,String fieldName) throws InstrumentException {
  try {
    Class<?> getterType=pluginContext.injectClass(classLoader,getterTypeName);
    GetterDetails getterDetails=new GetterAnalyzer().analyze(getterType);
    CtField field=ctClass.getField(fieldName);
    if (!field.getType().getName().equals(getterDetails.getFieldType().getName())) {
      throw new IllegalArgumentException("String_Node_Str" + getterDetails.getGetter() + "String_Node_Str"+ field.getType().getName());
    }
    CtMethod getterMethod=CtNewMethod.getter(getterDetails.getGetter().getName(),field);
    if (getterMethod.getDeclaringClass() != ctClass) {
      getterMethod=CtNewMethod.copy(getterMethod,ctClass,null);
    }
    ctClass.addMethod(getterMethod);
    CtClass ctInterface=ctClass.getClassPool().get(getterTypeName);
    ctClass.addInterface(ctInterface);
  }
 catch (  Exception e) {
    throw new InstrumentException("String_Node_Str" + getterTypeName,e);
  }
}

Fixed version (ground truth):
@Override public void addGetter(String getterTypeName,String fieldName) throws InstrumentException {
  try {
    Class<?> getterType=pluginContext.injectClass(classLoader,getterTypeName);
    GetterDetails getterDetails=new GetterAnalyzer().analyze(getterType);
    CtField field=ctClass.getField(fieldName);
    String fieldTypeName=JavaAssistUtils.javaClassNameToObjectName(getterDetails.getFieldType().getName());
    if (!field.getType().getName().equals(fieldTypeName)) {
      throw new IllegalArgumentException("String_Node_Str" + getterDetails.getGetter() + "String_Node_Str"+ field.getType().getName());
    }
    CtMethod getterMethod=CtNewMethod.getter(getterDetails.getGetter().getName(),field);
    if (getterMethod.getDeclaringClass() != ctClass) {
      getterMethod=CtNewMethod.copy(getterMethod,ctClass,null);
    }
    ctClass.addMethod(getterMethod);
    CtClass ctInterface=ctClass.getClassPool().get(getterTypeName);
    ctClass.addInterface(ctInterface);
  }
 catch (  Exception e) {
    throw new InstrumentException("String_Node_Str" + getterTypeName,e);
  }
}
Program: 53624
Project: 53624
Buggy source:
@Override public byte[] doInTransform(Instrumentor instrumentor,ClassLoader classLoader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain,byte[] classfileBuffer) throws InstrumentException {
  try {
    logger.info("String_Node_Str",classLoader);
    InstrumentClass aClass=instrumentor.getInstrumentClass(classLoader,className,classfileBuffer);
    aClass.addGetter(StringGetter.class.getName(),"String_Node_Str");
    aClass.addGetter(IntGetter.class.getName(),"String_Node_Str");
    return aClass.toBytecode();
  }
 catch (  InstrumentException e) {
    throw new RuntimeException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
@Override public byte[] doInTransform(Instrumentor instrumentor,ClassLoader classLoader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain,byte[] classfileBuffer) throws InstrumentException {
  try {
    logger.info("String_Node_Str",classLoader);
    InstrumentClass testClass=instrumentor.getInstrumentClass(classLoader,className,classfileBuffer);
    testClass.addSetter(IntSetter.class.getName(),"String_Node_Str");
    testClass.addSetter(IntArraySetter.class.getName(),"String_Node_Str");
    testClass.addSetter(IntegerArraySetter.class.getName(),"String_Node_Str");
    return testClass.toBytecode();
  }
 catch (  InstrumentException e) {
    throw new RuntimeException(e.getMessage(),e);
  }
}
Program: 53626
Project: 53626
Buggy source:
public static long toAggregatedTimestamp(AgentStat stat,long interval){
  long timestamp=(stat.getTimestamp() / interval) * interval;
  if (stat.getTimestamp() != timestamp) {
    timestamp+=interval;
  }
  return timestamp;
}

Fixed version (ground truth):
public static long toAggregatedTimestamp(AgentStat stat,long interval){
  long timestamp=(stat.getTimestamp() / interval) * interval;
  return timestamp;
}