nus-yam/ex-repair huggingface dataset:
Program: 53768
Project: 53768
Buggy source:
@Test public void testRead4PrefixedString() throws Exception {
  String value="String_Node_Str";
  byte[] length=Bytes.toBytes(value.length());
  byte[] string=Bytes.toBytes(value);
  byte[] result=Bytes.add(length,string);
  Buffer buffer=new FixedBuffer(result);
  String prefixedString=buffer.read4PrefixedString();
  Assert.assertEquals(prefixedString,value);
}

Fixed version (ground truth):
@Test public void testRead4PrefixedString() throws Exception {
  String value="String_Node_Str";
  byte[] length=Ints.toByteArray(value.length());
  byte[] string=value.getBytes();
  byte[] result=BytesUtils.merge(length,string);
  Buffer buffer=new FixedBuffer(result);
  String prefixedString=buffer.read4PrefixedString();
  Assert.assertEquals(prefixedString,value);
}
Program: 53769
Project: 53769
Buggy source:
@Test public void testRead4PrefixedString_Null() throws Exception {
  byte[] length=Bytes.toBytes(-1);
  Buffer buffer=new FixedBuffer(length);
  String prefixedString=buffer.read4PrefixedString();
  Assert.assertEquals(prefixedString,null);
}

Fixed version (ground truth):
@Test public void testRead4PrefixedString_Null() throws Exception {
  byte[] length=Ints.toByteArray(-1);
  Buffer buffer=new FixedBuffer(length);
  String prefixedString=buffer.read4PrefixedString();
  Assert.assertEquals(prefixedString,null);
}
Program: 53770
Project: 53770
Buggy source:
@Test public void testPadBytes() throws Exception {
  int TOTAL_LENGTH=20;
  int TEST_SIZE=10;
  int PAD_SIZE=TOTAL_LENGTH - TEST_SIZE;
  Buffer buffer=new FixedBuffer(32);
  byte[] test=new byte[10];
  random.nextBytes(test);
  buffer.putPadBytes(test,TOTAL_LENGTH);
  byte[] result=buffer.getBuffer();
  Assert.assertEquals(result.length,TOTAL_LENGTH);
  Assert.assertTrue("String_Node_Str",Bytes.equals(test,0,TEST_SIZE,result,0,TEST_SIZE));
  byte[] padBytes=new byte[TOTAL_LENGTH - TEST_SIZE];
  Assert.assertTrue("String_Node_Str",Bytes.equals(padBytes,0,TEST_SIZE,result,TEST_SIZE,PAD_SIZE));
}

Fixed version (ground truth):
@Test public void testPadBytes() throws Exception {
  int TOTAL_LENGTH=20;
  int TEST_SIZE=10;
  Buffer buffer=new FixedBuffer(32);
  byte[] test=new byte[10];
  random.nextBytes(test);
  buffer.putPadBytes(test,TOTAL_LENGTH);
  byte[] result=buffer.getBuffer();
  Assert.assertEquals(result.length,TOTAL_LENGTH);
  Assert.assertTrue("String_Node_Str",Arrays.equals(Arrays.copyOfRange(test,0,TEST_SIZE),Arrays.copyOfRange(result,0,TEST_SIZE)));
  byte[] padBytes=new byte[TOTAL_LENGTH - TEST_SIZE];
  Assert.assertTrue("String_Node_Str",Arrays.equals(Arrays.copyOfRange(padBytes,0,TEST_SIZE),Arrays.copyOfRange(result,TEST_SIZE,TOTAL_LENGTH)));
}
Program: 53771
Project: 53771
Buggy source:
public void find_SVarInt_errorCode() throws Exception {
  Random random=new Random();
  byte[] bytes=new byte[10];
  while (true) {
    random.nextBytes(bytes);
    Buffer buffer=new FixedBuffer(bytes);
    try {
      int i=buffer.readVarInt();
    }
 catch (    IllegalArgumentException e) {
      logger.info(e.getMessage(),e);
      String binaryString=Bytes.toStringBinary(bytes);
      logger.info(binaryString);
      ;
      for (      byte aByte : bytes) {
        String code=String.valueOf((int)aByte);
        logger.info(code);
      }
      return;
    }
  }
}

Fixed version (ground truth):
public void find_SVarInt_errorCode() throws Exception {
  Random random=new Random();
  byte[] bytes=new byte[10];
  while (true) {
    random.nextBytes(bytes);
    Buffer buffer=new FixedBuffer(bytes);
    try {
      int i=buffer.readVarInt();
    }
 catch (    IllegalArgumentException e) {
      logger.info(e.getMessage(),e);
      String binaryString=BytesUtils.toString(bytes);
      logger.info(binaryString);
      ;
      for (      byte aByte : bytes) {
        String code=String.valueOf((int)aByte);
        logger.info(code);
      }
      return;
    }
  }
}
Program: 53772
Project: 53772
Buggy source:
public void find_SVarLong_errorCode() throws Exception {
  Random random=new Random();
  byte[] bytes=new byte[10];
  while (true) {
    random.nextBytes(bytes);
    Buffer buffer=new FixedBuffer(bytes);
    try {
      long i=buffer.readVarLong();
    }
 catch (    IllegalArgumentException e) {
      logger.info(e.getMessage(),e);
      String binaryString=Bytes.toStringBinary(bytes);
      logger.info(binaryString);
      ;
      for (      byte aByte : bytes) {
        String code=String.valueOf((int)aByte);
        logger.info(code);
      }
      return;
    }
  }
}

Fixed version (ground truth):
public void find_SVarLong_errorCode() throws Exception {
  Random random=new Random();
  byte[] bytes=new byte[10];
  while (true) {
    random.nextBytes(bytes);
    Buffer buffer=new FixedBuffer(bytes);
    try {
      long i=buffer.readVarLong();
    }
 catch (    IllegalArgumentException e) {
      logger.info(e.getMessage(),e);
      String binaryString=BytesUtils.toString(bytes);
      logger.info(binaryString);
      ;
      for (      byte aByte : bytes) {
        String code=String.valueOf((int)aByte);
        logger.info(code);
      }
      return;
    }
  }
}
Program: 53773
Project: 53773
Buggy source:
@Test public void testMakeColumnName() throws Exception {
  final byte[] columnNameBytes=ApplicationMapStatisticsUtils.makeColumnName("String_Node_Str",(short)10);
  short slotNumber=Bytes.toShort(columnNameBytes);
  Assert.assertEquals(slotNumber,10);
  String columnName=Bytes.toString(columnNameBytes,Bytes.SIZEOF_SHORT,columnNameBytes.length - Bytes.SIZEOF_SHORT);
  Assert.assertEquals(columnName,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testMakeColumnName() throws Exception {
  final byte[] columnNameBytes=ApplicationMapStatisticsUtils.makeColumnName("String_Node_Str",(short)10);
  short slotNumber=BytesUtils.bytesToShort(columnNameBytes,0);
  Assert.assertEquals(slotNumber,10);
  String columnName=BytesUtils.toString(columnNameBytes,BytesUtils.SHORT_BYTE_LENGTH,columnNameBytes.length - BytesUtils.SHORT_BYTE_LENGTH);
  Assert.assertEquals(columnName,"String_Node_Str");
}
Program: 53774
Project: 53774
Buggy source:
@Test public void testAddStringLong(){
  byte[] testAgents=BytesUtils.add("String_Node_Str",11L);
  byte[] buf=Bytes.add(Bytes.toBytes("String_Node_Str"),Bytes.toBytes(11L));
  Assert.assertArrayEquals(testAgents,buf);
}

Fixed version (ground truth):
@Test public void testAddStringLong(){
  byte[] testAgents=BytesUtils.add("String_Node_Str",11L);
  byte[] buf=ByteBuffer.allocate(17).put("String_Node_Str".getBytes()).putLong(11L).array();
  Assert.assertArrayEquals(testAgents,buf);
}
Program: 53775
Project: 53775
Buggy source:
private void checkInt(int i){
  byte[] bytes=Bytes.toBytes(i);
  int i2=BytesUtils.bytesToInt(bytes,0);
  Assert.assertEquals(i,i2);
  int i3=Bytes.toInt(bytes);
  Assert.assertEquals(i,i3);
}

Fixed version (ground truth):
private void checkInt(int i){
  byte[] bytes=Ints.toByteArray(i);
  int i2=BytesUtils.bytesToInt(bytes,0);
  Assert.assertEquals(i,i2);
  int i3=Ints.fromByteArray(bytes);
  Assert.assertEquals(i,i3);
}
Program: 53776
Project: 53776
Buggy source:
private void check(String agentId0,long l1){
  TSpan span=new TSpan();
  span.setAgentId(agentId0);
  span.setStartTime(l1);
  byte[] traceIndexRowKey=SpanUtils.getAgentIdTraceIndexRowKey(span.getAgentId(),span.getStartTime());
  String agentId=Bytes.toString(traceIndexRowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN).trim();
  Assert.assertEquals(agentId0,agentId);
  long time=TimeUtils.recoveryTimeMillis(Bytes.toLong(traceIndexRowKey,PinpointConstants.AGENT_NAME_MAX_LEN));
  Assert.assertEquals(time,l1);
}

Fixed version (ground truth):
private void check(String agentId0,long l1){
  TSpan span=new TSpan();
  span.setAgentId(agentId0);
  span.setStartTime(l1);
  byte[] traceIndexRowKey=SpanUtils.getAgentIdTraceIndexRowKey(span.getAgentId(),span.getStartTime());
  String agentId=BytesUtils.toString(traceIndexRowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN).trim();
  Assert.assertEquals(agentId0,agentId);
  long time=Longs.fromByteArray(Arrays.copyOfRange(traceIndexRowKey,PinpointConstants.AGENT_NAME_MAX_LEN,PinpointConstants.AGENT_NAME_MAX_LEN + 8));
  time=TimeUtils.recoveryTimeMillis(time);
  Assert.assertEquals(time,l1);
}
Program: 53777
Project: 53777
Buggy source:
public PluginClassLoader run(){
  return new PluginClassLoader(urls,parent);
}

Fixed version (ground truth):
public PluginLoaderClassLoader run(){
  return new PluginLoaderClassLoader(urls,parent);
}
Program: 53778
Project: 53778
Buggy source:
private static PluginClassLoader createPluginClassLoader(final URL[] urls,final ClassLoader parent){
  if (SECURITY_MANAGER != null) {
    return AccessController.doPrivileged(new PrivilegedAction<PluginClassLoader>(){
      public PluginClassLoader run(){
        return new PluginClassLoader(urls,parent);
      }
    }
);
  }
 else {
    return new PluginClassLoader(urls,parent);
  }
}

Fixed version (ground truth):
private static PluginLoaderClassLoader createPluginClassLoader(final URL[] urls,final ClassLoader parent){
  if (SECURITY_MANAGER != null) {
    return AccessController.doPrivileged(new PrivilegedAction<PluginLoaderClassLoader>(){
      public PluginLoaderClassLoader run(){
        return new PluginLoaderClassLoader(urls,parent);
      }
    }
);
  }
 else {
    return new PluginLoaderClassLoader(urls,parent);
  }
}
Program: 53779
Project: 53779
Buggy source:
public PluginClassLoader run(){
  return new PluginClassLoader(urls,parent);
}

Fixed version (ground truth):
public ClassLoader run(){
  return createPluginClassLoader0(urls,parent);
}
Program: 53780
Project: 53780
Buggy source:
private PluginClassLoader createPluginClassLoader(final URL[] urls,final ClassLoader parent){
  if (SECURITY_MANAGER != null) {
    return AccessController.doPrivileged(new PrivilegedAction<PluginClassLoader>(){
      public PluginClassLoader run(){
        return new PluginClassLoader(urls,parent);
      }
    }
);
  }
 else {
    return new PluginClassLoader(urls,parent);
  }
}

Fixed version (ground truth):
private ClassLoader createPluginClassLoader(final URL[] urls,final ClassLoader parent){
  if (SECURITY_MANAGER != null) {
    return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>(){
      public ClassLoader run(){
        return createPluginClassLoader0(urls,parent);
      }
    }
);
  }
 else {
    return createPluginClassLoader0(urls,parent);
  }
}
Program: 53782
Project: 53782
Buggy source:
private void recordRootSpan(final Trace trace,final HttpServletRequest request){
  trace.markBeforeTime();
  trace.recordServiceType(TomcatConstants.TOMCAT);
  final String requestURL=request.getRequestURI();
  trace.recordRpcName(requestURL);
  final int port=request.getServerPort();
  final String endPoint=request.getServerName() + "String_Node_Str" + port;
  trace.recordEndPoint(endPoint);
  final String remoteAddr=request.getRemoteAddr();
  trace.recordRemoteAddress(remoteAddr);
  if (!trace.isRoot()) {
    recordParentInfo(trace,request);
  }
  trace.recordApi(TomcatConstants.SERVLET_SYNCHRONOUS_API_TAG);
}

Fixed version (ground truth):
private void recordRootSpan(final Trace trace,final HttpServletRequest request){
  trace.markBeforeTime();
  trace.recordServiceType(TomcatConstants.TOMCAT);
  final String requestURL=request.getRequestURI();
  trace.recordRpcName(requestURL);
  final int port=request.getServerPort();
  final String endPoint=request.getServerName() + "String_Node_Str" + port;
  trace.recordEndPoint(endPoint);
  final String remoteAddr=request.getRemoteAddr();
  trace.recordRemoteAddress(remoteAddr);
  if (!trace.isRoot()) {
    recordParentInfo(trace,request);
  }
  trace.recordApi(SERVLET_SYNCHRONOUS_API_TAG);
}
Program: 53783
Project: 53783
Buggy source:
public ApplicationServerTypeResolver(List<DefaultProfilerPluginContext> plugins,ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ServerTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector))     ;
    this.detectors.add(registeredDetectors.remove(orderedDetector));
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}

Fixed version (ground truth):
public ApplicationServerTypeResolver(List<DefaultProfilerPluginContext> plugins,ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ServerTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector)) {
      this.detectors.add(registeredDetectors.remove(orderedDetector));
    }
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}
Program: 53784
Project: 53784
Buggy source:
public ApplicationServerTypeResolver(List<DefaultProfilerPluginContext> plugins,ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ServerTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector))     ;
    this.detectors.add(registeredDetectors.remove(orderedDetector));
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}

Fixed version (ground truth):
public ApplicationServerTypeResolver(List<DefaultProfilerPluginContext> plugins,ServiceType defaultType,List<String> orderedDetectors){
  if (isValidApplicationServerType(defaultType)) {
    this.defaultType=defaultType;
  }
 else {
    this.defaultType=ServiceType.UNDEFINED;
  }
  Map<String,ServerTypeDetector> registeredDetectors=getRegisteredServerTypeDetectors(plugins);
  for (  String orderedDetector : orderedDetectors) {
    if (registeredDetectors.containsKey(orderedDetector)) {
      this.detectors.add(registeredDetectors.remove(orderedDetector));
    }
  }
  this.detectors.addAll(registeredDetectors.values());
  this.resolver=new ApplicationServerTypePluginResolver(this.detectors);
}
Program: 53785
Project: 53785
Buggy source:
public boolean findClass(String javassistClassName,ClassPool classPool){
  URL url=classPool.find(javassistClassName);
  if (url == null) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean findClass(ClassLoader classLoader,String javassistClassName){
  ClassPool classPool=findClassPool(classLoader);
  return findClass(javassistClassName,classPool);
}
Program: 53786
Project: 53786
Buggy source:
private void addOracleDriver(){
  AbstractModifier oracleDriverModifier=new OracleDriverModifier(byteCodeInstrumentor,agent);
  addModifier(oracleDriverModifier);
  AbstractModifier oracleConnectionModifier=new PhysicalConnectionModifier(byteCodeInstrumentor,agent);
  addModifier(oracleConnectionModifier);
  AbstractModifier oraclePreparedStatementModifier=new OraclePreparedStatementWrapperModifier(byteCodeInstrumentor,agent);
  addModifier(oraclePreparedStatementModifier);
  AbstractModifier oracleStatement=new OracleStatementWrapperModifier(byteCodeInstrumentor,agent);
  addModifier(oracleStatement);
}

Fixed version (ground truth):
private void addOracleDriver(){
  AbstractModifier oracleDriverModifier=new OracleDriverModifier(byteCodeInstrumentor,agent);
  addModifier(oracleDriverModifier);
  AbstractModifier oracleConnectionModifier=new PhysicalConnectionModifier(byteCodeInstrumentor,agent);
  addModifier(oracleConnectionModifier);
  AbstractModifier oraclePreparedStatementWrapperModifier=new OraclePreparedStatementWrapperModifier(byteCodeInstrumentor,agent);
  addModifier(oraclePreparedStatementWrapperModifier);
  AbstractModifier oraclePreparedStatementModifier=new OraclePreparedStatementModifier(byteCodeInstrumentor,agent);
  addModifier(oraclePreparedStatementModifier);
  AbstractModifier oracleStatementWrapperModifier=new OracleStatementWrapperModifier(byteCodeInstrumentor,agent);
  addModifier(oracleStatementWrapperModifier);
  AbstractModifier oracleStatementModifier=new OracleStatementModifier(byteCodeInstrumentor,agent);
  addModifier(oracleStatementModifier);
}
Program: 53787
Project: 53787
Buggy source:
@Override public void doInAfterTrace(RecordableTrace trace,Object target,Object[] args,Object result,Throwable throwable){
  ParsingResult parsingResult=((ParsingResultTraceValue)result)._$PINPOINT$_getTraceParsingResult();
  trace.recordSqlParsingResult(parsingResult);
  trace.recordException(throwable);
  trace.recordApi(getMethodDescriptor());
  trace.markAfterTime();
}

Fixed version (ground truth):
@Override public void doInAfterTrace(RecordableTrace trace,Object target,Object[] args,Object result,Throwable throwable){
  if (result instanceof ParsingResultTraceValue) {
    ParsingResult parsingResult=((ParsingResultTraceValue)result)._$PINPOINT$_getTraceParsingResult();
    trace.recordSqlParsingResult(parsingResult);
  }
  trace.recordException(throwable);
  trace.recordApi(getMethodDescriptor());
  trace.markAfterTime();
}
Program: 53788
Project: 53788
Buggy source:
private ZooKeeper createNewZookeeper(){
  ZooKeeper zookeeper=null;
  try {
    zookeeper=new ZooKeeper(hostPort,sessionTimeout,watcher);
    return zookeeper;
  }
 catch (  IOException e) {
    if (zookeeper != null) {
      try {
        zookeeper.close();
      }
 catch (      InterruptedException ie) {
        Thread.currentThread().interrupt();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private ZooKeeper createNewZookeeper(){
  try {
    return new ZooKeeper(hostPort,sessionTimeout,watcher);
  }
 catch (  IOException ignore) {
  }
  return null;
}
Program: 53789
Project: 53789
Buggy source:
private ZooKeeper createNewZookeeper(){
  ZooKeeper zookeeper=null;
  try {
    zookeeper=new ZooKeeper(hostPort,sessionTimeout,manager);
    return zookeeper;
  }
 catch (  IOException e) {
    if (zookeeper != null) {
      try {
        zookeeper.close();
      }
 catch (      InterruptedException ie) {
        Thread.currentThread().interrupt();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private ZooKeeper createNewZookeeper(){
  try {
    return new ZooKeeper(hostPort,sessionTimeout,manager);
  }
 catch (  IOException ignore) {
  }
  return null;
}
Program: 53790
Project: 53790
Buggy source:
private static Map<String,String> parseAgentArgs(String str){
  Map<String,String> map=new HashMap<String,String>();
  Scanner scanner=new Scanner(str);
  scanner.useDelimiter("String_Node_Str");
  while (scanner.hasNext()) {
    String token=scanner.next();
    int assign=token.indexOf('=');
    if (assign == -1) {
      map.put(token,"String_Node_Str");
    }
 else {
      map.put(token.substring(0,assign),token.substring(assign + 1));
    }
  }
  return map;
}

Fixed version (ground truth):
private static Map<String,String> parseAgentArgs(String str){
  Map<String,String> map=new HashMap<String,String>();
  if (str == null || str.isEmpty()) {
    return map;
  }
  Scanner scanner=new Scanner(str);
  scanner.useDelimiter("String_Node_Str");
  while (scanner.hasNext()) {
    String token=scanner.next();
    int assign=token.indexOf('=');
    if (assign == -1) {
      map.put(token,"String_Node_Str");
    }
 else {
      map.put(token.substring(0,assign),token.substring(assign + 1));
    }
  }
  return map;
}
Program: 53791
Project: 53791
Buggy source:
private List<Class<? extends Annotation>> getTargetAnnotations(ClassLoader loader){
  List<Class<? extends Annotation>> targetAnnotations=targetAnnotationMap.get(loader);
  if (targetAnnotations == null) {
    targetAnnotations=loadTargetAnnotations(loader);
    targetAnnotationMap.put(loader,targetAnnotations);
  }
  return targetAnnotations;
}

Fixed version (ground truth):
private List<Class<? extends Annotation>> getTargetAnnotations(ClassLoader classLoader){
  ClassLoader nonNull=classLoader == null ? ClassLoader.getSystemClassLoader() : classLoader;
  List<Class<? extends Annotation>> targetAnnotations=targetAnnotationMap.get(nonNull);
  if (targetAnnotations == null) {
    targetAnnotations=loadTargetAnnotations(nonNull);
    targetAnnotationMap.put(nonNull,targetAnnotations);
  }
  return targetAnnotations;
}
Program: 53792
Project: 53792
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());
}

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.changeStateStopped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53793
Project: 53793
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());
}

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.changeStateStopped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53794
Project: 53794
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());
}

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.changeStateStopped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53795
Project: 53795
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());
  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());
}

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.changeStateStopped();
  logger.info("String_Node_Str",this.getClass().getSimpleName());
}
Program: 53796
Project: 53796
Buggy source:
public void readRowKey(byte[] bytes){
  this.agentId=BytesUtils.toString(bytes,0,PinpointConstants.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=BytesUtils.safeTrim(BytesUtils.toString(bytes,0,PinpointConstants.AGENT_NAME_MAX_LEN));
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(bytes));
  this.apiId=readKeyCode(bytes);
}
Program: 53797
Project: 53797
Buggy source:
public void readRowKey(byte[] rowKey){
  this.agentId=BytesUtils.toString(rowKey,0,PinpointConstants.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=BytesUtils.safeTrim(BytesUtils.toString(rowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN));
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.hashCode=readKeyCode(rowKey);
}
Program: 53798
Project: 53798
Buggy source:
public void readRowKey(byte[] rowKey){
  this.agentId=BytesUtils.toString(rowKey,0,PinpointConstants.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=BytesUtils.safeTrim(BytesUtils.toString(rowKey,0,PinpointConstants.AGENT_NAME_MAX_LEN));
  this.startTime=TimeUtils.recoveryTimeMillis(readTime(rowKey));
  this.stringId=readKeyCode(rowKey);
}
Program: 53799
Project: 53799
Buggy source:
public static String toString(final byte[] bytes,final int offset,final int length){
  if (bytes == null) {
    return null;
  }
  if (offset < 0) {
    throw new IllegalArgumentException("String_Node_Str" + offset);
  }
  if (length == 0) {
    return "String_Node_Str";
  }
  try {
    return new String(bytes,offset,length,UTF8);
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.log(Level.SEVERE,"String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
public static String toString(final byte[] bytes,final int offset,final int length){
  if (bytes == null) {
    return null;
  }
  if (offset < 0) {
    throw new IndexOutOfBoundsException("String_Node_Str" + offset);
  }
  if (length == 0) {
    return "String_Node_Str";
  }
  try {
    return new String(bytes,offset,length,UTF8);
  }
 catch (  UnsupportedEncodingException e) {
    LOGGER.log(Level.SEVERE,"String_Node_Str",e);
    return null;
  }
}
Program: 53800
Project: 53800
Buggy source:
private void next(){
  if (nextElement != null || nextException != null) {
    return;
  }
  while (true) {
    final boolean hasMoreElements=delegate.hasMoreElements();
    E nextElement;
    try {
      nextElement=delegate.nextElement();
    }
 catch (    Exception e) {
      this.hasMoreElements=hasMoreElements;
      this.nextException=e;
      break;
    }
    if (filter.filter(nextElement)) {
      continue;
    }
    this.hasMoreElements=hasMoreElements;
    if (nextElement == null) {
      this.nextElement=(E)NULL_OBJECT;
    }
 else {
      this.nextElement=nextElement;
    }
    break;
  }
}

Fixed version (ground truth):
private void next(final boolean hasMoreElementMethod){
  if (nextElement != null || nextException != null) {
    return;
  }
  while (true) {
    final boolean nextExist=delegate.hasMoreElements();
    if (!nextExist && hasMoreElementMethod) {
      this.hasMoreElements=false;
      return;
    }
    E nextElement;
    try {
      nextElement=delegate.nextElement();
    }
 catch (    Exception e) {
      this.hasMoreElements=nextExist;
      this.nextException=e;
      break;
    }
    if (filter.filter(nextElement)) {
      continue;
    }
    this.hasMoreElements=nextExist;
    if (nextElement == null) {
      this.nextElement=(E)NULL_OBJECT;
    }
 else {
      this.nextElement=nextElement;
    }
    break;
  }
}
Program: 53801
Project: 53801
Buggy source:
@Override public boolean hasMoreElements(){
  next();
  return hasMoreElements;
}

Fixed version (ground truth):
@Override public boolean hasMoreElements(){
  next(true);
  return hasMoreElements;
}
Program: 53802
Project: 53802
Buggy source:
@SuppressWarnings("String_Node_Str") private <T extends Exception>void throwException(Exception exception) throws T {
  throw (T)exception;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T extends Exception>void throwException(final Exception exception) throws T {
  throw (T)exception;
}
Program: 53803
Project: 53803
Buggy source:
@Override public E nextElement(){
  next();
  if (nextException != null) {
    Exception exception=this.nextException;
    this.nextException=null;
    this.<RuntimeException>throwException(exception);
  }
  final E result=getNextElement();
  this.nextElement=null;
  return result;
}

Fixed version (ground truth):
@Override public E nextElement(){
  next(false);
  if (nextException != null) {
    final Exception exception=this.nextException;
    clearNext();
    this.<RuntimeException>throwException(exception);
  }
  final E result=getNextElement();
  clearNext();
  return result;
}
Program: 53804
Project: 53804
Buggy source:
@Test public void testNormal() throws Exception {
  Hashtable<String,String> hashTable=new Hashtable<String,String>();
  hashTable.put("String_Node_Str","String_Node_Str");
  hashTable.put("String_Node_Str","String_Node_Str");
  hashTable.put("String_Node_Str","String_Node_Str");
  List<String> valueList=new ArrayList<String>(hashTable.values());
  Enumeration<String> enumeration=hashTable.elements();
  DelegateEnumeration<String> delegateEnumeration=new DelegateEnumeration<String>(enumeration);
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(valueList.isEmpty());
  Assert.assertFalse(delegateEnumeration.hasMoreElements());
  assertNextElements_Expected_ExceptionEmulation(enumeration,delegateEnumeration);
}

Fixed version (ground truth):
@Test public void testNormal() throws Exception {
  Hashtable<String,String> hashTable=new Hashtable<String,String>();
  hashTable.put("String_Node_Str","String_Node_Str");
  hashTable.put("String_Node_Str","String_Node_Str");
  hashTable.put("String_Node_Str","String_Node_Str");
  List<String> valueList=new ArrayList<String>(hashTable.values());
  Enumeration<String> enumeration=hashTable.elements();
  DelegateEnumeration<String> delegateEnumeration=new DelegateEnumeration<String>(enumeration);
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(delegateEnumeration.hasMoreElements());
  Assert.assertTrue(valueList.remove(delegateEnumeration.nextElement()));
  Assert.assertTrue(valueList.isEmpty());
  Assert.assertFalse(delegateEnumeration.hasMoreElements());
  Assert.assertNull(delegateEnumeration._getNextException());
  assertNextElements_Expected_ExceptionEmulation(enumeration,delegateEnumeration);
}
Program: 53805
Project: 53805
Buggy source:
public AsyncQueueingExecutor(int queueSize,String executorName){
  if (executorName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.queue=new LinkedBlockingQueue<T>(queueSize);
  this.executeThread=this.createExecuteThread(executorName);
  this.executorName=executeThread.getName();
  this.maxDrainSize=10;
  this.drain=new UnsafeArrayCollection<T>(maxDrainSize);
}

Fixed version (ground truth):
public AsyncQueueingExecutor(int queueSize,String executorName){
  if (executorName == null) {
    throw new NullPointerException("String_Node_Str");
  }
  this.maxDrainSize=10;
  this.drain=new UnsafeArrayCollection<T>(maxDrainSize);
  this.queue=new LinkedBlockingQueue<T>(queueSize);
  this.executeThread=this.createExecuteThread(executorName);
  this.executorName=executeThread.getName();
}
Program: 53806
Project: 53806
Buggy source:
private boolean isTarget(Class<?> clazz){
  if (rejected.getIfPresent(clazz) == Boolean.TRUE) {
    return false;
  }
  if (targetAnnotationNames != null) {
    List<Class<? extends Annotation>> targetAnnotations=getTargetAnnotations(clazz.getClassLoader());
    for (    Class<? extends Annotation> a : targetAnnotations) {
      if (clazz.isAnnotationPresent(a)) {
        return true;
      }
    }
    for (    Annotation a : clazz.getAnnotations()) {
      for (      Class<? extends Annotation> ac : targetAnnotations) {
        if (a.annotationType().isAnnotationPresent(ac)) {
          return true;
        }
      }
    }
  }
  if (targetClassPatterns != null) {
    String className=clazz.getName();
    for (    Pattern pattern : targetClassPatterns) {
      if (pattern.matcher(className).matches()) {
        return true;
      }
    }
  }
  rejected.put(clazz,Boolean.TRUE);
  return false;
}

Fixed version (ground truth):
private boolean isTarget(Class<?> clazz){
  if (rejected.getIfPresent(clazz) == EXIST) {
    return false;
  }
  if (targetAnnotationNames != null) {
    List<Class<? extends Annotation>> targetAnnotations=getTargetAnnotations(clazz.getClassLoader());
    for (    Class<? extends Annotation> a : targetAnnotations) {
      if (clazz.isAnnotationPresent(a)) {
        return true;
      }
    }
    for (    Annotation a : clazz.getAnnotations()) {
      for (      Class<? extends Annotation> ac : targetAnnotations) {
        if (a.annotationType().isAnnotationPresent(ac)) {
          return true;
        }
      }
    }
  }
  if (targetClassPatterns != null) {
    String className=clazz.getName();
    for (    Pattern pattern : targetClassPatterns) {
      if (pattern.matcher(className).matches()) {
        return true;
      }
    }
  }
  rejected.put(clazz,EXIST);
  return false;
}
Program: 53807
Project: 53807
Buggy source:
private Cache<Class<?>,Boolean> createCache(){
  final CacheBuilder<Object,Object> builder=CacheBuilder.newBuilder();
  builder.concurrencyLevel(CACHE_CONCURRENCY_LEVEL);
  builder.maximumSize(CACHE_SIZE);
  builder.weakKeys();
  return builder.build();
}

Fixed version (ground truth):
private Cache<Class<?>,Object> createCache(){
  final CacheBuilder<Object,Object> builder=CacheBuilder.newBuilder();
  builder.concurrencyLevel(CACHE_CONCURRENCY_LEVEL);
  builder.maximumSize(CACHE_SIZE);
  builder.weakKeys();
  return builder.build();
}
Program: 53808
Project: 53808
Buggy source:
public void addTransformed(Class<?> clazz){
  transformed.put(clazz,Boolean.TRUE);
}

Fixed version (ground truth):
public void addTransformed(Class<?> clazz){
  transformed.put(clazz,EXIST);
}
Program: 53809
Project: 53809
Buggy source:
public static Class<?> defineClass(ClassLoader classLoader,String className,byte[] classFile){
  try {
    return (Class<?>)DEFINE_CLASS.invoke(classLoader,className,classFile,0,classFile.length);
  }
 catch (  Exception e) {
    return null;
  }
}

Fixed version (ground truth):
public static Class<?> defineClass(ClassLoader classLoader,String className,byte[] classFile){
  try {
    return (Class<?>)DEFINE_CLASS.invoke(classLoader,className,classFile,0,classFile.length);
  }
 catch (  Exception ex) {
    throw new RuntimeException("String_Node_Str" + ex.getMessage(),ex);
  }
}
Program: 53810
Project: 53810
Buggy source:
public static Loader createLoader(ClassPool classPool){
  if (classPool == null) {
    throw new NullPointerException("String_Node_Str");
  }
  final Loader loader=new Loader(classPool);
  loader.delegateLoadingOf("String_Node_Str");
  return loader;
}

Fixed version (ground truth):
public static Loader createLoader(final ClassPool classPool){
  if (classPool == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Loader loader;
  if (SECURITY_MANAGER != null) {
    loader=AccessController.doPrivileged(new PrivilegedAction<Loader>(){
      public Loader run(){
        return new Loader(classPool);
      }
    }
);
  }
 else {
    loader=new Loader(classPool);
  }
  loader.delegateLoadingOf("String_Node_Str");
  return loader;
}
Program: 53811
Project: 53811
Buggy source:
private static void close(Closeable closeable){
  if (closeable != null) {
    try {
      closeable.close();
    }
 catch (    IOException e) {
    }
  }
}

Fixed version (ground truth):
private static void close(Closeable closeable){
  if (closeable != null) {
    try {
      closeable.close();
    }
 catch (    IOException ignore) {
    }
  }
}
Program: 53812
Project: 53812
Buggy source:
/** 
 * 파라미터의 대기시간동안 이벤트가 일어날 경우 true 일어나지 않을 경우 false
 * @param waitTimeMillis
 * @return
 */
private boolean await(long waitTimeMillis,long waitUnitTimeMillis){
synchronized (lock) {
    long waitTime=waitTimeMillis;
    long waitUnitTime=waitUnitTimeMillis;
    if (waitTimeMillis < 1000) {
      waitTime=1000;
    }
    if (waitUnitTimeMillis < 100) {
      waitUnitTime=100;
    }
    long startTimeMillis=System.currentTimeMillis();
    while (latestJobRepository.size() == 0 && !isOverWaitTime(waitTime,startTimeMillis) && workerState.isStarted()) {
      try {
        lock.wait(waitUnitTime);
      }
 catch (      InterruptedException e) {
      }
    }
    if (isOverWaitTime(waitTime,startTimeMillis)) {
      return false;
    }
    return true;
  }
}

Fixed version (ground truth):
/** 
 * 파라미터의 대기시간동안 이벤트가 일어날 경우 true 일어나지 않을 경우 false
 * @param waitTimeMillis
 * @return
 */
private boolean await(long waitTimeMillis,long waitUnitTimeMillis){
synchronized (lock) {
    long waitTime=waitTimeMillis;
    long waitUnitTime=waitUnitTimeMillis;
    if (waitTimeMillis < 1000) {
      waitTime=1000;
    }
    if (waitUnitTimeMillis < 100) {
      waitUnitTime=100;
    }
    long startTimeMillis=System.currentTimeMillis();
    while (latestJobRepository.size() == 0 && !isOverWaitTime(waitTime,startTimeMillis) && workerState.isStarted()) {
      try {
        lock.wait(waitUnitTime);
      }
 catch (      InterruptedException ignore) {
      }
    }
    if (isOverWaitTime(waitTime,startTimeMillis)) {
      return false;
    }
    return true;
  }
}
Program: 53813
Project: 53813
Buggy source:
public static ClassLoader getDefaultClassLoader(ClassLoaderCallable defaultClassLoaderCallable){
  if (defaultClassLoaderCallable == null) {
    throw new NullPointerException("String_Node_Str");
  }
  try {
    final Thread th=Thread.currentThread();
    final ClassLoader contextClassLoader=th.getContextClassLoader();
    if (contextClassLoader != null) {
      return contextClassLoader;
    }
  }
 catch (  Throwable e) {
  }
  return defaultClassLoaderCallable.getClassLoader();
}

Fixed version (ground truth):
public static ClassLoader getDefaultClassLoader(ClassLoaderCallable defaultClassLoaderCallable){
  if (defaultClassLoaderCallable == null) {
    throw new NullPointerException("String_Node_Str");
  }
  try {
    final Thread th=Thread.currentThread();
    final ClassLoader contextClassLoader=th.getContextClassLoader();
    if (contextClassLoader != null) {
      return contextClassLoader;
    }
  }
 catch (  Throwable ignore) {
  }
  return defaultClassLoaderCallable.getClassLoader();
}
Program: 53814
Project: 53814
Buggy source:
public static boolean isLoaded(String name,ClassLoader classLoader){
  if (name == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoader classLoaderToUse=classLoader;
  if (classLoaderToUse == null) {
    classLoaderToUse=ClassLoaderUtils.getDefaultClassLoader();
  }
  try {
    return (classLoaderToUse.loadClass(name) != CLASS_NOT_LOADED);
  }
 catch (  ClassNotFoundException e) {
  }
  return false;
}

Fixed version (ground truth):
public static boolean isLoaded(String name,ClassLoader classLoader){
  if (name == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ClassLoader classLoaderToUse=classLoader;
  if (classLoaderToUse == null) {
    classLoaderToUse=ClassLoaderUtils.getDefaultClassLoader();
  }
  try {
    return (classLoaderToUse.loadClass(name) != CLASS_NOT_LOADED);
  }
 catch (  ClassNotFoundException ignore) {
  }
  return false;
}
Program: 53815
Project: 53815
Buggy source:
public static InetSocketAddress toInetSocketAddress(String address){
  try {
    URI uri=new URI("String_Node_Str" + address);
    return new InetSocketAddress(uri.getHost(),uri.getPort());
  }
 catch (  URISyntaxException e) {
  }
  return null;
}

Fixed version (ground truth):
public static InetSocketAddress toInetSocketAddress(String address){
  try {
    URI uri=new URI("String_Node_Str" + address);
    return new InetSocketAddress(uri.getHost(),uri.getPort());
  }
 catch (  URISyntaxException ignore) {
  }
  return null;
}
Program: 53816
Project: 53816
Buggy source:
/** 
 * 가지고 있는 외부에서 접근할수 있는 ip를 모두 반환합니다.  만약 로컬 ip가 획득하지 못할 경우 Empty List를 반환합니다. 
 */
public static List<String> getLocalV4IpList(){
  List<String> result=new ArrayList<String>();
  Enumeration<NetworkInterface> interfaces=null;
  try {
    interfaces=NetworkInterface.getNetworkInterfaces();
  }
 catch (  SocketException e) {
  }
  if (interfaces == null) {
    return Collections.EMPTY_LIST;
  }
  while (interfaces.hasMoreElements()) {
    NetworkInterface current=interfaces.nextElement();
    if (isSkipIp(current)) {
      continue;
    }
    Enumeration<InetAddress> addresses=current.getInetAddresses();
    while (addresses.hasMoreElements()) {
      InetAddress address=addresses.nextElement();
      if (address.isLoopbackAddress() || !(address instanceof Inet4Address)) {
        continue;
      }
      if (validationIpV4FormatAddress(address.getHostAddress())) {
        result.add(address.getHostAddress());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * 가지고 있는 외부에서 접근할수 있는 ip를 모두 반환합니다.  만약 로컬 ip가 획득하지 못할 경우 Empty List를 반환합니다. 
 */
public static List<String> getLocalV4IpList(){
  List<String> result=new ArrayList<String>();
  Enumeration<NetworkInterface> interfaces=null;
  try {
    interfaces=NetworkInterface.getNetworkInterfaces();
  }
 catch (  SocketException ignore) {
  }
  if (interfaces == null) {
    return Collections.EMPTY_LIST;
  }
  while (interfaces.hasMoreElements()) {
    NetworkInterface current=interfaces.nextElement();
    if (isSkipIp(current)) {
      continue;
    }
    Enumeration<InetAddress> addresses=current.getInetAddresses();
    while (addresses.hasMoreElements()) {
      InetAddress address=addresses.nextElement();
      if (address.isLoopbackAddress() || !(address instanceof Inet4Address)) {
        continue;
      }
      if (validationIpV4FormatAddress(address.getHostAddress())) {
        result.add(address.getHostAddress());
      }
    }
  }
  return result;
}
Program: 53817
Project: 53817
Buggy source:
public static boolean validationIpV4FormatAddress(String address){
  try {
    String[] eachDotAddress=address.split("String_Node_Str");
    if (eachDotAddress.length != 4) {
      return false;
    }
    for (    String eachAddress : eachDotAddress) {
      if (Integer.parseInt(eachAddress) > 255) {
        return false;
      }
    }
    return true;
  }
 catch (  NumberFormatException e) {
  }
  return false;
}

Fixed version (ground truth):
public static boolean validationIpV4FormatAddress(String address){
  try {
    String[] eachDotAddress=address.split("String_Node_Str");
    if (eachDotAddress.length != 4) {
      return false;
    }
    for (    String eachAddress : eachDotAddress) {
      if (Integer.parseInt(eachAddress) > 255) {
        return false;
      }
    }
    return true;
  }
 catch (  NumberFormatException ignore) {
  }
  return false;
}
Program: 53818
Project: 53818
Buggy source:
public static boolean validationIpPortV4FormatAddress(String address){
  try {
    int splitIndex=address.indexOf(':');
    if (splitIndex == -1 || splitIndex + 1 >= address.length()) {
      return false;
    }
    String ip=address.substring(0,splitIndex);
    if (!validationIpV4FormatAddress(ip)) {
      return false;
    }
    String port=address.substring(splitIndex + 1,address.length());
    if (Integer.parseInt(port) > 65535) {
      return false;
    }
    return true;
  }
 catch (  Exception e) {
  }
  return false;
}

Fixed version (ground truth):
public static boolean validationIpPortV4FormatAddress(String address){
  try {
    int splitIndex=address.indexOf(':');
    if (splitIndex == -1 || splitIndex + 1 >= address.length()) {
      return false;
    }
    String ip=address.substring(0,splitIndex);
    if (!validationIpV4FormatAddress(ip)) {
      return false;
    }
    String port=address.substring(splitIndex + 1,address.length());
    if (Integer.parseInt(port) > 65535) {
      return false;
    }
    return true;
  }
 catch (  Exception ignore) {
  }
  return false;
}
Program: 53819
Project: 53819
Buggy source:
public static String getLocalV4Ip(){
  try {
    InetAddress localHost=InetAddress.getLocalHost();
    String localIp=localHost.getHostAddress();
    if (validationIpV4FormatAddress(localIp)) {
      return localIp;
    }
  }
 catch (  UnknownHostException e) {
  }
  return LOOPBACK_ADDRESS_V4;
}

Fixed version (ground truth):
public static String getLocalV4Ip(){
  try {
    InetAddress localHost=InetAddress.getLocalHost();
    String localIp=localHost.getHostAddress();
    if (validationIpV4FormatAddress(localIp)) {
      return localIp;
    }
  }
 catch (  UnknownHostException ignore) {
  }
  return LOOPBACK_ADDRESS_V4;
}
Program: 53820
Project: 53820
Buggy source:
private static boolean isSkipIp(NetworkInterface networkInterface){
  try {
    if (!networkInterface.isUp() || networkInterface.isLoopback() || networkInterface.isVirtual()) {
      return true;
    }
    return false;
  }
 catch (  Exception e) {
  }
  return true;
}

Fixed version (ground truth):
private static boolean isSkipIp(NetworkInterface networkInterface){
  try {
    if (!networkInterface.isUp() || networkInterface.isLoopback() || networkInterface.isVirtual()) {
      return true;
    }
    return false;
  }
 catch (  Exception ignore) {
  }
  return true;
}