nus-yam/ex-repair huggingface dataset:
Program: 10628
Project: 10628
Buggy source:
@Override public ItemStack decrStackSize(int slot,int count){
  if (slot < 0 || slot >= getSizeInventory())   return null;
  IDrawer drawer=group.getDrawer(getDrawerSlot(slot));
  if (drawer == null)   return null;
  if (!(drawer instanceof IInventoryAdapter))   return null;
  IInventoryAdapter adapter=(IInventoryAdapter)drawer;
  adapter.syncInventory();
  ItemStack stack=drawer.getStoredItemCopy();
  if (stack.stackSize <= count) {
    drawer.setStoredItemCount(0);
  }
 else {
    stack.stackSize=count;
    drawer.setStoredItemCount(drawer.getStoredItemCount() - count);
  }
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack decrStackSize(int slot,int count){
  if (slot < 0 || slot >= getSizeInventory())   return null;
  IDrawer drawer=group.getDrawer(getDrawerSlot(slot));
  if (drawer == null)   return null;
  if (!(drawer instanceof IInventoryAdapter))   return null;
  IInventoryAdapter adapter=(IInventoryAdapter)drawer;
  adapter.syncInventory();
  ItemStack stack=adapter.getInventoryStack(SlotType.OUTPUT).copy();
  stack.stackSize=Math.min(stack.stackSize,drawer.getStoredItemCount());
  adapter.getInventoryStack(SlotType.OUTPUT).stackSize-=stack.stackSize;
  return stack;
}
Program: 10629
Project: 10629
Buggy source:
protected BlockDrawers(Material material,String blockName){
  super(material);
  this.useNeighborBrightness=true;
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setStepSound(Block.soundTypeWood);
  setUnlocalizedName(blockName);
  initDefaultState();
}

Fixed version (ground truth):
protected BlockDrawers(Material material,String blockName){
  super(material);
  this.useNeighborBrightness=true;
  setCreativeTab(ModCreativeTabs.tabStorageDrawers);
  setHardness(5f);
  setStepSound(Block.soundTypeWood);
  setUnlocalizedName(blockName);
  setLightOpacity(255);
  initDefaultState();
}
Program: 10630
Project: 10630
Buggy source:
@Override public boolean isValidMetaValue(int meta){
  if (meta < 0 || meta >= 16)   return false;
  return unlocalizedNames != null && unlocalizedNames[meta] != null;
}

Fixed version (ground truth):
@Override public boolean isValidMetaValue(int meta){
  if (meta < 0 || meta >= unlocalizedNames.length)   return false;
  return unlocalizedNames != null && unlocalizedNames[meta] != null;
}
Program: 10631
Project: 10631
Buggy source:
public StandardDataResolver(String modID,String[] unlocalizedNames){
  this.modID=modID;
  this.unlocalizedNames=unlocalizedNames;
}

Fixed version (ground truth):
public StandardDataResolver(String modID,String[] unlocalizedNames,CreativeTabs creativeTab){
  this(modID,unlocalizedNames);
  this.creativeTab=creativeTab;
}
Program: 10632
Project: 10632
Buggy source:
@Override public CreativeTabs getCreativeTabs(BlockType type){
  return null;
}

Fixed version (ground truth):
@Override public CreativeTabs getCreativeTabs(BlockType type){
  return creativeTab;
}
Program: 10633
Project: 10633
Buggy source:
public ItemDrawersPack(Block block){
  super(block,getUnlocalizedNames(block));
}

Fixed version (ground truth):
protected ItemDrawersPack(Block block,String[] unlocalizedNames){
  super(block,unlocalizedNames);
}
Program: 10634
Project: 10634
Buggy source:
public ItemSortingDrawersPack(Block block){
  super(block);
}

Fixed version (ground truth):
public ItemSortingDrawersPack(Block block){
  super(block,getUnlocalizedNames(block));
}
Program: 10635
Project: 10635
Buggy source:
@Override public void breakBlock(World world,int x,int y,int z,Block block,int meta){
  TileEntityDrawers tile=getTileEntity(world,x,y,z);
  if (tile != null) {
    if (tile.getStorageLevel() > 1)     dropBlockAsItem(world,x,y,z,new ItemStack(ModItems.upgrade,1,tile.getStorageLevel()));
    if (tile.getStatusLevel() > 0)     dropBlockAsItem(world,x,y,z,new ItemStack(ModItems.upgradeStatus,1,tile.getStatusLevel()));
    if (tile.isLocked())     dropBlockAsItem(world,x,y,z,new ItemStack(ModItems.upgradeLock));
    for (int i=0; i < tile.getDrawerCount(); i++) {
      if (!tile.isDrawerEnabled(i))       continue;
      IDrawer drawer=tile.getDrawer(i);
      while (drawer.getStoredItemCount() > 0) {
        ItemStack stack=tile.takeItemsFromSlot(i,drawer.getStoredItemStackSize());
        if (stack == null || stack.stackSize == 0)         break;
        dropStackInBatches(world,x,y,z,stack);
      }
    }
    world.func_147453_f(x,y,z,block);
  }
  super.breakBlock(world,x,y,z,block,meta);
}

Fixed version (ground truth):
@Override public void breakBlock(World world,int x,int y,int z,Block block,int meta){
  TileEntityDrawers tile=getTileEntity(world,x,y,z);
  if (tile != null) {
    if (tile.getStorageLevel() > 1)     dropBlockAsItem(world,x,y,z,new ItemStack(ModItems.upgrade,1,tile.getStorageLevel()));
    if (tile.getStatusLevel() > 0)     dropBlockAsItem(world,x,y,z,new ItemStack(ModItems.upgradeStatus,1,tile.getStatusLevel()));
    for (int i=0; i < tile.getDrawerCount(); i++) {
      if (!tile.isDrawerEnabled(i))       continue;
      IDrawer drawer=tile.getDrawer(i);
      while (drawer.getStoredItemCount() > 0) {
        ItemStack stack=tile.takeItemsFromSlot(i,drawer.getStoredItemStackSize());
        if (stack == null || stack.stackSize == 0)         break;
        dropStackInBatches(world,x,y,z,stack);
      }
    }
    world.func_147453_f(x,y,z,block);
  }
  super.breakBlock(world,x,y,z,block,meta);
}
Program: 10636
Project: 10636
Buggy source:
public TileEntityController getController(){
  if (controllerCoord == null)   return null;
  TileEntity te=worldObj.getTileEntity(controllerCoord.x(),controllerCoord.y(),controllerCoord.z());
  if (!(te instanceof TileEntityController)) {
    controllerCoord=null;
    markDirty();
    return null;
  }
  return (TileEntityController)te;
}

Fixed version (ground truth):
public TileEntityController getController(){
  if (controllerCoord == null)   return null;
  ensureInitialized();
  TileEntity te=worldObj.getTileEntity(controllerCoord.x(),controllerCoord.y(),controllerCoord.z());
  if (!(te instanceof TileEntityController)) {
    controllerCoord=null;
    markDirty();
    return null;
  }
  return (TileEntityController)te;
}
Program: 10637
Project: 10637
Buggy source:
private void syncClient(){
  IMessage message=new ControllerUpdateMessage(xCoord,yCoord,zCoord,inventorySlots);
  NetworkRegistry.TargetPoint targetPoint=new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId,xCoord,yCoord,zCoord,500);
  StorageDrawers.network.sendToAllAround(message,targetPoint);
}

Fixed version (ground truth):
private void syncClient(){
  IMessage message=new ControllerUpdateMessage(xCoord,yCoord,zCoord,inventorySlots);
  NetworkRegistry.TargetPoint targetPoint=new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId,xCoord,yCoord,zCoord,500);
  StorageDrawers.network.sendToAllAround(message,targetPoint);
  worldObj.notifyBlocksOfNeighborChange(xCoord,yCoord,zCoord,worldObj.getBlock(xCoord,yCoord,zCoord));
}
Program: 10638
Project: 10638
Buggy source:
@Override public void markDirty(){
  for (int i=0; i < drawerCount; i++) {
    if (snapshotItems[i] != null && snapshotItems[i].stackSize != snapshotCounts[i]) {
      int diff=snapshotItems[i].stackSize - snapshotCounts[i];
      if (diff > 0)       putItemsIntoSlot(i,snapshotItems[i],diff);
 else       takeItemsFromSlot(i,-diff);
      snapshotItems[i].stackSize=64 - Math.min(63,data[i].remainingCapacity());
      snapshotCounts[i]=snapshotItems[i].stackSize;
    }
  }
  super.markDirty();
}

Fixed version (ground truth):
@Override public void markDirty(){
  for (int i=0; i < drawerCount; i++) {
    if (snapshotItems[i] != null && snapshotItems[i].stackSize != snapshotCounts[i]) {
      int diff=snapshotItems[i].stackSize - snapshotCounts[i];
      if (diff > 0)       putItemsIntoSlot(i,snapshotItems[i],diff);
 else       takeItemsFromSlot(i,-diff);
      snapshotItems[i].stackSize=64 - Math.min(64,data[i].remainingCapacity());
      snapshotCounts[i]=snapshotItems[i].stackSize;
    }
  }
  super.markDirty();
}
Program: 10639
Project: 10639
Buggy source:
@Override public void setInventorySlotContents(int slot,ItemStack itemStack){
  if (slot >= getSizeInventory())   return;
  int count=putItemsIntoSlot(slot,itemStack,itemStack.stackSize);
  if (count > 0 && !worldObj.isRemote)   worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
}

Fixed version (ground truth):
@Override public void setInventorySlotContents(int slot,ItemStack itemStack){
  if (slot >= getSizeInventory())   return;
  int insertCount=itemStack.stackSize;
  if (snapshotItems[slot] != null)   insertCount=itemStack.stackSize - snapshotCounts[slot];
  if (insertCount > 0) {
    int count=putItemsIntoSlot(slot,itemStack,insertCount);
    if (count > 0 && !worldObj.isRemote)     worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
  }
 else   if (insertCount < 0) {
    ItemStack rmStack=takeItemsFromSlot(slot,-insertCount);
    if (rmStack != null && rmStack.stackSize > 0 && !worldObj.isRemote)     worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
  }
  if (snapshotItems[slot] != null) {
    snapshotItems[slot].stackSize=64 - Math.min(64,data[slot].remainingCapacity());
    snapshotCounts[slot]=snapshotItems[slot].stackSize;
  }
}
Program: 10640
Project: 10640
Buggy source:
@Override public ItemStack getStackInSlot(int slot){
  if (slot >= getSizeInventory())   return null;
  ItemStack stack=getItemsFromSlot(slot,getStackSize(slot));
  if (stack != null) {
    stack.stackSize=64 - Math.min(63,data[slot].remainingCapacity());
    snapshotItems[slot]=stack;
    snapshotCounts[slot]=stack.stackSize;
  }
 else {
    snapshotItems[slot]=null;
    snapshotCounts[slot]=0;
  }
  return stack;
}

Fixed version (ground truth):
@Override public ItemStack getStackInSlot(int slot){
  if (slot >= getSizeInventory())   return null;
  ItemStack stack=getItemsFromSlot(slot,getStackSize(slot));
  if (stack != null) {
    stack.stackSize=64 - Math.min(64,data[slot].remainingCapacity());
    snapshotItems[slot]=stack;
    snapshotCounts[slot]=stack.stackSize;
  }
 else {
    snapshotItems[slot]=null;
    snapshotCounts[slot]=0;
  }
  return stack;
}
Program: 10642
Project: 10642
Buggy source:
private float getRotationYForSide(ForgeDirection side,ForgeDirection orientation){
  return sideRotationY[side.ordinal()] * 90;
}

Fixed version (ground truth):
private float getRotationYForSide(ForgeDirection side){
  return sideRotationY[side.ordinal()] * 90;
}
Program: 10643
Project: 10643
Buggy source:
private void alignRendering(ForgeDirection side,ForgeDirection orientation){
  GL11.glTranslatef(.5f,.5f,.5f);
  GL11.glRotatef(180f,0,0,1f);
  GL11.glRotatef(getRotationYForSide(side,orientation),0,1,0);
  GL11.glTranslatef(-.5f,-.5f,-.5f);
}

Fixed version (ground truth):
private void alignRendering(ForgeDirection side){
  GL11.glTranslatef(.5f,.5f,.5f);
  GL11.glRotatef(180f,0,0,1f);
  GL11.glRotatef(getRotationYForSide(side),0,1,0);
  GL11.glTranslatef(-.5f,-.5f,-.5f);
}
Program: 10644
Project: 10644
Buggy source:
@Ignore @Test public void testRecorderPlayerDisconnectMp4() throws Exception {
  doTest(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderPlayerDisconnectMp4() throws Exception {
  doTest(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10645
Project: 10645
Buggy source:
@Ignore public void testRecorderSwitchFrameSizeDifferentPlayerMp4() throws Exception {
  doTestFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameSizeDifferentPlayerMp4() throws Exception {
  doTestFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10646
Project: 10646
Buggy source:
@Ignore public void testRecorderSwitchFrameRateFrameSizeDifferentPlayerMp4() throws Exception {
  doTestFrameRateAndFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameRateFrameSizeDifferentPlayerMp4() throws Exception {
  doTestFrameRateAndFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10647
Project: 10647
Buggy source:
@Ignore public void testRecorderSwitchFrameRateDifferentPlayerMp4() throws Exception {
  doTestFrameRateDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameRateDifferentPlayerMp4() throws Exception {
  doTestFrameRateDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10648
Project: 10648
Buggy source:
@Ignore public void testRecorderSwitchFrameRateFrameSizeDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameRateAndFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameRateFrameSizeDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameRateAndFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10649
Project: 10649
Buggy source:
@Ignore public void testRecorderSwitchFrameSizeDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameSizeDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameSizeDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10650
Project: 10650
Buggy source:
@Ignore public void testRecorderSwitchFrameRateDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameRateDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchFrameRateDifferentPlayerWithPassThroughMp4() throws Exception {
  doTestFrameRateDifferent(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10651
Project: 10651
Buggy source:
@Ignore @Test public void testRecorderSwitchWebRtcMp4() throws Exception {
  doTest(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}

Fixed version (ground truth):
@Test public void testRecorderSwitchWebRtcMp4() throws Exception {
  doTest(MP4,EXPECTED_VIDEO_CODEC_MP4,EXPECTED_AUDIO_CODEC_MP4,EXTENSION_MP4);
}
Program: 10653
Project: 10653
Buggy source:
public URL getUrl(){
  String ip=this.getHost();
  int port=this.getServerPort();
  String protocol=this.getProtocol().toString();
  String path=this.getWebPageType().toString();
  URL url=null;
  try {
    url=new URL(protocol,ip,port,path);
  }
 catch (  MalformedURLException e) {
    log.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
  return url;
}

Fixed version (ground truth):
public URL getUrl(){
  URL url=null;
  try {
    if (this.url != null) {
      url=this.url.toURL();
    }
 else {
      String ip=this.getHost();
      int port=this.getServerPort();
      String protocol=this.getProtocol().toString();
      String path=this.getWebPageType().toString();
      url=new URL(protocol,ip,port,path);
    }
  }
 catch (  MalformedURLException e) {
    log.error("String_Node_Str",e);
    throw new RuntimeException(e);
  }
  return url;
}
Program: 10655
Project: 10655
Buggy source:
private static MediaInfo getInfoByPath(String pathToMedia){
  MediaInfo info=new MediaInfo();
  String pathToMedia_[]=pathToMedia.split("String_Node_Str");
  String protocol="String_Node_Str";
  String path="String_Node_Str";
  if (pathToMedia_.length > 1) {
    protocol=pathToMedia_[0];
    path=pathToMedia_[1];
  }
 else {
    String recordDefaultPath=KurentoTest.getRecordDefaultPath();
    if (recordDefaultPath != null) {
      String defaultPathToMedia_[]=recordDefaultPath.split("String_Node_Str");
      protocol=defaultPathToMedia_[0];
      String pathStart=defaultPathToMedia_[1];
      path=pathStart + pathToMedia_[0];
    }
  }
  if (Protocol.FILE.toString().equals(protocol)) {
    info.open(new File(path));
    return info;
  }
 else   if (Protocol.HTTP.toString().equals(protocol) || Protocol.HTTPS.toString().equals(protocol)) {
  }
 else   if (Protocol.S3.toString().equals(protocol)) {
    String pathDownload=KurentoTest.getDefaultOutputFolder().getAbsolutePath() + File.separator + path;
    String pathOut=KurentoTest.getDefaultOutputFolder().getAbsolutePath() + File.separator + path.replace("String_Node_Str","String_Node_Str");
    Shell.runAndWaitString("String_Node_Str" + pathToMedia + "String_Node_Str"+ pathDownload);
    Shell.runAndWaitString("String_Node_Str" + pathDownload + "String_Node_Str"+ pathOut);
    info.open(new File(pathOut));
    return info;
  }
 else   if (Protocol.MONGODB.toString().equals(protocol)) {
  }
  return info;
}

Fixed version (ground truth):
private static MediaInfo getInfoByPath(String pathToMedia){
  MediaInfo info=new MediaInfo();
  String pathToMedia_[]=pathToMedia.split("String_Node_Str");
  String protocol="String_Node_Str";
  String path="String_Node_Str";
  if (pathToMedia_.length > 1) {
    protocol=pathToMedia_[0];
    path=pathToMedia_[1];
  }
 else {
    String recordDefaultPath=KurentoTest.getRecordDefaultPath();
    if (recordDefaultPath != null) {
      String defaultPathToMedia_[]=recordDefaultPath.split("String_Node_Str");
      protocol=defaultPathToMedia_[0];
      String pathStart=defaultPathToMedia_[1];
      path=pathStart + pathToMedia_[0];
    }
  }
  if (Protocol.FILE.toString().equals(protocol)) {
    info.open(new File(path));
    return info;
  }
 else   if (Protocol.HTTP.toString().equals(protocol) || Protocol.HTTPS.toString().equals(protocol)) {
  }
 else   if (Protocol.S3.toString().equals(protocol)) {
    pathToMedia=protocol + "String_Node_Str" + path;
    String pathDownload=KurentoTest.getDefaultOutputFolder().getAbsolutePath() + File.separator + path;
    String pathOut=KurentoTest.getDefaultOutputFolder().getAbsolutePath() + File.separator + path.replace("String_Node_Str","String_Node_Str");
    Shell.runAndWaitString("String_Node_Str" + pathToMedia + "String_Node_Str"+ pathDownload);
    Shell.runAndWaitString("String_Node_Str" + pathDownload + "String_Node_Str"+ pathOut);
    info.open(new File(pathOut));
    return info;
  }
 else   if (Protocol.MONGODB.toString().equals(protocol)) {
  }
  return info;
}
Program: 10657
Project: 10657
Buggy source:
protected void addCandidates(NewCandidatePairSelectedEvent event){
  Candidate lCandidate=new Candidate(getCandidateType(event.getCandidatePair().getLocalCandidate()),getTransportMode(event.getCandidatePair().getLocalCandidate()));
  Candidate rCandidate=new Candidate(getCandidateType(event.getCandidatePair().getRemoteCandidate()),getTransportMode(event.getCandidatePair().getRemoteCandidate()));
  if (WebRtcCandidateType.PRFLX.equals(lCandidate)) {
    lCandidate.setWebRtcCandidateType(WebRtcCandidateType.SRFLX);
  }
  if (WebRtcCandidateType.PRFLX.equals(rCandidate)) {
    rCandidate.setWebRtcCandidateType(WebRtcCandidateType.SRFLX);
  }
  localCandidate.add(lCandidate);
  remoteCandidate.add(rCandidate);
  if (getProperty(TEST_ICE_CANDIDATE_KMS_TYPE) != null) {
    kmsCandidateType.add(new Candidate(WebRtcCandidateType.find(getProperty(TEST_ICE_CANDIDATE_KMS_TYPE).toLowerCase()),TransportMode.find(getProperty(TEST_KMS_TRANSPORT))));
  }
  if (getProperty(TEST_ICE_CANDIDATE_SELENIUM_TYPE) != null) {
    seleniumCandidateType.add(new Candidate(WebRtcCandidateType.find(getProperty(TEST_ICE_CANDIDATE_SELENIUM_TYPE).toLowerCase()),TransportMode.find(getProperty(TEST_SELENIUM_TRANSPORT))));
  }
}

Fixed version (ground truth):
protected void addCandidates(NewCandidatePairSelectedEvent event){
  Candidate lCandidate=new Candidate(getCandidateType(event.getCandidatePair().getLocalCandidate()),getTransportMode(event.getCandidatePair().getLocalCandidate()));
  Candidate rCandidate=new Candidate(getCandidateType(event.getCandidatePair().getRemoteCandidate()),getTransportMode(event.getCandidatePair().getRemoteCandidate()));
  if (WebRtcCandidateType.PRFLX.equals(lCandidate.getWebRtcCandidateType())) {
    lCandidate.setWebRtcCandidateType(WebRtcCandidateType.SRFLX);
  }
  if (WebRtcCandidateType.PRFLX.equals(rCandidate.getWebRtcCandidateType())) {
    rCandidate.setWebRtcCandidateType(WebRtcCandidateType.SRFLX);
  }
  localCandidate.add(lCandidate);
  remoteCandidate.add(rCandidate);
  if (getProperty(TEST_ICE_CANDIDATE_KMS_TYPE) != null) {
    kmsCandidateType.add(new Candidate(WebRtcCandidateType.find(getProperty(TEST_ICE_CANDIDATE_KMS_TYPE).toLowerCase()),TransportMode.find(getProperty(TEST_KMS_TRANSPORT))));
  }
  if (getProperty(TEST_ICE_CANDIDATE_SELENIUM_TYPE) != null) {
    seleniumCandidateType.add(new Candidate(WebRtcCandidateType.find(getProperty(TEST_ICE_CANDIDATE_SELENIUM_TYPE).toLowerCase()),TransportMode.find(getProperty(TEST_SELENIUM_TRANSPORT))));
  }
}
Program: 10658
Project: 10658
Buggy source:
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  return TestScenario.localChromeAndFirefox();
}

Fixed version (ground truth):
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  return TestScenario.localChromesAndFirefoxs(2);
}
Program: 10659
Project: 10659
Buggy source:
@Ignore public void testIceHostIpv4SendOnlyAudioOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_ONLY,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv4SendOnlyAudioOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_ONLY,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}
Program: 10660
Project: 10660
Buggy source:
@Ignore public void testIceHostIpv4SendOnlyAudioVideo() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_AND_VIDEO,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv4SendOnlyAudioVideo() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_AND_VIDEO,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}
Program: 10661
Project: 10661
Buggy source:
@Ignore public void testIceHostIpv4SendOnlyVideoOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.VIDEO_ONLY,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv4SendOnlyVideoOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.VIDEO_ONLY,WebRtcIpvMode.IPV4,WebRtcCandidateType.HOST);
}
Program: 10662
Project: 10662
Buggy source:
@Ignore public void testIceHostIpv6SendOnlyVideoOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.VIDEO_ONLY,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv6SendOnlyVideoOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.VIDEO_ONLY,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}
Program: 10663
Project: 10663
Buggy source:
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  return TestScenario.localChromeAndFirefox();
}

Fixed version (ground truth):
@Parameters(name="String_Node_Str") public static Collection<Object[]> data(){
  return TestScenario.localChromesAndFirefoxs(2);
}
Program: 10664
Project: 10664
Buggy source:
@Ignore public void testIceHostIpv6SendOnlyAudioOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_ONLY,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv6SendOnlyAudioOnly() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_ONLY,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}
Program: 10665
Project: 10665
Buggy source:
@Ignore public void testIceHostIpv6SendOnlyAudioVideo() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_AND_VIDEO,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}

Fixed version (ground truth):
@Test public void testIceHostIpv6SendOnlyAudioVideo() throws InterruptedException {
  initTestSendOnly(WebRtcChannel.AUDIO_AND_VIDEO,WebRtcIpvMode.IPV6,WebRtcCandidateType.HOST);
}
Program: 10666
Project: 10666
Buggy source:
public void initTestRcvOnly(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType,String nameMedia) throws InterruptedException {
  String mediaUrl=getMediaUrl(Protocol.HTTP,nameMedia);
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  PlayerEndpoint playerEp=new PlayerEndpoint.Builder(mp,mediaUrl).build();
  WebRtcEndpoint webRtcEp=new WebRtcEndpoint.Builder(mp).build();
  playerEp.connect(webRtcEp);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEp.addMediaFlowInStateChangeListener(new EventListener<MediaFlowInStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowInStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage().subscribeEvents("String_Node_Str");
  getPage().initWebRtc(webRtcEp,webRtcChannel,WebRtcMode.RCV_ONLY,webRtcIpvMode,webRtcCandidateType);
  playerEp.play();
  Assert.assertTrue("String_Node_Str" + mediaUrl + "String_Node_Str"+ webRtcChannel,getPage().waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + mediaUrl + "String_Node_Str"+ webRtcChannel,eosLatch.await(getPage().getTimeout(),TimeUnit.SECONDS));
  mp.release();
}

Fixed version (ground truth):
public void initTestRcvOnly(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType,String nameMedia) throws InterruptedException {
  String mediaUrl=getMediaUrl(Protocol.HTTP,nameMedia);
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  PlayerEndpoint playerEp=new PlayerEndpoint.Builder(mp,mediaUrl).build();
  WebRtcEndpoint webRtcEp=new WebRtcEndpoint.Builder(mp).build();
  playerEp.connect(webRtcEp);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEp.addMediaFlowInStateChangeListener(new EventListener<MediaFlowInStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowInStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage(0).subscribeEvents("String_Node_Str");
  getPage(0).initWebRtc(webRtcEp,webRtcChannel,WebRtcMode.RCV_ONLY,webRtcIpvMode,webRtcCandidateType);
  playerEp.play();
  Assert.assertTrue("String_Node_Str" + mediaUrl + "String_Node_Str"+ webRtcChannel,getPage(0).waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + mediaUrl + "String_Node_Str"+ webRtcChannel,eosLatch.await(getPage(0).getTimeout(),TimeUnit.SECONDS));
  mp.release();
}
Program: 10667
Project: 10667
Buggy source:
public void initTestSendRecv(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType) throws InterruptedException {
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  WebRtcEndpoint webRtcEndpoint=new WebRtcEndpoint.Builder(mp).build();
  webRtcEndpoint.connect(webRtcEndpoint);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEndpoint.addMediaFlowOutStateChangeListener(new EventListener<MediaFlowOutStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowOutStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage().subscribeEvents("String_Node_Str");
  getPage().initWebRtc(webRtcEndpoint,webRtcChannel,WebRtcMode.SEND_RCV,webRtcIpvMode,webRtcCandidateType);
  Assert.assertTrue("String_Node_Str",getPage().waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + webRtcChannel,eosLatch.await(getPage().getTimeout(),TimeUnit.SECONDS));
  mp.release();
}

Fixed version (ground truth):
public void initTestSendRecv(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType) throws InterruptedException {
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  WebRtcEndpoint webRtcEndpoint=new WebRtcEndpoint.Builder(mp).build();
  webRtcEndpoint.connect(webRtcEndpoint);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEndpoint.addMediaFlowOutStateChangeListener(new EventListener<MediaFlowOutStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowOutStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage(0).subscribeEvents("String_Node_Str");
  getPage(0).initWebRtc(webRtcEndpoint,webRtcChannel,WebRtcMode.SEND_RCV,webRtcIpvMode,webRtcCandidateType);
  Assert.assertTrue("String_Node_Str",getPage(0).waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + webRtcChannel,eosLatch.await(getPage(0).getTimeout(),TimeUnit.SECONDS));
  mp.release();
}
Program: 10668
Project: 10668
Buggy source:
public void initTestSendOnly(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType) throws InterruptedException {
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  WebRtcEndpoint webRtcEpSendOnly=new WebRtcEndpoint.Builder(mp).build();
  WebRtcEndpoint webRtcEpRcvOnly=new WebRtcEndpoint.Builder(mp).build();
  webRtcEpSendOnly.connect(webRtcEpRcvOnly);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEpRcvOnly.addMediaFlowInStateChangeListener(new EventListener<MediaFlowInStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowInStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage().subscribeEvents("String_Node_Str");
  getPage().initWebRtc(webRtcEpSendOnly,webRtcChannel,WebRtcMode.SEND_ONLY,webRtcIpvMode,webRtcCandidateType);
  getPage().initWebRtc(webRtcEpRcvOnly,webRtcChannel,WebRtcMode.RCV_ONLY,webRtcIpvMode,webRtcCandidateType);
  Assert.assertTrue("String_Node_Str",getPage().waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + webRtcChannel,eosLatch.await(getPage().getTimeout(),TimeUnit.SECONDS));
  mp.release();
}

Fixed version (ground truth):
public void initTestSendOnly(WebRtcChannel webRtcChannel,WebRtcIpvMode webRtcIpvMode,WebRtcCandidateType webRtcCandidateType) throws InterruptedException {
  MediaPipeline mp=kurentoClient.createMediaPipeline();
  WebRtcEndpoint webRtcEpSendOnly=new WebRtcEndpoint.Builder(mp).build();
  WebRtcEndpoint webRtcEpRcvOnly=new WebRtcEndpoint.Builder(mp).build();
  webRtcEpSendOnly.connect(webRtcEpRcvOnly);
  final CountDownLatch eosLatch=new CountDownLatch(1);
  webRtcEpRcvOnly.addMediaFlowInStateChangeListener(new EventListener<MediaFlowInStateChangeEvent>(){
    @Override public void onEvent(    MediaFlowInStateChangeEvent event){
      if (event.getState().equals(MediaFlowState.FLOWING)) {
        eosLatch.countDown();
      }
    }
  }
);
  getPage(1).subscribeEvents("String_Node_Str");
  getPage(0).initWebRtc(webRtcEpSendOnly,webRtcChannel,WebRtcMode.SEND_ONLY,webRtcIpvMode,webRtcCandidateType);
  getPage(1).initWebRtc(webRtcEpRcvOnly,webRtcChannel,WebRtcMode.RCV_ONLY,webRtcIpvMode,webRtcCandidateType);
  Assert.assertTrue("String_Node_Str",getPage(1).waitForEvent("String_Node_Str"));
  Assert.assertTrue("String_Node_Str" + webRtcChannel,eosLatch.await(getPage(1).getTimeout(),TimeUnit.SECONDS));
  mp.release();
}
Program: 10669
Project: 10669
Buggy source:
public static KurentoClient create(String websocketUrl,KurentoConnectionListener listener,Properties properties){
  log.info("String_Node_Str",websocketUrl);
  JsonRpcClientWebSocket client=new JsonRpcClientWebSocket(websocketUrl,JsonRpcConnectionListenerKurento.create(listener));
  configureJsonRpcClient(client);
  return new KurentoClient(client);
}

Fixed version (ground truth):
public static KurentoClient create(String websocketUrl,KurentoConnectionListener listener,Properties properties){
  log.info("String_Node_Str",websocketUrl);
  JsonRpcClientWebSocket client=new JsonRpcClientWebSocket(websocketUrl,JsonRpcConnectionListenerKurento.create(listener),new SslContextFactory());
  configureJsonRpcClient(client);
  return new KurentoClient(client);
}
Program: 10670
Project: 10670
Buggy source:
@Bean public RepositoryApiConfiguration repositoryApiConfiguration() throws UnknownHostException {
  log.info("String_Node_Str");
  RepositoryApiConfiguration config=new RepositoryApiConfiguration();
  config.setWebappPublicUrl("String_Node_Str" + InetAddress.getLocalHost().getHostAddress() + "String_Node_Str"+ WebServerService.getAppHttpsPort()+ "String_Node_Str");
  config.setMongoDatabaseName("String_Node_Str");
  config.setMongoUrlConnection(Protocol.MONGODB + "String_Node_Str" + getTestFilesMongoPath());
  config.setRepositoryType(RepoType.MONGODB);
  return config;
}

Fixed version (ground truth):
@Bean public RepositoryApiConfiguration repositoryApiConfiguration() throws UnknownHostException {
  log.info("String_Node_Str");
  RepositoryApiConfiguration config=new RepositoryApiConfiguration();
  config.setWebappPublicUrl("String_Node_Str" + InetAddress.getLocalHost().getHostAddress() + "String_Node_Str"+ WebServerService.getAppHttpPort()+ "String_Node_Str");
  config.setMongoDatabaseName("String_Node_Str");
  config.setMongoUrlConnection(Protocol.MONGODB + "String_Node_Str" + getTestFilesMongoPath());
  config.setRepositoryType(RepoType.MONGODB);
  return config;
}
Program: 10671
Project: 10671
Buggy source:
@Bean public EmbeddedServletContainerFactory servletContainer(){
  TomcatEmbeddedServletContainerFactory tomcat=new TomcatEmbeddedServletContainerFactory();
  Connector connector=new Connector("String_Node_Str");
  connector.setScheme("String_Node_Str");
  connector.setPort(getAppHttpPort());
  tomcat.addAdditionalTomcatConnectors(connector);
  return tomcat;
}

Fixed version (ground truth):
@Bean @ConditionalOnMissingBean public EmbeddedServletContainerFactory servletContainer(){
  TomcatEmbeddedServletContainerFactory tomcat=new TomcatEmbeddedServletContainerFactory();
  Connector connector=new Connector("String_Node_Str");
  connector.setScheme("String_Node_Str");
  connector.setPort(getAppHttpPort());
  tomcat.addAdditionalTomcatConnectors(connector);
  return tomcat;
}
Program: 10673
Project: 10673
Buggy source:
KurentoClient(JsonRpcClient client){
  this.manager=new RomManager(new RomClientJsonRpcClient(client));
  client.setRequestTimeout(requesTimeout);
  if (client instanceof JsonRpcClientWebSocket) {
    ((JsonRpcClientWebSocket)client).enableHeartbeat(KEEPALIVE_TIME);
  }
  try {
    client.connect();
    sessionId=client.getSession().getSessionId();
  }
 catch (  IOException e) {
    throw new KurentoException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
KurentoClient(JsonRpcClient client){
  this.client=client;
  this.manager=new RomManager(new RomClientJsonRpcClient(client));
  client.setRequestTimeout(requesTimeout);
  if (client instanceof JsonRpcClientWebSocket) {
    ((JsonRpcClientWebSocket)client).enableHeartbeat(KEEPALIVE_TIME);
  }
  try {
    client.connect();
  }
 catch (  IOException e) {
    throw new KurentoException("String_Node_Str",e);
  }
}
Program: 10674
Project: 10674
Buggy source:
public String getSessionId(){
  return sessionId;
}

Fixed version (ground truth):
public String getSessionId(){
  return client.getSession().getSessionId();
}
Program: 10675
Project: 10675
Buggy source:
public KurentoClient getKurentoClient(){
  if (kurentoClient == null && isKmsStarted) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}

Fixed version (ground truth):
public KurentoClient getKurentoClient(){
  if (kurentoClient == null) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}
Program: 10676
Project: 10676
Buggy source:
public KurentoClient getKurentoClient(){
  if (kurentoClient == null && isKmsStarted) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}

Fixed version (ground truth):
public KurentoClient getKurentoClient(){
  if (kurentoClient == null) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}
Program: 10677
Project: 10677
Buggy source:
public KurentoClient getKurentoClient(){
  if (kurentoClient == null) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}

Fixed version (ground truth):
public KurentoClient getKurentoClient(){
  if (kurentoClient == null && isKmsStarted) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}
Program: 10679
Project: 10679
Buggy source:
public void setWsUri(String wsUri){
  System.setProperty(KMS_WS_URI_PROP_EXPORT,wsUri);
  this.wsUri=wsUri;
}

Fixed version (ground truth):
public void setWsUri(String wsUri){
  if (wsUri != null) {
    System.setProperty(KMS_WS_URI_PROP_EXPORT,wsUri);
  }
  this.wsUri=wsUri;
}
Program: 10680
Project: 10680
Buggy source:
public FakeKmsService(){
  this.kmsLoginProp=FAKE_KMS_LOGIN_PROP;
  this.kmsPasswdProp=FAKE_KMS_PASSWD_PROP;
  this.kmsPemProp=FAKE_KMS_PEM_PROP;
  this.kmsAutostartProp=FAKE_KMS_AUTOSTART_PROP;
  this.kmsAutostartDefault=FAKE_KMS_AUTOSTART_DEFAULT;
  this.kmsWsUriProp=FAKE_KMS_WS_URI_PROP;
}

Fixed version (ground truth):
public FakeKmsService(){
  this.kmsLoginProp=FAKE_KMS_LOGIN_PROP;
  this.kmsPasswdProp=FAKE_KMS_PASSWD_PROP;
  this.kmsPemProp=FAKE_KMS_PEM_PROP;
  this.kmsAutostartProp=FAKE_KMS_AUTOSTART_PROP;
  this.kmsAutostartDefault=FAKE_KMS_AUTOSTART_DEFAULT;
  this.kmsWsUriProp=FAKE_KMS_WS_URI_PROP;
  setWsUri(getProperty(kmsWsUriProp));
}
Program: 10681
Project: 10681
Buggy source:
public FakeKmsService(){
  this.kmsLoginProp=FAKE_KMS_LOGIN_PROP;
  this.kmsPasswdProp=FAKE_KMS_PASSWD_PROP;
  this.kmsPemProp=FAKE_KMS_PEM_PROP;
  this.kmsAutostartProp=FAKE_KMS_AUTOSTART_PROP;
  this.kmsAutostartDefault=FAKE_KMS_AUTOSTART_DEFAULT;
  this.kmsWsUriProp=FAKE_KMS_WS_URI_PROP;
  setWsUri(getProperty(kmsWsUriProp));
}

Fixed version (ground truth):
public FakeKmsService(){
  this.kmsLoginProp=FAKE_KMS_LOGIN_PROP;
  this.kmsPasswdProp=FAKE_KMS_PASSWD_PROP;
  this.kmsPemProp=FAKE_KMS_PEM_PROP;
  this.kmsAutostartProp=FAKE_KMS_AUTOSTART_PROP;
  this.kmsAutostartDefault=FAKE_KMS_AUTOSTART_DEFAULT;
  this.kmsWsUriProp=FAKE_KMS_WS_URI_PROP;
  this.kmsWsUriExportProp=FAKE_KMS_WS_URI_PROP_EXPORT;
  setWsUri(getProperty(kmsWsUriProp));
}
Program: 10682
Project: 10682
Buggy source:
public void setWsUri(String wsUri){
  if (wsUri != null) {
    System.setProperty(KMS_WS_URI_PROP_EXPORT,wsUri);
  }
  this.wsUri=wsUri;
}

Fixed version (ground truth):
public void setWsUri(String wsUri){
  if (wsUri != null) {
    System.setProperty(kmsWsUriExportProp,wsUri);
  }
  this.wsUri=wsUri;
}
Program: 10683
Project: 10683
Buggy source:
public KurentoClient getKurentoClient(){
  if (kurentoClient == null) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}

Fixed version (ground truth):
public KurentoClient getKurentoClient(){
  if (kurentoClient == null && wsUri != null) {
    kurentoClient=createKurentoClient();
  }
  return kurentoClient;
}
Program: 10684
Project: 10684
Buggy source:
public KmsService(String kmsLoginProp,String kmsPasswdProp,String kmsPemProp,String kmsAutostartProp,String kmsWsUriProp){
  this.kmsLoginProp=kmsLoginProp;
  this.kmsPasswdProp=kmsPasswdProp;
  this.kmsPemProp=kmsPemProp;
  this.kmsAutostartProp=kmsAutostartProp;
  this.kmsWsUriProp=kmsWsUriProp;
  setWsUri(getProperty(kmsWsUriProp,KMS_WS_URI_DEFAULT));
}

Fixed version (ground truth):
public KmsService(String kmsLoginProp,String kmsPasswdProp,String kmsPemProp,String kmsAutostartProp,String kmsWsUriProp,String kmsWsUriExportProp){
  this.kmsLoginProp=kmsLoginProp;
  this.kmsPasswdProp=kmsPasswdProp;
  this.kmsPemProp=kmsPemProp;
  this.kmsAutostartProp=kmsAutostartProp;
  this.kmsWsUriProp=kmsWsUriProp;
  this.kmsWsUriExportProp=kmsWsUriExportProp;
  setWsUri(getProperty(kmsWsUriProp,KMS_WS_URI_DEFAULT));
}
Program: 10685
Project: 10685
Buggy source:
private void stopContext(){
  if (context != null && context.isRunning()) {
    context.close();
    context.close();
  }
}

Fixed version (ground truth):
private void stopContext(){
  if (context != null && context.isRunning()) {
    context.stop();
    context.close();
  }
}
Program: 10686
Project: 10686
Buggy source:
@PreDestroy public void destroy(){
  log.info("String_Node_Str");
  manager.destroy();
  if (id != null) {
    kmsUrlLoader.clientDestroyed(id);
  }
}

Fixed version (ground truth):
@PreDestroy public void destroy(){
  log.info("String_Node_Str");
  manager.destroy();
  if (kmsUrlLoader != null) {
    kmsUrlLoader.clientDestroyed(id);
  }
}
Program: 10687
Project: 10687
Buggy source:
public void clientDestroyed(String id){
  getServiceProvider().releaseKms(id);
}

Fixed version (ground truth):
public void clientDestroyed(String id){
  if (getUrl() == null) {
    getServiceProvider().releaseKms(id);
  }
}
Program: 10688
Project: 10688
Buggy source:
@Before public void setupMonitor(){
  monitor=new SystemMonitorManager();
  monitor.startMonitoring();
}

Fixed version (ground truth):
@Before public void setupMonitor(){
  monitorResultPath=getDefaultOutputFile("String_Node_Str");
  monitor=new SystemMonitorManager();
  monitor.startMonitoring();
}
Program: 10689
Project: 10689
Buggy source:
public void writeResults(String csvFile) throws IOException {
  try (PrintWriter pw=new PrintWriter(new FileWriter(csvFile))){
    printKmsProcessHeaders(pw);
    Map<String,List<String>> headers=printWebRtcHeaders(pw);
    pw.println("String_Node_Str");
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("String_Node_Str");
    for (    long time : samples.keySet()) {
      MonitorSample sample=samples.get(time);
      pw.print(simpleDateFormat.format(time) + "String_Node_Str");
      printKmsProcessStats(pw,sample);
      printWebRtcStats(pw,headers,sample);
      pw.println("String_Node_Str");
    }
  }
 }

Fixed version (ground truth):
public void writeResults(String csvFile) throws IOException {
  Path path=Paths.get(csvFile);
  if (!Files.exists(path.getParent())) {
    Files.createDirectories(path.getParent());
  }
  try (PrintWriter pw=new PrintWriter(new FileWriter(csvFile))){
    printKmsProcessHeaders(pw);
    Map<String,List<String>> headers=printWebRtcHeaders(pw);
    pw.println("String_Node_Str");
    SimpleDateFormat simpleDateFormat=new SimpleDateFormat("String_Node_Str");
    for (    long time : samples.keySet()) {
      MonitorSample sample=samples.get(time);
      pw.print(simpleDateFormat.format(time) + "String_Node_Str");
      printKmsProcessStats(pw,sample);
      printWebRtcStats(pw,headers,sample);
      pw.println("String_Node_Str");
    }
  }
 }
Program: 10690
Project: 10690
Buggy source:
private void processReconnectMessage(ServerSessionFactory factory,Request<JsonElement> request,ResponseSender responseSender,String transportId) throws IOException {
  String sessionId=request.getSessionId();
  if (sessionId == null) {
    ServerSession session=getSession(factory,transportId,request);
    responseSender.sendResponse(new Response<>(session.getSessionId(),request.getId(),"String_Node_Str"));
  }
 else {
    ServerSession session=sessionsManager.get(sessionId);
    if (session != null) {
      String oldTransportId=session.getTransportId();
      session.setTransportId(transportId);
      factory.updateSessionOnReconnection(session);
      pingWachdogManager.updateTransportId(transportId,oldTransportId);
      sessionsManager.updateTransportId(session,oldTransportId);
      cancelCloseTimer(session);
      responseSender.sendResponse(new Response<>(sessionId,request.getId(),RECONNECTION_SUCCESSFUL));
    }
 else {
      responseSender.sendResponse(new Response<>(request.getId(),new ResponseError(99999,RECONNECTION_ERROR)));
    }
  }
}

Fixed version (ground truth):
private void processReconnectMessage(ServerSessionFactory factory,Request<JsonElement> request,ResponseSender responseSender,String transportId) throws IOException {
  String sessionId=request.getSessionId();
  if (sessionId == null) {
    ServerSession session=getSession(factory,transportId,request);
    responseSender.sendResponse(new Response<>(session.getSessionId(),request.getId(),"String_Node_Str"));
  }
 else {
    ServerSession session=sessionsManager.get(sessionId);
    if (session != null) {
      String oldTransportId=session.getTransportId();
      session.setTransportId(transportId);
      factory.updateSessionOnReconnection(session);
      pingWachdogManager.updateTransportId(transportId,oldTransportId);
      sessionsManager.updateTransportId(session,oldTransportId);
      cancelCloseTimer(session);
      responseSender.sendResponse(new Response<>(sessionId,request.getId(),RECONNECTION_SUCCESSFUL));
    }
 else {
      responseSender.sendResponse(new Response<>(request.getId(),new ResponseError(40007,RECONNECTION_ERROR)));
    }
  }
}
Program: 10691
Project: 10691
Buggy source:
KurentoClient(JsonRpcClient client){
  this.manager=new RomManager(new RomClientJsonRpcClient(client));
  client.setRequestTimeout(requesTimeout);
  try {
    client.connect();
  }
 catch (  IOException e) {
    throw new KurentoException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
KurentoClient(JsonRpcClient client){
  this.manager=new RomManager(new RomClientJsonRpcClient(client));
  client.setRequestTimeout(requesTimeout);
  if (client instanceof JsonRpcClientWebSocket) {
    ((JsonRpcClientWebSocket)client).setKeepAliveTime(KEEPALIVE_TIME);
  }
  try {
    client.connect();
  }
 catch (  IOException e) {
    throw new KurentoException("String_Node_Str",e);
  }
}
Program: 10692
Project: 10692
Buggy source:
public static KurentoClient create(String websocketUrl,KurentoConnectionListener listener,Properties properties){
  log.info("String_Node_Str",websocketUrl);
  JsonRpcClientWebSocket client=new JsonRpcClientWebSocket(websocketUrl,JsonRpcConnectionListenerKurento.create(listener));
  client.setLabel("String_Node_Str");
  return new KurentoClient(client);
}

Fixed version (ground truth):
public static KurentoClient create(String websocketUrl,KurentoConnectionListener listener,Properties properties){
  log.info("String_Node_Str",websocketUrl);
  JsonRpcClientWebSocket client=new JsonRpcClientWebSocket(websocketUrl,JsonRpcConnectionListenerKurento.create(listener));
  client.setKeepAliveTime(KEEPALIVE_TIME);
  client.setLabel("String_Node_Str");
  return new KurentoClient(client);
}
Program: 10694
Project: 10694
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;
  }
  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 synchronized 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 (keepAliveManager != null) {
    keepAliveManager.stop();
    keepAliveManager=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: 10695
Project: 10695
Buggy source:
@OnWebSocketClose public void onClose(int statusCode,String closeReason){
  handleReconnectDisconnection(statusCode,closeReason);
}

Fixed version (ground truth):
@OnWebSocketClose public void onClose(int statusCode,String closeReason){
  log.debug("String_Node_Str",closeReason,statusCode);
  handleReconnectDisconnection(statusCode,closeReason);
}