nus-yam/ex-repair huggingface dataset:
Program: 53821
Project: 53821
Buggy source:
/** 
 * copy org.apache.http.client.utils.URIUtils#extractHost(java.net.URI)
 * @param uri
 * @return
 */
private NameIntValuePair<String> extractHost(final URI uri){
  if (uri == null) {
    return null;
  }
  NameIntValuePair<String> target=null;
  if (uri.isAbsolute()) {
    int port=uri.getPort();
    String host=uri.getHost();
    if (host == null) {
      host=uri.getAuthority();
      if (host != null) {
        int at=host.indexOf('@');
        if (at >= 0) {
          if (host.length() > at + 1) {
            host=host.substring(at + 1);
          }
 else {
            host=null;
          }
        }
        if (host != null) {
          int colon=host.indexOf(':');
          if (colon >= 0) {
            int pos=colon + 1;
            int len=0;
            for (int i=pos; i < host.length(); i++) {
              if (Character.isDigit(host.charAt(i))) {
                len++;
              }
 else {
                break;
              }
            }
            if (len > 0) {
              try {
                port=Integer.parseInt(host.substring(pos,pos + len));
              }
 catch (              NumberFormatException ex) {
              }
            }
            host=host.substring(0,colon);
          }
        }
      }
    }
    if (host != null) {
      target=new NameIntValuePair<String>(host,port);
    }
  }
  return target;
}

Fixed version (ground truth):
/** 
 * copy org.apache.http.client.utils.URIUtils#extractHost(java.net.URI)
 * @param uri
 * @return
 */
private NameIntValuePair<String> extractHost(final URI uri){
  if (uri == null) {
    return null;
  }
  NameIntValuePair<String> target=null;
  if (uri.isAbsolute()) {
    int port=uri.getPort();
    String host=uri.getHost();
    if (host == null) {
      host=uri.getAuthority();
      if (host != null) {
        int at=host.indexOf('@');
        if (at >= 0) {
          if (host.length() > at + 1) {
            host=host.substring(at + 1);
          }
 else {
            host=null;
          }
        }
        if (host != null) {
          int colon=host.indexOf(':');
          if (colon >= 0) {
            int pos=colon + 1;
            int len=0;
            for (int i=pos; i < host.length(); i++) {
              if (Character.isDigit(host.charAt(i))) {
                len++;
              }
 else {
                break;
              }
            }
            if (len > 0) {
              try {
                port=Integer.parseInt(host.substring(pos,pos + len));
              }
 catch (              NumberFormatException ignore) {
              }
            }
            host=host.substring(0,colon);
          }
        }
      }
    }
    if (host != null) {
      target=new NameIntValuePair<String>(host,port);
    }
  }
  return target;
}
Program: 53822
Project: 53822
Buggy source:
static Map<Integer,String> inverse(){
  Map<Integer,String> map=new HashMap<Integer,String>();
  Field[] fields=java.sql.Types.class.getFields();
  for (  Field field : fields) {
    String name=field.getName();
    try {
      Integer value=(Integer)field.get(java.sql.Types.class);
      map.put(value,name);
    }
 catch (    IllegalAccessException e) {
    }
  }
  return map;
}

Fixed version (ground truth):
static Map<Integer,String> inverse(){
  Map<Integer,String> map=new HashMap<Integer,String>();
  Field[] fields=java.sql.Types.class.getFields();
  for (  Field field : fields) {
    String name=field.getName();
    try {
      Integer value=(Integer)field.get(java.sql.Types.class);
      map.put(value,name);
    }
 catch (    IllegalAccessException ignore) {
    }
  }
  return map;
}
Program: 53823
Project: 53823
Buggy source:
private void close(Closeable closeable){
  if (closeable == null) {
    return;
  }
  try {
    closeable.close();
  }
 catch (  IOException e) {
  }
}

Fixed version (ground truth):
private void close(Closeable closeable){
  if (closeable == null) {
    return;
  }
  try {
    closeable.close();
  }
 catch (  IOException ignore) {
  }
}
Program: 53824
Project: 53824
Buggy source:
@Override public void close(){
  if (out != null) {
    try {
      out.close();
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (out != null) {
    try {
      out.close();
    }
 catch (    IOException ignore) {
    }
  }
}
Program: 53825
Project: 53825
Buggy source:
@Test public void testDropNegative() throws Exception {
  String string="String_Node_Str";
  try {
    StringUtils.drop(string,-1);
    Assert.fail();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Test public void testDropNegative() throws Exception {
  String string="String_Node_Str";
  try {
    StringUtils.drop(string,-1);
    Assert.fail();
  }
 catch (  Exception ignore) {
  }
}
Program: 53826
Project: 53826
Buggy source:
@Override protected synchronized Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  Class clazz=findLoadedClass(name);
  if (clazz == null) {
    if (onLoadClass(name)) {
      clazz=findClass(name);
    }
 else {
      try {
        clazz=parent.loadClass(name);
      }
 catch (      ClassNotFoundException e) {
      }
      if (clazz == null) {
        clazz=findClass(name);
      }
    }
  }
  if (resolve) {
    resolveClass(clazz);
  }
  return clazz;
}

Fixed version (ground truth):
@Override protected synchronized Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
  Class clazz=findLoadedClass(name);
  if (clazz == null) {
    if (onLoadClass(name)) {
      clazz=findClass(name);
    }
 else {
      try {
        clazz=parent.loadClass(name);
      }
 catch (      ClassNotFoundException ignore) {
      }
      if (clazz == null) {
        clazz=findClass(name);
      }
    }
  }
  if (resolve) {
    resolveClass(clazz);
  }
  return clazz;
}
Program: 53827
Project: 53827
Buggy source:
public ClassLoader get(ClassLoader loader){
  final ClassLoader forPlugin=cache.get(loader);
  if (forPlugin != null) {
    return forPlugin;
  }
  final ClassLoader newInstance=new URLClassLoader(pluginJars,loader);
  final ClassLoader before=cache.putIfAbsent(loader,newInstance);
  if (before == null) {
    return newInstance;
  }
 else {
    close(newInstance);
    return before;
  }
}

Fixed version (ground truth):
public ClassLoader get(ClassLoader loader){
  final ClassLoader forPlugin=cache.get(loader);
  if (forPlugin != null) {
    return forPlugin;
  }
  final ClassLoader newInstance=createPluginClassLoader(pluginJars,loader);
  final ClassLoader before=cache.putIfAbsent(loader,newInstance);
  if (before == null) {
    return newInstance;
  }
 else {
    close(newInstance);
    return before;
  }
}
Program: 53828
Project: 53828
Buggy source:
public static <T>PluginLoader<T> get(Class<T> serviceType,String pluginPath){
  URL[] jars=findJars(pluginPath);
  URLClassLoader classLoader=new URLClassLoader(jars,ClassLoader.getSystemClassLoader());
  return new PluginLoader<T>(serviceType,classLoader);
}

Fixed version (ground truth):
public static <T>PluginLoader<T> get(Class<T> serviceType,String pluginPath){
  URL[] jars=findJars(pluginPath);
  URLClassLoader classLoader=createPluginClassLoader(jars,ClassLoader.getSystemClassLoader());
  return new PluginLoader<T>(serviceType,classLoader);
}
Program: 53829
Project: 53829
Buggy source:
public CmsCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=MetricMonitorValues.getLongGauge(gauges,JVM_GC_CMS_COUNT);
  this.gcTime=MetricMonitorValues.getLongGauge(gauges,JVM_GC_CMS_TIME);
}

Fixed version (ground truth):
public CmsCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=getLongGauge(gauges,JVM_GC_CMS_COUNT);
  this.gcTime=getLongGauge(gauges,JVM_GC_CMS_TIME);
}
Program: 53830
Project: 53830
Buggy source:
public G1Collector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=MetricMonitorValues.getLongGauge(gauges,JVM_GC_G1_OLD_COUNT);
  this.gcTime=MetricMonitorValues.getLongGauge(gauges,JVM_GC_G1_OLD_TIME);
}

Fixed version (ground truth):
public G1Collector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=getLongGauge(gauges,JVM_GC_G1_OLD_COUNT);
  this.gcTime=getLongGauge(gauges,JVM_GC_G1_OLD_TIME);
}
Program: 53831
Project: 53831
Buggy source:
public ParallelCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=MetricMonitorValues.getLongGauge(gauges,JVM_GC_PS_MS_COUNT);
  this.gcTime=MetricMonitorValues.getLongGauge(gauges,JVM_GC_PS_MS_TIME);
}

Fixed version (ground truth):
public ParallelCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=getLongGauge(gauges,JVM_GC_PS_MS_COUNT);
  this.gcTime=getLongGauge(gauges,JVM_GC_PS_MS_TIME);
}
Program: 53832
Project: 53832
Buggy source:
public SerialCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=MetricMonitorValues.getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=MetricMonitorValues.getLongGauge(gauges,JVM_GC_SERIAL_MSC_COUNT);
  this.gcTime=MetricMonitorValues.getLongGauge(gauges,JVM_GC_SERIAL_MSC_TIME);
}

Fixed version (ground truth):
public SerialCollector(MetricMonitorRegistry registry){
  if (registry == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final MetricRegistry metricRegistry=registry.getRegistry();
  final SortedMap<String,Gauge> gauges=metricRegistry.getGauges();
  this.heapMax=getLongGauge(gauges,JVM_MEMORY_HEAP_MAX);
  this.heapUsed=getLongGauge(gauges,JVM_MEMORY_HEAP_USED);
  this.heapNonHeapMax=getLongGauge(gauges,JVM_MEMORY_NONHEAP_MAX);
  this.heapNonHeapUsed=getLongGauge(gauges,JVM_MEMORY_NONHEAP_USED);
  this.gcCount=getLongGauge(gauges,JVM_GC_SERIAL_MSC_COUNT);
  this.gcTime=getLongGauge(gauges,JVM_GC_SERIAL_MSC_TIME);
}
Program: 53834
Project: 53834
Buggy source:
@Override public byte[] modify(ClassLoader classLoader,String javassistClassName,ProtectionDomain protectedDomain,byte[] classFileBuffer){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str",javassistClassName);
  }
  try {
    InstrumentClass ibatisClientImpl=byteCodeInstrumentor.getClass(classLoader,javassistClassName,classFileBuffer);
    List<MethodInfo> declaredMethods=ibatisClientImpl.getDeclaredMethods(getIbatisApiMethodFilter());
    for (    MethodInfo method : declaredMethods) {
      Interceptor ibatisApiInterceptor=new IbatisSqlMapOperationInterceptor(serviceType);
      ibatisClientImpl.addScopeInterceptor(method.getName(),method.getParameterTypes(),ibatisApiInterceptor,scope);
    }
    return ibatisClientImpl.toBytecode();
  }
 catch (  Throwable e) {
    this.logger.warn("String_Node_Str",javassistClassName,e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
@Override public byte[] modify(ClassLoader classLoader,String javassistClassName,ProtectionDomain protectedDomain,byte[] classFileBuffer){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str",javassistClassName);
  }
  try {
    InstrumentClass ibatisClientImpl=byteCodeInstrumentor.getClass(classLoader,javassistClassName,classFileBuffer);
    List<MethodInfo> declaredMethods=ibatisClientImpl.getDeclaredMethods(getIbatisApiMethodFilter());
    for (    MethodInfo method : declaredMethods) {
      Interceptor ibatisApiInterceptor=new IbatisSqlMapOperationInterceptor(serviceType);
      ibatisClientImpl.addScopeInterceptor(method.getName(),method.getParameterTypes(),ibatisApiInterceptor,SCOPE);
    }
    return ibatisClientImpl.toBytecode();
  }
 catch (  Throwable e) {
    this.logger.warn("String_Node_Str",javassistClassName,e.getMessage(),e);
    return null;
  }
}
Program: 53835
Project: 53835
Buggy source:
public DefaultSqlSessionModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent){
  super(byteCodeInstrumentor,agent);
  logger=LoggerFactory.getLogger(this.getClass());
}

Fixed version (ground truth):
public DefaultSqlSessionModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent){
  super(byteCodeInstrumentor,agent,DefaultSqlSessionModifier.class);
}
Program: 53836
Project: 53836
Buggy source:
@Override public byte[] modify(ClassLoader classLoader,String javassistClassName,ProtectionDomain protectedDomain,byte[] classFileBuffer){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str",javassistClassName);
  }
  try {
    InstrumentClass myBatisClientImpl=byteCodeInstrumentor.getClass(classLoader,javassistClassName,classFileBuffer);
    List<MethodInfo> declaredMethods=myBatisClientImpl.getDeclaredMethods(getSqlSessionMethodFilter());
    for (    MethodInfo method : declaredMethods) {
      Interceptor sqlSessionInterceptor=new MyBatisSqlMapOperationInterceptor(serviceType);
      myBatisClientImpl.addScopeInterceptor(method.getName(),method.getParameterTypes(),sqlSessionInterceptor,scope);
    }
    return myBatisClientImpl.toBytecode();
  }
 catch (  Throwable e) {
    logger.warn("String_Node_Str",javassistClassName,e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
@Override public byte[] modify(ClassLoader classLoader,String javassistClassName,ProtectionDomain protectedDomain,byte[] classFileBuffer){
  if (logger.isInfoEnabled()) {
    logger.info("String_Node_Str",javassistClassName);
  }
  try {
    InstrumentClass myBatisClientImpl=byteCodeInstrumentor.getClass(classLoader,javassistClassName,classFileBuffer);
    List<MethodInfo> declaredMethods=myBatisClientImpl.getDeclaredMethods(getSqlSessionMethodFilter());
    for (    MethodInfo method : declaredMethods) {
      Interceptor sqlSessionInterceptor=new MyBatisSqlMapOperationInterceptor(serviceType);
      myBatisClientImpl.addScopeInterceptor(method.getName(),method.getParameterTypes(),sqlSessionInterceptor,SCOPE);
    }
    return myBatisClientImpl.toBytecode();
  }
 catch (  Throwable e) {
    logger.warn("String_Node_Str",javassistClassName,e.getMessage(),e);
    return null;
  }
}
Program: 53837
Project: 53837
Buggy source:
public MyBatisClientModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent){
  super(byteCodeInstrumentor,agent);
}

Fixed version (ground truth):
public MyBatisClientModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent,Class<? extends MyBatisClientModifier> childClazz){
  super(byteCodeInstrumentor,agent);
  logger=LoggerFactory.getLogger(childClazz);
}
Program: 53838
Project: 53838
Buggy source:
public SqlSessionTemplateModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent){
  super(byteCodeInstrumentor,agent);
  this.logger=LoggerFactory.getLogger(this.getClass());
}

Fixed version (ground truth):
public SqlSessionTemplateModifier(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent){
  super(byteCodeInstrumentor,agent,SqlSessionTemplateModifier.class);
}
Program: 53839
Project: 53839
Buggy source:
@Deprecated public static String getMachineName(){
  try {
    String name=null;
    Enumeration<NetworkInterface> enet=NetworkInterface.getNetworkInterfaces();
    while (enet.hasMoreElements() && (name == null)) {
      NetworkInterface net=enet.nextElement();
      if (net.isLoopback())       continue;
      Enumeration<InetAddress> eaddr=net.getInetAddresses();
      while (eaddr.hasMoreElements()) {
        InetAddress inet=eaddr.nextElement();
        final String canonicalHostName=inet.getCanonicalHostName();
        if (!canonicalHostName.equalsIgnoreCase(inet.getHostAddress())) {
          name=canonicalHostName;
          break;
        }
      }
    }
    return name;
  }
 catch (  SocketException e) {
    Logger.getLogger(NetworkUtils.class.getClass().getName()).warning(e.getMessage());
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Deprecated public static String getMachineName(){
  try {
    Enumeration<NetworkInterface> enet=NetworkInterface.getNetworkInterfaces();
    while (enet.hasMoreElements()) {
      NetworkInterface net=enet.nextElement();
      if (net.isLoopback()) {
        continue;
      }
      Enumeration<InetAddress> eaddr=net.getInetAddresses();
      while (eaddr.hasMoreElements()) {
        InetAddress inet=eaddr.nextElement();
        final String canonicalHostName=inet.getCanonicalHostName();
        if (!canonicalHostName.equalsIgnoreCase(inet.getHostAddress())) {
          return canonicalHostName;
        }
      }
    }
    return ERROR_HOST_NAME;
  }
 catch (  SocketException e) {
    Logger.getLogger(NetworkUtils.class.getClass().getName()).warning(e.getMessage());
    return ERROR_HOST_NAME;
  }
}
Program: 53840
Project: 53840
Buggy source:
private void sendSMS(String jobName,Date start,Date end){
  String encodeMsg=encodeMessage("String_Node_Str" + jobName + "String_Node_Str"+ start+ "String_Node_Str");
  for (  String number : cellPhoneNumbers) {
    String url=mexServerUrl + "String_Node_Str" + serviceID+ "String_Node_Str"+ "String_Node_Str"+ number+ "String_Node_Str"+ "String_Node_Str"+ number+ "String_Node_Str"+ "String_Node_Str"+ encodeMsg+ "String_Node_Str";
    try {
      URL submitURL=new URL(url);
      HttpURLConnection connection=(HttpURLConnection)submitURL.openConnection();
      connection.setConnectTimeout(3000);
      connection.setReadTimeout(3000);
      connection.setRequestMethod("String_Node_Str");
      connection.setRequestProperty("String_Node_Str","String_Node_Str");
      connection.connect();
      if (connection != null && connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
        logger.error("String_Node_Str");
      }
    }
 catch (    Exception e) {
      logger.error("String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
private void sendSMS(String jobName,Date start,Date end){
  String encodeMsg=encodeMessage("String_Node_Str" + jobName + "String_Node_Str"+ start+ "String_Node_Str");
  for (  String number : cellPhoneNumbers) {
    String url=mexServerUrl + "String_Node_Str" + serviceID+ "String_Node_Str"+ "String_Node_Str"+ number+ "String_Node_Str"+ "String_Node_Str"+ number+ "String_Node_Str"+ "String_Node_Str"+ encodeMsg+ "String_Node_Str";
    HttpURLConnection connection=null;
    try {
      connection=openHttpURLConnection(url);
      connection.setRequestMethod("String_Node_Str");
      connection.connect();
      if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
        logger.error("String_Node_Str");
      }
    }
 catch (    IOException ex) {
      logger.error("String_Node_Str" + ex.getMessage(),ex);
    }
 finally {
      close(connection);
    }
  }
}
Program: 53841
Project: 53841
Buggy source:
public ClassLoader get(ClassLoader loader){
  ClassLoader forPlugin=cache.get(loader);
  if (forPlugin != null) {
    return forPlugin;
  }
  ClassLoader newInstance=new URLClassLoader(pluginJars,loader);
  ClassLoader inCache=cache.putIfAbsent(loader,newInstance);
  return inCache == null ? newInstance : inCache;
}

Fixed version (ground truth):
public ClassLoader get(ClassLoader loader){
  final ClassLoader forPlugin=cache.get(loader);
  if (forPlugin != null) {
    return forPlugin;
  }
  final ClassLoader newInstance=new URLClassLoader(pluginJars,loader);
  final ClassLoader before=cache.putIfAbsent(loader,newInstance);
  if (before == null) {
    return newInstance;
  }
 else {
    close(newInstance);
    return before;
  }
}
Program: 53842
Project: 53842
Buggy source:
private String getEndpoint(String host,int port){
  if (host == null) {
    return "String_Node_Str";
  }
  if (port < 0) {
    return host;
  }
  StringBuilder sb=new StringBuilder(host.length() + 8);
  sb.append(host);
  sb.append(':');
  sb.append(port);
  return sb.toString();
}

Fixed version (ground truth):
private String getEndpoint(String host,int port){
  if (host == null) {
    return "String_Node_Str";
  }
  if (port < 0) {
    return host;
  }
  final StringBuilder sb=new StringBuilder(host.length() + 8);
  sb.append(host);
  sb.append(':');
  sb.append(port);
  return sb.toString();
}
Program: 53843
Project: 53843
Buggy source:
public HttpRequestExecuteInterceptor(){
  this.logger=PLoggerFactory.getLogger(this.getClass());
  this.isDebug=logger.isDebugEnabled();
}

Fixed version (ground truth):
public HttpRequestExecuteInterceptor(){
  super(HttpRequestExecuteInterceptor.class);
}
Program: 53844
Project: 53844
Buggy source:
public HttpUriRequestExecuteInterceptor(){
  this.logger=PLoggerFactory.getLogger(this.getClass());
  this.isDebug=logger.isDebugEnabled();
}

Fixed version (ground truth):
public HttpUriRequestExecuteInterceptor(){
  super(HttpUriRequestExecuteInterceptor.class);
}
Program: 53845
Project: 53845
Buggy source:
private ChildProcessException toException(String message,String exceptionClass,List<String> traceInText){
  StackTraceElement[] stackTrace=new StackTraceElement[traceInText.size()];
  for (int i=0; i < traceInText.size(); i++) {
    String trace=traceInText.get(i);
    String[] tokens=trace.split("String_Node_Str");
    stackTrace[i]=new StackTraceElement(tokens[0],tokens[1],tokens[2],Integer.valueOf(tokens[3]));
  }
  return new ChildProcessException(exceptionClass + "String_Node_Str" + message,stackTrace);
}

Fixed version (ground truth):
private ChildProcessException toException(String message,String exceptionClass,List<String> traceInText){
  StackTraceElement[] stackTrace=new StackTraceElement[traceInText.size()];
  for (int i=0; i < traceInText.size(); i++) {
    String trace=traceInText.get(i);
    String[] tokens=trace.split("String_Node_Str");
    stackTrace[i]=new StackTraceElement(tokens[0],tokens[1],tokens[2],Integer.parseInt(tokens[3]));
  }
  return new ChildProcessException(exceptionClass + "String_Node_Str" + message,stackTrace);
}
Program: 53846
Project: 53846
Buggy source:
public void close(){
  if (clientState.compareAndSet(true,false)) {
    if (zookeeper != null) {
      try {
        zookeeper.close();
      }
 catch (      InterruptedException ignore) {
        logger.debug(ignore.getMessage(),ignore);
      }
    }
  }
}

Fixed version (ground truth):
public void close(){
  if (clientState.compareAndSet(true,false)) {
    if (zookeeper != null) {
      try {
        zookeeper.close();
      }
 catch (      InterruptedException ignore) {
        logger.info("String_Node_Str" + ignore.getMessage(),ignore);
        Thread.currentThread().interrupt();
      }
    }
  }
}
Program: 53847
Project: 53847
Buggy source:
@PreDestroy @Override public void tearDown(){
  if (!config.isClusterEnable()) {
    logger.info("String_Node_Str");
    return;
  }
  if (!(this.serviceState.changeStateDestroying())) {
    WorkerState state=this.serviceState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  if (this.profilerClusterManager != null) {
    profilerClusterManager.stop();
  }
  if (this.webClusterManager != null) {
    webClusterManager.stop();
  }
  if (client != null) {
    client.close();
  }
  if (webCluster != null) {
    webCluster.close();
  }
  this.serviceState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  return;
}

Fixed version (ground truth):
@PreDestroy @Override public void tearDown(){
  if (!config.isClusterEnable()) {
    logger.info("String_Node_Str");
    return;
  }
  if (!(this.serviceState.changeStateDestroying())) {
    WorkerState state=this.serviceState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  if (this.profilerClusterManager != null) {
    profilerClusterManager.stop();
  }
  if (this.webClusterManager != null) {
    webClusterManager.stop();
  }
  if (client != null) {
    client.close();
  }
  if (webCluster != null) {
    webCluster.close();
  }
  this.serviceState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53848
Project: 53848
Buggy source:
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  return;
}

Fixed version (ground truth):
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53849
Project: 53849
Buggy source:
public ZookeeperProfilerClusterManager(ZookeeperClient client,String serverIdentifier,ClusterPointRepository profileCluster){
  this.workerState=new WorkerStateContext();
  this.profileCluster=profileCluster;
  this.client=client;
  this.worker=new ZookeeperLatestJobWorker(client,serverIdentifier);
}

Fixed version (ground truth):
public ZookeeperProfilerClusterManager(ZookeeperClient client,String serverIdentifier,ClusterPointRepository profileCluster){
  this.workerState=new WorkerStateContext();
  this.profileCluster=profileCluster;
  this.worker=new ZookeeperLatestJobWorker(client,serverIdentifier);
}
Program: 53850
Project: 53850
Buggy source:
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  if (worker != null) {
    worker.stop();
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  return;
}

Fixed version (ground truth):
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  if (worker != null) {
    worker.stop();
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53851
Project: 53851
Buggy source:
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  queue.offer(stopTask);
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  return;
}

Fixed version (ground truth):
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  queue.offer(stopTask);
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53852
Project: 53852
Buggy source:
public IDGenerator(int startIndex,int gap){
  AssertUtils.assertTrue(startIndex >= 0,"String_Node_Str");
  AssertUtils.assertTrue(gap > 0,"String_Node_Str");
  this.startIndex=startIndex;
  this.gap=gap;
  idGenerator=new AtomicInteger(startIndex);
}

Fixed version (ground truth):
public IDGenerator(int startIndex,int gap){
  AssertUtils.assertTrue(startIndex >= 0,"String_Node_Str");
  AssertUtils.assertTrue(gap > 0,"String_Node_Str");
  this.gap=gap;
  this.idGenerator=new AtomicInteger(startIndex);
}
Program: 53853
Project: 53853
Buggy source:
public boolean isInterceptable();

Fixed version (ground truth):
boolean isInterceptable();
Program: 53854
Project: 53854
Buggy source:
public MethodDescriptor getDescriptor();

Fixed version (ground truth):
MethodDescriptor getDescriptor();
Program: 53855
Project: 53855
Buggy source:
public String getName();

Fixed version (ground truth):
String getName();
Program: 53856
Project: 53856
Buggy source:
public boolean isConstructor();

Fixed version (ground truth):
boolean isConstructor();
Program: 53857
Project: 53857
Buggy source:
public String[] getParameterTypes();

Fixed version (ground truth):
String[] getParameterTypes();
Program: 53858
Project: 53858
Buggy source:
public int getModifiers();

Fixed version (ground truth):
int getModifiers();
Program: 53859
Project: 53859
Buggy source:
public void warn(String msg,Throwable t);

Fixed version (ground truth):
void warn(String msg,Throwable t);
Program: 53860
Project: 53860
Buggy source:
public void debug(String msg,Throwable t);

Fixed version (ground truth):
void debug(String msg,Throwable t);
Program: 53861
Project: 53861
Buggy source:
public boolean isInfoEnabled();

Fixed version (ground truth):
boolean isInfoEnabled();
Program: 53862
Project: 53862
Buggy source:
public boolean isErrorEnabled();

Fixed version (ground truth):
boolean isErrorEnabled();
Program: 53863
Project: 53863
Buggy source:
public boolean isDebugEnabled();

Fixed version (ground truth):
boolean isDebugEnabled();
Program: 53864
Project: 53864
Buggy source:
public boolean isWarnEnabled();

Fixed version (ground truth):
boolean isWarnEnabled();
Program: 53865
Project: 53865
Buggy source:
public void error(String msg,Throwable t);

Fixed version (ground truth):
void error(String msg,Throwable t);
Program: 53866
Project: 53866
Buggy source:
public void info(String msg,Throwable t);

Fixed version (ground truth):
void info(String msg,Throwable t);
Program: 53867
Project: 53867
Buggy source:
public byte[] edit(ClassLoader classLoader,InstrumentClass target);

Fixed version (ground truth):
byte[] edit(ClassLoader classLoader,InstrumentClass target);
Program: 53868
Project: 53868
Buggy source:
public ClassEditor get(ProfilerPluginContext context);

Fixed version (ground truth):
ClassEditor get(ProfilerPluginContext context);
Program: 53869
Project: 53869
Buggy source:
public boolean check(InstrumentClass target);

Fixed version (ground truth):
boolean check(InstrumentClass target);
Program: 53870
Project: 53870
Buggy source:
public String getTargetClassName();

Fixed version (ground truth):
String getTargetClassName();
Program: 53871
Project: 53871
Buggy source:
public Interceptor getInterceptor(ClassLoader classLoader,InstrumentClass target,MethodInfo targetMethod);

Fixed version (ground truth):
Interceptor getInterceptor(ClassLoader classLoader,InstrumentClass target,MethodInfo targetMethod);
Program: 53872
Project: 53872
Buggy source:
public void inject(ClassLoader classLoader,InstrumentClass target) throws InstrumentException ;

Fixed version (ground truth):
void inject(ClassLoader classLoader,InstrumentClass target) throws InstrumentException ;
Program: 53873
Project: 53873
Buggy source:
public void inject(ClassLoader classLoader,InstrumentClass target) throws InstrumentException ;

Fixed version (ground truth):
void inject(ClassLoader classLoader,InstrumentClass target) throws InstrumentException ;
Program: 53874
Project: 53874
Buggy source:
public List<ClassEditor> getClassEditors(ProfilerPluginContext context);

Fixed version (ground truth):
List<ClassEditor> getClassEditors(ProfilerPluginContext context);
Program: 53875
Project: 53875
Buggy source:
public void insert(final TAgentInfo agentInfo);

Fixed version (ground truth):
void insert(final TAgentInfo agentInfo);
Program: 53876
Project: 53876
Buggy source:
public T map(F thriftObject);

Fixed version (ground truth):
T map(F thriftObject);
Program: 53877
Project: 53877
Buggy source:
public long getTimeSlot(long time);

Fixed version (ground truth):
long getTimeSlot(long time);
Program: 53878
Project: 53878
Buggy source:
public List<Modifier> getModifiers(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent);

Fixed version (ground truth):
List<Modifier> getModifiers(ByteCodeInstrumentor byteCodeInstrumentor,Agent agent);
Program: 53879
Project: 53879
Buggy source:
public boolean addResponseTime(String parentApplicationName,short serviceType,int millis);

Fixed version (ground truth):
boolean addResponseTime(String parentApplicationName,short serviceType,int millis);
Program: 53880
Project: 53880
Buggy source:
@Override public void collect(){
  if (init.get()) {
    return;
  }
  Range range=Range.createUncheckedRange(timeSlotEndTime - slotInterval,timeSlotEndTime);
  List<String> agentIds=applicationIndexDao.selectAgentIds(application.getName());
  for (  String agentId : agentIds) {
    List<AgentStat> scanAgentStatList=agentStatDao.scanAgentStatList(agentId,range);
    int listSize=scanAgentStatList.size();
    long totalHeapSize=0;
    long usedHeapSize=0;
    long jvmCpuUsaged=0;
    for (    AgentStat agentStat : scanAgentStatList) {
      totalHeapSize+=agentStat.getMemoryGc().getJvmMemoryHeapMax();
      usedHeapSize+=agentStat.getMemoryGc().getJvmMemoryHeapUsed();
      jvmCpuUsaged+=agentStat.getCpuLoad().getJvmCpuLoad() * 100;
    }
    if (listSize > 0) {
      long percent=0;
      percent=calculatePercent(usedHeapSize,totalHeapSize);
      agentHeapUsageRate.put(agentId,percent);
      percent=calculatePercent(jvmCpuUsaged,100 * scanAgentStatList.size());
      agentJvmCpuUsageRate.put(agentId,percent);
      long accruedLastGCcount=scanAgentStatList.get(0).getMemoryGc().getJvmGcOldCount();
      long accruedFirstGCcount=scanAgentStatList.get(listSize - 1).getMemoryGc().getJvmGcOldCount();
      agentGcCount.put(agentId,accruedLastGCcount - accruedFirstGCcount);
    }
  }
  init.set(true);
}

Fixed version (ground truth):
@Override public void collect(){
  if (init.get()) {
    return;
  }
  Range range=Range.createUncheckedRange(timeSlotEndTime - slotInterval,timeSlotEndTime);
  List<String> agentIds=applicationIndexDao.selectAgentIds(application.getName());
  for (  String agentId : agentIds) {
    List<AgentStat> scanAgentStatList=agentStatDao.scanAgentStatList(agentId,range);
    int listSize=scanAgentStatList.size();
    long totalHeapSize=0;
    long usedHeapSize=0;
    long jvmCpuUsaged=0;
    for (    AgentStat agentStat : scanAgentStatList) {
      totalHeapSize+=agentStat.getMemoryGc().getJvmMemoryHeapMax();
      usedHeapSize+=agentStat.getMemoryGc().getJvmMemoryHeapUsed();
      jvmCpuUsaged+=agentStat.getCpuLoad().getJvmCpuLoad() * 100;
    }
    if (listSize > 0) {
      long percent=calculatePercent(usedHeapSize,totalHeapSize);
      agentHeapUsageRate.put(agentId,percent);
      percent=calculatePercent(jvmCpuUsaged,100 * scanAgentStatList.size());
      agentJvmCpuUsageRate.put(agentId,percent);
      long accruedLastGCcount=scanAgentStatList.get(0).getMemoryGc().getJvmGcOldCount();
      long accruedFirstGCcount=scanAgentStatList.get(listSize - 1).getMemoryGc().getJvmGcOldCount();
      agentGcCount.put(agentId,accruedLastGCcount - accruedFirstGCcount);
    }
  }
  init.set(true);
}
Program: 53881
Project: 53881
Buggy source:
private long calculatePercent(long used,long total){
  if (total == 0 || used == 0) {
    return 0;
  }
 else {
    return Math.round((used * 100) / total);
  }
}

Fixed version (ground truth):
private long calculatePercent(long used,long total){
  if (total == 0 || used == 0) {
    return 0;
  }
 else {
    return (used * 100L) / total;
  }
}
Program: 53882
Project: 53882
Buggy source:
private int calculatePercent(long count,long totalCount){
  if (totalCount == 0 || count == 0) {
    return 0;
  }
 else {
    return Math.round((count * 100) / totalCount);
  }
}

Fixed version (ground truth):
private long calculatePercent(long count,long totalCount){
  if (totalCount == 0 || count == 0) {
    return 0;
  }
 else {
    return (count * 100L) / totalCount;
  }
}
Program: 53883
Project: 53883
Buggy source:
private int calculatePercent(long value){
  if (totalCount == 0 || value == 0) {
    return 0;
  }
 else {
    return Math.round((value * 100) / totalCount);
  }
}

Fixed version (ground truth):
private long calculatePercent(long value){
  if (totalCount == 0 || value == 0) {
    return 0;
  }
 else {
    return (value * 100L) / totalCount;
  }
}
Program: 53885
Project: 53885
Buggy source:
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  queue.offer(stopTask);
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}

Fixed version (ground truth):
public void stop(){
  if (!(this.workerState.changeStateDestroying())) {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
  logger.info("String_Node_Str",this.getClass().getSimpleName());
  final boolean stopOffer=queue.offer(stopTask);
  if (!stopOffer) {
    logger.warn("String_Node_Str");
  }
  boolean interrupted=false;
  while (this.workerThread.isAlive()) {
    this.workerThread.interrupt();
    try {
      this.workerThread.join(100L);
    }
 catch (    InterruptedException e) {
      interrupted=true;
    }
  }
  this.workerState.changeStateStoped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53886
Project: 53886
Buggy source:
public void handleAndRegisterWatcher(String path){
  if (workerState.isStarted()) {
    if (zNodePath.equals(path)) {
      boolean offerSuccess=queue.offer(getAndRegisterTask);
      if (!offerSuccess) {
        logger.info("String_Node_Str");
      }
    }
 else {
      logger.info("String_Node_Str",path);
    }
  }
 else {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
    return;
  }
}

Fixed version (ground truth):
public void handleAndRegisterWatcher(String path){
  if (workerState.isStarted()) {
    if (zNodePath.equals(path)) {
      final boolean offerSuccess=queue.offer(getAndRegisterTask);
      if (!offerSuccess) {
        logger.info("String_Node_Str");
      }
    }
 else {
      logger.info("String_Node_Str",path);
    }
  }
 else {
    WorkerState state=this.workerState.getCurrentState();
    logger.info("String_Node_Str",this.getClass().getSimpleName(),state.toString());
  }
}
Program: 53887
Project: 53887
Buggy source:
public TBase dispatchRequestMessage(org.apache.thrift.TBase<?,?> tBase,byte[] packet,int offset,int length){
  acceptedTimeService.accept();
  RequestResponseHandler requestResponseHandler=getRequestResponseHandler(tBase);
  if (requestResponseHandler != null) {
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str",requestResponseHandler.getClass().getName());
    }
    return requestResponseHandler.handleRequest(tBase);
  }
  throw new UnsupportedOperationException("String_Node_Str" + tBase);
}

Fixed version (ground truth):
public TBase dispatchRequestMessage(TBase<?,?> tBase,byte[] packet,int offset,int length){
  acceptedTimeService.accept();
  RequestResponseHandler requestResponseHandler=getRequestResponseHandler(tBase);
  if (requestResponseHandler != null) {
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str",requestResponseHandler.getClass().getName());
    }
    return requestResponseHandler.handleRequest(tBase);
  }
  throw new UnsupportedOperationException("String_Node_Str" + tBase);
}
Program: 53888
Project: 53888
Buggy source:
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,AGENT_NAME_MAX_LEN);
}

Fixed version (ground truth):
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN);
}
Program: 53889
Project: 53889
Buggy source:
public void readRowKey(byte[] bytes){
  this.agentId=Bytes.toString(bytes,0,AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(bytes));
  this.apiId=readKeyCode(bytes);
}

Fixed version (ground truth):
public void readRowKey(byte[] bytes){
  this.agentId=Bytes.toString(bytes,0,PinpointConstants.AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(bytes));
  this.apiId=readKeyCode(bytes);
}
Program: 53890
Project: 53890
Buggy source:
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,AGENT_NAME_MAX_LEN + LONG_BYTE_LENGTH);
}

Fixed version (ground truth):
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN + BytesUtils.LONG_BYTE_LENGTH);
}
Program: 53891
Project: 53891
Buggy source:
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,AGENT_NAME_MAX_LEN);
}

Fixed version (ground truth):
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN);
}
Program: 53892
Project: 53892
Buggy source:
public void readRowKey(byte[] rowKey){
  this.agentId=Bytes.toString(rowKey,0,AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.hashCode=readKeyCode(rowKey);
}

Fixed version (ground truth):
public void readRowKey(byte[] rowKey){
  this.agentId=Bytes.toString(rowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.hashCode=readKeyCode(rowKey);
}
Program: 53893
Project: 53893
Buggy source:
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,AGENT_NAME_MAX_LEN + LONG_BYTE_LENGTH);
}

Fixed version (ground truth):
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN + BytesUtils.LONG_BYTE_LENGTH);
}
Program: 53894
Project: 53894
Buggy source:
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,AGENT_NAME_MAX_LEN);
}

Fixed version (ground truth):
private static long readTime(byte[] rowKey){
  return BytesUtils.bytesToLong(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN);
}
Program: 53895
Project: 53895
Buggy source:
public void readRowKey(byte[] rowKey){
  this.agentId=Bytes.toString(rowKey,0,AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.stringId=readKeyCode(rowKey);
}

Fixed version (ground truth):
public void readRowKey(byte[] rowKey){
  this.agentId=Bytes.toString(rowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN).trim();
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.stringId=readKeyCode(rowKey);
}
Program: 53896
Project: 53896
Buggy source:
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,AGENT_NAME_MAX_LEN + LONG_BYTE_LENGTH);
}

Fixed version (ground truth):
private static int readKeyCode(byte[] rowKey){
  return BytesUtils.bytesToInt(rowKey,PinpointConstants.AGENT_NAME_MAX_LEN + BytesUtils.LONG_BYTE_LENGTH);
}
Program: 53897
Project: 53897
Buggy source:
private List<ThreadInfo> getThreadInfo(long pendingTimeMillis){
  List<ThreadInfo> result=new ArrayList<ThreadInfo>();
  if (pendingTimeMillis <= 0) {
    return Arrays.asList(getAllThreadInfo());
  }
  for (  ThreadInfo threadInfo : getAllThreadInfo()) {
    if (threadInfo.getBlockedTime() >= pendingTimeMillis) {
      result.add(threadInfo);
      continue;
    }
    if (threadInfo.getWaitedTime() >= pendingTimeMillis) {
      result.add(threadInfo);
      continue;
    }
  }
  return result;
}

Fixed version (ground truth):
private List<ThreadInfo> getThreadInfo(long pendingTimeMillis){
  List<ThreadInfo> result=new ArrayList<ThreadInfo>();
  if (pendingTimeMillis <= 0) {
    return Arrays.asList(getAllThreadInfo());
  }
  for (  ThreadInfo threadInfo : getAllThreadInfo()) {
    if (threadInfo.getBlockedTime() >= pendingTimeMillis) {
      result.add(threadInfo);
      continue;
    }
    if (threadInfo.getWaitedTime() >= pendingTimeMillis) {
      result.add(threadInfo);
    }
  }
  return result;
}