nus-yam/ex-repair huggingface dataset:
Program: 53978
Project: 53978
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  final Matcher matcher=PATTERN.matcher(url);
  if (!matcher.find()) {
    logger.warn("String_Node_Str",url);
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  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.warn("String_Node_Str",portString,url);
    }
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(url);
  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(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url,normalizedUrl,hostList,db);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,null);
  }
  final Matcher matcher=PATTERN.matcher(url);
  if (!matcher.find()) {
    logger.warn("String_Node_Str",url);
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  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.warn("String_Node_Str",portString,url);
    }
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(url);
  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(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url,normalizedUrl,hostList,db);
}
Program: 53979
Project: 53979
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url);
  }
  StringMaker maker=new StringMaker(url);
  maker.lower().after("String_Node_Str");
  StringMaker before=maker.after("String_Node_Str").before(';');
  final String hostAndPortAndDataBaseString=before.value();
  String databaseId="String_Node_Str";
  String hostAndPortString="String_Node_Str";
  final int databaseIdIndex=hostAndPortAndDataBaseString.indexOf('/');
  if (databaseIdIndex != -1) {
    hostAndPortString=hostAndPortAndDataBaseString.substring(0,databaseIdIndex);
    databaseId=hostAndPortAndDataBaseString.substring(databaseIdIndex + 1,hostAndPortAndDataBaseString.length());
  }
 else {
    hostAndPortString=hostAndPortAndDataBaseString;
  }
  List<String> hostList=new ArrayList<String>(1);
  hostList.add(hostAndPortString);
  if (databaseId.isEmpty()) {
    databaseId=maker.next().after("String_Node_Str").before(';').value();
  }
  String normalizedUrl=maker.clear().before("String_Node_Str").value();
  return new DefaultDatabaseInfo(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url,normalizedUrl,hostList,databaseId);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,null);
  }
  StringMaker maker=new StringMaker(url);
  maker.lower().after("String_Node_Str");
  StringMaker before=maker.after("String_Node_Str").before(';');
  final String hostAndPortAndDataBaseString=before.value();
  String databaseId="String_Node_Str";
  String hostAndPortString="String_Node_Str";
  final int databaseIdIndex=hostAndPortAndDataBaseString.indexOf('/');
  if (databaseIdIndex != -1) {
    hostAndPortString=hostAndPortAndDataBaseString.substring(0,databaseIdIndex);
    databaseId=hostAndPortAndDataBaseString.substring(databaseIdIndex + 1,hostAndPortAndDataBaseString.length());
  }
 else {
    hostAndPortString=hostAndPortAndDataBaseString;
  }
  List<String> hostList=new ArrayList<String>(1);
  hostList.add(hostAndPortString);
  if (databaseId.isEmpty()) {
    databaseId=maker.next().after("String_Node_Str").before(';').value();
  }
  String normalizedUrl=maker.clear().before("String_Node_Str").value();
  return new DefaultDatabaseInfo(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url,normalizedUrl,hostList,databaseId);
}
Program: 53980
Project: 53980
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MYSQL,ServiceType.MYSQL_EXECUTE_QUERY,url);
  }
  if (isLoadbalanceUrl(url)) {
    return parseLoadbalancedUrl(url);
  }
  return parseNormal(url);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MYSQL,ServiceType.MYSQL_EXECUTE_QUERY,null);
  }
  if (isLoadbalanceUrl(url)) {
    return parseLoadbalancedUrl(url);
  }
  return parseNormal(url);
}
Program: 53981
Project: 53981
Buggy source:
public static String mergeParameterVariableNameDescription(String[] parameterType,String[] variableName){
  if (parameterType == null) {
    if (variableName == null) {
      return EMPTY_ARRAY;
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(parameterType) + "String_Node_Str"+ Arrays.toString(variableName));
    }
  }
  if (parameterType.length != variableName.length) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (parameterType.length == 0) {
    return EMPTY_ARRAY;
  }
  StringBuilder sb=new StringBuilder(64);
  sb.append('(');
  int end=parameterType.length - 1;
  for (int i=0; i < parameterType.length; i++) {
    sb.append(parameterType[i]);
    sb.append(' ');
    sb.append(variableName[i]);
    if (i < end) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(')');
  return sb.toString();
}

Fixed version (ground truth):
public static String mergeParameterVariableNameDescription(String[] parameterType,String[] variableName){
  if (parameterType == null && variableName == null) {
    return EMPTY_ARRAY;
  }
  if (variableName != null && parameterType != null) {
    if (parameterType.length != variableName.length) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (parameterType.length == 0) {
      return EMPTY_ARRAY;
    }
    StringBuilder sb=new StringBuilder(64);
    sb.append('(');
    int end=parameterType.length - 1;
    for (int i=0; i < parameterType.length; i++) {
      sb.append(parameterType[i]);
      sb.append(' ');
      sb.append(variableName[i]);
      if (i < end) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(')');
    return sb.toString();
  }
  throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(parameterType) + "String_Node_Str"+ Arrays.toString(variableName));
}
Program: 53982
Project: 53982
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  final Matcher matcher=PATTERN.matcher(url);
  if (!matcher.find()) {
    logger.warn("String_Node_Str",url);
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  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.warn("String_Node_Str",portString,url);
    }
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(url);
  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(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url,normalizedUrl,hostList,db);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,null);
  }
  final Matcher matcher=PATTERN.matcher(url);
  if (!matcher.find()) {
    logger.warn("String_Node_Str",url);
    return JDBCUrlParser.createUnknownDataBase(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url);
  }
  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.warn("String_Node_Str",portString,url);
    }
  }
  if (user == null) {
    user=DEFAULT_USER;
  }
  StringMaker maker=new StringMaker(url);
  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(ServiceType.CUBRID,ServiceType.CUBRID_EXECUTE_QUERY,url,normalizedUrl,hostList,db);
}
Program: 53983
Project: 53983
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url);
  }
  StringMaker maker=new StringMaker(url);
  maker.lower().after("String_Node_Str");
  StringMaker before=maker.after("String_Node_Str").before(';');
  final String hostAndPortAndDataBaseString=before.value();
  String databaseId="String_Node_Str";
  String hostAndPortString="String_Node_Str";
  final int databaseIdIndex=hostAndPortAndDataBaseString.indexOf('/');
  if (databaseIdIndex != -1) {
    hostAndPortString=hostAndPortAndDataBaseString.substring(0,databaseIdIndex);
    databaseId=hostAndPortAndDataBaseString.substring(databaseIdIndex + 1,hostAndPortAndDataBaseString.length());
  }
 else {
    hostAndPortString=hostAndPortAndDataBaseString;
  }
  List<String> hostList=new ArrayList<String>(1);
  hostList.add(hostAndPortString);
  if (databaseId.isEmpty()) {
    databaseId=maker.next().after("String_Node_Str").before(';').value();
  }
  String normalizedUrl=maker.clear().before("String_Node_Str").value();
  return new DefaultDatabaseInfo(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url,normalizedUrl,hostList,databaseId);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,null);
  }
  StringMaker maker=new StringMaker(url);
  maker.lower().after("String_Node_Str");
  StringMaker before=maker.after("String_Node_Str").before(';');
  final String hostAndPortAndDataBaseString=before.value();
  String databaseId="String_Node_Str";
  String hostAndPortString="String_Node_Str";
  final int databaseIdIndex=hostAndPortAndDataBaseString.indexOf('/');
  if (databaseIdIndex != -1) {
    hostAndPortString=hostAndPortAndDataBaseString.substring(0,databaseIdIndex);
    databaseId=hostAndPortAndDataBaseString.substring(databaseIdIndex + 1,hostAndPortAndDataBaseString.length());
  }
 else {
    hostAndPortString=hostAndPortAndDataBaseString;
  }
  List<String> hostList=new ArrayList<String>(1);
  hostList.add(hostAndPortString);
  if (databaseId.isEmpty()) {
    databaseId=maker.next().after("String_Node_Str").before(';').value();
  }
  String normalizedUrl=maker.clear().before("String_Node_Str").value();
  return new DefaultDatabaseInfo(ServiceType.MSSQL,ServiceType.MSSQL_EXECUTE_QUERY,url,normalizedUrl,hostList,databaseId);
}
Program: 53984
Project: 53984
Buggy source:
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MYSQL,ServiceType.MYSQL_EXECUTE_QUERY,url);
  }
  if (isLoadbalanceUrl(url)) {
    return parseLoadbalancedUrl(url);
  }
  return parseNormal(url);
}

Fixed version (ground truth):
@Override public DatabaseInfo parse(String url){
  if (url == null) {
    return JDBCUrlParser.createUnknownDataBase(ServiceType.MYSQL,ServiceType.MYSQL_EXECUTE_QUERY,null);
  }
  if (isLoadbalanceUrl(url)) {
    return parseLoadbalancedUrl(url);
  }
  return parseNormal(url);
}
Program: 53985
Project: 53985
Buggy source:
public static String mergeParameterVariableNameDescription(String[] parameterType,String[] variableName){
  if (parameterType == null) {
    if (variableName == null) {
      return EMPTY_ARRAY;
    }
 else {
      throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(parameterType) + "String_Node_Str"+ Arrays.toString(variableName));
    }
  }
  if (parameterType.length != variableName.length) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (parameterType.length == 0) {
    return EMPTY_ARRAY;
  }
  StringBuilder sb=new StringBuilder(64);
  sb.append('(');
  int end=parameterType.length - 1;
  for (int i=0; i < parameterType.length; i++) {
    sb.append(parameterType[i]);
    sb.append(' ');
    sb.append(variableName[i]);
    if (i < end) {
      sb.append("String_Node_Str");
    }
  }
  sb.append(')');
  return sb.toString();
}

Fixed version (ground truth):
public static String mergeParameterVariableNameDescription(String[] parameterType,String[] variableName){
  if (parameterType == null && variableName == null) {
    return EMPTY_ARRAY;
  }
  if (variableName != null && parameterType != null) {
    if (parameterType.length != variableName.length) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (parameterType.length == 0) {
      return EMPTY_ARRAY;
    }
    StringBuilder sb=new StringBuilder(64);
    sb.append('(');
    int end=parameterType.length - 1;
    for (int i=0; i < parameterType.length; i++) {
      sb.append(parameterType[i]);
      sb.append(' ');
      sb.append(variableName[i]);
      if (i < end) {
        sb.append("String_Node_Str");
      }
    }
    sb.append(')');
    return sb.toString();
  }
  throw new IllegalArgumentException("String_Node_Str" + Arrays.toString(parameterType) + "String_Node_Str"+ Arrays.toString(variableName));
}
Program: 53986
Project: 53986
Buggy source:
/** 
 * Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
 * @param size the initial size.
 * @throws IllegalArgumentException if size is negative.
 */
public UnsafeByteArrayOutputStream(int size){
  if (size < 0) {
    throw new IllegalArgumentException("String_Node_Str" + size);
  }
  buf=new byte[size];
}

Fixed version (ground truth):
/** 
 * Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
 * @param size the initial size.
 * @throws IllegalArgumentException if size is negative.
 */
public UnsafeByteArrayOutputStream(int size){
  super(size);
}
Program: 53987
Project: 53987
Buggy source:
int addSimpleInterceptor0(SimpleAroundInterceptor interceptor){
  if (interceptor == null) {
    return -1;
  }
  int newId=nextId();
  if (newId > max) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index.length + "String_Node_Str"+ id);
  }
  this.simpleIndex[newId]=interceptor;
  return newId;
}

Fixed version (ground truth):
int addSimpleInterceptor0(SimpleAroundInterceptor interceptor){
  if (interceptor == null) {
    return -1;
  }
  int newId=nextId();
  if (newId >= max) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index.length + "String_Node_Str"+ id);
  }
  this.simpleIndex[newId]=interceptor;
  return newId;
}
Program: 53988
Project: 53988
Buggy source:
public int addInterceptor0(StaticAroundInterceptor interceptor){
  if (interceptor == null) {
    return -1;
  }
  int newId=nextId();
  if (newId > max) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index.length + "String_Node_Str"+ id);
  }
  this.index[newId]=interceptor;
  return newId;
}

Fixed version (ground truth):
public int addInterceptor0(StaticAroundInterceptor interceptor){
  if (interceptor == null) {
    return -1;
  }
  int newId=nextId();
  if (newId >= max) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index.length + "String_Node_Str"+ id);
  }
  this.index[newId]=interceptor;
  return newId;
}
Program: 53991
Project: 53991
Buggy source:
public void add(SpanBo span){
  long elapsed=span.getElapsed();
  totalTime+=elapsed;
  if (maxTime < elapsed)   maxTime=elapsed;
  if (minTime > elapsed)   minTime=elapsed;
  this.traces.add(new Trace(new UUID(span.getMostTraceId(),span.getLeastTraceId()).toString(),elapsed,span.getStartTime(),span.isException()));
  if (span.getParentSpanId() == -1) {
    calls++;
  }
}

Fixed version (ground truth):
public void add(SpanBo span){
  long elapsed=span.getElapsed();
  totalTime+=elapsed;
  if (maxTime < elapsed)   maxTime=elapsed;
  if (minTime > elapsed)   minTime=elapsed;
  this.traces.add(new Trace(new UUID(span.getMostTraceId(),span.getLeastTraceId()).toString(),elapsed,span.getStartTime(),span.isException()));
  calls++;
}
Program: 53992
Project: 53992
Buggy source:
public com.profiler.common.dto.thrift.SubSpan toThrift(boolean child){
  com.profiler.common.dto.thrift.SubSpan subSpan=new com.profiler.common.dto.thrift.SubSpan();
  long parentSpanStartTime=parentSpan.getStartTime();
  subSpan.setStartElapsed((int)(startTime - parentSpanStartTime));
  subSpan.setEndElapsed((int)(endTime - startTime));
  subSpan.setSequence(sequence);
  if (!child) {
    subSpan.setAgentId(Agent.getInstance().getAgentId());
    TraceID parentSpanTraceID=parentSpan.getTraceID();
    subSpan.setMostTraceId(parentSpanTraceID.getId().getMostSignificantBits());
    subSpan.setLeastTraceId(parentSpanTraceID.getId().getLeastSignificantBits());
    subSpan.setSpanId(parentSpanTraceID.getSpanId());
  }
  subSpan.setRpc(rpc);
  subSpan.setServiceName(serviceName);
  if (serviceType != null) {
    subSpan.setServiceType(serviceType.getCode());
  }
  subSpan.setEndPoint(endPoint);
  subSpan.setErr(exception);
  List<com.profiler.common.dto.thrift.Annotation> annotationList=new ArrayList<com.profiler.common.dto.thrift.Annotation>(annotations.size());
  for (  HippoAnnotation a : annotations) {
    annotationList.add(a.toThrift());
  }
  subSpan.setAnnotations(annotationList);
  if (depth != null) {
    subSpan.setDepth(depth);
  }
  if (nextSpanId != null) {
    subSpan.setNextSpanId(nextSpanId);
  }
  return subSpan;
}

Fixed version (ground truth):
public com.profiler.common.dto.thrift.SubSpan toThrift(boolean child){
  com.profiler.common.dto.thrift.SubSpan subSpan=new com.profiler.common.dto.thrift.SubSpan();
  long parentSpanStartTime=parentSpan.getStartTime();
  subSpan.setStartElapsed((int)(startTime - parentSpanStartTime));
  subSpan.setEndElapsed((int)(endTime - startTime));
  subSpan.setSequence(sequence);
  if (!child) {
    subSpan.setAgentId(Agent.getInstance().getAgentId());
    TraceID parentSpanTraceID=parentSpan.getTraceID();
    subSpan.setMostTraceId(parentSpanTraceID.getId().getMostSignificantBits());
    subSpan.setLeastTraceId(parentSpanTraceID.getId().getLeastSignificantBits());
    subSpan.setSpanId(parentSpanTraceID.getSpanId());
  }
  subSpan.setRpc(rpc);
  subSpan.setServiceName(serviceName);
  if (serviceType != null) {
    subSpan.setServiceType(serviceType.getCode());
  }
  subSpan.setEndPoint(endPoint);
  subSpan.setErr(exception);
  List<com.profiler.common.dto.thrift.Annotation> annotationList=new ArrayList<com.profiler.common.dto.thrift.Annotation>(annotations.size());
  for (  HippoAnnotation a : annotations) {
    annotationList.add(a.toThrift());
  }
  subSpan.setAnnotations(annotationList);
  if (depth != -1) {
    subSpan.setDepth(depth);
  }
  if (nextSpanId != -1) {
    subSpan.setNextSpanId(nextSpanId);
  }
  return subSpan;
}
Program: 53993
Project: 53993
Buggy source:
private List<com.profiler.common.dto.thrift.SubSpan> createSubSpan(List<SubSpan> subSpanList){
  List<com.profiler.common.dto.thrift.SubSpan> result=new ArrayList<com.profiler.common.dto.thrift.SubSpan>(subSpanList.size());
  for (  SubSpan subSpan : subSpanList) {
    com.profiler.common.dto.thrift.SubSpan tSubSpan=new com.profiler.common.dto.thrift.SubSpan();
    tSubSpan.setAgentId(Agent.getInstance().getAgentId());
    long parentSpanStartTime=subSpan.getParentSpan().getStartTime();
    tSubSpan.setStartElapsed((int)(subSpan.getStartTime() - parentSpanStartTime));
    tSubSpan.setEndElapsed((int)(subSpan.getEndTime() - subSpan.getStartTime()));
    tSubSpan.setSequence(subSpan.getSequence());
    tSubSpan.setRpc(subSpan.getRpc());
    tSubSpan.setServiceName(subSpan.getServiceName());
    tSubSpan.setServiceType(subSpan.getServiceType().getCode());
    tSubSpan.setEndPoint(subSpan.getEndPoint());
    List<com.profiler.common.dto.thrift.Annotation> annotationList=new ArrayList<com.profiler.common.dto.thrift.Annotation>(subSpan.getAnnotationSize());
    for (    HippoAnnotation a : subSpan.getAnnotations()) {
      annotationList.add(a.toThrift());
    }
    tSubSpan.setAnnotations(annotationList);
    result.add(tSubSpan);
  }
  return result;
}

Fixed version (ground truth):
private List<com.profiler.common.dto.thrift.SubSpan> createSubSpan(List<SubSpan> subSpanList){
  List<com.profiler.common.dto.thrift.SubSpan> result=new ArrayList<com.profiler.common.dto.thrift.SubSpan>(subSpanList.size());
  for (  SubSpan subSpan : subSpanList) {
    com.profiler.common.dto.thrift.SubSpan tSubSpan=new com.profiler.common.dto.thrift.SubSpan();
    tSubSpan.setAgentId(Agent.getInstance().getAgentId());
    long parentSpanStartTime=subSpan.getParentSpan().getStartTime();
    tSubSpan.setStartElapsed((int)(subSpan.getStartTime() - parentSpanStartTime));
    tSubSpan.setEndElapsed((int)(subSpan.getEndTime() - subSpan.getStartTime()));
    tSubSpan.setSequence(subSpan.getSequence());
    tSubSpan.setRpc(subSpan.getRpc());
    tSubSpan.setServiceName(subSpan.getServiceName());
    tSubSpan.setServiceType(subSpan.getServiceType().getCode());
    tSubSpan.setEndPoint(subSpan.getEndPoint());
    List<com.profiler.common.dto.thrift.Annotation> annotationList=new ArrayList<com.profiler.common.dto.thrift.Annotation>(subSpan.getAnnotationSize());
    for (    HippoAnnotation a : subSpan.getAnnotations()) {
      annotationList.add(a.toThrift());
    }
    if (subSpan.getDepth() != -1) {
      tSubSpan.setDepth(subSpan.getDepth());
    }
    if (subSpan.getNextSpanId() != -1) {
      tSubSpan.setNextSpanId(subSpan.getNextSpanId());
    }
    tSubSpan.setAnnotations(annotationList);
    result.add(tSubSpan);
  }
  return result;
}
Program: 53994
Project: 53994
Buggy source:
@Override public void before(Object target,String className,String methodName,String parameterDescription,Object[] args){
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + StringUtils.toString(target) + "String_Node_Str"+ className+ "String_Node_Str"+ methodName+ parameterDescription+ "String_Node_Str"+ Arrays.toString(args));
  }
  Trace trace=TraceContext.getTraceContext().currentTraceObject();
  if (trace == null) {
    return;
  }
  trace.traceBlockBegin();
  trace.markBeforeTime();
}

Fixed version (ground truth):
@Override public void before(Object target,String className,String methodName,String parameterDescription,Object[] args){
  if (logger.isLoggable(Level.INFO)) {
    logger.info("String_Node_Str" + StringUtils.toString(target) + "String_Node_Str"+ className+ "String_Node_Str"+ methodName+ parameterDescription+ "String_Node_Str"+ Arrays.toString(args));
  }
  Trace trace=TraceContext.getTraceContext().currentTraceObject();
  if (trace == null) {
    return;
  }
  trace.traceBlockBegin();
  trace.recordRpcName(ServiceType.INTERNAL_METHOD,null,null);
  trace.markBeforeTime();
}
Program: 53995
Project: 53995
Buggy source:
public long getNextSpanStartTime(){
  int nextIndex=index + 1;
  if (nextIndex >= list.size()) {
    return Long.MAX_VALUE;
  }
  return list.get(nextIndex).getSpan().getStartTime();
}

Fixed version (ground truth):
public long getNextSpanStartTime(){
  int nextIndex=index + 1;
  if (nextIndex >= list.size()) {
    return Long.MAX_VALUE;
  }
  return list.get(nextIndex).getSpanBo().getStartTime();
}
Program: 53996
Project: 53996
Buggy source:
private void populatedSpan(List<SpanAlign> populatedList){
  SpanAlign spanAlign=list.get(index);
  SpanBo span=spanAlign.getSpan();
  populatedList.add(spanAlign);
  long startTime=span.getStartTime();
  List<SubSpanBo> subSpanBos=sortSubSpan(span);
  for (  SubSpanBo subSpanBo : subSpanBos) {
    long subStartTime=startTime + subSpanBo.getStartElapsed();
    long nextSpanStartTime=getNextSpanStartTime();
    if (subStartTime <= nextSpanStartTime) {
      SpanAlign subSpanAlign=new SpanAlign(spanAlign.getDepth(),span,subSpanBo);
      subSpanAlign.setSpan(false);
      populatedList.add(subSpanAlign);
    }
 else {
      if (nextSpanStartTime == Long.MAX_VALUE) {
        return;
      }
      index++;
      populatedSpan(populatedList);
    }
  }
  index++;
}

Fixed version (ground truth):
private void populatedSpan(List<SpanAlign> populatedList){
  SpanAlign spanAlign=list.get(index);
  SpanBo span=spanAlign.getSpanBo();
  populatedList.add(spanAlign);
  long startTime=span.getStartTime();
  List<SubSpanBo> subSpanBos=sortSubSpan(span);
  for (  SubSpanBo subSpanBo : subSpanBos) {
    long subStartTime=startTime + subSpanBo.getStartElapsed();
    long nextSpanStartTime=getNextSpanStartTime();
    if (subStartTime <= nextSpanStartTime) {
      SpanAlign subSpanAlign=new SpanAlign(spanAlign.getDepth(),span,subSpanBo);
      subSpanAlign.setSpan(false);
      populatedList.add(subSpanAlign);
    }
 else {
      if (nextSpanStartTime == Long.MAX_VALUE) {
        return;
      }
      index++;
      populatedSpan(populatedList);
    }
  }
  index++;
}
Program: 53997
Project: 53997
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView flow(@RequestParam(value="String_Node_Str") String traceId){
  logger.debug("String_Node_Str",traceId);
  List<SpanAlign> spanAligns=spanService.selectSpan(traceId);
  ModelAndView mv=new ModelAndView("String_Node_Str");
  if (spanAligns.isEmpty()) {
    mv.addObject("String_Node_Str",9);
    mv.setViewName("String_Node_Str");
    return mv;
  }
  mv.addObject("String_Node_Str",spanAligns);
  mv.addObject("String_Node_Str",traceId);
  ServerCallTree callTree=flow.selectServerCallTree(new TraceId(UUID.fromString(traceId)));
  mv.addObject("String_Node_Str",callTree.getNodes());
  mv.addObject("String_Node_Str",callTree.getLinks());
  RecordSet recordset=new RecordSet(spanAligns);
  mv.addObject("String_Node_Str",recordset.getApplicationName());
  mv.addObject("String_Node_Str",recordset.getIterator());
  mv.addObject("String_Node_Str",recordset.getIterator());
  mv.addObject("String_Node_Str",recordset.getStartTime());
  mv.addObject("String_Node_Str",recordset.getEndTime());
  return mv;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView flow(@RequestParam(value="String_Node_Str") String traceId){
  logger.debug("String_Node_Str",traceId);
  ModelAndView mv=new ModelAndView("String_Node_Str");
  try {
    List<SpanAlign> spanAligns=spanService.selectSpan(traceId);
    if (spanAligns.isEmpty()) {
      mv.addObject("String_Node_Str",9);
      mv.setViewName("String_Node_Str");
      return mv;
    }
    mv.addObject("String_Node_Str",spanAligns);
    mv.addObject("String_Node_Str",traceId);
    ServerCallTree callTree=flow.selectServerCallTree(new TraceId(UUID.fromString(traceId)));
    mv.addObject("String_Node_Str",callTree.getNodes());
    mv.addObject("String_Node_Str",callTree.getLinks());
    RecordSet recordset=new RecordSet(spanAligns);
    mv.addObject("String_Node_Str",recordset.getApplicationName());
    mv.addObject("String_Node_Str",recordset.getIterator());
    mv.addObject("String_Node_Str",recordset.getIterator());
    mv.addObject("String_Node_Str",recordset.getStartTime());
    mv.addObject("String_Node_Str",recordset.getEndTime());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return mv;
}
Program: 53998
Project: 53998
Buggy source:
private String getAgentId(SpanAlign spanAlign){
  if (spanAlign.isSpan()) {
    return spanAlign.getSpan().getAgentId();
  }
 else {
    return spanAlign.getSubSpanBo().getAgentId();
  }
}

Fixed version (ground truth):
private String getAgentId(SpanAlign spanAlign){
  if (spanAlign.isSpan()) {
    return spanAlign.getSpanBo().getAgentId();
  }
 else {
    return spanAlign.getSubSpanBo().getAgentId();
  }
}
Program: 54000
Project: 54000
Buggy source:
private void transitionAnnotation(List<SpanAlign> spans,AnnotationReplacementCallback annotationReplacementCallback){
  for (  SpanAlign spanAlign : spans) {
    List<AnnotationBo> annotationBoList;
    if (spanAlign.isSpan()) {
      annotationBoList=spanAlign.getSpan().getAnnotationBoList();
      annotationReplacementCallback.replacement(spanAlign,annotationBoList);
    }
 else {
      annotationBoList=spanAlign.getSubSpanBo().getAnnotationBoList();
      annotationReplacementCallback.replacement(spanAlign,annotationBoList);
    }
  }
}

Fixed version (ground truth):
private void transitionAnnotation(List<SpanAlign> spans,AnnotationReplacementCallback annotationReplacementCallback){
  for (  SpanAlign spanAlign : spans) {
    List<AnnotationBo> annotationBoList;
    if (spanAlign.isSpan()) {
      annotationBoList=spanAlign.getSpanBo().getAnnotationBoList();
      annotationReplacementCallback.replacement(spanAlign,annotationBoList);
    }
 else {
      annotationBoList=spanAlign.getSubSpanBo().getAnnotationBoList();
      annotationReplacementCallback.replacement(spanAlign,annotationBoList);
    }
  }
}
Program: 54001
Project: 54001
Buggy source:
private void addSpanRecord(List<SpanAlign> spanAligns){
  boolean marked=false;
  for (  SpanAlign sa : spanAligns) {
    if (sa.isSpan()) {
      SpanBo span=sa.getSpan();
      AnnotationUtils.sortAnnotationListByKey(span);
      String method=(String)AnnotationUtils.getDisplayMethod(span);
      String arguments=(String)AnnotationUtils.getDisplayArgument(span);
      long begin=span.getStartTime();
      long elapsed=span.getElapsed();
      if (!marked) {
        setStartTime(begin);
        setEndTime(begin + elapsed);
        applicationName=arguments;
        marked=true;
      }
      recordset.add(new Record(sa.getDepth(),true,method,arguments,begin,elapsed,span.getAgentId(),span.getServiceName()));
      addAnnotationRecord(sa.getDepth() + 1,span.getAnnotationBoList());
    }
 else {
      SubSpanBo subSpan=sa.getSubSpanBo();
      AnnotationUtils.sortAnnotationListByKey(subSpan);
      String method=(String)AnnotationUtils.getDisplayMethod(subSpan);
      Object arguments=AnnotationUtils.getDisplayArgument(subSpan);
      long begin=sa.getSpan().getStartTime() + subSpan.getStartElapsed();
      long elapsed=subSpan.getEndElapsed();
      if (!marked) {
        setStartTime(begin);
        setEndTime(begin + elapsed);
        marked=true;
      }
      recordset.add(new Record(sa.getDepth(),true,method,(arguments != null) ? arguments.toString() : "String_Node_Str",begin,elapsed,subSpan.getAgentId(),subSpan.getServiceName()));
      addAnnotationRecord(sa.getDepth() + 1,subSpan.getAnnotationBoList());
    }
  }
}

Fixed version (ground truth):
private void addSpanRecord(List<SpanAlign> spanAligns){
  boolean marked=false;
  for (  SpanAlign sa : spanAligns) {
    if (sa.isSpan()) {
      SpanBo span=sa.getSpanBo();
      AnnotationUtils.sortAnnotationListByKey(span);
      String method=(String)AnnotationUtils.getDisplayMethod(span);
      String arguments=(String)AnnotationUtils.getDisplayArgument(span);
      long begin=span.getStartTime();
      long elapsed=span.getElapsed();
      if (!marked) {
        setStartTime(begin);
        setEndTime(begin + elapsed);
        applicationName=arguments;
        marked=true;
      }
      recordset.add(new Record(sa.getDepth(),true,method,arguments,begin,elapsed,span.getAgentId(),span.getServiceName()));
      addAnnotationRecord(sa.getDepth() + 1,span.getAnnotationBoList());
    }
 else {
      SubSpanBo subSpan=sa.getSubSpanBo();
      AnnotationUtils.sortAnnotationListByKey(subSpan);
      String method=(String)AnnotationUtils.getDisplayMethod(subSpan);
      Object arguments=AnnotationUtils.getDisplayArgument(subSpan);
      long begin=sa.getSpanBo().getStartTime() + subSpan.getStartElapsed();
      long elapsed=subSpan.getEndElapsed();
      if (!marked) {
        setStartTime(begin);
        setEndTime(begin + elapsed);
        marked=true;
      }
      recordset.add(new Record(sa.getDepth(),true,method,(arguments != null) ? arguments.toString() : "String_Node_Str",begin,elapsed,subSpan.getAgentId(),subSpan.getServiceName()));
      addAnnotationRecord(sa.getDepth() + 1,subSpan.getAnnotationBoList());
    }
  }
}
Program: 54002
Project: 54002
Buggy source:
public SpanAligner2(List<SpanBo> spans){
  spanMap=new HashMap<Long,SpanBo>(spans.size());
  long rootSpanStartTime=Long.MAX_VALUE;
  for (  SpanBo span : spans) {
    if (spanMap.containsKey(Long.valueOf(span.getSpanId()))) {
      throw new IllegalStateException("String_Node_Str" + span.getSpanId());
    }
    if (span.getParentSpanId() == -1L) {
      rootSpanId=-1L;
      spanMap.put(-1L,span);
      continue;
    }
 else     if (rootSpanId != -1 && span.getStartTime() < rootSpanStartTime) {
      rootSpanId=(span.getParentSpanId() == -1) ? -1L : span.getSpanId();
      rootSpanStartTime=span.getStartTime();
    }
    spanMap.put(span.getSpanId(),span);
  }
}

Fixed version (ground truth):
public SpanAligner2(List<SpanBo> spans){
  spanMap=new HashMap<Long,SpanBo>(spans.size());
  long rootSpanStartTime=Long.MAX_VALUE;
  for (  SpanBo span : spans) {
    if (spanMap.containsKey(Long.valueOf(span.getSpanId()))) {
      throw new IllegalStateException("String_Node_Str" + span.getSpanId());
    }
    if (span.getParentSpanId() == -1L) {
      rootSpanId=-1L;
      spanMap.put(-1L,span);
      continue;
    }
 else     if ((rootSpanId == null || rootSpanId != -1) && span.getStartTime() < rootSpanStartTime) {
      rootSpanId=(span.getParentSpanId() == -1) ? -1L : span.getSpanId();
      rootSpanStartTime=span.getStartTime();
    }
    spanMap.put(span.getSpanId(),span);
  }
}
Program: 54004
Project: 54004
Buggy source:
public void handler(TBase<?,?> tbase,DatagramPacket datagramPacket){
  assert(tbase instanceof Span);
  try {
    Span span=(Span)tbase;
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str" + span);
    }
    String applicationName=agentIdApplicationIndexDao.selectApplicationName(span.getAgentId());
    if (applicationName == null) {
      logger.warn("String_Node_Str",applicationName);
      return;
    }
 else {
      logger.info("String_Node_Str",applicationName);
    }
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",applicationName);
    }
    ServiceType serviceType=ServiceType.parse(span.getServiceType());
    if (serviceType.isTerminal()) {
      traceDao.insertTerminalSpan(applicationName,span);
      terminalStatistics.update(applicationName,span.getServiceName(),serviceType.getCode(),span.getAgentId(),span.getElapsed());
    }
 else {
      traceDao.insert(applicationName,span);
    }
    if (span.getParentSpanId() == -1) {
      rootTraceIndexDao.insert(span);
    }
    if (serviceType.isIndexable()) {
      traceIndexDao.insert(span);
      applicationTraceIndexDao.insert(applicationName,span);
    }
 else {
      logger.debug("String_Node_Str",span);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void handler(TBase<?,?> tbase,DatagramPacket datagramPacket){
  assert(tbase instanceof Span);
  try {
    Span span=(Span)tbase;
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str" + span);
    }
    String applicationName=agentIdApplicationIndexDao.selectApplicationName(span.getAgentId());
    if (applicationName == null) {
      logger.warn("String_Node_Str",applicationName);
      return;
    }
 else {
      logger.info("String_Node_Str",applicationName);
    }
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str",applicationName);
    }
    ServiceType serviceType=ServiceType.parse(span.getServiceType());
    if (serviceType.isTerminal()) {
      traceDao.insertTerminalSpan(applicationName,span);
      terminalStatistics.update(applicationName,span.getServiceName(),serviceType.getCode(),span.getEndPoint(),span.getElapsed());
    }
 else {
      traceDao.insert(applicationName,span);
    }
    if (span.getParentSpanId() == -1) {
      rootTraceIndexDao.insert(span);
    }
    if (serviceType.isIndexable()) {
      traceIndexDao.insert(span);
      applicationTraceIndexDao.insert(applicationName,span);
    }
 else {
      logger.debug("String_Node_Str",span);
    }
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + e.getMessage(),e);
  }
}
Program: 54005
Project: 54005
Buggy source:
public TerminalStatisticsBo(){
  histogramResolution=HistogramBo.DEFAULT_RESOLUTION;
  histogram=new HistogramBo(histogramResolution);
}

Fixed version (ground truth):
public TerminalStatisticsBo(){
  histogramResolution=HistogramBo.DEFAULT_RESOLUTION_MS;
  histogram=new HistogramBo(histogramResolution);
}
Program: 54006
Project: 54006
Buggy source:
public Server(String id,String applicationName,String endPoint,ServiceType serviceType){
  this.id=id;
  this.applicationName=applicationName;
  this.endPoint=endPoint;
  this.serviceType=serviceType;
}

Fixed version (ground truth):
public Server(String id,String applicationName,String endPoint,ServiceType serviceType,Set<String> agentIds){
  this.id=id;
  this.applicationName=applicationName;
  this.endPoint=endPoint;
  this.serviceType=serviceType;
  this.agentIds=agentIds;
}
Program: 54008
Project: 54008
Buggy source:
public void addSpan(SpanBo span){
  Server server=new Server(span.getAgentId(),span.getServiceName(),span.getEndPoint(),span.isTerminal(),span.getRecursiveCallCount());
  if (server.getId() == null) {
    return;
  }
  if (server.getId().contains("String_Node_Str") || server.getId().contains("String_Node_Str")) {
    return;
  }
  if (!servers.containsKey(server.getId())) {
    servers.put(server.getId(),server);
  }
 else {
    servers.get(server.getId()).mergeWith(server);
  }
  spanIdToServerId.put(String.valueOf(span.getSpanId()),server.getId());
  if (span.getParentSpanId() == -1) {
    businessTransactions.add(span);
  }
 else {
    spans.add(span);
  }
}

Fixed version (ground truth):
public void addSpan(SpanBo span){
  Server server=new Server(span.getAgentId(),span.getServiceName(),span.getEndPoint(),span.isTerminal(),span.getRecursiveCallCount());
  if (server.getId() == null) {
    return;
  }
  if (!servers.containsKey(server.getId())) {
    servers.put(server.getId(),server);
  }
 else {
    servers.get(server.getId()).mergeWith(server);
  }
  spanIdToServerId.put(String.valueOf(span.getSpanId()),server.getId());
  if (span.getParentSpanId() == -1) {
    businessTransactions.add(span);
  }
 else {
    spans.add(span);
  }
}
Program: 54009
Project: 54009
Buggy source:
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView flow(@RequestParam(value="String_Node_Str") String traceId){
  logger.debug("String_Node_Str",traceId);
  List<SpanAlign> spanAligns=spanService.selectSpan(traceId);
  ModelAndView mv=new ModelAndView("String_Node_Str");
  mv.addObject("String_Node_Str",spanAligns);
  mv.addObject("String_Node_Str",traceId);
  Set<TraceId> traceIds=new HashSet<TraceId>(1);
  traceIds.add(new TraceId(UUID.fromString(traceId)));
  ServerCallTree callTree=flow.selectServerCallTree(traceIds);
  mv.addObject("String_Node_Str",callTree.getNodes());
  mv.addObject("String_Node_Str",callTree.getLinks());
  return mv;
}

Fixed version (ground truth):
@RequestMapping(value="String_Node_Str",method=RequestMethod.GET) public ModelAndView flow(@RequestParam(value="String_Node_Str") String traceId){
  logger.debug("String_Node_Str",traceId);
  List<SpanAlign> spanAligns=spanService.selectSpan(traceId);
  ModelAndView mv=new ModelAndView("String_Node_Str");
  mv.addObject("String_Node_Str",spanAligns);
  mv.addObject("String_Node_Str",traceId);
  Set<TraceId> traceIds=new HashSet<TraceId>(1);
  traceIds.add(new TraceId(UUID.fromString(traceId)));
  ServerCallTree callTree=flow.selectServerCallTree(traceIds);
  mv.addObject("String_Node_Str",callTree.getNodes());
  mv.addObject("String_Node_Str",callTree.getLinks());
  RPCCallTree rpcTree=flow.selectRPCCallTree(traceIds);
  mv.addObject("String_Node_Str",rpcTree.getNodes());
  mv.addObject("String_Node_Str",rpcTree.getLinks());
  return mv;
}
Program: 54010
Project: 54010
Buggy source:
private List<SpanBo> refine(List<SpanBo> list){
  SpanBo removeSpan=null;
  boolean rescan=true;
  for (int i=0; i < list.size(); i++) {
    SpanBo span=list.get(i);
    String svcName=span.getServiceName();
    if (removeSpan != null) {
      if (span.getParentSpanId() == removeSpan.getSpanId()) {
        logger.debug("String_Node_Str",span);
        span.setParentSpanId(removeSpan.getParentSpanId());
        span.getAnnotationBoList().addAll(removeSpan.getAnnotationBoList());
        logger.debug("String_Node_Str",span);
        removeSpan=null;
      }
    }
    if ("String_Node_Str".equals(svcName)) {
      removeSpan=list.get(i);
      logger.debug("String_Node_Str",removeSpan);
      list.remove(i);
    }
    if (removeSpan != null && i == list.size() - 1 && rescan) {
      logger.debug("String_Node_Str",removeSpan);
      i=-1;
      rescan=false;
      continue;
    }
  }
  return list;
}

Fixed version (ground truth):
private List<SpanBo> refine(final List<SpanBo> list){
  for (int i=0; i < list.size(); i++) {
    SpanBo span=list.get(i);
    String svcName=span.getServiceName();
    if ("String_Node_Str".equals(svcName)) {
      SpanBo child=findChildSpan(list,span);
      if (child != null) {
        child.setParentSpanId(span.getParentSpanId());
        child.getAnnotationBoList().addAll(span.getAnnotationBoList());
      }
      list.remove(i);
      i--;
    }
  }
  return list;
}
Program: 54012
Project: 54012
Buggy source:
public void start(){
  logger.info("String_Node_Str");
  Trace.addTracer(new DefaultTracer());
  systemMonitor.start();
}

Fixed version (ground truth):
public void start(){
  logger.info("String_Node_Str");
  systemMonitor.start();
}
Program: 54013
Project: 54013
Buggy source:
private void logSpan(Span span){
  System.out.println("String_Node_Str" + span);
}

Fixed version (ground truth):
private void logSpan(Span span){
  System.out.println("String_Node_Str" + span.hashCode() + "String_Node_Str"+ span+ "String_Node_Str"+ spanMap.size()+ "String_Node_Str"+ Thread.currentThread().getId());
}
Program: 54014
Project: 54014
Buggy source:
@Override public void before(Object target,String className,String methodName,Object[] args){
  try {
    HttpServletRequest request=(HttpServletRequest)args[0];
    String requestURL=request.getRequestURI();
    String clientIP=request.getRemoteAddr();
    String traceID=request.getHeader(Header.HTTP_TRACE_ID.toString());
    String parentSpanID=request.getHeader(Header.HTTP_PARENT_SPAN_ID.toString());
    String spanID=request.getHeader(Header.HTTP_SPAN_ID.toString());
    Boolean sampled=null;
    if (request.getHeader(Header.HTTP_SAMPLED.toString()) != null) {
      sampled=Boolean.valueOf(request.getHeader(Header.HTTP_SAMPLED.toString()));
    }
    Integer flags=null;
    if (request.getHeader(Header.HTTP_FLAGS.toString()) != null) {
      flags=Integer.valueOf(request.getHeader(Header.HTTP_FLAGS.toString()));
    }
    String parameters=getParameter(request);
    if (traceID != null) {
      Trace.setTraceId(new TraceID(traceID,parentSpanID,spanID,sampled,flags));
    }
 else {
      Trace.setTraceId(TraceID.newTraceId());
    }
    Trace.recordRpcName("String_Node_Str",requestURL);
    Trace.recordServerAddr(request.getLocalAddr(),request.getLocalPort());
    Trace.record("String_Node_Str" + parameters);
    Trace.record(new Annotation.ServerRecv());
    RequestTracer.startTransaction(requestURL,clientIP,System.currentTimeMillis(),parameters);
    start.set(System.currentTimeMillis());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void before(Object target,String className,String methodName,Object[] args){
  try {
    HttpServletRequest request=(HttpServletRequest)args[0];
    String requestURL=request.getRequestURI();
    String clientIP=request.getRemoteAddr();
    String traceID=request.getHeader(Header.HTTP_TRACE_ID.toString());
    String parentSpanID=request.getHeader(Header.HTTP_PARENT_SPAN_ID.toString());
    String spanID=request.getHeader(Header.HTTP_SPAN_ID.toString());
    Boolean sampled=null;
    if (request.getHeader(Header.HTTP_SAMPLED.toString()) != null) {
      sampled=Boolean.valueOf(request.getHeader(Header.HTTP_SAMPLED.toString()));
    }
    Integer flags=null;
    if (request.getHeader(Header.HTTP_FLAGS.toString()) != null) {
      flags=Integer.valueOf(request.getHeader(Header.HTTP_FLAGS.toString()));
    }
    String parameters=getParameter(request);
    if (traceID != null) {
      Trace.setTraceId(new TraceID(traceID,parentSpanID,spanID,sampled,flags));
    }
 else {
      Trace.setTraceId(TraceID.newTraceId());
    }
    Trace.recordRpcName("String_Node_Str",requestURL);
    Trace.recordServerAddr(request.getLocalAddr(),request.getLocalPort());
    Trace.record("String_Node_Str" + parameters);
    Trace.record(new Annotation.ServerRecv());
    RequestTracer.startTransaction(requestURL,clientIP,System.currentTimeMillis(),parameters);
    start.set(System.currentTimeMillis());
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    System.out.println("String_Node_Str");
  }
}
Program: 54015
Project: 54015
Buggy source:
@Override public void after(Object target,String className,String methodName,Object[] args,Object result){
  Trace.record(new Annotation.ServerSend(),System.currentTimeMillis() - start.get());
  start.remove();
  RequestTracer.endTransaction();
}

Fixed version (ground truth):
@Override public void after(Object target,String className,String methodName,Object[] args,Object result){
  Trace.record(new Annotation.ServerSend(),System.currentTimeMillis() - start.get());
  start.remove();
  System.out.println("String_Node_Str");
  RequestTracer.endTransaction();
}