nus-yam/ex-repair huggingface dataset:
Program: 10696
Project: 10696
Buggy source:
private DockerBrowserManager getDockerManager(){
  if (dockerManager == null) {
synchronized (Browser.class) {
      if (dockerManager == null) {
        dockerManager=new DockerBrowserManager();
        Path logFile=Paths.get(KurentoClientWebPageTest.getDefaultOutputFile("String_Node_Str"));
        try {
          if (!Files.exists(logFile)) {
            Files.createDirectories(logFile);
          }
          dockerManager.setDownloadLogsPath(logFile);
        }
 catch (        IOException e) {
          log.warn("String_Node_Str",logFile);
        }
      }
    }
  }
  return dockerManager;
}

Fixed version (ground truth):
private DockerBrowserManager getDockerManager(){
  if (dockerManager == null) {
synchronized (Browser.class) {
      if (dockerManager == null) {
        dockerManager=new DockerBrowserManager();
      }
    }
  }
  return dockerManager;
}
Program: 10698
Project: 10698
Buggy source:
@Override public void close(){
  if (driver != null) {
    try {
      log.debug("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.debug("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    getDockerManager().closeDriver(id);
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (driver != null) {
    try {
      log.debug("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.debug("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    Path logFile=Paths.get(KurentoClientWebPageTest.getDefaultOutputFile("String_Node_Str"));
    try {
      if (!Files.exists(logFile)) {
        Files.createDirectories(logFile);
      }
      getDockerManager().setDownloadLogsPath(logFile);
    }
 catch (    IOException e) {
      log.warn("String_Node_Str",logFile);
    }
    getDockerManager().closeDriver(id);
  }
}
Program: 10699
Project: 10699
Buggy source:
public DockerBrowser(String id,DesiredCapabilities capabilities){
  this.id=id;
  this.capabilities=capabilities;
  calculateContainerNames();
}

Fixed version (ground truth):
public DockerBrowser(String id,DesiredCapabilities capabilities){
  this.id=id;
  this.capabilities=capabilities;
  calculateContainerNames();
  capabilities.setCapability("String_Node_Str",browserContainerName);
}
Program: 10700
Project: 10700
Buggy source:
@Test public void testSerialBrowser() throws InterruptedException, IOException {
  initTestFolder("String_Node_Str");
  for (int i=0; i < NUM_ITERATIONS; i++) {
    for (int j=0; j < NUM_BROWSERS; j++) {
      log.info("String_Node_Str",i,j);
      Browser browser=new Browser.Builder().scope(BrowserScope.DOCKER).build();
      browser.setId("String_Node_Str" + i + "String_Node_Str"+ j);
      browser.init();
      browser.close();
    }
  }
}

Fixed version (ground truth):
@Test public void testSerialBrowser() throws InterruptedException, IOException {
  System.setProperty("String_Node_Str","String_Node_Str");
  initTestFolder("String_Node_Str");
  for (int i=0; i < NUM_ITERATIONS; i++) {
    for (int j=0; j < NUM_BROWSERS; j++) {
      log.info("String_Node_Str",i,j);
      Browser browser=new Browser.Builder().scope(BrowserScope.DOCKER).build();
      browser.setId("String_Node_Str" + i + "String_Node_Str"+ j);
      browser.init();
      browser.close();
    }
  }
}
Program: 10701
Project: 10701
Buggy source:
private void initTestFolder(String testName) throws IOException {
  KurentoServicesTestHelper.setTestCaseName("String_Node_Str");
  KurentoServicesTestHelper.setTestName(testName);
  log.info("String_Node_Str",KurentoServicesTestHelper.getTestDir());
  Path testFolder=Paths.get(KurentoServicesTestHelper.getTestDir(),"String_Node_Str");
  if (Files.exists(testFolder)) {
    FileUtils.forceDelete(testFolder.toFile());
  }
  Files.deleteIfExists(testFolder);
  Files.createDirectories(testFolder);
}

Fixed version (ground truth):
private void initTestFolder(String testName) throws IOException {
  KurentoServicesTestHelper.setTestCaseName(this.getClass().getSimpleName());
  KurentoServicesTestHelper.setTestName(testName);
  log.info("String_Node_Str",KurentoServicesTestHelper.getTestDir());
  Path testFolder=Paths.get(KurentoServicesTestHelper.getTestDir(),"String_Node_Str");
  if (Files.exists(testFolder)) {
    log.debug("String_Node_Str",testFolder);
    FileUtils.forceDelete(testFolder.toFile());
  }
  log.debug("String_Node_Str",testFolder);
  Files.createDirectories(testFolder);
}
Program: 10703
Project: 10703
Buggy source:
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    downloadLogsForContainers(hubContainerName,browserContainerName,vncrecorderContainerName);
    docker.stopAndRemoveContainers(hubContainerName,browserContainerName,vncrecorderContainerName);
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    downloadLogsForContainer(hubContainerName,"String_Node_Str");
    downloadLogsForContainer(browserContainerName,id);
    downloadLogsForContainer(vncrecorderContainerName,id + "String_Node_Str");
    docker.stopAndRemoveContainers(hubContainerName,browserContainerName,vncrecorderContainerName);
  }
}
Program: 10704
Project: 10704
Buggy source:
private void createVncRecorderContainer(){
  try {
    String vncrecordImageId=getProperty(DOCKER_VNCRECORDER_IMAGE_PROPERTY,DOCKER_VNCRECORDER_IMAGE_DEFAULT);
    if (!docker.existsContainer(vncrecorderContainerName)) {
      String secretFile=createSecretFile();
      docker.pullImageIfNecessary(vncrecordImageId);
      String browserIp=docker.inspectContainer(browserContainerName).getNetworkSettings().getIpAddress();
      String videoFile=Paths.get(KurentoClientWebPageTest.getDefaultOutputFile("String_Node_Str")).toAbsolutePath().toString();
      log.debug("String_Node_Str",vncrecorderContainerName,browserContainerName,videoFile);
      CreateContainerCmd createContainerCmd=docker.getClient().createContainerCmd(vncrecordImageId).withName(vncrecorderContainerName).withCmd("String_Node_Str",videoFile,"String_Node_Str",secretFile,browserIp,"String_Node_Str");
      docker.mountDefaultFolders(createContainerCmd);
      createContainerCmd.exec();
      docker.startContainer(vncrecorderContainerName);
      log.debug("String_Node_Str",vncrecorderContainerName);
    }
 else {
      log.debug("String_Node_Str",vncrecorderContainerName);
    }
  }
 catch (  Exception e) {
    log.warn("String_Node_Str");
  }
}

Fixed version (ground truth):
private void createVncRecorderContainer(){
  try {
    String vncrecordImageId=getProperty(DOCKER_VNCRECORDER_IMAGE_PROPERTY,DOCKER_VNCRECORDER_IMAGE_DEFAULT);
    if (!docker.existsContainer(vncrecorderContainerName)) {
      String secretFile=createSecretFile();
      docker.pullImageIfNecessary(vncrecordImageId);
      String browserIp=docker.inspectContainer(browserContainerName).getNetworkSettings().getIpAddress();
      String videoFile=Paths.get(KurentoClientWebPageTest.getDefaultOutputFile("String_Node_Str" + id + "String_Node_Str")).toAbsolutePath().toString();
      log.debug("String_Node_Str",vncrecorderContainerName,browserContainerName,videoFile);
      CreateContainerCmd createContainerCmd=docker.getClient().createContainerCmd(vncrecordImageId).withName(vncrecorderContainerName).withCmd("String_Node_Str",videoFile,"String_Node_Str",secretFile,browserIp,"String_Node_Str");
      docker.mountDefaultFolders(createContainerCmd);
      createContainerCmd.exec();
      docker.startContainer(vncrecorderContainerName);
      log.debug("String_Node_Str",vncrecorderContainerName);
    }
 else {
      log.debug("String_Node_Str",vncrecorderContainerName);
    }
  }
 catch (  Exception e) {
    log.warn("String_Node_Str");
  }
}
Program: 10706
Project: 10706
Buggy source:
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    downloadLogsForContainer(browserContainerName,id);
    downloadLogsForContainer(vncrecorderContainerName,id + "String_Node_Str");
    docker.stopAndRemoveContainers(hubContainerName,vncrecorderContainerName,browserContainerName);
    if (numBrowsers.decrementAndGet() == 0) {
      downloadLogsForContainer(hubContainerName,"String_Node_Str");
      docker.stopAndRemoveContainers(hubContainerName);
    }
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    downloadLogsForContainer(browserContainerName,id);
    downloadLogsForContainer(vncrecorderContainerName,id + "String_Node_Str");
    docker.stopAndRemoveContainers(vncrecorderContainerName,browserContainerName);
    if (numBrowsers.decrementAndGet() == 0) {
      downloadLogsForContainer(hubContainerName,"String_Node_Str");
      docker.stopAndRemoveContainers(hubContainerName);
    }
  }
}
Program: 10708
Project: 10708
Buggy source:
public void mountDefaultFolders(CreateContainerCmd createContainerCmd){
  if (isRunningInContainer()) {
    createContainerCmd.withVolumesFrom(new VolumesFrom(getContainerId()));
  }
 else {
    String testFilesPath=KurentoServicesTestHelper.getTestFilesPath();
    Volume testFilesVolume=new Volume(testFilesPath);
    String workspacePath=Paths.get(KurentoServicesTestHelper.getTestDir()).toAbsolutePath().toString();
    Volume workspaceVolume=new Volume(workspacePath);
    createContainerCmd.withVolumes(testFilesVolume).withBinds(new Bind(testFilesPath,testFilesVolume,AccessMode.ro)).withVolumes(workspaceVolume).withBinds(new Bind(workspacePath,workspaceVolume,AccessMode.rw));
  }
}

Fixed version (ground truth):
public void mountDefaultFolders(CreateContainerCmd createContainerCmd){
  if (isRunningInContainer()) {
    createContainerCmd.withVolumesFrom(new VolumesFrom(getContainerId()));
  }
 else {
    String testFilesPath=KurentoServicesTestHelper.getTestFilesPath();
    Volume testFilesVolume=new Volume(testFilesPath);
    String workspacePath=Paths.get(KurentoServicesTestHelper.getTestDir()).toAbsolutePath().toString();
    Volume workspaceVolume=new Volume(workspacePath);
    createContainerCmd.withVolumes(testFilesVolume,workspaceVolume).withBinds(new Bind(testFilesPath,testFilesVolume,AccessMode.ro),new Bind(workspacePath,workspaceVolume,AccessMode.rw));
  }
}
Program: 10709
Project: 10709
Buggy source:
public static void configurePropertiesFromConfigFile(Path configFilePath) throws JsonSyntaxException, JsonIOException, IOException {
  Preconditions.checkNotNull(configFilePath,"String_Node_Str");
  log.debug("String_Node_Str" + configFilePath + "String_Node_Str"+ configFilePath.getClass().getCanonicalName()+ "String_Node_Str");
  JsonReader reader=new JsonReader(Files.newBufferedReader(configFilePath,StandardCharsets.UTF_8));
  reader.setLenient(true);
  JsonObject configFile=gson.fromJson(reader,JsonObject.class);
  traceConfigContent(configFile);
  PropertiesManager.setPropertyHolder(new ConfigFilePropertyHolder(configFile));
}

Fixed version (ground truth):
public static synchronized void configurePropertiesFromConfigFile(Path configFilePath) throws JsonSyntaxException, JsonIOException, IOException {
  if (lastLoadedconfigFilePath != null) {
    if (lastLoadedconfigFilePath.equals(configFilePath)) {
      log.info("String_Node_Str",configFilePath.toAbsolutePath());
    }
 else {
      log.warn("String_Node_Str" + "String_Node_Str",lastLoadedconfigFilePath,configFilePath);
    }
    return;
  }
  lastLoadedconfigFilePath=configFilePath;
  Preconditions.checkNotNull(configFilePath,"String_Node_Str");
  log.debug("String_Node_Str" + configFilePath + "String_Node_Str"+ configFilePath.getClass().getCanonicalName()+ "String_Node_Str");
  JsonReader reader=new JsonReader(Files.newBufferedReader(configFilePath,StandardCharsets.UTF_8));
  reader.setLenient(true);
  JsonObject configFile=gson.fromJson(reader,JsonObject.class);
  traceConfigContent(configFile);
  PropertiesManager.setPropertyHolder(new ConfigFilePropertyHolder(configFile));
}
Program: 10710
Project: 10710
Buggy source:
@Parameters public static Collection<Object[]> data(){
  return Arrays.asList(new Object[][]{{}});
}

Fixed version (ground truth):
@Parameters public static Collection<Object[]> data(){
  return TestScenario.from("String_Node_Str");
}
Program: 10711
Project: 10711
Buggy source:
public static Properties of(Object... params){
  if (params.length % 2 != 0) {
    throw new IllegalArgumentException("String_Node_Str" + params);
  }
  Properties p=new Properties();
  for (int i=0; i < params.length; i++) {
    if (!(params[i] instanceof String)) {
      throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str"+ params[i]);
    }
    p.add((String)params[i],params[i + 1]);
  }
  return p;
}

Fixed version (ground truth):
public static Properties of(Object... params){
  if (params.length % 2 != 0) {
    throw new IllegalArgumentException("String_Node_Str" + params);
  }
  Properties p=new Properties();
  for (int i=0; i < params.length; i+=2) {
    if (!(params[i] instanceof String)) {
      throw new IllegalArgumentException("String_Node_Str" + i + "String_Node_Str"+ params[i]);
    }
    p.add((String)params[i],params[i + 1]);
  }
  return p;
}
Program: 10712
Project: 10712
Buggy source:
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (docker != null) {
    String hubContainerName=getProperty(DOCKER_HUB_CONTAINER_NAME_PROPERTY,DOCKER_HUB_CONTAINER_NAME_DEFAULT);
    docker.stopAndRemoveContainers(hubContainerName,getId());
  }
}

Fixed version (ground truth):
@Override public void close(){
  if (driver != null) {
    try {
      log.info("String_Node_Str",id);
      driver.quit();
      driver=null;
    }
 catch (    Throwable t) {
      log.warn("String_Node_Str",t.getClass(),t.getMessage());
    }
  }
  if (GridHandler.getInstance().useRemoteNodes()) {
    log.info("String_Node_Str",id);
    GridHandler.getInstance().stopGrid();
  }
  if (scope == BrowserScope.DOCKER) {
    String hubContainerName=getProperty(DOCKER_HUB_CONTAINER_NAME_PROPERTY,DOCKER_HUB_CONTAINER_NAME_DEFAULT);
    docker.stopAndRemoveContainers(hubContainerName,getId());
  }
}
Program: 10714
Project: 10714
Buggy source:
public static void loadConfigFile(String configFileName){
  try {
    String configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY);
    if (configFilePath == null) {
      configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY2);
    }
    if (configFilePath == null) {
      configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY3);
    }
    Path configFile=null;
    if (configFilePath != null) {
      configFile=Paths.get(configFilePath);
      if (!Files.exists(configFile)) {
        log.warn("String_Node_Str",CONFIG_FILE_PATH_PROPERTY,configFilePath,configFileName);
        configFile=ConfigFileFinder.searchConfigFileInDefaultPlaces(configFileName);
      }
 else {
        log.info("String_Node_Str",CONFIG_FILE_PATH_PROPERTY,configFilePath);
      }
    }
 else {
      configFile=ConfigFileFinder.searchConfigFileInDefaultPlaces(configFileName);
    }
    if (configFile != null && Files.exists(configFile)) {
      ConfigFilePropertyHolder.configurePropertiesFromConfigFile(configFile);
    }
 else {
      log.warn("String_Node_Str",configFileName);
    }
  }
 catch (  IOException e) {
    log.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static void loadConfigFile(String configFileName){
  try {
    String property=CONFIG_FILE_PATH_PROPERTY;
    String configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY);
    if (configFilePath == null) {
      configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY2);
      property=CONFIG_FILE_PATH_PROPERTY2;
    }
    if (configFilePath == null) {
      configFilePath=System.getProperty(CONFIG_FILE_PATH_PROPERTY3);
      property=CONFIG_FILE_PATH_PROPERTY3;
    }
    Path configFile=null;
    if (configFilePath != null) {
      configFile=Paths.get(configFilePath);
      if (!Files.exists(configFile)) {
        log.warn("String_Node_Str",property,configFilePath,configFileName);
        configFile=ConfigFileFinder.searchConfigFileInDefaultPlaces(configFileName);
      }
 else {
        log.info("String_Node_Str",property,configFilePath);
      }
    }
 else {
      configFile=ConfigFileFinder.searchConfigFileInDefaultPlaces(configFileName);
    }
    if (configFile != null && Files.exists(configFile)) {
      ConfigFilePropertyHolder.configurePropertiesFromConfigFile(configFile);
    }
 else {
      log.warn("String_Node_Str",configFileName);
    }
  }
 catch (  IOException e) {
    log.warn("String_Node_Str",e);
  }
}
Program: 10717
Project: 10717
Buggy source:
@Ignore @Test public void testFileUploadWithSeqPUTs() throws Exception {
  RepositoryItem repositoryItem=getRepository().createRepositoryItem();
  String id=repositoryItem.getId();
  File fileToUpload=new File("String_Node_Str");
  uploadFileWithSeqPUTs(repositoryItem.createRepositoryHttpRecorder(),fileToUpload,repositoryItem);
  RepositoryItem newRepositoryItem=getRepository().findRepositoryItemById(id);
  File downloadedFile=new File("String_Node_Str" + id);
  downloadFromURL(newRepositoryItem.createRepositoryHttpPlayer().getURL(),downloadedFile);
  assertTrue("String_Node_Str",TestUtils.equalFiles(fileToUpload,downloadedFile));
}

Fixed version (ground truth):
@Test public void testFileUploadWithSeqPUTs() throws Exception {
  RepositoryItem repositoryItem=getRepository().createRepositoryItem();
  String id=repositoryItem.getId();
  File fileToUpload=new File("String_Node_Str");
  uploadFileWithSeqPUTs(repositoryItem.createRepositoryHttpRecorder(),fileToUpload,repositoryItem);
  RepositoryItem newRepositoryItem=getRepository().findRepositoryItemById(id);
  File downloadedFile=new File("String_Node_Str" + id);
  downloadFromURL(newRepositoryItem.createRepositoryHttpPlayer().getURL(),downloadedFile);
  assertTrue("String_Node_Str",TestUtils.equalFiles(fileToUpload,downloadedFile));
}
Program: 10718
Project: 10718
Buggy source:
@Override public RepositoryItem createRepositoryItem(String id){
  if (!gridFS.find(idQuery(id)).isEmpty()) {
    throw new DuplicateItemException(id);
  }
  GridFSInputFile dbFile=gridFS.createFile(id);
  dbFile.setId(id);
  return createRepositoryItem(dbFile);
}

Fixed version (ground truth):
@Override public RepositoryItem createRepositoryItem(String id){
  if (!gridFS.find(id).isEmpty()) {
    throw new DuplicateItemException(id);
  }
  GridFSInputFile dbFile=gridFS.createFile(id);
  dbFile.setId(id);
  return createRepositoryItem(dbFile);
}
Program: 10719
Project: 10719
Buggy source:
@Override public RepositoryItem findRepositoryItemById(String id){
  List<GridFSDBFile> dbFiles=gridFS.find(idQuery(id));
  if (dbFiles.size() > 0) {
    if (dbFiles.size() > 1) {
      log.warn("String_Node_Str" + "String_Node_Str");
    }
    return createRepositoryItem(dbFiles.get(0));
  }
  throw new NoSuchElementException("String_Node_Str" + id + "String_Node_Str");
}

Fixed version (ground truth):
@Override public RepositoryItem findRepositoryItemById(String id){
  List<GridFSDBFile> dbFiles=gridFS.find(id);
  if (dbFiles.size() > 0) {
    if (dbFiles.size() > 1) {
      log.warn("String_Node_Str" + "String_Node_Str");
    }
    return createRepositoryItem(dbFiles.get(0));
  }
  throw new NoSuchElementException("String_Node_Str" + id + "String_Node_Str");
}
Program: 10720
Project: 10720
Buggy source:
@Override public void remove(RepositoryItem item){
  httpManager.disposeHttpRepoItemElemByItemId(item,"String_Node_Str");
  gridFS.remove(idQuery(item.getId()));
}

Fixed version (ground truth):
@Override public void remove(RepositoryItem item){
  httpManager.disposeHttpRepoItemElemByItemId(item,"String_Node_Str");
  gridFS.remove(item.getId());
}
Program: 10721
Project: 10721
Buggy source:
protected void refreshAttributesOnClose(){
  BasicDBObject query=new BasicDBObject("String_Node_Str",new ObjectId(getId()));
  dbFile=((MongoRepository)repository).getGridFS().findOne(query);
  if (dbFile == null)   throw new KurentoException("String_Node_Str" + getId());
  state=State.STORED;
  attributes.setContentLength(dbFile.getLength());
}

Fixed version (ground truth):
protected void refreshAttributesOnClose(){
  dbFile=((MongoRepository)repository).getGridFS().findOne(getId());
  if (dbFile == null)   throw new KurentoException("String_Node_Str" + getId());
  state=State.STORED;
  attributes.setContentLength(dbFile.getLength());
}
Program: 10722
Project: 10722
Buggy source:
private void processResponseMessage(JsonObject messagetJsonObject,String internalSessionId){
  Response<JsonElement> response=JsonUtils.fromJsonResponse(messagetJsonObject,JsonElement.class);
  ServerSession session=sessionsManager.getByTransportId(internalSessionId);
  session.handleResponse(response);
}

Fixed version (ground truth):
private void processResponseMessage(JsonObject messagetJsonObject,String internalSessionId){
  Response<JsonElement> response=JsonUtils.fromJsonResponse(messagetJsonObject,JsonElement.class);
  ServerSession session=sessionsManager.getByTransportId(internalSessionId);
  if (session != null) {
    session.handleResponse(response);
  }
 else {
    log.debug("String_Node_Str",response.toString(),internalSessionId);
  }
}
Program: 10723
Project: 10723
Buggy source:
private void processPingMessage(ServerSessionFactory factory,Request<JsonElement> request,ResponseSender responseSender,String transportId) throws IOException {
  if (maxHeartbeats == 0 || maxHeartbeats > ++heartbeats) {
    long interval=-1;
    if (request.getParams() != null) {
      JsonObject element=(JsonObject)request.getParams();
      if (element.has(INTERVAL_PROPERTY)) {
        interval=element.get(INTERVAL_PROPERTY).getAsLong();
      }
    }
    pingWachdogManager.pingReceived(transportId,interval);
    String sessionId=request.getSessionId();
    JsonObject pongPayload=new JsonObject();
    pongPayload.add(PONG_PAYLOAD,new JsonPrimitive(PONG));
    responseSender.sendPingResponse(new Response<>(sessionId,request.getId(),pongPayload));
  }
}

Fixed version (ground truth):
private void processPingMessage(ServerSessionFactory factory,Request<JsonElement> request,ResponseSender responseSender,String transportId) throws IOException {
  if ((maxHeartbeats == 0) || (maxHeartbeats > ++heartbeats)) {
    long interval=-1;
    if (request.getParams() != null) {
      JsonObject element=(JsonObject)request.getParams();
      if (element.has(INTERVAL_PROPERTY)) {
        interval=element.get(INTERVAL_PROPERTY).getAsLong();
      }
    }
    pingWachdogManager.pingReceived(transportId,interval);
    String sessionId=request.getSessionId();
    JsonObject pongPayload=new JsonObject();
    pongPayload.add(PONG_PAYLOAD,new JsonPrimitive(PONG));
    responseSender.sendPingResponse(new Response<>(sessionId,request.getId(),pongPayload));
  }
}
Program: 10724
Project: 10724
Buggy source:
private void closeClient(){
  if (client != null) {
    log.debug("String_Node_Str",label);
    try {
      client.stop();
      client.destroy();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    client=null;
  }
 else {
    if (connectionListener != null) {
      connectionListener.disconnected();
    }
  }
  if (execService != null) {
    try {
      execService.shutdown();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    execService=null;
  }
  if (disconnectExecService != null) {
    try {
      disconnectExecService.shutdown();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    disconnectExecService=null;
  }
}

Fixed version (ground truth):
private void closeClient(){
  if (client != null) {
    log.debug("String_Node_Str",label);
    try {
      client.stop();
      client.destroy();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    client=null;
  }
  if (execService != null) {
    try {
      execService.shutdown();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    execService=null;
  }
  if (disconnectExecService != null) {
    try {
      disconnectExecService.shutdown();
    }
 catch (    Exception e) {
      log.debug("String_Node_Str",label,e.getMessage());
    }
    disconnectExecService=null;
  }
}
Program: 10725
Project: 10725
Buggy source:
public void closeWithReconnection() throws IOException {
  this.close();
}

Fixed version (ground truth):
protected void closeWithReconnection() throws IOException {
  this.close();
}
Program: 10727
Project: 10727
Buggy source:
@Override public void closeWithReconnection(){
  log.info("String_Node_Str",label);
  this.wsSession.close();
  this.closeClient();
}

Fixed version (ground truth):
@Override protected void closeWithReconnection(){
  log.info("String_Node_Str",label);
  this.wsSession.close();
  handleReconnectDisconnection(999,"String_Node_Str");
}
Program: 10729
Project: 10729
Buggy source:
private void fireConnectionFailed(){
  if (connectionListener != null) {
    execService.submit(new Runnable(){
      @Override public void run(){
        connectionListener.connectionFailed();
      }
    }
);
  }
}

Fixed version (ground truth):
private void fireConnectionFailed(){
  if (connectionListener != null) {
    createExecServiceIfNecessary();
    execService.submit(new Runnable(){
      @Override public void run(){
        connectionListener.connectionFailed();
      }
    }
);
  }
}
Program: 10730
Project: 10730
Buggy source:
@Test public void disconnectionEventTest() throws InterruptedException, IOException {
  KurentoMediaServerManager kms=KurentoServicesTestHelper.startKurentoMediaServer();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  String kmsUrl=kms.getLocalhostWsUrl();
  log.info("String_Node_Str" + kmsUrl);
  KurentoClient kurentoClient=KurentoClient.create(kmsUrl,new KurentoConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      disconnectedLatch.countDown();
    }
    @Override public void connectionFailed(){
    }
    @Override public void connected(){
    }
  }
);
  MediaPipeline pipeline=kurentoClient.createMediaPipeline();
  PlayerEndpoint player=new PlayerEndpoint.Builder(pipeline,"String_Node_Str").build();
  HttpPostEndpoint httpEndpoint=new HttpPostEndpoint.Builder(pipeline).build();
  player.connect(httpEndpoint);
  try {
    kms.destroy();
  }
 catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  log.debug("String_Node_Str");
  if (!disconnectedLatch.await(60,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  log.debug("String_Node_Str");
}

Fixed version (ground truth):
@Test public void disconnectionEventTest() throws InterruptedException, IOException {
  KurentoMediaServerManager kms=KurentoServicesTestHelper.startKurentoMediaServer();
  final CountDownLatch disconnectedLatch=new CountDownLatch(1);
  String kmsUrl=kms.getLocalhostWsUrl();
  log.info("String_Node_Str" + kmsUrl);
  KurentoClient kurentoClient=KurentoClient.create(kmsUrl,new KurentoConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      disconnectedLatch.countDown();
    }
    @Override public void connectionFailed(){
    }
    @Override public void connected(){
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  MediaPipeline pipeline=kurentoClient.createMediaPipeline();
  PlayerEndpoint player=new PlayerEndpoint.Builder(pipeline,"String_Node_Str").build();
  HttpPostEndpoint httpEndpoint=new HttpPostEndpoint.Builder(pipeline).build();
  player.connect(httpEndpoint);
  try {
    kms.destroy();
  }
 catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  log.debug("String_Node_Str");
  if (!disconnectedLatch.await(60,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  log.debug("String_Node_Str");
}
Program: 10731
Project: 10731
Buggy source:
@Test public void serverDisconnectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connectionFailed(){
    }
    @Override public void connected(){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  context.close();
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}

Fixed version (ground truth):
@Test public void serverDisconnectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connectionFailed(){
    }
    @Override public void connected(){
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  context.close();
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}
Program: 10732
Project: 10732
Buggy source:
@Test public void connectionTimeoutTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
      latch.countDown();
    }
  }
);
  try {
    client.sendRequest("String_Node_Str",String.class);
    if (!latch.await(20,TimeUnit.SECONDS)) {
      fail("String_Node_Str");
    }
  }
 catch (  KurentoException e) {
    assertTrue(e.getMessage().contains("String_Node_Str"));
  }
  client.close();
}

Fixed version (ground truth):
@Test public void connectionTimeoutTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
      latch.countDown();
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  try {
    client.sendRequest("String_Node_Str",String.class);
    if (!latch.await(20,TimeUnit.SECONDS)) {
      fail("String_Node_Str");
    }
  }
 catch (  KurentoException e) {
    assertTrue(e.getMessage().contains("String_Node_Str"));
  }
  client.close();
}
Program: 10733
Project: 10733
Buggy source:
@Test public void connectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
    }
    @Override public void connected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connectionFailed(){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}

Fixed version (ground truth):
@Test public void connectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
    }
    @Override public void connected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connectionFailed(){
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}
Program: 10734
Project: 10734
Buggy source:
@Test public void clientDisconnectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  client.close();
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}

Fixed version (ground truth):
@Test public void clientDisconnectedTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      log.info("String_Node_Str");
      latch.countDown();
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  client.close();
  if (!latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str");
  }
  client.close();
}
Program: 10735
Project: 10735
Buggy source:
@Test public void communicationFailureDisconnectionTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      System.out.println("String_Node_Str");
      latch.countDown();
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  JsonRpcClientWebSocket webSocketClient=(JsonRpcClientWebSocket)client;
  webSocketClient.closeNativeSession();
  if (latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str" + "String_Node_Str");
  }
  client.close();
}

Fixed version (ground truth):
@Test public void communicationFailureDisconnectionTest() throws IOException, InterruptedException {
  final CountDownLatch latch=new CountDownLatch(1);
  JsonRpcClient client=new JsonRpcClientWebSocket("String_Node_Str" + getPort() + "String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void disconnected(){
      System.out.println("String_Node_Str");
      latch.countDown();
    }
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  client.sendRequest("String_Node_Str",String.class);
  JsonRpcClientWebSocket webSocketClient=(JsonRpcClientWebSocket)client;
  webSocketClient.closeNativeSession();
  if (latch.await(20,TimeUnit.SECONDS)) {
    fail("String_Node_Str" + "String_Node_Str");
  }
  client.close();
}
Program: 10736
Project: 10736
Buggy source:
@Test public void test() throws IOException, InterruptedException {
  log.info("String_Node_Str");
  JsonRpcClient client=createJsonRpcClient("String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
      System.out.println("String_Node_Str");
    }
    @Override public void disconnected(){
      System.out.println("String_Node_Str");
    }
  }
);
  client.setHeartbeatInterval(500);
  client.enableHeartbeat();
  String result=client.sendRequest("String_Node_Str","String_Node_Str",String.class);
  log.info("String_Node_Str" + result);
  Assert.assertEquals(result,"String_Node_Str");
  Thread.sleep(20000);
  log.info("String_Node_Str");
  client.disableHeartbeat();
  Thread.sleep(30000);
  log.info("String_Node_Str");
  client.enableHeartbeat();
  Thread.sleep(30000);
  log.info("String_Node_Str");
}

Fixed version (ground truth):
@Test public void test() throws IOException, InterruptedException {
  log.info("String_Node_Str");
  JsonRpcClient client=createJsonRpcClient("String_Node_Str",new JsonRpcWSConnectionListener(){
    @Override public void connected(){
    }
    @Override public void connectionFailed(){
      System.out.println("String_Node_Str");
    }
    @Override public void disconnected(){
      System.out.println("String_Node_Str");
    }
    @Override public void reconnected(    boolean sameServer){
    }
  }
);
  client.setHeartbeatInterval(500);
  client.enableHeartbeat();
  String result=client.sendRequest("String_Node_Str","String_Node_Str",String.class);
  log.info("String_Node_Str" + result);
  Assert.assertEquals(result,"String_Node_Str");
  Thread.sleep(20000);
  log.info("String_Node_Str");
  client.disableHeartbeat();
  Thread.sleep(30000);
  log.info("String_Node_Str");
  client.enableHeartbeat();
  Thread.sleep(30000);
  log.info("String_Node_Str");
}
Program: 10737
Project: 10737
Buggy source:
protected void handleReconnectDisconnection(final int statusCode,final String closeReason){
  if (!clientClose) {
    reconnecting=true;
    if (execService == null || execService.isShutdown() || execService.isTerminated()) {
      execService=Executors.newFixedThreadPool(10,threadFactory);
    }
    execService.execute(new Runnable(){
      @Override public void run(){
        try {
          connectIfNecessary();
          reconnecting=false;
        }
 catch (        KurentoException e) {
          pendingRequests.closeAllPendingRequests();
          handlerManager.afterConnectionClosed(session,closeReason);
          log.debug("String_Node_Str",label,closeReason);
          wsSession=null;
          if (connectionListener != null) {
            connectionListener.disconnected();
          }
        }
catch (        IOException e) {
          log.warn("String_Node_Str",label,url,e);
        }
      }
    }
);
  }
 else {
    pendingRequests.closeAllPendingRequests();
    handlerManager.afterConnectionClosed(session,closeReason);
    if (connectionListener != null) {
      connectionListener.disconnected();
    }
  }
}

Fixed version (ground truth):
protected void handleReconnectDisconnection(final int statusCode,final String closeReason){
  if (!clientClose) {
    reconnecting=true;
    createExecServiceIfNecessary();
    execService.execute(new Runnable(){
      @Override public void run(){
        try {
          connectIfNecessary();
          reconnecting=false;
        }
 catch (        KurentoException e) {
          pendingRequests.closeAllPendingRequests();
          handlerManager.afterConnectionClosed(session,closeReason);
          log.debug("String_Node_Str",label,closeReason);
          wsSession=null;
          if (connectionListener != null) {
            connectionListener.disconnected();
          }
        }
catch (        IOException e) {
          log.warn("String_Node_Str",label,url,e);
        }
      }
    }
);
  }
 else {
    pendingRequests.closeAllPendingRequests();
    handlerManager.afterConnectionClosed(session,closeReason);
    if (connectionListener != null) {
      connectionListener.disconnected();
    }
  }
}
Program: 10738
Project: 10738
Buggy source:
private void handleRequestFromServer(final JsonObject message){
  execService.submit(new Runnable(){
    @Override public void run(){
      try {
        handlerManager.handleRequest(session,fromJsonRequest(message,JsonElement.class),rs);
      }
 catch (      IOException e) {
        log.warn("String_Node_Str",label,message,e);
      }
    }
  }
);
}

Fixed version (ground truth):
private void handleRequestFromServer(final JsonObject message){
  createExecServiceIfNecessary();
  execService.submit(new Runnable(){
    @Override public void run(){
      try {
        handlerManager.handleRequest(session,fromJsonRequest(message,JsonElement.class),rs);
      }
 catch (      IOException e) {
        log.warn("String_Node_Str",label,message,e);
      }
    }
  }
);
}
Program: 10741
Project: 10741
Buggy source:
public void destroy() throws IOException {
  int numKmsProcesses=0;
  long timeout=System.currentTimeMillis() + 5000;
  do {
    if (System.currentTimeMillis() > timeout) {
      break;
    }
    kmsSigTerm();
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    numKmsProcesses=countKmsProcesses();
  }
 while (numKmsProcesses > 0);
  if (numKmsProcesses > 0) {
    kmsSigKill();
  }
  if (remoteKms != null) {
    SshConnection kms=KurentoMediaServerManager.remoteKms;
    String targetFile=KurentoServicesTestHelper.getServerLogFile().getAbsolutePath();
    String origFile=kms.getTmpFolder() + "String_Node_Str";
    KurentoMediaServerManager.remoteKms.getFile(targetFile,origFile);
    remoteKms.stop();
  }
}

Fixed version (ground truth):
public void destroy() throws IOException {
  int numKmsProcesses=0;
  long timeout=System.currentTimeMillis() + 5000;
  do {
    if (System.currentTimeMillis() > timeout) {
      break;
    }
    kmsSigTerm();
    try {
      Thread.sleep(100);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    numKmsProcesses=countKmsProcesses();
  }
 while (numKmsProcesses > 0);
  if (numKmsProcesses > 0) {
    kmsSigKill();
  }
  if (remoteKms != null) {
    SshConnection kms=KurentoMediaServerManager.remoteKms;
    File serverLogFile=KurentoServicesTestHelper.getServerLogFile();
    if (serverLogFile != null) {
      String targetFile=serverLogFile.getAbsolutePath();
      String origFile=kms.getTmpFolder() + "String_Node_Str";
      KurentoMediaServerManager.remoteKms.getFile(targetFile,origFile);
    }
    remoteKms.stop();
  }
}
Program: 10742
Project: 10742
Buggy source:
public static boolean ping(final String ipAddress,int timeout){
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(){
    public void run(){
      try {
        String[] command={"String_Node_Str","String_Node_Str","String_Node_Str",ipAddress};
        Process p=new ProcessBuilder(command).redirectErrorStream(true).start();
        CharStreams.toString(new InputStreamReader(p.getInputStream(),"String_Node_Str"));
        latch.countDown();
      }
 catch (      Exception e) {
      }
    }
  }
;
  t.setDaemon(true);
  t.start();
  boolean ping=false;
  try {
    ping=latch.await(timeout,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    log.error("String_Node_Str",ipAddress,e.getClass());
  }
  if (!ping) {
    t.interrupt();
  }
  return ping;
}

Fixed version (ground truth):
public static boolean ping(final String ipAddress,int timeout){
  final CountDownLatch latch=new CountDownLatch(1);
  Thread t=new Thread(){
    @Override public void run(){
      try {
        String[] command={"String_Node_Str","String_Node_Str","String_Node_Str",ipAddress};
        Process p=new ProcessBuilder(command).redirectErrorStream(true).start();
        CharStreams.toString(new InputStreamReader(p.getInputStream(),"String_Node_Str"));
        latch.countDown();
      }
 catch (      Exception e) {
      }
    }
  }
;
  t.setDaemon(true);
  t.start();
  boolean ping=false;
  try {
    ping=latch.await(timeout,TimeUnit.SECONDS);
  }
 catch (  InterruptedException e) {
    log.error("String_Node_Str",ipAddress,e.getClass());
  }
  if (!ping) {
    t.interrupt();
  }
  return ping;
}
Program: 10743
Project: 10743
Buggy source:
public void run(){
  try {
    String[] command={"String_Node_Str","String_Node_Str","String_Node_Str",ipAddress};
    Process p=new ProcessBuilder(command).redirectErrorStream(true).start();
    CharStreams.toString(new InputStreamReader(p.getInputStream(),"String_Node_Str"));
    latch.countDown();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    String[] command={"String_Node_Str","String_Node_Str","String_Node_Str",ipAddress};
    Process p=new ProcessBuilder(command).redirectErrorStream(true).start();
    CharStreams.toString(new InputStreamReader(p.getInputStream(),"String_Node_Str"));
    latch.countDown();
  }
 catch (  Exception e) {
  }
}
Program: 10744
Project: 10744
Buggy source:
public String execAndWaitCommand(String... command) throws IOException {
  log.info("String_Node_Str",Arrays.toString(command));
  CmdLine cmdLine=new CmdLine();
  for (  String c : command) {
    cmdLine.addRaw(c);
  }
  OverthereProcess process=connection.startProcess(cmdLine);
  return CharStreams.toString(new InputStreamReader(process.getStdout(),"String_Node_Str"));
}

Fixed version (ground truth):
public String execAndWaitCommand(String... command) throws IOException {
  log.info("String_Node_Str",Arrays.toString(command));
  CmdLine cmdLine=new CmdLine();
  for (  String c : command) {
    cmdLine.addRaw(c);
  }
  OverthereProcess process=connection.startProcess(cmdLine);
  BufferedReader r=new BufferedReader(new InputStreamReader(process.getStdout(),"String_Node_Str"));
  StringBuilder sb=new StringBuilder();
  String line=null;
  while ((line=r.readLine()) != null) {
    System.out.println(line);
    sb.append(line).append("String_Node_Str");
  }
  return sb.toString();
}