nus-yam/ex-repair huggingface dataset:
Program: 53532
Project: 53532
Buggy source:
private Bootstrap(){
  String[] SPRING_CONFIG_XML=new String[]{"String_Node_Str","String_Node_Str"};
  applicationContext=new ClassPathXmlApplicationContext(SPRING_CONFIG_XML);
  tbaseFlatMapper=applicationContext.getBean("String_Node_Str",TbaseFlatMapper.class);
  flinkConfiguration=applicationContext.getBean("String_Node_Str",FlinkConfiguration.class);
  tcpDispatchHandler=applicationContext.getBean("String_Node_Str",TcpDispatchHandler.class);
  tcpSourceFunction=applicationContext.getBean("String_Node_Str",TcpSourceFunction.class);
  statisticsDao=applicationContext.getBean("String_Node_Str",StatisticsDao.class);
}

Fixed version (ground truth):
private Bootstrap(){
  String[] SPRING_CONFIG_XML=new String[]{"String_Node_Str","String_Node_Str"};
  applicationContext=new ClassPathXmlApplicationContext(SPRING_CONFIG_XML);
  tbaseFlatMapper=applicationContext.getBean("String_Node_Str",TbaseFlatMapper.class);
  flinkConfiguration=applicationContext.getBean("String_Node_Str",FlinkConfiguration.class);
  tcpDispatchHandler=applicationContext.getBean("String_Node_Str",TcpDispatchHandler.class);
  tcpSourceFunction=applicationContext.getBean("String_Node_Str",TcpSourceFunction.class);
  statisticsDao=applicationContext.getBean("String_Node_Str",StatisticsDao.class);
  applicationCache=applicationContext.getBean("String_Node_Str",ApplicationCache.class);
  cpuLoadDao=applicationContext.getBean("String_Node_Str",CpuLoadDao.class);
  memoryDao=applicationContext.getBean("String_Node_Str",MemoryDao.class);
  transactionDao=applicationContext.getBean("String_Node_Str",TransactionDao.class);
  activeTraceDao=applicationContext.getBean("String_Node_Str",ActiveTraceDao.class);
  responseTimeDao=applicationContext.getBean("String_Node_Str",ResponseTimeDao.class);
}
Program: 53533
Project: 53533
Buggy source:
public StatisticsDao(CpuLoadDao cpuLoadDao,MemoryDao memoryDao,TransactionDao transactionDao,ActiveTraceDao activeTraceDao,ResponseTimeDao responseTimeDao){
  this.cpuLoadDao=Objects.requireNonNull(cpuLoadDao,"String_Node_Str");
  this.memoryDao=Objects.requireNonNull(memoryDao,"String_Node_Str");
  this.transactionDao=Objects.requireNonNull(transactionDao,"String_Node_Str");
  this.activeTraceDao=Objects.requireNonNull(activeTraceDao,"String_Node_Str");
  this.responseTimeDao=Objects.requireNonNull(responseTimeDao,"String_Node_Str");
}

Fixed version (ground truth):
public StatisticsDao(){
}
Program: 53534
Project: 53534
Buggy source:
@Override public void configure(Configuration parameters){
  this.APPLICATION_STAT_AGGRE=HBaseTables.APPLICATION_STAT_AGGRE;
}

Fixed version (ground truth):
@Override public void configure(Configuration parameters){
  this.APPLICATION_STAT_AGGRE=HBaseTables.APPLICATION_STAT_AGGRE;
  Bootstrap bootstrap=Bootstrap.getInstance();
  cpuLoadDao=bootstrap.getCpuLoadDao();
  memoryDao=bootstrap.getMemoryDao();
  transactionDao=bootstrap.getTransactionDao();
  activeTraceDao=bootstrap.getActiveTraceDao();
  responseTimeDao=bootstrap.getResponseTimeDao();
}
Program: 53535
Project: 53535
Buggy source:
@Override public void flatMap(TBase tBase,Collector<Tuple3<String,JoinStatBo,Long>> out) throws Exception {
  if (tBase instanceof TFAgentStatBatch) {
    logger.info("String_Node_Str",tBase);
    final TFAgentStatBatch tFAgentStatBatch=(TFAgentStatBatch)tBase;
    final JoinAgentStatBo joinAgentStatBo;
    try {
      joinAgentStatBo=joinAgentStatBoMapper.map(tFAgentStatBatch);
      if (joinAgentStatBo == JoinAgentStatBo.EMPTY_JOIN_AGENT_STAT_BO) {
        return;
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",tFAgentStatBatch,e);
      return;
    }
    out.collect(new Tuple3<String,JoinStatBo,Long>(joinAgentStatBo.getId(),joinAgentStatBo,joinAgentStatBo.getTimestamp()));
    final ApplicationCache.ApplicationKey applicationKey=new ApplicationCache.ApplicationKey(joinAgentStatBo.getId(),joinAgentStatBo.getAgentStartTimestamp());
    final String applicationId=applicationCache.findApplicationId(applicationKey);
    if (applicationId.equals(ApplicationCache.NOT_FOUND_APP_ID)) {
      logger.warn("String_Node_Str");
      return;
    }
    List<JoinApplicationStatBo> joinApplicationStatBoList=JoinApplicationStatBo.createJoinApplicationStatBo(applicationId,joinAgentStatBo,ApplicationStatBoWindow.WINDOW_SIZE);
    for (    JoinApplicationStatBo joinApplicationStatBo : joinApplicationStatBoList) {
      out.collect(new Tuple3<String,JoinStatBo,Long>(applicationId,joinApplicationStatBo,joinApplicationStatBo.getTimestamp()));
    }
  }
}

Fixed version (ground truth):
@Override public void flatMap(TBase tBase,Collector<Tuple3<String,JoinStatBo,Long>> out) throws Exception {
  if (tBase instanceof TFAgentStatBatch) {
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str",tBase);
    }
    final TFAgentStatBatch tFAgentStatBatch=(TFAgentStatBatch)tBase;
    final JoinAgentStatBo joinAgentStatBo;
    try {
      joinAgentStatBo=joinAgentStatBoMapper.map(tFAgentStatBatch);
      if (joinAgentStatBo == JoinAgentStatBo.EMPTY_JOIN_AGENT_STAT_BO) {
        return;
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",tFAgentStatBatch,e);
      return;
    }
    out.collect(new Tuple3<String,JoinStatBo,Long>(joinAgentStatBo.getId(),joinAgentStatBo,joinAgentStatBo.getTimestamp()));
    final ApplicationCache.ApplicationKey applicationKey=new ApplicationCache.ApplicationKey(joinAgentStatBo.getId(),joinAgentStatBo.getAgentStartTimestamp());
    final String applicationId=applicationCache.findApplicationId(applicationKey);
    if (applicationId.equals(ApplicationCache.NOT_FOUND_APP_ID)) {
      logger.warn("String_Node_Str");
      return;
    }
    List<JoinApplicationStatBo> joinApplicationStatBoList=JoinApplicationStatBo.createJoinApplicationStatBo(applicationId,joinAgentStatBo,ApplicationStatBoWindow.WINDOW_SIZE);
    for (    JoinApplicationStatBo joinApplicationStatBo : joinApplicationStatBoList) {
      out.collect(new Tuple3<String,JoinStatBo,Long>(applicationId,joinApplicationStatBo,joinApplicationStatBo.getTimestamp()));
    }
  }
}
Program: 53536
Project: 53536
Buggy source:
public TbaseFlatMapper(ApplicationCache applicationCache){
  this.applicationCache=Objects.requireNonNull(applicationCache,"String_Node_Str");
}

Fixed version (ground truth):
public TbaseFlatMapper(JoinAgentStatBoMapper joinAgentStatBoMapper,ApplicationCache applicationCache){
  this.joinAgentStatBoMapper=joinAgentStatBoMapper;
  this.applicationCache=applicationCache;
}
Program: 53537
Project: 53537
Buggy source:
@Override public void before(Object target,Object[] args){
  logger.beforeInterceptor(target,target.getClass().getName(),targetMethod.getName(),"String_Node_Str",args);
  try {
    if (target != null) {
      if (target instanceof AsyncAccessor) {
        ((AsyncAccessor)target)._$PINPOINT$_setAsync(Boolean.FALSE);
      }
      if (target instanceof TraceAccessor) {
        final Trace trace=((TraceAccessor)target)._$PINPOINT$_getTrace();
        if (trace != null && trace.canSampled()) {
          trace.close();
        }
        ((TraceAccessor)target)._$PINPOINT$_setTrace(null);
      }
    }
  }
 catch (  Throwable t) {
    logger.warn("String_Node_Str",t.getMessage(),t);
  }
}

Fixed version (ground truth):
@Override public void before(Object target,Object[] args){
  if (logger.isDebugEnabled()) {
    logger.beforeInterceptor(target,methodDescriptor.getClassName(),methodDescriptor.getMethodName(),"String_Node_Str",args);
  }
  try {
    if (target != null) {
      if (target instanceof AsyncAccessor) {
        ((AsyncAccessor)target)._$PINPOINT$_setAsync(Boolean.FALSE);
      }
      if (target instanceof TraceAccessor) {
        final Trace trace=((TraceAccessor)target)._$PINPOINT$_getTrace();
        if (trace != null && trace.canSampled()) {
          trace.close();
        }
        ((TraceAccessor)target)._$PINPOINT$_setTrace(null);
      }
    }
  }
 catch (  Throwable t) {
    logger.warn("String_Node_Str",t.getMessage(),t);
  }
}
Program: 53538
Project: 53538
Buggy source:
public HttpRequestInterceptor(InstrumentMethod targetMethod){
  this.targetMethod=targetMethod;
}

Fixed version (ground truth):
public HttpRequestInterceptor(MethodDescriptor methodDescriptor){
  this.methodDescriptor=methodDescriptor;
}
Program: 53539
Project: 53539
Buggy source:
private void recordCookie(HttpServletRequest request,Trace trace){
  if (cookieSampler.isSampling()) {
    final SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    Map<String,Object> cookies=ReadCookieMap(request);
    recorder.recordAttribute(AnnotationKey.HTTP_COOKIE,cookies);
  }
}

Fixed version (ground truth):
private void recordCookie(HttpServletRequest request,Trace trace){
  if (cookieSampler.isSampling()) {
    final SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    Map<String,Object> cookies=readCookieMap(request);
    recorder.recordAttribute(AnnotationKey.HTTP_COOKIE,cookies);
  }
}
Program: 53540
Project: 53540
Buggy source:
public RequestRecycleInterceptor(InstrumentMethod targetMethod){
  this.targetMethod=targetMethod;
}

Fixed version (ground truth):
public RequestRecycleInterceptor(MethodDescriptor methodDescriptor){
  this.methodDescriptor=methodDescriptor;
}
Program: 53541
Project: 53541
Buggy source:
@Override public void before(Object target,Object[] args){
  logger.beforeInterceptor(target,target.getClass().getName(),targetMethod.getName(),"String_Node_Str",args);
  try {
    if (target instanceof AsyncAccessor) {
      ((AsyncAccessor)target)._$PINPOINT$_setAsync(Boolean.FALSE);
    }
    if (target instanceof TraceAccessor) {
      final Trace trace=((TraceAccessor)target)._$PINPOINT$_getTrace();
      if (trace != null && trace.canSampled()) {
        trace.close();
      }
      ((TraceAccessor)target)._$PINPOINT$_setTrace(null);
    }
  }
 catch (  Throwable t) {
    logger.warn("String_Node_Str",t.getMessage(),t);
  }
}

Fixed version (ground truth):
@Override public void before(Object target,Object[] args){
  if (logger.isDebugEnabled()) {
    logger.beforeInterceptor(target,methodDescriptor.getClassName(),methodDescriptor.getMethodName(),"String_Node_Str",args);
  }
  try {
    if (target instanceof AsyncAccessor) {
      ((AsyncAccessor)target)._$PINPOINT$_setAsync(Boolean.FALSE);
    }
    if (target instanceof TraceAccessor) {
      final Trace trace=((TraceAccessor)target)._$PINPOINT$_getTrace();
      if (trace != null && trace.canSampled()) {
        trace.close();
      }
      ((TraceAccessor)target)._$PINPOINT$_setTrace(null);
    }
  }
 catch (  Throwable t) {
    logger.warn("String_Node_Str",t.getMessage(),t);
  }
}
Program: 53542
Project: 53542
Buggy source:
/** 
 * @deprecated Since 1.6.1. Use {@link com.navercorp.pinpoint.common.util.StringUtils#abbreviate(String,int)}
 */
@Deprecated public static String drop(final String str,final int maxWidth){
  return abbreviate(str,maxWidth);
}

Fixed version (ground truth):
/** 
 * @deprecated Since 1.6.1. Use {@link com.navercorp.pinpoint.common.util.StringUtils#abbreviate(String,int)}
 */
@Deprecated public static String drop(final String str,final int maxWidth){
  return com.navercorp.pinpoint.common.util.StringUtils.abbreviate(str,maxWidth);
}
Program: 53543
Project: 53543
Buggy source:
/** 
 * @deprecated Since 1.7.0. Use {@link com.navercorp.pinpoint.common.util.StringUtils#tokenizeToStringList(String,String)}
 */
@Deprecated public static List<String> splitAndTrim(final String value,final String separator){
  return tokenizeToStringList(value,separator);
}

Fixed version (ground truth):
/** 
 * @deprecated Since 1.7.0. Use {@link com.navercorp.pinpoint.common.util.StringUtils#tokenizeToStringList(String,String)}
 */
@Deprecated public static List<String> splitAndTrim(final String value,final String separator){
  return com.navercorp.pinpoint.common.util.StringUtils.tokenizeToStringList(value,separator);
}
Program: 53544
Project: 53544
Buggy source:
/** 
 * @deprecated Since 1.6.1. Use {@link com.navercorp.pinpoint.common.util.StringUtils#appendAbbreviate(StringBuilder,String,int)}
 */
@Deprecated public static void appendDrop(final StringBuilder builder,final String str,final int maxWidth){
  appendAbbreviate(builder,str,maxWidth);
}

Fixed version (ground truth):
/** 
 * @deprecated Since 1.6.1. Use {@link com.navercorp.pinpoint.common.util.StringUtils#appendAbbreviate(StringBuilder,String,int)}
 */
@Deprecated public static void appendDrop(final StringBuilder builder,final String str,final int maxWidth){
  com.navercorp.pinpoint.common.util.StringUtils.appendAbbreviate(builder,str,maxWidth);
}
Program: 53545
Project: 53545
Buggy source:
private void recordCookie(HttpServletRequest request,Trace trace){
  if (cookieSampler.isSampling()) {
    final SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    Map<String,Object> cookies=ReadCookieMap(request);
    recorder.recordAttribute(AnnotationKey.HTTP_COOKIE,cookies);
  }
  return;
}

Fixed version (ground truth):
private void recordCookie(HttpServletRequest request,Trace trace){
  if (cookieSampler.isSampling()) {
    final SpanEventRecorder recorder=trace.currentSpanEventRecorder();
    Map<String,Object> cookies=ReadCookieMap(request);
    recorder.recordAttribute(AnnotationKey.HTTP_COOKIE,cookies);
  }
}
Program: 53546
Project: 53546
Buggy source:
private String getRequestParameter(IRequest request,int eachLimit,int totalLimit){
  String queryString=request.getQueryString();
  final StringBuilder params=new StringBuilder(64);
  try {
    Map<String,String> query_pairs=splitQuery(queryString);
    Iterator<String> attrs=query_pairs.keySet().iterator();
    while (attrs.hasNext()) {
      if (params.length() != 0) {
        params.append('&');
      }
      if (params.length() > totalLimit) {
        params.append("String_Node_Str");
        return params.toString();
      }
      String key=attrs.next();
      params.append(StringUtils.abbreviate(key,eachLimit));
      params.append('=');
      String value=query_pairs.get(key);
      if (value != null) {
        params.append(StringUtils.abbreviate(StringUtils.toString(value),eachLimit));
      }
    }
  }
 catch (  UnsupportedEncodingException e) {
    logger.error("String_Node_Str",queryString,e);
  }
  return params.toString();
}

Fixed version (ground truth):
private String getRequestParameter(IRequest request,int eachLimit,int totalLimit){
  String queryString=request.getQueryString();
  final StringBuilder params=new StringBuilder(64);
  try {
    Map<String,String> query_pairs=splitQuery(queryString);
    for (    Map.Entry<String,String> entry : query_pairs.entrySet()) {
      if (params.length() != 0) {
        params.append('&');
      }
      if (params.length() > totalLimit) {
        params.append("String_Node_Str");
        return params.toString();
      }
      String key=entry.getKey();
      params.append(StringUtils.abbreviate(key,eachLimit));
      params.append('=');
      String value=entry.getValue();
      if (value != null) {
        params.append(StringUtils.abbreviate(StringUtils.toString(value),eachLimit));
      }
    }
  }
 catch (  UnsupportedEncodingException e) {
    logger.error("String_Node_Str",queryString,e);
  }
  return params.toString();
}
Program: 53547
Project: 53547
Buggy source:
public void init(FilterConfig filterConfig){
  this.filterConfig=filterConfig;
}

Fixed version (ground truth):
public void init(FilterConfig filterConfig){
}
Program: 53548
Project: 53548
Buggy source:
public void destroy(){
  this.filterConfig=null;
}

Fixed version (ground truth):
public void destroy(){
}
Program: 53549
Project: 53549
Buggy source:
private long getStartTimestamp(AgentStatBo agentStatBo){
  List<CpuLoadBo> cpuLoadBos=agentStatBo.getCpuLoadBos();
  if (cpuLoadBos != null) {
    CpuLoadBo cpuLoadBo=cpuLoadBos.get(0);
    if (cpuLoadBo != null) {
      return cpuLoadBo.getStartTimestamp();
    }
  }
  return Long.MIN_VALUE;
}

Fixed version (ground truth):
private long getStartTimestamp(AgentStatBo agentStatBo){
  List<CpuLoadBo> cpuLoadBos=agentStatBo.getCpuLoadBos();
  if (CollectionUtils.isEmpty(cpuLoadBos)) {
    CpuLoadBo cpuLoadBo=cpuLoadBos.get(0);
    if (cpuLoadBo != null) {
      return cpuLoadBo.getStartTimestamp();
    }
  }
  return Long.MIN_VALUE;
}
Program: 53550
Project: 53550
Buggy source:
public TFAgentStatBatch map(AgentStatBo agentStatBo){
  try {
    List<TFAgentStat> tFAgentstatList=tFAgentStatMapper.map(agentStatBo);
    long startTimestamp=getStartTimestamp(agentStatBo);
    TFAgentStatBatch tFAgentStatBatch=new TFAgentStatBatch(agentStatBo.getAgentId(),startTimestamp,tFAgentstatList);
    return tFAgentStatBatch;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  return null;
}

Fixed version (ground truth):
public TFAgentStatBatch map(AgentStatBo agentStatBo){
  try {
    List<TFAgentStat> tFAgentstatList=tFAgentStatMapper.map(agentStatBo);
    long startTimestamp=getStartTimestamp(agentStatBo);
    TFAgentStatBatch tFAgentStatBatch=new TFAgentStatBatch(agentStatBo.getAgentId(),startTimestamp,tFAgentstatList);
    return tFAgentStatBatch;
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + agentStatBo,e);
  }
  return null;
}
Program: 53551
Project: 53551
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + applicationId + '\''+ "String_Node_Str"+ joinCpuLoadBoList+ "String_Node_Str"+ joinMemoryBoList+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ statType+ '}';
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + applicationId + '\''+ "String_Node_Str"+ joinCpuLoadBoList+ "String_Node_Str"+ joinMemoryBoList+ "String_Node_Str"+ joinTransactionBoList+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ statType+ '}';
}
Program: 53552
Project: 53552
Buggy source:
private List<AggreJoinTransactionBo> cast(List<AggregationStatData> aggregationStatDataList){
  List<AggreJoinTransactionBo> aggreJoinCpuLoadBoList=new ArrayList<>(aggregationStatDataList.size());
  for (  AggregationStatData aggregationStatData : aggregationStatDataList) {
    aggreJoinCpuLoadBoList.add((AggreJoinTransactionBo)aggregationStatData);
  }
  return aggreJoinCpuLoadBoList;
}

Fixed version (ground truth):
private List<AggreJoinTransactionBo> cast(List<AggregationStatData> aggregationStatDataList){
  List<AggreJoinTransactionBo> aggreJoinTransactionBoList=new ArrayList<>(aggregationStatDataList.size());
  for (  AggregationStatData aggregationStatData : aggregationStatDataList) {
    aggreJoinTransactionBoList.add((AggreJoinTransactionBo)aggregationStatData);
  }
  return aggreJoinTransactionBoList;
}
Program: 53553
Project: 53553
Buggy source:
public ApplicationTransactionChartGroup(TimeWindow timeWindow,List<AggreJoinTransactionBo> aggreJoinTransactionBoList){
  transactionChartMap=new HashMap<>();
  List<Point> transactionList=new ArrayList<>(aggreJoinTransactionBoList.size());
  for (  AggreJoinTransactionBo aggreJoinTransactionBo : aggreJoinTransactionBoList) {
    transactionList.add(new TransactionPoint(aggreJoinTransactionBo.getTimestamp(),aggreJoinTransactionBo.getMinTotalCount(),aggreJoinTransactionBo.getMinTotalCountAgentId(),aggreJoinTransactionBo.getMaxTotalCount(),aggreJoinTransactionBo.getMaxTotalCountAgentId(),aggreJoinTransactionBo.getTotalCount()));
  }
  transactionChartMap.put(TransactionChartType.TRANSACTION_COUNT,new TimeSeriesChartBuilder(timeWindow,UNCOLLECTED_TRANSACTION_POINT).build(transactionList));
}

Fixed version (ground truth):
public ApplicationTransactionChartGroup(TimeWindow timeWindow,List<AggreJoinTransactionBo> aggreJoinTransactionBoList){
  transactionChartMap=new HashMap<>();
  List<Point> transactionList=new ArrayList<>(aggreJoinTransactionBoList.size());
  for (  AggreJoinTransactionBo aggreJoinTransactionBo : aggreJoinTransactionBoList) {
    double minTotalCount=calculateTPS(aggreJoinTransactionBo.getMinTotalCount(),aggreJoinTransactionBo.getCollectInterval());
    double maxTotalCount=calculateTPS(aggreJoinTransactionBo.getMaxTotalCount(),aggreJoinTransactionBo.getCollectInterval());
    double totalCount=calculateTPS(aggreJoinTransactionBo.getTotalCount(),aggreJoinTransactionBo.getCollectInterval());
    transactionList.add(new TransactionPoint(aggreJoinTransactionBo.getTimestamp(),minTotalCount,aggreJoinTransactionBo.getMinTotalCountAgentId(),maxTotalCount,aggreJoinTransactionBo.getMaxTotalCountAgentId(),totalCount));
  }
  transactionChartMap.put(TransactionChartType.TRANSACTION_COUNT,new TimeSeriesChartBuilder(timeWindow,UNCOLLECTED_TRANSACTION_POINT).build(transactionList));
}
Program: 53554
Project: 53554
Buggy source:
private void testTranCount(TransactionPoint transactionPoint,AggreJoinTransactionBo aggreJoinTransactionBo){
  assertEquals(transactionPoint.getyValForAvg(),aggreJoinTransactionBo.getTotalCount(),0);
  assertEquals(transactionPoint.getyValForMin(),aggreJoinTransactionBo.getMinTotalCount(),0);
  assertEquals(transactionPoint.getyValForMax(),aggreJoinTransactionBo.getMaxTotalCount(),0);
  assertEquals(transactionPoint.getAgentIdForMin(),aggreJoinTransactionBo.getMinTotalCountAgentId());
  assertEquals(transactionPoint.getAgentIdForMax(),aggreJoinTransactionBo.getMaxTotalCountAgentId());
}

Fixed version (ground truth):
private void testTranCount(TransactionPoint transactionPoint,AggreJoinTransactionBo aggreJoinTransactionBo){
  assertEquals(transactionPoint.getyValForAvg(),calculateTPS(aggreJoinTransactionBo.getTotalCount(),aggreJoinTransactionBo.getCollectInterval()),0);
  assertEquals(transactionPoint.getyValForMin(),calculateTPS(aggreJoinTransactionBo.getMinTotalCount(),aggreJoinTransactionBo.getCollectInterval()),0);
  assertEquals(transactionPoint.getyValForMax(),calculateTPS(aggreJoinTransactionBo.getMaxTotalCount(),aggreJoinTransactionBo.getCollectInterval()),0);
  assertEquals(transactionPoint.getAgentIdForMin(),aggreJoinTransactionBo.getMinTotalCountAgentId());
  assertEquals(transactionPoint.getAgentIdForMax(),aggreJoinTransactionBo.getMaxTotalCountAgentId());
}
Program: 53555
Project: 53555
Buggy source:
public Record getException(final int depth,final int parentId,final SpanAlign align){
  if (!align.hasException()) {
    return null;
  }
  final Record record=new Record(depth,getNextId(),parentId,false,getSimpleExceptionName(align.getExceptionClass()),align.getExceptionMessage(),0L,0L,0,null,null,null,null,false,true,align.getTransactionId(),align.getSpanId(),align.getExecutionMilliseconds(),MethodTypeEnum.DEFAULT,true);
  return record;
}

Fixed version (ground truth):
public Record getException(final int depth,final int parentId,final SpanAlign align){
  if (!align.hasException()) {
    return null;
  }
  final Record record=new Record(depth,getNextId(),parentId,false,getSimpleExceptionName(align.getExceptionClass()),getArgumentFromExceptionMessage(align.getExceptionMessage()),0L,0L,0,null,null,null,null,false,true,align.getTransactionId(),align.getSpanId(),align.getExecutionMilliseconds(),MethodTypeEnum.DEFAULT,true);
  return record;
}
Program: 53556
Project: 53556
Buggy source:
public Record getParameter(final int depth,final int parentId,final String method,final String argument){
  return new Record(depth,getNextId(),parentId,false,method,argument,0L,0L,0,null,null,null,null,false,false,null,0,0,MethodTypeEnum.DEFAULT,true);
}

Fixed version (ground truth):
public Record getParameter(final int depth,final int parentId,final String method,final String argument){
  return new Record(depth,getNextId(),parentId,false,method,getArgumentFromParameter(argument),0L,0L,0,null,null,null,null,false,false,null,0,0,MethodTypeEnum.DEFAULT,true);
}
Program: 53557
Project: 53557
Buggy source:
private void sendSimpleRequestPacket(OutputStream outputStream) throws ProtocolException, IOException {
  RequestPacket packet=new RequestPacket(new byte[0]);
  packet.setRequestId(10);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  sendData(outputStream,bb.array());
}

Fixed version (ground truth):
private void sendSimpleRequestPacket(OutputStream outputStream) throws ProtocolException, IOException {
  RequestPacket packet=new RequestPacket(new byte[0]);
  packet.setRequestId(10);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  IOUtils.write(outputStream,bb.array());
}
Program: 53558
Project: 53558
Buggy source:
private ControlHandshakeResponsePacket receiveRegisterConfirmPacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=readData(inputStream);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ControlHandshakeResponsePacket packet=ControlHandshakeResponsePacket.readBuffer(packetType,cb);
  return packet;
}

Fixed version (ground truth):
private ControlHandshakeResponsePacket receiveRegisterConfirmPacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=IOUtils.read(inputStream,50,3000);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ControlHandshakeResponsePacket packet=ControlHandshakeResponsePacket.readBuffer(packetType,cb);
  return packet;
}
Program: 53559
Project: 53559
Buggy source:
private void sendRegisterPacket(OutputStream outputStream,Map<String,Object> properties) throws ProtocolException, IOException {
  byte[] payload=ControlMessageEncodingUtils.encode(properties);
  ControlHandshakePacket packet=new ControlHandshakePacket(1,payload);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  sendData(outputStream,bb.array());
}

Fixed version (ground truth):
private void sendRegisterPacket(OutputStream outputStream,Map<String,Object> properties) throws ProtocolException, IOException {
  byte[] payload=ControlMessageEncodingUtils.encode(properties);
  ControlHandshakePacket packet=new ControlHandshakePacket(1,payload);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  IOUtils.write(outputStream,bb.array());
}
Program: 53560
Project: 53560
Buggy source:
private ResponsePacket readSimpleResponsePacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=readData(inputStream);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ResponsePacket packet=ResponsePacket.readBuffer(packetType,cb);
  return packet;
}

Fixed version (ground truth):
private ResponsePacket readSimpleResponsePacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=IOUtils.read(inputStream,50,3000);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ResponsePacket packet=ResponsePacket.readBuffer(packetType,cb);
  return packet;
}
Program: 53561
Project: 53561
Buggy source:
private void sendSimpleRequestPacket(OutputStream outputStream) throws ProtocolException, IOException {
  RequestPacket packet=new RequestPacket(new byte[0]);
  packet.setRequestId(10);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  sendData(outputStream,bb.array());
}

Fixed version (ground truth):
private void sendSimpleRequestPacket(OutputStream outputStream) throws ProtocolException, IOException {
  RequestPacket packet=new RequestPacket(new byte[0]);
  packet.setRequestId(10);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  IOUtils.write(outputStream,bb.array());
}
Program: 53562
Project: 53562
Buggy source:
private ControlHandshakeResponsePacket receiveRegisterConfirmPacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=readData(inputStream);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ControlHandshakeResponsePacket packet=ControlHandshakeResponsePacket.readBuffer(packetType,cb);
  return packet;
}

Fixed version (ground truth):
private ControlHandshakeResponsePacket receiveRegisterConfirmPacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=IOUtils.read(inputStream,50,3000);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ControlHandshakeResponsePacket packet=ControlHandshakeResponsePacket.readBuffer(packetType,cb);
  return packet;
}
Program: 53563
Project: 53563
Buggy source:
private void sendRegisterPacket(OutputStream outputStream,Map<String,Object> properties) throws ProtocolException, IOException {
  byte[] payload=ControlMessageEncodingUtils.encode(properties);
  ControlHandshakePacket packet=new ControlHandshakePacket(1,payload);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  sendData(outputStream,bb.array());
}

Fixed version (ground truth):
private void sendRegisterPacket(OutputStream outputStream,Map<String,Object> properties) throws ProtocolException, IOException {
  byte[] payload=ControlMessageEncodingUtils.encode(properties);
  ControlHandshakePacket packet=new ControlHandshakePacket(1,payload);
  ByteBuffer bb=packet.toBuffer().toByteBuffer(0,packet.toBuffer().writerIndex());
  IOUtils.write(outputStream,bb.array());
}
Program: 53564
Project: 53564
Buggy source:
private ResponsePacket readSimpleResponsePacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=readData(inputStream);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ResponsePacket packet=ResponsePacket.readBuffer(packetType,cb);
  return packet;
}

Fixed version (ground truth):
private ResponsePacket readSimpleResponsePacket(InputStream inputStream) throws ProtocolException, IOException {
  byte[] payload=IOUtils.read(inputStream,50,3000);
  ChannelBuffer cb=ChannelBuffers.wrappedBuffer(payload);
  short packetType=cb.readShort();
  ResponsePacket packet=ResponsePacket.readBuffer(packetType,cb);
  return packet;
}
Program: 53565
Project: 53565
Buggy source:
private void throwAuthException(String messsage) throws ModelAndViewDefiningException {
  logger.warn(messsage);
  throw new ModelAndViewDefiningException(ControllerUtils.createJsonView(false,messsage));
}

Fixed version (ground truth):
private void throwAuthException(String message) throws ModelAndViewDefiningException {
  logger.warn(message);
  throw new ModelAndViewDefiningException(ControllerUtils.createJsonView(false,message));
}
Program: 53566
Project: 53566
Buggy source:
/** 
 * Returns a list of ip addresses on this machine that is accessible from a remote source. If no network interfaces can be found on this machine, returns an empty List.
 */
public static List<String> getLocalV4IpList(){
  List<String> result=new ArrayList<String>();
  Enumeration<NetworkInterface> interfaces=null;
  try {
    interfaces=NetworkInterface.getNetworkInterfaces();
  }
 catch (  SocketException ignore) {
  }
  if (interfaces == null) {
    return Collections.EMPTY_LIST;
  }
  while (interfaces.hasMoreElements()) {
    NetworkInterface current=interfaces.nextElement();
    if (isSkipIp(current)) {
      continue;
    }
    Enumeration<InetAddress> addresses=current.getInetAddresses();
    while (addresses.hasMoreElements()) {
      InetAddress address=addresses.nextElement();
      if (address.isLoopbackAddress() || !(address instanceof Inet4Address)) {
        continue;
      }
      if (validationIpV4FormatAddress(address.getHostAddress())) {
        result.add(address.getHostAddress());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Returns a list of ip addresses on this machine that is accessible from a remote source. If no network interfaces can be found on this machine, returns an empty List.
 */
public static List<String> getLocalV4IpList(){
  List<String> result=new ArrayList<String>();
  Enumeration<NetworkInterface> interfaces=null;
  try {
    interfaces=NetworkInterface.getNetworkInterfaces();
  }
 catch (  SocketException ignore) {
  }
  if (interfaces == null) {
    return Collections.emptyList();
  }
  while (interfaces.hasMoreElements()) {
    NetworkInterface current=interfaces.nextElement();
    if (isSkipIp(current)) {
      continue;
    }
    Enumeration<InetAddress> addresses=current.getInetAddresses();
    while (addresses.hasMoreElements()) {
      InetAddress address=addresses.nextElement();
      if (address.isLoopbackAddress() || !(address instanceof Inet4Address)) {
        continue;
      }
      if (validationIpV4FormatAddress(address.getHostAddress())) {
        result.add(address.getHostAddress());
      }
    }
  }
  return result;
}
Program: 53567
Project: 53567
Buggy source:
public static String getParameterDescription(String[] params){
  if (params == null) {
    return EMTPY_ARRAY;
  }
  StringBuilder sb=new StringBuilder(64);
  sb.append('(');
  int end=params.length - 1;
  for (int i=0; i < params.length; i++) {
    sb.append(params[i]);
    if (i < end) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(')');
  return sb.toString();
}

Fixed version (ground truth):
public static String getParameterDescription(String[] params){
  if (params == null) {
    return EMPTY_ARRAY;
  }
  StringBuilder sb=new StringBuilder(64);
  sb.append('(');
  int end=params.length - 1;
  for (int i=0; i < params.length; i++) {
    sb.append(params[i]);
    if (i < end) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(')');
  return sb.toString();
}
Program: 53568
Project: 53568
Buggy source:
private String findFromBootDir(final String name,final Pattern pattern){
  String bootDirPath=agentDirPath + File.separator + "String_Node_Str";
  File[] files=listFiles(name,pattern,bootDirPath);
  if (ArrayUtils.isEmpty(files)) {
    logger.info(name + "String_Node_Str");
    return null;
  }
 else   if (files.length == 1) {
    File file=files[0];
    return toCanonicalPath(file);
  }
 else {
    logger.info("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(files));
    return null;
  }
}

Fixed version (ground truth):
private String findFromBootDir(final String name,final Pattern pattern){
  String bootDirPath=agentDirPath + File.separator + "String_Node_Str";
  File[] files=listFiles(name,pattern,bootDirPath);
  if (isEmpty(files)) {
    logger.info(name + "String_Node_Str");
    return null;
  }
 else   if (files.length == 1) {
    File file=files[0];
    return toCanonicalPath(file);
  }
 else {
    logger.info("String_Node_Str" + name + "String_Node_Str"+ Arrays.toString(files));
    return null;
  }
}
Program: 53569
Project: 53569
Buggy source:
private DatabaseInfo parse0(String jdbcUrl){
  final Matcher matcher=PATTERN.matcher(jdbcUrl);
  if (!matcher.find()) {
    throw new IllegalArgumentException();
  }
  String host=matcher.group(2);
  String portString=matcher.group(3);
  String db=matcher.group(4);
  String user=matcher.group(5);
  int port=DEFAULT_PORT;
  if (host == null || host.length() == 0) {
    host=DEFAULT_HOSTNAME;
  }
  if (portString == null || portString.length() == 0) {
    port=DEFAULT_PORT;
  }
 else {
    try {
      port=Integer.parseInt(portString);
    }
 catch (    NumberFormatException e) {
      logger.info("String_Node_Str",portString,jdbcUrl);
    }
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(jdbcUrl);
  String normalizedUrl=maker.clear().before('?').value();
  List<String> hostList=new ArrayList<String>(1);
  final String hostAndPort=host + "String_Node_Str" + portString;
  hostList.add(hostAndPort);
  return new DefaultDatabaseInfo(CubridConstants.CUBRID,CubridConstants.CUBRID_EXECUTE_QUERY,jdbcUrl,normalizedUrl,hostList,db);
}

Fixed version (ground truth):
private DatabaseInfo parse0(String jdbcUrl){
  final Matcher matcher=PATTERN.matcher(jdbcUrl);
  if (!matcher.find()) {
    throw new IllegalArgumentException();
  }
  String host=matcher.group(2);
  String portString=matcher.group(3);
  String db=matcher.group(4);
  String user=matcher.group(5);
  if (host == null || host.length() == 0) {
    host=DEFAULT_HOSTNAME;
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(jdbcUrl);
  String normalizedUrl=maker.clear().before('?').value();
  List<String> hostList=new ArrayList<String>(1);
  final String hostAndPort=host + "String_Node_Str" + portString;
  hostList.add(hostAndPort);
  return new DefaultDatabaseInfo(CubridConstants.CUBRID,CubridConstants.CUBRID_EXECUTE_QUERY,jdbcUrl,normalizedUrl,hostList,db);
}
Program: 53570
Project: 53570
Buggy source:
public DataSourceConstructorInterceptor(TraceContext traceContext,DataSourceMonitorRegistry dataSourceMonitorRegistry,MethodDescriptor methodDescriptor){
  this.traceContext=traceContext;
  this.dataSourceMonitorRegistry=dataSourceMonitorRegistry;
  this.methodDescriptor=methodDescriptor;
}

Fixed version (ground truth):
public DataSourceConstructorInterceptor(DataSourceMonitorRegistry dataSourceMonitorRegistry){
  this.dataSourceMonitorRegistry=dataSourceMonitorRegistry;
}
Program: 53571
Project: 53571
Buggy source:
public DataSourceConstructorInterceptor(TraceContext traceContext,DataSourceMonitorRegistry dataSourceMonitorRegistry,MethodDescriptor methodDescriptor){
  this.traceContext=traceContext;
  this.dataSourceMonitorRegistry=dataSourceMonitorRegistry;
  this.methodDescriptor=methodDescriptor;
}

Fixed version (ground truth):
public DataSourceConstructorInterceptor(DataSourceMonitorRegistry dataSourceMonitorRegistry){
  this.dataSourceMonitorRegistry=dataSourceMonitorRegistry;
}
Program: 53572
Project: 53572
Buggy source:
@Test public void test(){
  ProfilerConfig profilerConfig=new DefaultProfilerConfig();
  InterceptorRegistryBinder binder=new TestInterceptorRegistryBinder();
  AgentOption agentOption=new DefaultAgentOption(new DummyInstrumentation(),"String_Node_Str","String_Node_Str",profilerConfig,new URL[0],null,new DefaultServiceTypeRegistryService(),new DefaultAnnotationKeyRegistryService());
  final PluginApplicationContextModule pluginApplicationContextModule=new PluginApplicationContextModule();
  PluginTestAgent pluginTestAgent=new PluginTestAgent(agentOption){
    @Override protected ApplicationContext newApplicationContext(    AgentOption agentOption,    InterceptorRegistryBinder interceptorRegistryBinder){
      ApplicationContext applicationContext=new DefaultApplicationContext(agentOption,interceptorRegistryBinder){
        @Override protected Module newApplicationContextModule(        AgentOption agentOption,        InterceptorRegistryBinder interceptorRegistryBinder){
          Module applicationContextModule=super.newApplicationContextModule(agentOption,interceptorRegistryBinder);
          return Modules.override(applicationContextModule).with(pluginApplicationContextModule);
        }
      }
;
      return applicationContext;
    }
  }
;
  try {
    pluginTestAgent.start();
  }
  finally {
    pluginTestAgent.stop(true);
  }
}

Fixed version (ground truth):
@Test public void test(){
  ProfilerConfig profilerConfig=new DefaultProfilerConfig();
  AgentOption agentOption=new DefaultAgentOption(new DummyInstrumentation(),"String_Node_Str","String_Node_Str",profilerConfig,new URL[0],null,new DefaultServiceTypeRegistryService(),new DefaultAnnotationKeyRegistryService());
  final PluginApplicationContextModule pluginApplicationContextModule=new PluginApplicationContextModule();
  PluginTestAgent pluginTestAgent=new PluginTestAgent(agentOption){
    @Override protected ApplicationContext newApplicationContext(    AgentOption agentOption,    InterceptorRegistryBinder interceptorRegistryBinder){
      ApplicationContext applicationContext=new DefaultApplicationContext(agentOption,interceptorRegistryBinder){
        @Override protected Module newApplicationContextModule(        AgentOption agentOption,        InterceptorRegistryBinder interceptorRegistryBinder){
          Module applicationContextModule=super.newApplicationContextModule(agentOption,interceptorRegistryBinder);
          return Modules.override(applicationContextModule).with(pluginApplicationContextModule);
        }
      }
;
      return applicationContext;
    }
  }
;
  try {
    pluginTestAgent.start();
  }
  finally {
    pluginTestAgent.stop(true);
  }
}
Program: 53573
Project: 53573
Buggy source:
public static boolean await(TestAwaitTaskUtils awaitTaskUtils,long waitUnitTime,long maxWaitTime){
  StopWatch stopWatch=new StopWatch();
  stopWatch.start();
  while (true) {
    try {
      if (awaitTaskUtils.checkCompleted()) {
        return true;
      }
    }
 catch (    Exception e) {
      LOGGER.warn(e.getMessage(),e);
    }
    try {
      Thread.sleep(waitUnitTime);
    }
 catch (    InterruptedException e) {
    }
    if (stopWatch.stop() > maxWaitTime) {
      return false;
    }
  }
}

Fixed version (ground truth):
public static boolean await(TestAwaitTaskUtils awaitTaskUtils,long waitUnitTime,long maxWaitTime){
  StopWatch stopWatch=new StopWatch();
  stopWatch.start();
  int retryCount=0;
  while (true) {
    LOGGER.info("String_Node_Str",retryCount++,maxWaitTime,stopWatch.stop());
    try {
      if (awaitTaskUtils.checkCompleted()) {
        return true;
      }
    }
 catch (    Exception e) {
      LOGGER.warn(e.getMessage(),e);
    }
    try {
      Thread.sleep(waitUnitTime);
    }
 catch (    InterruptedException e) {
    }
    if (stopWatch.stop() > maxWaitTime) {
      return false;
    }
  }
}
Program: 53574
Project: 53574
Buggy source:
private List<String> getServerData(ZookeeperClient zookeeperClient) throws PinpointZookeeperException, InterruptedException {
  List<String> servers=new ArrayList<>();
  String[] allData=new String(zookeeperClient.getData(PATH)).split("String_Node_Str");
  for (  String data : allData) {
    if (!EMPTY_STRING.equals(data.trim())) {
      servers.add(data);
    }
  }
  return servers;
}

Fixed version (ground truth):
private List<String> getServerData(ZookeeperClient zookeeperClient) throws PinpointZookeeperException, InterruptedException {
  return decodeServerData(zookeeperClient.getData(PATH));
}
Program: 53575
Project: 53575
Buggy source:
@Test public void test1() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    int random=ThreadLocalRandom.current().nextInt(1,10);
    for (int i=0; i < random; i++) {
      PinpointServer mockServer=createMockPinpointServer("String_Node_Str" + i,"String_Node_Str" + i,System.currentTimeMillis());
      zookeeperWorker.addPinpointServer(mockServer);
    }
    waitZookeeperServerData(random,zookeeperClient);
  }
  finally {
    zookeeperWorker.stop();
  }
}

Fixed version (ground truth):
@Test public void test1() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  zookeeperWorker.start();
  try {
    int random=ThreadLocalRandom.current().nextInt(1,10);
    for (int i=0; i < random; i++) {
      PinpointServer mockServer=createMockPinpointServer("String_Node_Str" + i,"String_Node_Str" + i,System.currentTimeMillis());
      zookeeperWorker.addPinpointServer(mockServer);
    }
    waitZookeeperServerData(random,zookeeperClient);
    Assert.assertEquals(random,decodeServerData(zookeeperWorker.getClusterData()).size());
  }
  finally {
    zookeeperWorker.stop();
  }
}
Program: 53576
Project: 53576
Buggy source:
@Test public void test4() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer1=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer1);
    PinpointServer mockServer2=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis() + 1000);
    zookeeperWorker.addPinpointServer(mockServer2);
    waitZookeeperServerData(2,zookeeperClient);
    zookeeperWorker.removePinpointServer(mockServer1);
    waitZookeeperServerData(1,zookeeperClient);
  }
  finally {
    zookeeperWorker.stop();
  }
}

Fixed version (ground truth):
@Test public void test4() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer1=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer1);
    PinpointServer mockServer2=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis() + 1000);
    zookeeperWorker.addPinpointServer(mockServer2);
    waitZookeeperServerData(2,zookeeperClient);
    Assert.assertEquals(2,decodeServerData(zookeeperWorker.getClusterData()).size());
    zookeeperWorker.removePinpointServer(mockServer1);
    waitZookeeperServerData(1,zookeeperClient);
    Assert.assertEquals(1,decodeServerData(zookeeperWorker.getClusterData()).size());
  }
  finally {
    zookeeperWorker.stop();
  }
}
Program: 53577
Project: 53577
Buggy source:
@Test public void test2() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer);
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
    zookeeperWorker.removePinpointServer(mockServer);
    waitZookeeperServerData(0,zookeeperClient);
  }
  finally {
    zookeeperWorker.stop();
  }
}

Fixed version (ground truth):
@Test public void test2() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer);
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
    Assert.assertEquals(1,decodeServerData(zookeeperWorker.getClusterData()).size());
    zookeeperWorker.removePinpointServer(mockServer);
    waitZookeeperServerData(0,zookeeperClient);
    Assert.assertEquals(0,decodeServerData(zookeeperWorker.getClusterData()).size());
  }
  finally {
    zookeeperWorker.stop();
  }
}
Program: 53578
Project: 53578
Buggy source:
@Test public void test3() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
    zookeeperWorker.clear();
    waitZookeeperServerData(0,zookeeperClient);
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
  }
  finally {
    zookeeperWorker.stop();
  }
}

Fixed version (ground truth):
@Test public void test3() throws Exception {
  MockZookeeperClient zookeeperClient=new MockZookeeperClient();
  zookeeperClient.connect();
  ZookeeperJobWorker zookeeperWorker=new ZookeeperJobWorker(zookeeperClient,IDENTIFIER);
  zookeeperWorker.start();
  try {
    PinpointServer mockServer=createMockPinpointServer("String_Node_Str","String_Node_Str",System.currentTimeMillis());
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
    Assert.assertEquals(1,decodeServerData(zookeeperWorker.getClusterData()).size());
    zookeeperWorker.clear();
    waitZookeeperServerData(0,zookeeperClient);
    Assert.assertEquals(0,decodeServerData(zookeeperWorker.getClusterData()).size());
    zookeeperWorker.addPinpointServer(mockServer);
    waitZookeeperServerData(1,zookeeperClient);
    Assert.assertEquals(1,decodeServerData(zookeeperWorker.getClusterData()).size());
  }
  finally {
    zookeeperWorker.stop();
  }
}