nus-yam/ex-repair huggingface dataset:
Program: 105502
Project: 105502
Buggy source:
private KVMPhysicalDisk createPhysicalDiskOnRBD(String name,KVMStoragePool pool,PhysicalDiskFormat format,Storage.ProvisioningType provisioningType,long size){
  String volPath=null;
  try {
    s_logger.info("String_Node_Str" + pool.getSourceDir() + "String_Node_Str"+ name+ "String_Node_Str"+ size);
    Rados r=new Rados(pool.getAuthUserName());
    r.confSet("String_Node_Str",pool.getSourceHost() + "String_Node_Str" + pool.getSourcePort());
    r.confSet("String_Node_Str",pool.getAuthSecret());
    r.confSet("String_Node_Str","String_Node_Str");
    r.connect();
    s_logger.debug("String_Node_Str" + r.confGet("String_Node_Str"));
    IoCTX io=r.ioCtxCreate(pool.getSourceDir());
    Rbd rbd=new Rbd(io);
    rbd.create(name,size,this.rbdFeatures,this.rbdOrder);
    r.ioCtxDestroy(io);
  }
 catch (  RadosException e) {
    throw new CloudRuntimeException(e.toString());
  }
catch (  RbdException e) {
    throw new CloudRuntimeException(e.toString());
  }
  volPath=pool.getSourceDir() + "String_Node_Str" + name;
  KVMPhysicalDisk disk=new KVMPhysicalDisk(volPath,name,pool);
  disk.setFormat(PhysicalDiskFormat.RAW);
  disk.setSize(size);
  disk.setVirtualSize(size);
  return disk;
}

Fixed version (ground truth):
private KVMPhysicalDisk createPhysicalDiskOnRBD(String name,KVMStoragePool pool,PhysicalDiskFormat format,Storage.ProvisioningType provisioningType,long size){
  String volPath=null;
  try {
    s_logger.info("String_Node_Str" + pool.getSourceDir() + "String_Node_Str"+ name+ "String_Node_Str"+ size);
    Rados r=new Rados(pool.getAuthUserName());
    r.confSet("String_Node_Str",pool.getSourceHost() + "String_Node_Str" + pool.getSourcePort());
    r.confSet("String_Node_Str",pool.getAuthSecret());
    r.confSet("String_Node_Str","String_Node_Str");
    r.connect();
    s_logger.debug("String_Node_Str" + r.confGet("String_Node_Str"));
    IoCTX io=r.ioCtxCreate(pool.getSourceDir());
    Rbd rbd=new Rbd(io);
    rbd.create(name,size,rbdFeatures,rbdOrder);
    r.ioCtxDestroy(io);
  }
 catch (  RadosException e) {
    throw new CloudRuntimeException(e.toString());
  }
catch (  RbdException e) {
    throw new CloudRuntimeException(e.toString());
  }
  volPath=pool.getSourceDir() + "String_Node_Str" + name;
  KVMPhysicalDisk disk=new KVMPhysicalDisk(volPath,name,pool);
  disk.setFormat(PhysicalDiskFormat.RAW);
  disk.setSize(size);
  disk.setVirtualSize(size);
  return disk;
}
Program: 105505
Project: 105505
Buggy source:
@Override public void addSystemVMTemplatesToSecondary(DataStore store){
  long storeId=store.getId();
  List<VMTemplateVO> rtngTmplts=_templateDao.listAllSystemVMTemplates();
  for (  VMTemplateVO tmplt : rtngTmplts) {
    TemplateDataStoreVO tmpltStore=_vmTemplateStoreDao.findByStoreTemplate(storeId,tmplt.getId());
    if (tmpltStore == null) {
      tmpltStore=new TemplateDataStoreVO(storeId,tmplt.getId(),new Date(),100,Status.DOWNLOADED,null,null,null,TemplateConstants.DEFAULT_SYSTEM_VM_TEMPLATE_PATH + tmplt.getId() + File.separator,tmplt.getUrl());
      tmpltStore.setSize(0L);
      tmpltStore.setPhysicalSize(0);
      tmpltStore.setDataStoreRole(store.getRole());
      _vmTemplateStoreDao.persist(tmpltStore);
    }
  }
}

Fixed version (ground truth):
@Override public void addSystemVMTemplatesToSecondary(DataStore store){
  long storeId=store.getId();
  List<VMTemplateVO> rtngTmplts=_templateDao.listAllSystemVMTemplates();
  for (  VMTemplateVO tmplt : rtngTmplts) {
    TemplateDataStoreVO tmpltStore=_vmTemplateStoreDao.findByStoreTemplate(storeId,tmplt.getId());
    if (tmpltStore == null) {
      tmpltStore=new TemplateDataStoreVO(storeId,tmplt.getId(),new Date(),100,Status.DOWNLOADED,null,null,null,TemplateConstants.DEFAULT_SYSTEM_VM_TEMPLATE_PATH + tmplt.getId() + '/',tmplt.getUrl());
      tmpltStore.setSize(0L);
      tmpltStore.setPhysicalSize(0);
      tmpltStore.setDataStoreRole(store.getRole());
      _vmTemplateStoreDao.persist(tmpltStore);
    }
  }
}
Program: 105506
Project: 105506
Buggy source:
String createSyslogMessage(){
  StringBuilder message=new StringBuilder();
  message.append(severityOfAlert(alertType)).append(MESSAGE_DELIMITER_STRING);
  InetAddress ip;
  try {
    ip=InetAddress.getLocalHost();
  }
 catch (  UnknownHostException e) {
    ip=null;
  }
  if (ip != null) {
    message.append(ip.getHostName()).append(MESSAGE_DELIMITER_STRING);
  }
 else {
    message.append("String_Node_Str" + MESSAGE_DELIMITER_STRING);
  }
  if (alertType >= 0) {
    message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(alertsMap.get(alertType)).append(MESSAGE_DELIMITER_STRING);
    if (dataCenterId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(dataCenterId).append(MESSAGE_DELIMITER_STRING);
    }
    if (podId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(podId).append(MESSAGE_DELIMITER_STRING);
    }
    if (clusterId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(clusterId).append(MESSAGE_DELIMITER_STRING);
    }
    if (sysMessage != null) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(sysMessage);
    }
 else {
      errorHandler.error("String_Node_Str");
    }
  }
 else {
    errorHandler.error("String_Node_Str");
  }
  return message.toString();
}

Fixed version (ground truth):
String createSyslogMessage(){
  StringBuilder message=new StringBuilder();
  message.append(severityOfAlert(alertType)).append(MESSAGE_DELIMITER_STRING);
  InetAddress ip;
  try {
    ip=InetAddress.getLocalHost();
  }
 catch (  UnknownHostException e) {
    ip=null;
  }
  if (ip != null) {
    message.append(ip.getHostName()).append(MESSAGE_DELIMITER_STRING);
  }
 else {
    message.append("String_Node_Str" + MESSAGE_DELIMITER_STRING);
  }
  if (alertType >= 0) {
    message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(alertsMap.containsKey(alertType) ? alertsMap.get(alertType) : "String_Node_Str").append(MESSAGE_DELIMITER_STRING);
    if (dataCenterId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(dataCenterId).append(MESSAGE_DELIMITER_STRING);
    }
    if (podId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(podId).append(MESSAGE_DELIMITER_STRING);
    }
    if (clusterId != 0) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(clusterId).append(MESSAGE_DELIMITER_STRING);
    }
    if (sysMessage != null) {
      message.append("String_Node_Str").append(_keyValueDelimiter).append("String_Node_Str").append(sysMessage);
    }
 else {
      errorHandler.error("String_Node_Str");
    }
  }
 else {
    errorHandler.error("String_Node_Str");
  }
  return message.toString();
}
Program: 105507
Project: 105507
Buggy source:
public String mapRbdDevice(KVMPhysicalDisk disk){
  KVMStoragePool pool=disk.getPool();
  String[] splitPoolImage=disk.getPath().split("String_Node_Str");
  String device=Script.runSimpleBashScript("String_Node_Str" + splitPoolImage[0] + "String_Node_Str"+ splitPoolImage[1]+ "String_Node_Str");
  if (device == null) {
    String mapRbd=Script.runSimpleBashScript("String_Node_Str" + disk.getPath() + "String_Node_Str"+ pool.getAuthUserName());
    device=Script.runSimpleBashScript("String_Node_Str" + splitPoolImage[0] + "String_Node_Str"+ splitPoolImage[1]+ "String_Node_Str");
  }
  return device;
}

Fixed version (ground truth):
public String mapRbdDevice(KVMPhysicalDisk disk){
  KVMStoragePool pool=disk.getPool();
  String[] splitPoolImage=disk.getPath().split("String_Node_Str");
  String device=Script.runSimpleBashScript("String_Node_Str" + splitPoolImage[0] + "String_Node_Str"+ splitPoolImage[1]+ "String_Node_Str");
  if (device == null) {
    Script.runSimpleBashScript("String_Node_Str" + disk.getPath() + "String_Node_Str"+ pool.getAuthUserName());
    device=Script.runSimpleBashScript("String_Node_Str" + splitPoolImage[0] + "String_Node_Str"+ splitPoolImage[1]+ "String_Node_Str");
  }
  return device;
}
Program: 105514
Project: 105514
Buggy source:
@Override public String handleTimeout(long updateMs){
  if (s_logger.isTraceEnabled()) {
    getDownloadListener().log("String_Node_Str" + updateMs + "String_Node_Str"+ getName(),Level.TRACE);
  }
  String newState=this.getName();
  if (updateMs > 5 * DownloadListener.STATUS_POLL_INTERVAL) {
    newState=Status.DOWNLOAD_ERROR.toString();
    getDownloadListener().log("String_Node_Str" + getName(),Level.DEBUG);
  }
 else   if (updateMs > 3 * DownloadListener.STATUS_POLL_INTERVAL) {
    getDownloadListener().cancelStatusTask();
    getDownloadListener().scheduleImmediateStatusCheck(RequestType.GET_STATUS);
    getDownloadListener().scheduleTimeoutTask(3 * DownloadListener.STATUS_POLL_INTERVAL);
    getDownloadListener().log(getName() + "String_Node_Str",Level.DEBUG);
  }
 else {
    getDownloadListener().scheduleTimeoutTask(3 * DownloadListener.STATUS_POLL_INTERVAL);
  }
  return newState;
}

Fixed version (ground truth):
@Override public String handleTimeout(long updateMs){
  if (s_logger.isTraceEnabled()) {
    getDownloadListener().log("String_Node_Str" + updateMs + "String_Node_Str"+ getName(),Level.TRACE);
  }
  String newState=getName();
  if (updateMs > 5 * DownloadListener.STATUS_POLL_INTERVAL) {
    newState=Status.DOWNLOAD_ERROR.toString();
    getDownloadListener().log("String_Node_Str" + getName(),Level.DEBUG);
  }
 else   if (updateMs > 3 * DownloadListener.STATUS_POLL_INTERVAL) {
    getDownloadListener().cancelStatusTask();
    getDownloadListener().scheduleImmediateStatusCheck(RequestType.GET_STATUS);
    getDownloadListener().scheduleTimeoutTask(3 * DownloadListener.STATUS_POLL_INTERVAL);
    getDownloadListener().log(getName() + "String_Node_Str",Level.DEBUG);
  }
 else {
    getDownloadListener().scheduleTimeoutTask(3 * DownloadListener.STATUS_POLL_INTERVAL);
  }
  return newState;
}
Program: 105515
Project: 105515
Buggy source:
@Override public void onEntry(String prevState,DownloadEvent event,Object evtObj){
  if (s_logger.isTraceEnabled()) {
    getDownloadListener().log("String_Node_Str" + prevState + "String_Node_Str"+ getName()+ "String_Node_Str"+ event,Level.TRACE);
  }
  if (event == DownloadEvent.DOWNLOAD_ANSWER) {
    getDownloadListener().callback((DownloadAnswer)evtObj);
    getDownloadListener().setLastUpdated();
  }
}

Fixed version (ground truth):
@Override public void onEntry(String prevState,DownloadEvent event,Object evtObj){
  super.onEntry(prevState,event,evtObj);
  if (event == DownloadEvent.DOWNLOAD_ANSWER) {
    getDownloadListener().setLastUpdated();
  }
}
Program: 105516
Project: 105516
Buggy source:
@Override public String handleTimeout(long updateMs){
  if (s_logger.isTraceEnabled()) {
    getUploadListener().log("String_Node_Str" + updateMs + "String_Node_Str"+ getName(),Level.TRACE);
  }
  String newState=this.getName();
  if (updateMs > 5 * UploadListener.STATUS_POLL_INTERVAL) {
    newState=Status.UPLOAD_ERROR.toString();
    getUploadListener().log("String_Node_Str" + getName(),Level.DEBUG);
  }
 else   if (updateMs > 3 * UploadListener.STATUS_POLL_INTERVAL) {
    getUploadListener().cancelStatusTask();
    getUploadListener().scheduleImmediateStatusCheck(RequestType.GET_STATUS);
    getUploadListener().scheduleTimeoutTask(3 * UploadListener.STATUS_POLL_INTERVAL);
    getUploadListener().log(getName() + "String_Node_Str",Level.DEBUG);
  }
 else {
    getUploadListener().scheduleTimeoutTask(3 * UploadListener.STATUS_POLL_INTERVAL);
  }
  return newState;
}

Fixed version (ground truth):
@Override public String handleTimeout(long updateMs){
  if (s_logger.isTraceEnabled()) {
    getUploadListener().log("String_Node_Str" + updateMs + "String_Node_Str"+ getName(),Level.TRACE);
  }
  String newState=getName();
  if (updateMs > 5 * UploadListener.STATUS_POLL_INTERVAL) {
    newState=Status.UPLOAD_ERROR.toString();
    getUploadListener().log("String_Node_Str" + getName(),Level.DEBUG);
  }
 else   if (updateMs > 3 * UploadListener.STATUS_POLL_INTERVAL) {
    getUploadListener().cancelStatusTask();
    getUploadListener().scheduleImmediateStatusCheck(RequestType.GET_STATUS);
    getUploadListener().scheduleTimeoutTask(3 * UploadListener.STATUS_POLL_INTERVAL);
    getUploadListener().log(getName() + "String_Node_Str",Level.DEBUG);
  }
 else {
    getUploadListener().scheduleTimeoutTask(3 * UploadListener.STATUS_POLL_INTERVAL);
  }
  return newState;
}
Program: 105517
Project: 105517
Buggy source:
@Override public void onEntry(String prevState,UploadEvent event,Object evtObj){
  if (s_logger.isTraceEnabled()) {
    getUploadListener().log("String_Node_Str" + prevState + "String_Node_Str"+ getName()+ "String_Node_Str"+ event,Level.TRACE);
  }
  if (event == UploadEvent.UPLOAD_ANSWER) {
    getUploadListener().updateDatabase((UploadAnswer)evtObj);
    getUploadListener().setLastUpdated();
  }
}

Fixed version (ground truth):
@Override public void onEntry(String prevState,UploadEvent event,Object evtObj){
  super.onEntry(prevState,event,evtObj);
  if (event == UploadEvent.UPLOAD_ANSWER) {
    getUploadListener().setLastUpdated();
  }
}
Program: 105520
Project: 105520
Buggy source:
@Override protected void init() throws IOException {
  _selector=Selector.open();
  Task task=null;
  try (SocketChannel sch=SocketChannel.open()){
    sch.configureBlocking(true);
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    if (_bindAddress != null) {
      s_logger.info("String_Node_Str" + _bindAddress);
      InetSocketAddress bindAddr=new InetSocketAddress(_bindAddress,0);
      sch.socket().bind(bindAddr);
    }
    InetSocketAddress peerAddr=new InetSocketAddress(_host,_port);
    sch.connect(peerAddr);
    SSLEngine sslEngine=null;
    sch.configureBlocking(true);
    SSLContext sslContext=Link.initSSLContext(true);
    sslEngine=sslContext.createSSLEngine(_host,_port);
    sslEngine.setUseClientMode(true);
    Link.doHandshake(sch,sslEngine,true);
    s_logger.info("String_Node_Str");
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    sch.configureBlocking(false);
    Link link=new Link(peerAddr,this);
    link.setSSLEngine(sslEngine);
    SelectionKey key=sch.register(_selector,SelectionKey.OP_READ);
    link.setKey(key);
    key.attach(link);
    task=_factory.create(Task.Type.CONNECT,link,null);
  }
 catch (  GeneralSecurityException e) {
    throw new IOException("String_Node_Str",e);
  }
 finally {
    _selector.close();
  }
  _executor.execute(task);
}

Fixed version (ground truth):
@Override protected void init() throws IOException {
  _selector=Selector.open();
  Task task=null;
  try {
    _clientConnection=SocketChannel.open();
    _clientConnection.configureBlocking(true);
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    if (_bindAddress != null) {
      s_logger.info("String_Node_Str" + _bindAddress);
      InetSocketAddress bindAddr=new InetSocketAddress(_bindAddress,0);
      _clientConnection.socket().bind(bindAddr);
    }
    InetSocketAddress peerAddr=new InetSocketAddress(_host,_port);
    _clientConnection.connect(peerAddr);
    SSLEngine sslEngine=null;
    _clientConnection.configureBlocking(true);
    SSLContext sslContext=Link.initSSLContext(true);
    sslEngine=sslContext.createSSLEngine(_host,_port);
    sslEngine.setUseClientMode(true);
    Link.doHandshake(_clientConnection,sslEngine,true);
    s_logger.info("String_Node_Str");
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    _clientConnection.configureBlocking(false);
    Link link=new Link(peerAddr,this);
    link.setSSLEngine(sslEngine);
    SelectionKey key=_clientConnection.register(_selector,SelectionKey.OP_READ);
    link.setKey(key);
    key.attach(link);
    task=_factory.create(Task.Type.CONNECT,link,null);
  }
 catch (  GeneralSecurityException e) {
    _selector.close();
    throw new IOException("String_Node_Str",e);
  }
catch (  IOException e) {
    _selector.close();
    throw e;
  }
  _executor.execute(task);
}
Program: 105521
Project: 105521
Buggy source:
public InternalErrorException(String message){
  super(message);
}

Fixed version (ground truth):
public InternalErrorException(String message,Throwable cause){
  super(message,cause);
}
Program: 105522
Project: 105522
Buggy source:
public ManagementServerException(String message){
  super(message);
}

Fixed version (ground truth):
public ManagementServerException(String message,Throwable cause){
  super(message,cause);
}
Program: 105524
Project: 105524
Buggy source:
public static SSLContext initSSLContext(boolean isClient) throws Exception {
  InputStream stream;
  SSLContext sslContext=null;
  KeyManagerFactory kmf=KeyManagerFactory.getInstance("String_Node_Str");
  TrustManagerFactory tmf=TrustManagerFactory.getInstance("String_Node_Str");
  KeyStore ks=KeyStore.getInstance("String_Node_Str");
  TrustManager[] tms;
  File confFile=PropertiesUtil.findConfigFile("String_Node_Str");
  if (null != confFile && !isClient) {
    final Properties dbProps=DbProperties.getDbProperties();
    char[] passphrase=dbProps.getProperty("String_Node_Str").toCharArray();
    String confPath=confFile.getParent();
    String keystorePath=confPath + keystoreFile;
    if (new File(keystorePath).exists()) {
      stream=new FileInputStream(keystorePath);
    }
 else {
      s_logger.warn("String_Node_Str");
      stream=NioConnection.class.getResourceAsStream("String_Node_Str");
    }
    ks.load(stream,passphrase);
    stream.close();
    kmf.init(ks,passphrase);
    tmf.init(ks);
    tms=tmf.getTrustManagers();
  }
 else {
    ks.load(null,null);
    kmf.init(ks,null);
    tms=new TrustManager[1];
    tms[0]=new TrustAllManager();
  }
  sslContext=SSLContext.getInstance("String_Node_Str");
  sslContext.init(kmf.getKeyManagers(),tms,null);
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str");
  }
  return sslContext;
}

Fixed version (ground truth):
public static SSLContext initSSLContext(boolean isClient) throws GeneralSecurityException, IOException {
  InputStream stream;
  SSLContext sslContext=null;
  KeyManagerFactory kmf=KeyManagerFactory.getInstance("String_Node_Str");
  TrustManagerFactory tmf=TrustManagerFactory.getInstance("String_Node_Str");
  KeyStore ks=KeyStore.getInstance("String_Node_Str");
  TrustManager[] tms;
  File confFile=PropertiesUtil.findConfigFile("String_Node_Str");
  if (null != confFile && !isClient) {
    final Properties dbProps=DbProperties.getDbProperties();
    char[] passphrase=dbProps.getProperty("String_Node_Str").toCharArray();
    String confPath=confFile.getParent();
    String keystorePath=confPath + keystoreFile;
    if (new File(keystorePath).exists()) {
      stream=new FileInputStream(keystorePath);
    }
 else {
      s_logger.warn("String_Node_Str");
      stream=NioConnection.class.getResourceAsStream("String_Node_Str");
    }
    ks.load(stream,passphrase);
    stream.close();
    kmf.init(ks,passphrase);
    tmf.init(ks);
    tms=tmf.getTrustManagers();
  }
 else {
    ks.load(null,null);
    kmf.init(ks,null);
    tms=new TrustManager[1];
    tms[0]=new TrustAllManager();
  }
  sslContext=SSLContext.getInstance("String_Node_Str");
  sslContext.init(kmf.getKeyManagers(),tms,null);
  if (s_logger.isTraceEnabled()) {
    s_logger.trace("String_Node_Str");
  }
  return sslContext;
}
Program: 105525
Project: 105525
Buggy source:
@Override protected void init() throws IOException {
  _selector=Selector.open();
  SocketChannel sch=null;
  InetSocketAddress addr=null;
  try {
    sch=SocketChannel.open();
    sch.configureBlocking(true);
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    if (_bindAddress != null) {
      s_logger.info("String_Node_Str" + _bindAddress);
      addr=new InetSocketAddress(_bindAddress,0);
      sch.socket().bind(addr);
    }
    addr=new InetSocketAddress(_host,_port);
    sch.connect(addr);
  }
 catch (  IOException e) {
    _selector.close();
    throw e;
  }
  SSLEngine sslEngine=null;
  try {
    sch.configureBlocking(true);
    SSLContext sslContext=Link.initSSLContext(true);
    sslEngine=sslContext.createSSLEngine(_host,_port);
    sslEngine.setUseClientMode(true);
    Link.doHandshake(sch,sslEngine,true);
    s_logger.info("String_Node_Str");
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
  }
 catch (  Exception e) {
    _selector.close();
    throw new IOException("String_Node_Str" + e);
  }
  Task task=null;
  try {
    sch.configureBlocking(false);
    Link link=new Link(addr,this);
    link.setSSLEngine(sslEngine);
    SelectionKey key=sch.register(_selector,SelectionKey.OP_READ);
    link.setKey(key);
    key.attach(link);
    task=_factory.create(Task.Type.CONNECT,link,null);
  }
 catch (  Exception e) {
    _selector.close();
    throw new IOException("String_Node_Str" + e);
  }
  _executor.execute(task);
}

Fixed version (ground truth):
@Override protected void init() throws IOException {
  _selector=Selector.open();
  Task task=null;
  try (SocketChannel sch=SocketChannel.open()){
    sch.configureBlocking(true);
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    if (_bindAddress != null) {
      s_logger.info("String_Node_Str" + _bindAddress);
      InetSocketAddress bindAddr=new InetSocketAddress(_bindAddress,0);
      sch.socket().bind(bindAddr);
    }
    InetSocketAddress peerAddr=new InetSocketAddress(_host,_port);
    sch.connect(peerAddr);
    SSLEngine sslEngine=null;
    sch.configureBlocking(true);
    SSLContext sslContext=Link.initSSLContext(true);
    sslEngine=sslContext.createSSLEngine(_host,_port);
    sslEngine.setUseClientMode(true);
    Link.doHandshake(sch,sslEngine,true);
    s_logger.info("String_Node_Str");
    s_logger.info("String_Node_Str" + _host + "String_Node_Str"+ _port);
    sch.configureBlocking(false);
    Link link=new Link(peerAddr,this);
    link.setSSLEngine(sslEngine);
    SelectionKey key=sch.register(_selector,SelectionKey.OP_READ);
    link.setKey(key);
    key.attach(link);
    task=_factory.create(Task.Type.CONNECT,link,null);
  }
 catch (  GeneralSecurityException e) {
    throw new IOException("String_Node_Str",e);
  }
 finally {
    _selector.close();
  }
  _executor.execute(task);
}
Program: 105526
Project: 105526
Buggy source:
@Override protected void init() throws IOException {
  _selector=SelectorProvider.provider().openSelector();
  ServerSocketChannel ssc=ServerSocketChannel.open();
  ssc.configureBlocking(false);
  _localAddr=new InetSocketAddress(_port);
  ssc.socket().bind(_localAddr);
  ssc.register(_selector,SelectionKey.OP_ACCEPT,null);
  s_logger.info("String_Node_Str" + _localAddr.toString());
}

Fixed version (ground truth):
@Override protected void init() throws IOException {
  _selector=SelectorProvider.provider().openSelector();
  _serverSocket=ServerSocketChannel.open();
  _serverSocket.configureBlocking(false);
  _localAddr=new InetSocketAddress(_port);
  _serverSocket.socket().bind(_localAddr);
  _serverSocket.register(_selector,SelectionKey.OP_ACCEPT,null);
  s_logger.info("String_Node_Str" + _localAddr.toString());
}
Program: 105528
Project: 105528
Buggy source:
public void setRefCnt(Long refCnt){
  if (refCnt > 0) {
    refCnt--;
  }
 else {
    s_logger.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
public void setRefCnt(Long refCnt){
  this.refCnt=refCnt;
}
Program: 105529
Project: 105529
Buggy source:
public void decrRefCnt(){
  refCnt--;
}

Fixed version (ground truth):
public void decrRefCnt(){
  if (refCnt > 0) {
    refCnt--;
  }
 else {
    s_logger.warn("String_Node_Str");
  }
}
Program: 105530
Project: 105530
Buggy source:
private String sendRequest(String service,String xmlRequest) throws ExecutionException {
  org.apache.commons.httpclient.protocol.Protocol myhttps=new org.apache.commons.httpclient.protocol.Protocol("String_Node_Str",new EasySSLProtocolSocketFactory(),443);
  HttpClient client=new HttpClient();
  client.getHostConfiguration().setHost(_ip,443,myhttps);
  byte[] response=null;
  PostMethod method=new PostMethod("String_Node_Str" + service);
  method.setRequestBody(xmlRequest);
  try {
    int statusCode=client.executeMethod(method);
    if (statusCode != HttpStatus.SC_OK) {
      throw new Exception("String_Node_Str" + statusCode);
    }
    response=method.getResponseBody();
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new ExecutionException(e.getMessage());
  }
  System.out.println(new String(response));
  return new String(response);
}

Fixed version (ground truth):
private String sendRequest(String service,String xmlRequest) throws ExecutionException {
  org.apache.commons.httpclient.protocol.Protocol myhttps=null;
  HttpClient client=new HttpClient();
  byte[] response=null;
  PostMethod method=new PostMethod("String_Node_Str" + service);
  method.setRequestBody(xmlRequest);
  try {
    myhttps=new org.apache.commons.httpclient.protocol.Protocol("String_Node_Str",new EasySSLProtocolSocketFactory(),443);
    client.getHostConfiguration().setHost(_ip,443,myhttps);
    int statusCode=client.executeMethod(method);
    if (statusCode != HttpStatus.SC_OK) {
      throw new Exception("String_Node_Str" + statusCode);
    }
    response=method.getResponseBody();
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    throw new ExecutionException(e.getMessage());
  }
  System.out.println(new String(response));
  return new String(response);
}
Program: 105531
Project: 105531
Buggy source:
@Override public void create(){
  if (getSourceCidrList() != null) {
    String guestCidr=_networkService.getNetwork(getNetworkId()).getCidr();
    for (    String cidr : getSourceCidrList()) {
      if (!NetUtils.isValidCIDR(cidr)) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR,"String_Node_Str" + cidr);
      }
      if (cidr.equals(NetUtils.ALL_CIDRS)) {
        continue;
      }
      if (!NetUtils.isNetworkAWithinNetworkB(cidr,guestCidr)) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR,cidr + "String_Node_Str" + guestCidr);
      }
    }
  }
  if (getProtocol().equalsIgnoreCase(NetUtils.ALL_PROTO)) {
    if (getSourcePortStart() != null && getSourcePortEnd() != null) {
      throw new InvalidParameterValueException("String_Node_Str" + "String_Node_Str" + networkId);
    }
  }
  if (getVpcId() != null) {
    throw new InvalidParameterValueException("String_Node_Str" + networkId + "String_Node_Str");
  }
  try {
    FirewallRule result=_firewallService.createEgressFirewallRule(this);
    setEntityId(result.getId());
    setEntityUuid(result.getUuid());
  }
 catch (  NetworkRuleConflictException ex) {
    s_logger.info("String_Node_Str" + ex.getMessage());
    s_logger.trace("String_Node_Str",ex);
    throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR,ex.getMessage());
  }
}

Fixed version (ground truth):
@Override public void create(){
  if (getSourceCidrList() != null) {
    String guestCidr=_networkService.getNetwork(getNetworkId()).getCidr();
    for (    String cidr : getSourceCidrList()) {
      if (!NetUtils.isValidCIDR(cidr)) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR,"String_Node_Str" + cidr);
      }
      if (cidr.equals(NetUtils.ALL_CIDRS)) {
        continue;
      }
      if (!NetUtils.isNetworkAWithinNetworkB(cidr,guestCidr)) {
        throw new ServerApiException(ApiErrorCode.PARAM_ERROR,cidr + "String_Node_Str" + guestCidr);
      }
    }
  }
  if (getProtocol().equalsIgnoreCase(NetUtils.ALL_PROTO)) {
    if (getSourcePortStart() != null && getSourcePortEnd() != null) {
      throw new InvalidParameterValueException("String_Node_Str" + "String_Node_Str" + networkId);
    }
  }
  if (getVpcId() != null) {
    throw new InvalidParameterValueException("String_Node_Str" + networkId + "String_Node_Str");
  }
  try {
    FirewallRule result=_firewallService.createEgressFirewallRule(this);
    if (result != null) {
      setEntityId(result.getId());
      setEntityUuid(result.getUuid());
    }
  }
 catch (  NetworkRuleConflictException ex) {
    s_logger.info("String_Node_Str" + ex.getMessage());
    s_logger.trace("String_Node_Str",ex);
    throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR,ex.getMessage());
  }
}
Program: 105532
Project: 105532
Buggy source:
@Override public void execute(){
  Pair<List<? extends FirewallRule>,Integer> result=_firewallService.listFirewallRules(this);
  ListResponse<FirewallResponse> response=new ListResponse<FirewallResponse>();
  List<FirewallResponse> fwResponses=new ArrayList<FirewallResponse>();
  for (  FirewallRule fwRule : result.first()) {
    FirewallResponse ruleData=_responseGenerator.createFirewallResponse(fwRule);
    ruleData.setObjectName("String_Node_Str");
    fwResponses.add(ruleData);
  }
  response.setResponses(fwResponses,result.second());
  response.setResponseName(getCommandName());
  setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Pair<List<? extends FirewallRule>,Integer> result=_firewallService.listFirewallRules(this);
  ListResponse<FirewallResponse> response=new ListResponse<FirewallResponse>();
  List<FirewallResponse> fwResponses=new ArrayList<FirewallResponse>();
  if (result != null) {
    for (    FirewallRule fwRule : result.first()) {
      FirewallResponse ruleData=_responseGenerator.createFirewallResponse(fwRule);
      ruleData.setObjectName("String_Node_Str");
      fwResponses.add(ruleData);
    }
    response.setResponses(fwResponses,result.second());
  }
  response.setResponseName(getCommandName());
  setResponseObject(response);
}
Program: 105533
Project: 105533
Buggy source:
@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
  try {
    List<? extends Nic> results=_networkService.listNics(this);
    ListResponse<NicResponse> response=new ListResponse<NicResponse>();
    List<NicResponse> resList=new ArrayList<NicResponse>(results.size());
    for (    Nic r : results) {
      NicResponse resp=_responseGenerator.createNicResponse(r);
      resp.setObjectName("String_Node_Str");
      resList.add(resp);
    }
    response.setResponses(resList);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str");
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,e.getMessage());
  }
}

Fixed version (ground truth):
@Override public void execute() throws ResourceUnavailableException, ResourceAllocationException, ConcurrentOperationException, InsufficientCapacityException {
  try {
    List<? extends Nic> results=_networkService.listNics(this);
    ListResponse<NicResponse> response=new ListResponse<NicResponse>();
    List<NicResponse> resList=null;
    if (results != null) {
      resList=new ArrayList<NicResponse>(results.size());
      for (      Nic r : results) {
        NicResponse resp=_responseGenerator.createNicResponse(r);
        resp.setObjectName("String_Node_Str");
        resList.add(resp);
      }
      response.setResponses(resList);
    }
    response.setResponses(resList);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str");
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,e.getMessage());
  }
}
Program: 105537
Project: 105537
Buggy source:
@Override public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
  CallContext.current().setEventDetails("String_Node_Str" + id);
  VirtualRouterProvider result=_service.get(0).configure(this);
  if (result != null) {
    VirtualRouterProviderResponse routerResponse=_responseGenerator.createVirtualRouterProviderResponse(result);
    routerResponse.setResponseName(getCommandName());
    this.setResponseObject(routerResponse);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
  CallContext.current().setEventDetails("String_Node_Str" + id);
  VirtualRouterProvider result=_service.get(0).configure(this);
  if (result != null) {
    VirtualRouterProviderResponse routerResponse=_responseGenerator.createVirtualRouterProviderResponse(result);
    if (routerResponse != null) {
      routerResponse.setResponseName(getCommandName());
      this.setResponseObject(routerResponse);
    }
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 105538
Project: 105538
Buggy source:
@Override public void execute(){
  CallContext.current().setEventDetails("String_Node_Str" + getEntityId());
  VirtualRouterProvider result=_service.get(0).getCreatedElement(getEntityId());
  if (result != null) {
    VirtualRouterProviderResponse response=_responseGenerator.createVirtualRouterProviderResponse(result);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void execute(){
  CallContext.current().setEventDetails("String_Node_Str" + getEntityId());
  VirtualRouterProvider result=_service.get(0).getCreatedElement(getEntityId());
  if (result != null) {
    VirtualRouterProviderResponse response=_responseGenerator.createVirtualRouterProviderResponse(result);
    if (response != null) {
      response.setResponseName(getCommandName());
      this.setResponseObject(response);
    }
  }
 else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,"String_Node_Str");
  }
}
Program: 105539
Project: 105539
Buggy source:
@Override public void execute(){
  Pair<List<? extends PhysicalNetworkTrafficType>,Integer> trafficTypes=_networkService.listTrafficTypes(getPhysicalNetworkId());
  ListResponse<TrafficTypeResponse> response=new ListResponse<TrafficTypeResponse>();
  List<TrafficTypeResponse> trafficTypesResponses=new ArrayList<TrafficTypeResponse>();
  for (  PhysicalNetworkTrafficType trafficType : trafficTypes.first()) {
    TrafficTypeResponse trafficTypeResponse=_responseGenerator.createTrafficTypeResponse(trafficType);
    trafficTypesResponses.add(trafficTypeResponse);
  }
  response.setResponses(trafficTypesResponses,trafficTypes.second());
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  Pair<List<? extends PhysicalNetworkTrafficType>,Integer> trafficTypes=_networkService.listTrafficTypes(getPhysicalNetworkId());
  ListResponse<TrafficTypeResponse> response=new ListResponse<TrafficTypeResponse>();
  List<TrafficTypeResponse> trafficTypesResponses=new ArrayList<TrafficTypeResponse>();
  if (trafficTypes != null) {
    for (    PhysicalNetworkTrafficType trafficType : trafficTypes.first()) {
      TrafficTypeResponse trafficTypeResponse=_responseGenerator.createTrafficTypeResponse(trafficType);
      trafficTypesResponses.add(trafficTypeResponse);
    }
    response.setResponses(trafficTypesResponses,trafficTypes.second());
    response.setResponseName(getCommandName());
  }
  this.setResponseObject(response);
}
Program: 105540
Project: 105540
Buggy source:
@Override public void execute(){
  String[] keys=_accountService.createApiKeyAndSecretKey(this);
  RegisterResponse response=new RegisterResponse();
  response.setApiKey(keys[0]);
  response.setSecretKey(keys[1]);
  response.setObjectName("String_Node_Str");
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  String[] keys=_accountService.createApiKeyAndSecretKey(this);
  RegisterResponse response=new RegisterResponse();
  if (keys != null) {
    response.setApiKey(keys[0]);
    response.setSecretKey(keys[1]);
  }
  response.setObjectName("String_Node_Str");
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}
Program: 105541
Project: 105541
Buggy source:
public Boolean isForVirtualNetwork(){
  return forVirtualNetwork == null ? true : forVirtualNetwork;
}

Fixed version (ground truth):
public Boolean isForVirtualNetwork(){
  return forVirtualNetwork == null ? Boolean.TRUE : forVirtualNetwork;
}
Program: 105542
Project: 105542
Buggy source:
public Long getNetworkId(){
  if (vpcId != null) {
    return null;
  }
  if (networkId != null) {
    return networkId;
  }
  Long zoneId=getZoneId();
  if (zoneId == null) {
    return null;
  }
  DataCenter zone=_entityMgr.findById(DataCenter.class,zoneId);
  if (zone.getNetworkType() == NetworkType.Advanced) {
    List<? extends Network> networks=_networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(),_accountService.getAccount(getEntityOwnerId()));
    if (networks.size() == 0) {
      String domain=_domainService.getDomain(getDomainId()).getName();
      throw new InvalidParameterValueException("String_Node_Str" + getAccountName() + "String_Node_Str"+ domain+ "String_Node_Str"+ zone.getName());
    }
    if (networks.size() < 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
 else     if (networks.size() > 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    return networks.get(0).getId();
  }
 else {
    Network defaultGuestNetwork=_networkService.getExclusiveGuestNetwork(zoneId);
    if (defaultGuestNetwork == null) {
      throw new InvalidParameterValueException("String_Node_Str" + getAccountName() + "String_Node_Str"+ getDomainId());
    }
 else {
      return defaultGuestNetwork.getId();
    }
  }
}

Fixed version (ground truth):
public Long getNetworkId(){
  if (vpcId != null) {
    return null;
  }
  if (networkId != null) {
    return networkId;
  }
  Long zoneId=getZoneId();
  DataCenter zone=_entityMgr.findById(DataCenter.class,zoneId);
  if (zone.getNetworkType() == NetworkType.Advanced) {
    List<? extends Network> networks=_networkService.getIsolatedNetworksOwnedByAccountInZone(getZoneId(),_accountService.getAccount(getEntityOwnerId()));
    if (networks.size() == 0) {
      String domain=_domainService.getDomain(getDomainId()).getName();
      throw new InvalidParameterValueException("String_Node_Str" + getAccountName() + "String_Node_Str"+ domain+ "String_Node_Str"+ zone.getName());
    }
    if (networks.size() < 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
 else     if (networks.size() > 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    return networks.get(0).getId();
  }
 else {
    Network defaultGuestNetwork=_networkService.getExclusiveGuestNetwork(zoneId);
    if (defaultGuestNetwork == null) {
      throw new InvalidParameterValueException("String_Node_Str" + getAccountName() + "String_Node_Str"+ getDomainId());
    }
 else {
      return defaultGuestNetwork.getId();
    }
  }
}
Program: 105543
Project: 105543
Buggy source:
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
  IpAddress result=_networkService.updateIP(getId(),getCustomId(),getDisplayIp());
  IPAddressResponse ipResponse=_responseGenerator.createIPAddressResponse(ResponseView.Restricted,result);
  ipResponse.setResponseName(getCommandName());
  setResponseObject(ipResponse);
}

Fixed version (ground truth):
@Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
  IpAddress result=_networkService.updateIP(getId(),getCustomId(),getDisplayIp());
  if (result != null) {
    IPAddressResponse ipResponse=_responseGenerator.createIPAddressResponse(ResponseView.Restricted,result);
    ipResponse.setResponseName(getCommandName());
    setResponseObject(ipResponse);
  }
}
Program: 105549
Project: 105549
Buggy source:
@Override public void downloadTemplateToStorage(DataObject template,AsyncCompletionCallback<DownloadAnswer> callback){
  long templateId=template.getId();
  DataStore store=template.getDataStore();
  if (isTemplateUpdateable(templateId,store.getId())) {
    if (template != null && template.getUri() != null) {
      initiateTemplateDownload(template,callback);
    }
 else {
      s_logger.info("String_Node_Str");
      DownloadAnswer ans=new DownloadAnswer("String_Node_Str",Status.UNKNOWN);
      callback.complete(ans);
    }
  }
 else {
    s_logger.info("String_Node_Str");
    DownloadAnswer ans=new DownloadAnswer("String_Node_Str",Status.UNKNOWN);
    callback.complete(ans);
  }
}

Fixed version (ground truth):
@Override public void downloadTemplateToStorage(DataObject template,AsyncCompletionCallback<DownloadAnswer> callback){
  if (template != null) {
    long templateId=template.getId();
    DataStore store=template.getDataStore();
    if (isTemplateUpdateable(templateId,store.getId())) {
      if (template.getUri() != null) {
        initiateTemplateDownload(template,callback);
      }
 else {
        s_logger.info("String_Node_Str");
        DownloadAnswer ans=new DownloadAnswer("String_Node_Str",Status.UNKNOWN);
        callback.complete(ans);
      }
    }
 else {
      s_logger.info("String_Node_Str");
      DownloadAnswer ans=new DownloadAnswer("String_Node_Str",Status.UNKNOWN);
      callback.complete(ans);
    }
  }
}
Program: 105550
Project: 105550
Buggy source:
public static String getDefaultHostIp(){
  if (SystemUtils.IS_OS_WINDOWS) {
    Pattern pattern=Pattern.compile("String_Node_Str");
    try {
      Process result=Runtime.getRuntime().exec("String_Node_Str");
      BufferedReader output=new BufferedReader(new InputStreamReader(result.getInputStream()));
      String line=output.readLine();
      while (line != null) {
        Matcher matcher=pattern.matcher(line);
        if (matcher.find()) {
          return matcher.group(2);
        }
        line=output.readLine();
      }
    }
 catch (    IOException e) {
      s_logger.debug("String_Node_Str",e);
    }
    return null;
  }
 else {
    NetworkInterface nic=null;
    String pubNic=getDefaultEthDevice();
    if (pubNic == null) {
      return null;
    }
    try {
      nic=NetworkInterface.getByName(pubNic);
    }
 catch (    final SocketException e) {
      return null;
    }
    String[] info=NetUtils.getNetworkParams(nic);
    return info[0];
  }
}

Fixed version (ground truth):
public static String getDefaultHostIp(){
  if (SystemUtils.IS_OS_WINDOWS) {
    Pattern pattern=Pattern.compile("String_Node_Str");
    try {
      Process result=Runtime.getRuntime().exec("String_Node_Str");
      BufferedReader output=new BufferedReader(new InputStreamReader(result.getInputStream()));
      String line=output.readLine();
      while (line != null) {
        Matcher matcher=pattern.matcher(line);
        if (matcher.find()) {
          return matcher.group(2);
        }
        line=output.readLine();
      }
    }
 catch (    IOException e) {
      s_logger.debug("String_Node_Str",e);
    }
    return null;
  }
 else {
    NetworkInterface nic=null;
    String pubNic=getDefaultEthDevice();
    if (pubNic == null) {
      return null;
    }
    try {
      nic=NetworkInterface.getByName(pubNic);
    }
 catch (    final SocketException e) {
      return null;
    }
    String[] info=NetUtils.getNetworkParams(nic);
    if (info != null) {
      return info[0];
    }
    return null;
  }
}
Program: 105551
Project: 105551
Buggy source:
public static boolean isSiteLocalAddress(String ipAddress){
  if (ipAddress == null) {
    return false;
  }
 else {
    InetAddress ip=parseIpAddress(ipAddress);
    return ip.isSiteLocalAddress();
  }
}

Fixed version (ground truth):
public static boolean isSiteLocalAddress(String ipAddress){
  if (ipAddress == null) {
    return false;
  }
 else {
    InetAddress ip=parseIpAddress(ipAddress);
    if (ip != null) {
      return ip.isSiteLocalAddress();
    }
    return false;
  }
}
Program: 105552
Project: 105552
Buggy source:
public static String getIp6FromRange(String ip6Range){
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  IPv6Address start=IPv6Address.fromString(startIp);
  BigInteger gap=countIp6InRange(ip6Range);
  BigInteger next=new BigInteger(gap.bitLength(),s_rand);
  while (next.compareTo(gap) >= 0) {
    next=new BigInteger(gap.bitLength(),s_rand);
  }
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  BigInteger resultInt=startInt.add(next);
  InetAddress resultAddr;
  try {
    resultAddr=InetAddress.getByAddress(resultInt.toByteArray());
  }
 catch (  UnknownHostException e) {
    return null;
  }
  IPv6Address ip=IPv6Address.fromInetAddress(resultAddr);
  return ip.toString();
}

Fixed version (ground truth):
public static String getIp6FromRange(String ip6Range){
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  IPv6Address start=IPv6Address.fromString(startIp);
  BigInteger gap=countIp6InRange(ip6Range);
  BigInteger next=new BigInteger(gap.bitLength(),s_rand);
  while (next.compareTo(gap) >= 0) {
    next=new BigInteger(gap.bitLength(),s_rand);
  }
  InetAddress resultAddr=null;
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  if (startInt != null) {
    BigInteger resultInt=startInt.add(next);
    try {
      resultAddr=InetAddress.getByAddress(resultInt.toByteArray());
    }
 catch (    UnknownHostException e) {
      return null;
    }
  }
  if (resultAddr != null) {
    IPv6Address ip=IPv6Address.fromInetAddress(resultAddr);
    return ip.toString();
  }
  return null;
}
Program: 105553
Project: 105553
Buggy source:
public static BigInteger countIp6InRange(String ip6Range){
  if (ip6Range == null) {
    return null;
  }
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  String endIp=ips[0];
  if (ips.length > 1) {
    endIp=ips[1];
  }
  IPv6Address start, end;
  try {
    start=IPv6Address.fromString(startIp);
    end=IPv6Address.fromString(endIp);
  }
 catch (  IllegalArgumentException ex) {
    return null;
  }
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  BigInteger endInt=convertIPv6AddressToBigInteger(end);
  if (startInt.compareTo(endInt) > 0) {
    return null;
  }
  return endInt.subtract(startInt).add(BigInteger.ONE);
}

Fixed version (ground truth):
public static BigInteger countIp6InRange(String ip6Range){
  if (ip6Range == null) {
    return null;
  }
  String[] ips=ip6Range.split("String_Node_Str");
  String startIp=ips[0];
  String endIp=ips[0];
  if (ips.length > 1) {
    endIp=ips[1];
  }
  IPv6Address start, end;
  try {
    start=IPv6Address.fromString(startIp);
    end=IPv6Address.fromString(endIp);
  }
 catch (  IllegalArgumentException ex) {
    return null;
  }
  BigInteger startInt=convertIPv6AddressToBigInteger(start);
  BigInteger endInt=convertIPv6AddressToBigInteger(end);
  if (endInt != null) {
    if (startInt.compareTo(endInt) > 0) {
      return null;
    }
  }
  return endInt.subtract(startInt).add(BigInteger.ONE);
}